{"version":3,"file":"static/js/main.6f2279d5.js","sources":["config.js","store/actions.js","store/accountReducer.js","contexts/AWSCognitoContext.js","contexts/ConfigContext.js","hooks/useLocalStorage.js","hooks/useAuth.js","hooks/useConfig.js","layout/MainLayout/Header/LocalizationSection/index.js","store/constant.js","../node_modules/redux-persist/es/constants.js","../node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js","../node_modules/redux-persist/es/createPersistoid.js","../node_modules/redux-persist/es/getStoredState.js","../node_modules/redux-persist/es/purgeStoredState.js","../node_modules/redux-persist/es/persistReducer.js","../node_modules/redux-persist/es/persistStore.js","store/reducer.js","store/index.js","store/slices/albumPhoto.js","store/slices/albums.js","store/slices/cart.js","store/slices/contestants.js","store/slices/dashboard.js","store/slices/ecommerce.js","store/slices/menu.js","store/slices/packages.js","store/slices/snackbar.js","store/slices/superathletes.js","store/slices/tags.js","ui-component/Loader.js","assets/images/logo.svg","ui-component/Logo.js","ui-component/RemaningCredits.js","ui-component/cards/MainCard.js","ui-component/cards/SubCard.js","../node_modules/framer-motion/dist/es/utils/use-cycle.js","../node_modules/popmotion/dist/es/utils/wrap.js","ui-component/extended/AnimateButton.js","ui-component/extended/Avatar.js","ui-component/extended/Chip.js","ui-component/extended/Transitions.js","utils/axios.js","utils/dates.js","utils/errors.js","utils/iframe.js","utils/validators.js","views/albums/AlbumAccessibility.js","../node_modules/@tabler/icons-react/src/icons/IconClock.js","../node_modules/@tabler/icons-react/src/icons/IconChecks.js","../node_modules/@tabler/icons-react/src/icons/IconUserExclamation.js","../node_modules/@tabler/icons-react/src/icons/IconBike.js","../node_modules/@tabler/icons-react/src/icons/IconMotorbike.js","../node_modules/@tabler/icons-react/src/icons/IconCar.js","../node_modules/@tabler/icons-react/src/icons/IconFaceId.js","../node_modules/@tabler/icons-react/src/icons/IconSailboat.js","../node_modules/@tabler/icons-react/src/icons/IconIdOff.js","../node_modules/@tabler/icons-react/src/icons/IconLock.js","../node_modules/@tabler/icons-react/src/icons/IconLinkOff.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/v4.js","views/albums/album-utils.js","views/packages/utils.js","views/public/FloatingCart.js","assets/images/maintenance/img-error-bg-dark.svg","assets/images/maintenance/img-error-bg.svg","assets/images/maintenance/img-error-blue.svg","assets/images/maintenance/img-error-purple.svg","assets/images/maintenance/img-error-text.svg","views/ui-elements/Error.js","views/ui-elements/PhotographLogo.js","../node_modules/@aws-amplify/auth/src/types/Auth.ts","../node_modules/@aws-amplify/core/src/Util/Constants.ts","../node_modules/@aws-amplify/core/src/Logger/ConsoleLogger.ts","../node_modules/@aws-amplify/core/src/Hub.ts","../node_modules/@aws-amplify/core/src/StorageHelper/index.ts","../node_modules/@aws-amplify/core/src/JS.ts","../node_modules/@aws-amplify/core/src/Util/Retry.ts","../node_modules/@aws-amplify/core/src/OAuthHelper/GoogleOAuth.ts","../node_modules/@aws-amplify/core/src/OAuthHelper/FacebookOAuth.ts","../node_modules/@aws-amplify/core/src/OAuthHelper/index.ts","../node_modules/@aws-amplify/core/src/Amplify.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/models/models_0.ts","../node_modules/@aws-sdk/protocol-http/src/httpResponse.ts","../node_modules/@aws-sdk/protocol-http/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/protocol-http/src/httpRequest.ts","../node_modules/@aws-sdk/client-cognito-identity/protocols/Aws_json1_1.ts","../node_modules/@aws-sdk/middleware-serde/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/middleware-serde/src/deserializerMiddleware.ts","../node_modules/@aws-sdk/middleware-serde/src/serdePlugin.ts","../node_modules/@aws-sdk/middleware-serde/src/serializerMiddleware.ts","../node_modules/@aws-sdk/middleware-stack/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/middleware-stack/src/MiddlewareStack.ts","../node_modules/@aws-sdk/smithy-client/src/client.ts","../node_modules/@aws-sdk/smithy-client/src/command.ts","../node_modules/@aws-sdk/smithy-client/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/smithy-client/src/lazy-json.ts","../node_modules/@aws-sdk/client-cognito-identity/commands/GetCredentialsForIdentityCommand.ts","../node_modules/@aws-sdk/property-provider/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/property-provider/src/ProviderError.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/src/resolveLogins.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/src/fromCognitoIdentity.ts","../node_modules/@aws-sdk/client-cognito-identity/commands/GetIdCommand.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/src/IndexedDbStorage.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/src/localStorage.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/src/InMemoryStorage.ts","../node_modules/@aws-sdk/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts","../node_modules/@aws-sdk/fetch-http-handler/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/querystring-builder/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/util-uri-escape/src/escape-uri.ts","../node_modules/@aws-sdk/util-base64-browser/src/index.ts","../node_modules/@aws-sdk/fetch-http-handler/src/fetch-http-handler.ts","../node_modules/@aws-sdk/querystring-builder/src/index.ts","../node_modules/@aws-sdk/fetch-http-handler/src/request-timeout.ts","../node_modules/@aws-sdk/fetch-http-handler/src/stream-collector.ts","../node_modules/@aws-sdk/middleware-retry/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/middleware-retry/src/retryMiddleware.ts","../node_modules/@aws-sdk/service-error-classification/src/constants.ts","../node_modules/@aws-sdk/service-error-classification/src/index.ts","../node_modules/@aws-sdk/middleware-retry/src/delayDecider.ts","../node_modules/@aws-sdk/middleware-retry/src/constants.ts","../node_modules/@aws-sdk/middleware-retry/src/retryDecider.ts","../node_modules/@aws-sdk/middleware-retry/src/defaultStrategy.ts","../node_modules/@aws-sdk/middleware-retry/src/defaultRetryQuota.ts","../node_modules/@aws-sdk/middleware-retry/src/configurations.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-browser/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/endpoints.ts","../node_modules/@aws-sdk/querystring-parser/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/url-parser/src/index.ts","../node_modules/@aws-sdk/invalid-dependency/src/invalidProvider.ts","../node_modules/@aws-sdk/client-cognito-identity/runtimeConfig.shared.ts","../node_modules/@aws-sdk/querystring-parser/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/runtimeConfig.browser.ts","../node_modules/@aws-sdk/util-body-length-browser/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-browser/src/index.ts","../node_modules/@aws-sdk/config-resolver/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/config-resolver/src/EndpointsConfig.ts","../node_modules/@aws-sdk/config-resolver/src/RegionConfig.ts","../node_modules/@aws-sdk/middleware-content-length/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/middleware-content-length/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-host-header/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-host-header/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-logger/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-logger/src/loggerMiddleware.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-signing/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/signature-v4/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/util-hex-encoding/src/index.ts","../node_modules/@aws-sdk/signature-v4/src/constants.ts","../node_modules/@aws-sdk/signature-v4/src/credentialDerivation.ts","../node_modules/@aws-sdk/signature-v4/src/getCanonicalHeaders.ts","../node_modules/@aws-sdk/signature-v4/src/getPayloadHash.ts","../node_modules/@aws-sdk/is-array-buffer/src/index.ts","../node_modules/@aws-sdk/signature-v4/src/cloneRequest.ts","../node_modules/@aws-sdk/signature-v4/src/prepareRequest.ts","../node_modules/@aws-sdk/signature-v4/src/utilDate.ts","../node_modules/@aws-sdk/signature-v4/src/SignatureV4.ts","../node_modules/@aws-sdk/signature-v4/src/moveHeadersToQuery.ts","../node_modules/@aws-sdk/signature-v4/src/hasHeader.ts","../node_modules/@aws-sdk/signature-v4/src/getCanonicalQuery.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-signing/src/configurations.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-user-agent/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-user-agent/src/constants.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-user-agent/src/user-agent-middleware.ts","../node_modules/@aws-sdk/client-cognito-identity/CognitoIdentityClient.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/middleware-user-agent/src/configurations.ts","../node_modules/@aws-amplify/core/src/Platform/index.ts","../node_modules/@aws-amplify/core/src/Util/CognitoIdentityClient.ts","../node_modules/@aws-amplify/core/src/Credentials.ts","../node_modules/@aws-amplify/core/src/Parser.ts","../node_modules/@aws-amplify/core/node_modules/universal-cookie/es6/utils.js","../node_modules/@aws-amplify/core/node_modules/universal-cookie/es6/Cookies.js","../node_modules/@aws-amplify/core/node_modules/universal-cookie/es6/index.js","../node_modules/@aws-amplify/core/src/UniversalStorage/index.ts","../node_modules/@aws-amplify/auth/src/OAuth/urlOpener.ts","../node_modules/@aws-amplify/auth/src/OAuth/OAuth.ts","../node_modules/@aws-amplify/core/src/Util/StringUtils.ts","../node_modules/@aws-amplify/auth/src/OAuth/oauthStorage.ts","../node_modules/@aws-amplify/auth/src/common/AuthErrorStrings.ts","../node_modules/@aws-amplify/auth/src/Errors.ts","../node_modules/@aws-amplify/auth/src/Auth.ts","../node_modules/@aws-amplify/auth/src/urlListener.ts","../node_modules/@aws-amplify/core/node_modules/cookie/index.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/ie11-detection/src/MsWindow.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/ie11-detection/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/src/constants.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/src/crossPlatformSha256.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/src/ie11Sha256.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/src/isEmptyData.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/src/webCryptoSha256.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-js/src/RawSha256.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-js/src/constants.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-js/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-js/src/jsSha256.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/supports-web-crypto/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/supports-web-crypto/src/supportsWebCrypto.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/src/convertToBuffer.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/src/isEmptyData.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/src/numToUint8.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/src/uint32ArrayFrom.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-utf8-browser/src/index.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-utf8-browser/src/whatwgEncodingApi.ts","../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-utf8-browser/src/pureJs.ts","../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/index.js","../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/lib/bytesToUuid.js","../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/lib/rng-browser.js","../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/v1.js","../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/v4.js","../node_modules/@aws-sdk/util-locate-window/dist-es/index.js","../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../node_modules/stylis/src/Utility.js","../node_modules/stylis/src/Tokenizer.js","../node_modules/stylis/src/Enum.js","../node_modules/stylis/src/Serializer.js","../node_modules/stylis/src/Parser.js","../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../node_modules/stylis/src/Middleware.js","../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","../node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../node_modules/@emotion/react/dist/emotion-element-43c6fea0.browser.esm.js","../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../node_modules/@formatjs/ecma402-abstract/lib/utils.js","../node_modules/@formatjs/fast-memoize/lib/index.js","../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../node_modules/@formatjs/intl/lib/src/error.js","../node_modules/@formatjs/intl/lib/src/utils.js","../node_modules/@mui/base/ClickAwayListener/ClickAwayListener.js","../node_modules/@mui/base/FocusTrap/FocusTrap.js","../node_modules/@mui/base/Portal/Portal.js","../node_modules/@mui/base/TextareaAutosize/TextareaAutosize.js","../node_modules/@mui/base/unstable_useModal/ModalManager.js","../node_modules/@mui/base/utils/appendOwnerState.js","../node_modules/@mui/base/utils/extractEventHandlers.js","../node_modules/@mui/base/utils/isHostComponent.js","../node_modules/@mui/base/utils/omitEventHandlers.js","../node_modules/@mui/base/utils/mergeSlotProps.js","../node_modules/@mui/base/utils/resolveComponentProps.js","../node_modules/@mui/base/utils/useSlotProps.js","../node_modules/@mui/icons-material/AccountTreeTwoTone.js","../node_modules/@mui/icons-material/Close.js","../node_modules/@mui/icons-material/FiberManualRecord.js","../node_modules/@mui/icons-material/Home.js","../node_modules/@mui/icons-material/HomeTwoTone.js","../node_modules/@mui/icons-material/Menu.js","../node_modules/@mui/icons-material/ShoppingCartTwoTone.js","../node_modules/@mui/icons-material/TableChartOutlined.js","../node_modules/@mui/icons-material/utils/createSvgIcon.js","../node_modules/@mui/material/internal/svg-icons/SuccessOutlined.js","../node_modules/@mui/material/internal/svg-icons/ReportProblemOutlined.js","../node_modules/@mui/material/internal/svg-icons/ErrorOutline.js","../node_modules/@mui/material/internal/svg-icons/InfoOutlined.js","../node_modules/@mui/material/Alert/Alert.js","../node_modules/@mui/material/Alert/alertClasses.js","../node_modules/@mui/material/AppBar/AppBar.js","../node_modules/@mui/material/AppBar/appBarClasses.js","../node_modules/@mui/material/internal/svg-icons/Person.js","../node_modules/@mui/material/Avatar/Avatar.js","../node_modules/@mui/material/Avatar/avatarClasses.js","../node_modules/@mui/material/Backdrop/Backdrop.js","../node_modules/@mui/material/Backdrop/backdropClasses.js","../node_modules/@mui/material/Badge/Badge.js","../node_modules/@mui/base/useBadge/useBadge.js","../node_modules/@mui/material/Badge/badgeClasses.js","../node_modules/@mui/system/esm/createBox.js","../node_modules/@mui/material/Box/Box.js","../node_modules/@mui/material/Box/boxClasses.js","../node_modules/@mui/material/internal/svg-icons/MoreHoriz.js","../node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed.js","../node_modules/@mui/material/Breadcrumbs/Breadcrumbs.js","../node_modules/@mui/material/Breadcrumbs/breadcrumbsClasses.js","../node_modules/@mui/material/Button/Button.js","../node_modules/@mui/material/Button/buttonClasses.js","../node_modules/@mui/material/ButtonBase/Ripple.js","../node_modules/@mui/material/ButtonBase/TouchRipple.js","../node_modules/@mui/material/ButtonBase/ButtonBase.js","../node_modules/@mui/material/ButtonBase/buttonBaseClasses.js","../node_modules/@mui/material/ButtonBase/touchRippleClasses.js","../node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext.js","../node_modules/@mui/material/ButtonGroup/ButtonGroupContext.js","../node_modules/@mui/material/Card/Card.js","../node_modules/@mui/material/Card/cardClasses.js","../node_modules/@mui/material/CardContent/CardContent.js","../node_modules/@mui/material/CardContent/cardContentClasses.js","../node_modules/@mui/material/CardHeader/CardHeader.js","../node_modules/@mui/material/CardHeader/cardHeaderClasses.js","../node_modules/@mui/material/CardMedia/CardMedia.js","../node_modules/@mui/material/CardMedia/cardMediaClasses.js","../node_modules/@mui/material/internal/svg-icons/Cancel.js","../node_modules/@mui/material/Chip/Chip.js","../node_modules/@mui/material/Chip/chipClasses.js","../node_modules/@mui/material/CircularProgress/CircularProgress.js","../node_modules/@mui/material/CircularProgress/circularProgressClasses.js","../node_modules/@mui/material/Collapse/Collapse.js","../node_modules/@mui/material/Collapse/collapseClasses.js","../node_modules/@mui/system/esm/Container/createContainer.js","../node_modules/@mui/material/Container/Container.js","../node_modules/@mui/material/CssBaseline/CssBaseline.js","../node_modules/@mui/material/Dialog/Dialog.js","../node_modules/@mui/material/Dialog/DialogContext.js","../node_modules/@mui/material/Dialog/dialogClasses.js","../node_modules/@mui/material/DialogActions/DialogActions.js","../node_modules/@mui/material/DialogActions/dialogActionsClasses.js","../node_modules/@mui/material/DialogTitle/DialogTitle.js","../node_modules/@mui/material/DialogTitle/dialogTitleClasses.js","../node_modules/@mui/material/Divider/Divider.js","../node_modules/@mui/material/Divider/dividerClasses.js","../node_modules/@mui/material/Drawer/Drawer.js","../node_modules/@mui/material/Drawer/drawerClasses.js","../node_modules/@mui/material/Fab/Fab.js","../node_modules/@mui/material/Fab/fabClasses.js","../node_modules/@mui/material/Fade/Fade.js","../node_modules/@mui/material/FilledInput/FilledInput.js","../node_modules/@mui/material/FilledInput/filledInputClasses.js","../node_modules/@mui/material/FormControl/FormControl.js","../node_modules/@mui/material/FormControl/FormControlContext.js","../node_modules/@mui/material/FormControl/formControlClasses.js","../node_modules/@mui/material/FormControl/formControlState.js","../node_modules/@mui/material/FormControl/useFormControl.js","../node_modules/@mui/material/FormHelperText/FormHelperText.js","../node_modules/@mui/material/FormHelperText/formHelperTextClasses.js","../node_modules/@mui/material/FormLabel/FormLabel.js","../node_modules/@mui/material/FormLabel/formLabelClasses.js","../node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js","../node_modules/@mui/material/GlobalStyles/GlobalStyles.js","../node_modules/@mui/material/Grid/GridContext.js","../node_modules/@mui/material/Grid/Grid.js","../node_modules/@mui/material/Grid/gridClasses.js","../node_modules/@mui/material/Grow/Grow.js","../node_modules/@mui/material/IconButton/IconButton.js","../node_modules/@mui/material/IconButton/iconButtonClasses.js","../node_modules/@mui/material/Input/Input.js","../node_modules/@mui/material/Input/inputClasses.js","../node_modules/@mui/material/InputBase/InputBase.js","../node_modules/@mui/material/InputBase/inputBaseClasses.js","../node_modules/@mui/material/InputBase/utils.js","../node_modules/@mui/material/InputLabel/InputLabel.js","../node_modules/@mui/material/InputLabel/inputLabelClasses.js","../node_modules/@mui/material/LinearProgress/LinearProgress.js","../node_modules/@mui/material/LinearProgress/linearProgressClasses.js","../node_modules/@mui/material/Link/getTextDecoration.js","../node_modules/@mui/material/Link/Link.js","../node_modules/@mui/material/Link/linkClasses.js","../node_modules/@mui/material/List/List.js","../node_modules/@mui/material/List/ListContext.js","../node_modules/@mui/material/List/listClasses.js","../node_modules/@mui/material/ListItem/ListItem.js","../node_modules/@mui/material/ListItem/listItemClasses.js","../node_modules/@mui/material/ListItemAvatar/ListItemAvatar.js","../node_modules/@mui/material/ListItemAvatar/listItemAvatarClasses.js","../node_modules/@mui/material/ListItemButton/ListItemButton.js","../node_modules/@mui/material/ListItemButton/listItemButtonClasses.js","../node_modules/@mui/material/ListItemIcon/ListItemIcon.js","../node_modules/@mui/material/ListItemIcon/listItemIconClasses.js","../node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction.js","../node_modules/@mui/material/ListItemSecondaryAction/listItemSecondaryActionClasses.js","../node_modules/@mui/material/ListItemText/ListItemText.js","../node_modules/@mui/material/ListItemText/listItemTextClasses.js","../node_modules/@mui/material/Menu/Menu.js","../node_modules/@mui/material/Menu/menuClasses.js","../node_modules/@mui/material/utils/getScrollbarSize.js","../node_modules/@mui/material/MenuList/MenuList.js","../node_modules/@mui/base/unstable_useModal/useModal.js","../node_modules/@mui/material/Modal/Modal.js","../node_modules/@mui/material/Modal/modalClasses.js","../node_modules/@mui/material/NativeSelect/NativeSelectInput.js","../node_modules/@mui/material/NativeSelect/nativeSelectClasses.js","../node_modules/@mui/material/OutlinedInput/NotchedOutline.js","../node_modules/@mui/material/OutlinedInput/OutlinedInput.js","../node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js","../node_modules/@mui/material/Paper/Paper.js","../node_modules/@mui/material/Paper/paperClasses.js","../node_modules/@mui/material/Popover/Popover.js","../node_modules/@mui/material/Popover/popoverClasses.js","../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../node_modules/@popperjs/core/lib/utils/math.js","../node_modules/@popperjs/core/lib/utils/userAgent.js","../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../node_modules/@popperjs/core/lib/enums.js","../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../node_modules/@popperjs/core/lib/utils/debounce.js","../node_modules/@popperjs/core/lib/createPopper.js","../node_modules/@popperjs/core/lib/utils/mergeByName.js","../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../node_modules/@popperjs/core/lib/utils/getVariation.js","../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../node_modules/@popperjs/core/lib/modifiers/offset.js","../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../node_modules/@popperjs/core/lib/dom-utils/contains.js","../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../node_modules/@popperjs/core/lib/utils/within.js","../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../node_modules/@popperjs/core/lib/modifiers/arrow.js","../node_modules/@popperjs/core/lib/modifiers/hide.js","../node_modules/@popperjs/core/lib/popper.js","../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../node_modules/@popperjs/core/lib/modifiers/flip.js","../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../node_modules/@mui/base/generateUtilityClass/index.js","../node_modules/@mui/base/Popper/popperClasses.js","../node_modules/@mui/base/generateUtilityClasses/index.js","../node_modules/@mui/base/utils/ClassNameConfigurator.js","../node_modules/@mui/base/Popper/Popper.js","../node_modules/@mui/material/Popper/Popper.js","../node_modules/@mui/material/Select/SelectInput.js","../node_modules/@mui/material/Select/Select.js","../node_modules/@mui/material/Select/selectClasses.js","../node_modules/@mui/material/Slide/Slide.js","../node_modules/@mui/material/Snackbar/Snackbar.js","../node_modules/@mui/base/useSnackbar/useSnackbar.js","../node_modules/@mui/material/Snackbar/snackbarClasses.js","../node_modules/@mui/material/SnackbarContent/SnackbarContent.js","../node_modules/@mui/material/SnackbarContent/snackbarContentClasses.js","../node_modules/@mui/system/esm/Stack/createStack.js","../node_modules/@mui/material/Stack/Stack.js","../node_modules/@mui/material/SvgIcon/SvgIcon.js","../node_modules/@mui/material/SvgIcon/svgIconClasses.js","../node_modules/@mui/material/Tab/Tab.js","../node_modules/@mui/material/Tab/tabClasses.js","../node_modules/@mui/material/TabScrollButton/TabScrollButton.js","../node_modules/@mui/material/TabScrollButton/tabScrollButtonClasses.js","../node_modules/@mui/utils/scrollLeft/scrollLeft.js","../node_modules/@mui/material/internal/animate.js","../node_modules/@mui/material/Tabs/ScrollbarSize.js","../node_modules/@mui/material/Tabs/Tabs.js","../node_modules/@mui/material/Tabs/tabsClasses.js","../node_modules/@mui/material/TextField/TextField.js","../node_modules/@mui/material/TextField/textFieldClasses.js","../node_modules/@mui/material/Toolbar/Toolbar.js","../node_modules/@mui/material/Toolbar/toolbarClasses.js","../node_modules/@mui/material/Tooltip/Tooltip.js","../node_modules/@mui/material/Tooltip/tooltipClasses.js","../node_modules/@mui/material/Typography/Typography.js","../node_modules/@mui/material/Typography/typographyClasses.js","../node_modules/@mui/material/Zoom/Zoom.js","../node_modules/@mui/material/colors/blue.js","../node_modules/@mui/material/colors/common.js","../node_modules/@mui/material/colors/green.js","../node_modules/@mui/material/colors/grey.js","../node_modules/@mui/material/colors/lightBlue.js","../node_modules/@mui/material/colors/orange.js","../node_modules/@mui/material/colors/purple.js","../node_modules/@mui/material/colors/red.js","../node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js","../node_modules/@mui/material/internal/svg-icons/Close.js","../node_modules/@mui/material/internal/svg-icons/KeyboardArrowLeft.js","../node_modules/@mui/material/internal/svg-icons/KeyboardArrowRight.js","../node_modules/@mui/material/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/@mui/material/node_modules/react-is/index.js","../node_modules/@mui/material/styles/ThemeProvider.js","../node_modules/@mui/material/styles/createMixins.js","../node_modules/@mui/material/styles/createPalette.js","../node_modules/@mui/material/styles/shadows.js","../node_modules/@mui/material/styles/zIndex.js","../node_modules/@mui/material/styles/createTheme.js","../node_modules/@mui/material/styles/createTransitions.js","../node_modules/@mui/material/styles/createTypography.js","../node_modules/@mui/material/styles/defaultTheme.js","../node_modules/@mui/material/styles/getOverlayAlpha.js","../node_modules/@mui/material/styles/identifier.js","../node_modules/@mui/material/styles/rootShouldForwardProp.js","../node_modules/@mui/material/styles/slotShouldForwardProp.js","../node_modules/@mui/material/styles/styled.js","../node_modules/@mui/material/styles/useTheme.js","../node_modules/@mui/material/styles/useThemeProps.js","../node_modules/@mui/material/transitions/utils.js","../node_modules/@mui/material/useScrollTrigger/useScrollTrigger.js","../node_modules/@mui/material/utils/capitalize.js","../node_modules/@mui/material/utils/createChainedFunction.js","../node_modules/@mui/material/utils/createSvgIcon.js","../node_modules/@mui/material/utils/debounce.js","../node_modules/@mui/material/utils/deprecatedPropType.js","../node_modules/@mui/utils/deprecatedPropType/deprecatedPropType.js","../node_modules/@mui/material/utils/requirePropFactory.js","../node_modules/@mui/utils/requirePropFactory/requirePropFactory.js","../node_modules/@mui/material/utils/setRef.js","../node_modules/@mui/material/utils/unsupportedProp.js","../node_modules/@mui/utils/unsupportedProp/unsupportedProp.js","../node_modules/@mui/material/utils/index.js","../node_modules/@mui/material/utils/isMuiElement.js","../node_modules/@mui/material/utils/ownerDocument.js","../node_modules/@mui/material/utils/ownerWindow.js","../node_modules/@mui/material/utils/useControlled.js","../node_modules/@mui/material/utils/useEnhancedEffect.js","../node_modules/@mui/material/utils/useEventCallback.js","../node_modules/@mui/material/utils/useForkRef.js","../node_modules/@mui/material/utils/useId.js","../node_modules/@mui/material/utils/useIsFocusVisible.js","../node_modules/@mui/material/utils/useSlot.js","../node_modules/@mui/material/zero-styled/index.js","../node_modules/@mui/private-theming/ThemeProvider/nested.js","../node_modules/@mui/private-theming/useTheme/ThemeContext.js","../node_modules/@mui/private-theming/useTheme/useTheme.js","../node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js","../node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js","../node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","../node_modules/@mui/styled-engine/index.js","../node_modules/@mui/styles/useTheme/index.js","../node_modules/@mui/system/colorManipulator.js","../node_modules/@mui/system/createStyled.js","../node_modules/@mui/system/esm/RtlProvider/index.js","../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js","../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js","../node_modules/@mui/system/esm/breakpoints.js","../node_modules/@mui/system/esm/colorManipulator.js","../node_modules/@mui/system/esm/createStyled.js","../node_modules/@mui/system/esm/createTheme/applyStyles.js","../node_modules/@mui/system/esm/createTheme/createBreakpoints.js","../node_modules/@mui/system/esm/createTheme/createSpacing.js","../node_modules/@mui/system/esm/createTheme/shape.js","../node_modules/@mui/system/esm/createTheme/createTheme.js","../node_modules/@mui/system/esm/merge.js","../node_modules/@mui/system/esm/spacing.js","../node_modules/@mui/system/esm/memoize.js","../node_modules/@mui/system/esm/style.js","../node_modules/@mui/system/esm/compose.js","../node_modules/@mui/system/esm/borders.js","../node_modules/@mui/system/esm/cssGrid.js","../node_modules/@mui/system/esm/palette.js","../node_modules/@mui/system/esm/sizing.js","../node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js","../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js","../node_modules/@mui/system/esm/styled.js","../node_modules/@mui/system/esm/useMediaQuery/useMediaQuery.js","../node_modules/@mui/system/esm/useTheme.js","../node_modules/@mui/system/esm/useThemeProps/getThemeProps.js","../node_modules/@mui/system/esm/useThemeProps/useThemeProps.js","../node_modules/@mui/system/esm/useThemeWithoutDefault.js","../node_modules/@mui/system/useThemeWithoutDefault.js","../node_modules/@mui/utils/ClassNameGenerator/ClassNameGenerator.js","../node_modules/@mui/utils/capitalize/capitalize.js","../node_modules/@mui/utils/clamp/clamp.js","../node_modules/@mui/utils/composeClasses/composeClasses.js","../node_modules/@mui/utils/createChainedFunction/createChainedFunction.js","../node_modules/@mui/utils/debounce/debounce.js","../node_modules/@mui/utils/deepmerge/deepmerge.js","../node_modules/@mui/utils/formatMuiErrorMessage/formatMuiErrorMessage.js","../node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.js","../node_modules/@mui/utils/generateUtilityClasses/generateUtilityClasses.js","../node_modules/@mui/utils/getDisplayName/getDisplayName.js","../node_modules/@mui/utils/getScrollbarSize/getScrollbarSize.js","../node_modules/@mui/utils/isMuiElement/isMuiElement.js","../node_modules/@mui/utils/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/@mui/utils/node_modules/react-is/index.js","../node_modules/@mui/utils/ownerDocument/ownerDocument.js","../node_modules/@mui/utils/ownerWindow/ownerWindow.js","../node_modules/@mui/utils/resolveProps/resolveProps.js","../node_modules/@mui/utils/setRef/setRef.js","../node_modules/@mui/utils/useControlled/useControlled.js","../node_modules/@mui/utils/useEnhancedEffect/useEnhancedEffect.js","../node_modules/@mui/utils/useEventCallback/useEventCallback.js","../node_modules/@mui/utils/useForkRef/useForkRef.js","../node_modules/@mui/utils/useId/useId.js","../node_modules/@mui/utils/useIsFocusVisible/useIsFocusVisible.js","../node_modules/@mui/utils/usePreviousProps/usePreviousProps.js","../node_modules/@mui/utils/useLazyRef/useLazyRef.js","../node_modules/@mui/utils/useOnMount/useOnMount.js","../node_modules/@mui/utils/useTimeout/useTimeout.js","../node_modules/@mui/x-data-grid/constants/localeTextConstants.js","../node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider.js","../node_modules/@mui/x-date-pickers/internals/utils/warning.js","../node_modules/redux-thunk/es/index.js","../node_modules/@reduxjs/toolkit/src/devtoolsExtension.ts","../node_modules/@reduxjs/toolkit/src/isPlainObject.ts","../node_modules/@reduxjs/toolkit/src/createAction.ts","../node_modules/@reduxjs/toolkit/src/utils.ts","../node_modules/@reduxjs/toolkit/src/getDefaultMiddleware.ts","../node_modules/@reduxjs/toolkit/src/configureStore.ts","../node_modules/@reduxjs/toolkit/src/mapBuilders.ts","../node_modules/@reduxjs/toolkit/src/createSlice.ts","../node_modules/@reduxjs/toolkit/src/createReducer.ts","../node_modules/@reduxjs/toolkit/src/nanoid.ts","../node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts","../node_modules/@reduxjs/toolkit/src/listenerMiddleware/index.ts","../node_modules/@reduxjs/toolkit/src/listenerMiddleware/task.ts","../node_modules/@reduxjs/toolkit/src/autoBatchEnhancer.ts","../node_modules/@reduxjs/toolkit/src/index.ts","../node_modules/@remix-run/router/history.ts","../node_modules/@remix-run/router/utils.ts","../node_modules/@remix-run/router/router.ts","../node_modules/@sentry/src/constants.ts","../node_modules/@sentry/src/debug-build.ts","../node_modules/@sentry/src/eventProcessors.ts","../node_modules/@sentry/src/exports.ts","../node_modules/@sentry/src/hub.ts","../node_modules/@sentry/src/scope.ts","../node_modules/@sentry/src/session.ts","../node_modules/@sentry/src/tracing/dynamicSamplingContext.ts","../node_modules/@sentry/src/utils/applyScopeDataToEvent.ts","../node_modules/@sentry/src/utils/getRootSpan.ts","../node_modules/@sentry/src/utils/prepareEvent.ts","../node_modules/@sentry/src/utils/spanUtils.ts","../node_modules/@sentry/src/version.ts","../node_modules/@sentry/src/baggage.ts","../node_modules/@sentry/src/browser.ts","../node_modules/@sentry/src/is.ts","../node_modules/@sentry/src/logger.ts","../node_modules/@sentry/src/misc.ts","../node_modules/@sentry/src/normalize.ts","../node_modules/@sentry/src/memo.ts","../node_modules/@sentry/src/object.ts","../node_modules/@sentry/src/stacktrace.ts","../node_modules/@sentry/src/string.ts","../node_modules/@sentry/src/syncpromise.ts","../node_modules/@sentry/src/time.ts","../node_modules/@sentry/src/tracing.ts","../node_modules/@sentry/src/worldwide.ts","../node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js","../node_modules/@tabler/icons-react/src/defaultAttributes.js","../node_modules/@tabler/icons-react/src/createReactComponent.js","../node_modules/@tabler/icons-react/src/icons/IconAlertTriangle.js","../node_modules/@tabler/icons-react/src/icons/IconBell.js","../node_modules/@tabler/icons-react/src/icons/IconLockOpen.js","../node_modules/@tabler/icons-react/src/icons/IconPhoto.js","../node_modules/@tabler/icons-react/src/icons/IconRun.js","../node_modules/@tabler/icons-react/src/icons/IconSubscript.js","../node_modules/@tabler/icons-react/src/icons/IconUserCheck.js","../node_modules/@tabler/icons-react/src/icons/IconUserStar.js","../node_modules/amazon-cognito-identity-js/es/AuthenticationDetails.js","../node_modules/amazon-cognito-identity-js/es/utils/cryptoSecureRandomInt.web.js","../node_modules/amazon-cognito-identity-js/es/utils/WordArray.js","../node_modules/amazon-cognito-identity-js/es/BigInteger.js","../node_modules/amazon-cognito-identity-js/es/AuthenticationHelper.js","../node_modules/amazon-cognito-identity-js/es/CognitoJwtToken.js","../node_modules/amazon-cognito-identity-js/es/CognitoAccessToken.js","../node_modules/amazon-cognito-identity-js/es/CognitoIdToken.js","../node_modules/amazon-cognito-identity-js/es/CognitoRefreshToken.js","../node_modules/amazon-cognito-identity-js/es/CognitoUserSession.js","../node_modules/amazon-cognito-identity-js/es/DateHelper.js","../node_modules/amazon-cognito-identity-js/es/CognitoUserAttribute.js","../node_modules/amazon-cognito-identity-js/es/StorageHelper.js","../node_modules/amazon-cognito-identity-js/es/CognitoUser.js","../node_modules/amazon-cognito-identity-js/es/Platform/index.js","../node_modules/amazon-cognito-identity-js/es/UserAgent.js","../node_modules/amazon-cognito-identity-js/es/Client.js","../node_modules/amazon-cognito-identity-js/es/CognitoUserPool.js","../node_modules/amazon-cognito-identity-js/es/CookieStorage.js","../node_modules/axios/index.js","../node_modules/axios/lib/adapters/xhr.js","../node_modules/axios/lib/axios.js","../node_modules/axios/lib/cancel/Cancel.js","../node_modules/axios/lib/cancel/CancelToken.js","../node_modules/axios/lib/cancel/isCancel.js","../node_modules/axios/lib/core/Axios.js","../node_modules/axios/lib/core/InterceptorManager.js","../node_modules/axios/lib/core/buildFullPath.js","../node_modules/axios/lib/core/createError.js","../node_modules/axios/lib/core/dispatchRequest.js","../node_modules/axios/lib/core/enhanceError.js","../node_modules/axios/lib/core/mergeConfig.js","../node_modules/axios/lib/core/settle.js","../node_modules/axios/lib/core/transformData.js","../node_modules/axios/lib/defaults.js","../node_modules/axios/lib/env/data.js","../node_modules/axios/lib/helpers/bind.js","../node_modules/axios/lib/helpers/buildURL.js","../node_modules/axios/lib/helpers/combineURLs.js","../node_modules/axios/lib/helpers/cookies.js","../node_modules/axios/lib/helpers/isAbsoluteURL.js","../node_modules/axios/lib/helpers/isAxiosError.js","../node_modules/axios/lib/helpers/isURLSameOrigin.js","../node_modules/axios/lib/helpers/normalizeHeaderName.js","../node_modules/axios/lib/helpers/parseHeaders.js","../node_modules/axios/lib/helpers/spread.js","../node_modules/axios/lib/helpers/validator.js","../node_modules/axios/lib/utils.js","../node_modules/base64-js/index.js","../node_modules/bowser/es5.js","../node_modules/buffer/index.js","../node_modules/buffer/node_modules/isarray/index.js","../node_modules/call-bind/callBound.js","../node_modules/call-bind/index.js","../node_modules/crypto-js/core.js","../node_modules/crypto-js/enc-base64.js","../node_modules/crypto-js/hmac-sha256.js","../node_modules/crypto-js/hmac.js","../node_modules/crypto-js/lib-typedarrays.js","../node_modules/crypto-js/sha256.js","../node_modules/dayjs/dayjs.min.js","../node_modules/dayjs/locale/en.js","../node_modules/dayjs/locale/es.js","../node_modules/dayjs/locale/fr.js","../node_modules/dayjs/locale/pt.js","../node_modules/dayjs/plugin/advancedFormat.js","../node_modules/dayjs/plugin/customParseFormat.js","../node_modules/dayjs/plugin/isBetween.js","../node_modules/dayjs/plugin/localizedFormat.js","../node_modules/dayjs/plugin/relativeTime.js","../node_modules/dayjs/plugin/weekOfYear.js","../node_modules/define-data-property/index.js","../node_modules/es-define-property/index.js","../node_modules/es-errors/eval.js","../node_modules/es-errors/index.js","../node_modules/es-errors/range.js","../node_modules/es-errors/ref.js","../node_modules/es-errors/syntax.js","../node_modules/es-errors/type.js","../node_modules/es-errors/uri.js","../node_modules/flat/index.js","../node_modules/formik/node_modules/deepmerge/dist/es.js","../node_modules/lodash-es/_freeGlobal.js","../node_modules/lodash-es/_root.js","../node_modules/lodash-es/_Symbol.js","../node_modules/lodash-es/_getRawTag.js","../node_modules/lodash-es/_objectToString.js","../node_modules/lodash-es/_baseGetTag.js","../node_modules/lodash-es/_overArg.js","../node_modules/lodash-es/_getPrototype.js","../node_modules/lodash-es/isObjectLike.js","../node_modules/lodash-es/isPlainObject.js","../node_modules/lodash-es/_listCacheClear.js","../node_modules/lodash-es/eq.js","../node_modules/lodash-es/_assocIndexOf.js","../node_modules/lodash-es/_listCacheDelete.js","../node_modules/lodash-es/_listCacheGet.js","../node_modules/lodash-es/_listCacheHas.js","../node_modules/lodash-es/_listCacheSet.js","../node_modules/lodash-es/_ListCache.js","../node_modules/lodash-es/_stackClear.js","../node_modules/lodash-es/_stackDelete.js","../node_modules/lodash-es/_stackGet.js","../node_modules/lodash-es/_stackHas.js","../node_modules/lodash-es/isObject.js","../node_modules/lodash-es/isFunction.js","../node_modules/lodash-es/_coreJsData.js","../node_modules/lodash-es/_isMasked.js","../node_modules/lodash-es/_toSource.js","../node_modules/lodash-es/_baseIsNative.js","../node_modules/lodash-es/_getValue.js","../node_modules/lodash-es/_getNative.js","../node_modules/lodash-es/_Map.js","../node_modules/lodash-es/_nativeCreate.js","../node_modules/lodash-es/_hashClear.js","../node_modules/lodash-es/_hashDelete.js","../node_modules/lodash-es/_hashGet.js","../node_modules/lodash-es/_hashHas.js","../node_modules/lodash-es/_hashSet.js","../node_modules/lodash-es/_Hash.js","../node_modules/lodash-es/_mapCacheClear.js","../node_modules/lodash-es/_isKeyable.js","../node_modules/lodash-es/_getMapData.js","../node_modules/lodash-es/_mapCacheDelete.js","../node_modules/lodash-es/_mapCacheGet.js","../node_modules/lodash-es/_mapCacheHas.js","../node_modules/lodash-es/_mapCacheSet.js","../node_modules/lodash-es/_MapCache.js","../node_modules/lodash-es/_stackSet.js","../node_modules/lodash-es/_Stack.js","../node_modules/lodash-es/_arrayEach.js","../node_modules/lodash-es/_defineProperty.js","../node_modules/lodash-es/_baseAssignValue.js","../node_modules/lodash-es/_assignValue.js","../node_modules/lodash-es/_copyObject.js","../node_modules/lodash-es/_baseTimes.js","../node_modules/lodash-es/_baseIsArguments.js","../node_modules/lodash-es/isArguments.js","../node_modules/lodash-es/isArray.js","../node_modules/lodash-es/stubFalse.js","../node_modules/lodash-es/isBuffer.js","../node_modules/lodash-es/_isIndex.js","../node_modules/lodash-es/isLength.js","../node_modules/lodash-es/_baseIsTypedArray.js","../node_modules/lodash-es/_baseUnary.js","../node_modules/lodash-es/_nodeUtil.js","../node_modules/lodash-es/isTypedArray.js","../node_modules/lodash-es/_arrayLikeKeys.js","../node_modules/lodash-es/_isPrototype.js","../node_modules/lodash-es/_nativeKeys.js","../node_modules/lodash-es/_baseKeys.js","../node_modules/lodash-es/isArrayLike.js","../node_modules/lodash-es/keys.js","../node_modules/lodash-es/_baseAssign.js","../node_modules/lodash-es/_nativeKeysIn.js","../node_modules/lodash-es/_baseKeysIn.js","../node_modules/lodash-es/keysIn.js","../node_modules/lodash-es/_baseAssignIn.js","../node_modules/lodash-es/_cloneBuffer.js","../node_modules/lodash-es/_copyArray.js","../node_modules/lodash-es/_arrayFilter.js","../node_modules/lodash-es/stubArray.js","../node_modules/lodash-es/_getSymbols.js","../node_modules/lodash-es/_copySymbols.js","../node_modules/lodash-es/_arrayPush.js","../node_modules/lodash-es/_getSymbolsIn.js","../node_modules/lodash-es/_copySymbolsIn.js","../node_modules/lodash-es/_baseGetAllKeys.js","../node_modules/lodash-es/_getAllKeys.js","../node_modules/lodash-es/_getAllKeysIn.js","../node_modules/lodash-es/_DataView.js","../node_modules/lodash-es/_Promise.js","../node_modules/lodash-es/_Set.js","../node_modules/lodash-es/_WeakMap.js","../node_modules/lodash-es/_getTag.js","../node_modules/lodash-es/_initCloneArray.js","../node_modules/lodash-es/_Uint8Array.js","../node_modules/lodash-es/_cloneArrayBuffer.js","../node_modules/lodash-es/_cloneDataView.js","../node_modules/lodash-es/_cloneRegExp.js","../node_modules/lodash-es/_cloneSymbol.js","../node_modules/lodash-es/_cloneTypedArray.js","../node_modules/lodash-es/_initCloneByTag.js","../node_modules/lodash-es/_baseCreate.js","../node_modules/lodash-es/_initCloneObject.js","../node_modules/lodash-es/_baseIsMap.js","../node_modules/lodash-es/isMap.js","../node_modules/lodash-es/_baseIsSet.js","../node_modules/lodash-es/isSet.js","../node_modules/lodash-es/_baseClone.js","../node_modules/lodash-es/cloneDeep.js","../node_modules/tiny-warning/dist/tiny-warning.esm.js","../node_modules/lodash-es/clone.js","../node_modules/lodash-es/_arrayMap.js","../node_modules/lodash-es/isSymbol.js","../node_modules/lodash-es/memoize.js","../node_modules/lodash-es/_stringToPath.js","../node_modules/lodash-es/_memoizeCapped.js","../node_modules/lodash-es/_toKey.js","../node_modules/lodash-es/_baseToString.js","../node_modules/lodash-es/toString.js","../node_modules/lodash-es/toPath.js","../node_modules/formik/src/FormikContext.tsx","../node_modules/formik/src/utils.ts","../node_modules/formik/src/Formik.tsx","../node_modules/formik/src/Form.tsx","../node_modules/formik/src/FieldArray.tsx","../node_modules/framer-motion/dist/es/motion/features/definitions.js","../node_modules/framer-motion/dist/es/context/LazyContext.js","../node_modules/framer-motion/dist/es/motion/features/use-features.js","../node_modules/framer-motion/dist/es/context/MotionConfigContext.js","../node_modules/framer-motion/dist/es/context/MotionContext/index.js","../node_modules/framer-motion/dist/es/context/PresenceContext.js","../node_modules/framer-motion/dist/es/utils/use-constant.js","../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js","../node_modules/framer-motion/dist/es/context/LayoutGroupContext.js","../node_modules/framer-motion/dist/es/utils/is-browser.js","../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js","../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js","../node_modules/framer-motion/dist/es/utils/is-ref-object.js","../node_modules/framer-motion/dist/es/render/utils/variants.js","../node_modules/framer-motion/dist/es/context/MotionContext/create.js","../node_modules/framer-motion/dist/es/context/MotionContext/utils.js","../node_modules/framer-motion/dist/es/motion/index.js","../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js","../node_modules/framer-motion/dist/es/render/dom/motion-proxy.js","../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js","../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js","../node_modules/framer-motion/dist/es/render/dom/projection/scale-correction.js","../node_modules/framer-motion/dist/es/render/html/utils/transform.js","../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js","../node_modules/framer-motion/dist/es/value/utils/is-motion-value.js","../node_modules/framer-motion/dist/es/render/html/utils/build-transform.js","../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js","../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js","../node_modules/style-value-types/dist/es/utils.js","../node_modules/style-value-types/dist/es/numbers/units.js","../node_modules/style-value-types/dist/es/numbers/index.js","../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js","../node_modules/framer-motion/dist/es/render/dom/value-types/number.js","../node_modules/framer-motion/dist/es/render/html/utils/build-styles.js","../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js","../node_modules/framer-motion/dist/es/render/html/use-props.js","../node_modules/framer-motion/dist/es/motion/utils/valid-prop.js","../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js","../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js","../node_modules/framer-motion/dist/es/render/svg/utils/path.js","../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js","../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js","../node_modules/framer-motion/dist/es/render/svg/use-props.js","../node_modules/framer-motion/dist/es/render/dom/use-render.js","../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js","../node_modules/framer-motion/dist/es/render/html/utils/render.js","../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js","../node_modules/framer-motion/dist/es/render/svg/utils/render.js","../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js","../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js","../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js","../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js","../node_modules/framer-motion/dist/es/utils/resolve-value.js","../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js","../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js","../node_modules/framer-motion/dist/es/render/svg/config-motion.js","../node_modules/framer-motion/dist/es/render/html/config-motion.js","../node_modules/framer-motion/dist/es/render/utils/types.js","../node_modules/framer-motion/dist/es/events/use-dom-event.js","../node_modules/framer-motion/dist/es/gestures/utils/event-type.js","../node_modules/framer-motion/dist/es/events/event-info.js","../node_modules/framer-motion/dist/es/events/utils.js","../node_modules/framer-motion/dist/es/events/use-pointer-event.js","../node_modules/framer-motion/dist/es/gestures/drag/utils/lock.js","../node_modules/framer-motion/dist/es/gestures/use-hover-gesture.js","../node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.js","../node_modules/framer-motion/dist/es/utils/use-unmount-effect.js","../node_modules/popmotion/dist/es/utils/pipe.js","../node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.js","../node_modules/framer-motion/dist/es/motion/features/gestures.js","../node_modules/framer-motion/dist/es/gestures/use-tap-gesture.js","../node_modules/framer-motion/dist/es/gestures/use-focus-gesture.js","../node_modules/framer-motion/dist/es/utils/shallow-compare.js","../node_modules/hey-listen/dist/hey-listen.es.js","../node_modules/popmotion/dist/es/utils/clamp.js","../node_modules/popmotion/dist/es/animations/utils/find-spring.js","../node_modules/popmotion/dist/es/animations/generators/spring.js","../node_modules/popmotion/dist/es/utils/progress.js","../node_modules/popmotion/dist/es/utils/mix.js","../node_modules/style-value-types/dist/es/color/utils.js","../node_modules/style-value-types/dist/es/color/rgba.js","../node_modules/style-value-types/dist/es/color/hex.js","../node_modules/style-value-types/dist/es/color/hsla.js","../node_modules/popmotion/dist/es/utils/mix-color.js","../node_modules/style-value-types/dist/es/color/index.js","../node_modules/style-value-types/dist/es/complex/index.js","../node_modules/popmotion/dist/es/utils/inc.js","../node_modules/popmotion/dist/es/utils/mix-complex.js","../node_modules/popmotion/dist/es/utils/interpolate.js","../node_modules/popmotion/dist/es/easing/utils.js","../node_modules/popmotion/dist/es/easing/index.js","../node_modules/popmotion/dist/es/animations/generators/keyframes.js","../node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js","../node_modules/popmotion/dist/es/animations/generators/decay.js","../node_modules/framesync/dist/es/on-next-frame.js","../node_modules/framesync/dist/es/index.js","../node_modules/framesync/dist/es/create-render-step.js","../node_modules/popmotion/dist/es/animations/utils/elapsed.js","../node_modules/popmotion/dist/es/animations/index.js","../node_modules/popmotion/dist/es/utils/velocity-per-second.js","../node_modules/framer-motion/dist/es/utils/time-conversion.js","../node_modules/popmotion/dist/es/easing/cubic-bezier.js","../node_modules/framer-motion/dist/es/animation/utils/easing.js","../node_modules/framer-motion/dist/es/animation/utils/is-animatable.js","../node_modules/framer-motion/dist/es/animation/utils/default-transitions.js","../node_modules/style-value-types/dist/es/complex/filter.js","../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js","../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js","../node_modules/framer-motion/dist/es/animation/utils/transitions.js","../node_modules/popmotion/dist/es/animations/inertia.js","../node_modules/framer-motion/dist/es/utils/array.js","../node_modules/framer-motion/dist/es/utils/subscription-manager.js","../node_modules/framer-motion/dist/es/value/index.js","../node_modules/framer-motion/dist/es/render/dom/value-types/test.js","../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js","../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js","../node_modules/framer-motion/dist/es/render/dom/value-types/find.js","../node_modules/framer-motion/dist/es/render/utils/setters.js","../node_modules/framer-motion/dist/es/render/utils/animation.js","../node_modules/framer-motion/dist/es/render/utils/animation-state.js","../node_modules/framer-motion/dist/es/motion/features/animations.js","../node_modules/popmotion/dist/es/utils/is-point.js","../node_modules/popmotion/dist/es/utils/is-point-3d.js","../node_modules/popmotion/dist/es/utils/distance.js","../node_modules/framer-motion/dist/es/gestures/PanSession.js","../node_modules/framer-motion/dist/es/utils/noop.js","../node_modules/framer-motion/dist/es/utils/geometry/index.js","../node_modules/framer-motion/dist/es/utils/each-axis.js","../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js","../node_modules/framer-motion/dist/es/render/dom/projection/measure.js","../node_modules/framer-motion/dist/es/utils/geometry/delta-calc.js","../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js","../node_modules/framer-motion/dist/es/render/dom/projection/utils.js","../node_modules/framer-motion/dist/es/motion/features/layout/utils.js","../node_modules/framer-motion/dist/es/render/utils/is-draggable.js","../node_modules/framer-motion/dist/es/utils/geometry/delta-apply.js","../node_modules/framer-motion/dist/es/render/dom/utils/batch-layout.js","../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js","../node_modules/framer-motion/dist/es/render/dom/projection/convert-to-relative.js","../node_modules/framer-motion/dist/es/motion/features/drag.js","../node_modules/framer-motion/dist/es/components/AnimateSharedLayout/types.js","../node_modules/framer-motion/dist/es/gestures/use-pan-gesture.js","../node_modules/framer-motion/dist/es/gestures/drag/use-drag.js","../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js","../node_modules/framer-motion/dist/es/render/dom/projection/default-scale-correctors.js","../node_modules/framer-motion/dist/es/motion/features/layout/Animate.js","../node_modules/framer-motion/dist/es/components/AnimateSharedLayout/utils/batcher.js","../node_modules/framer-motion/dist/es/context/SharedLayoutContext.js","../node_modules/framer-motion/dist/es/motion/features/layout/Measure.js","../node_modules/framer-motion/dist/es/motion/features/layout/index.js","../node_modules/framer-motion/dist/es/render/utils/state.js","../node_modules/framer-motion/dist/es/render/html/utils/build-projection-transform.js","../node_modules/framer-motion/dist/es/render/utils/lifecycles.js","../node_modules/framer-motion/dist/es/render/utils/projection.js","../node_modules/framer-motion/dist/es/render/utils/flat-tree.js","../node_modules/framer-motion/dist/es/render/index.js","../node_modules/framer-motion/dist/es/render/utils/motion-values.js","../node_modules/framer-motion/dist/es/render/dom/projection/relative-set.js","../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js","../node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.js","../node_modules/framer-motion/dist/es/render/html/visual-element.js","../node_modules/framer-motion/dist/es/utils/is-numerical-string.js","../node_modules/framer-motion/dist/es/render/svg/visual-element.js","../node_modules/framer-motion/dist/es/render/dom/create-visual-element.js","../node_modules/framer-motion/dist/es/render/dom/motion.js","../node_modules/framer-motion/dist/es/render/dom/utils/create-config.js","../node_modules/function-bind/implementation.js","../node_modules/function-bind/index.js","../node_modules/get-intrinsic/index.js","../node_modules/gopd/index.js","../node_modules/has-property-descriptors/index.js","../node_modules/has-proto/index.js","../node_modules/has-symbols/index.js","../node_modules/has-symbols/shams.js","../node_modules/hasown/index.js","../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../node_modules/ieee754/index.js","../node_modules/intl-messageformat/lib/src/core.js","../node_modules/intl-messageformat/lib/src/error.js","../node_modules/intl-messageformat/lib/src/formatters.js","../node_modules/isomorphic-unfetch/browser.js","../node_modules/js-cookie/src/js.cookie.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_arrayReduce.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_asciiToArray.js","../node_modules/lodash/_asciiWords.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/_baseHas.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseIteratee.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/_basePropertyOf.js","../node_modules/lodash/_baseSlice.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/_castSlice.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_createCaseFirst.js","../node_modules/lodash/_createCompounder.js","../node_modules/lodash/_deburrLetter.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/_hasUnicode.js","../node_modules/lodash/_hasUnicodeWord.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_root.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_stringToArray.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_unicodeToArray.js","../node_modules/lodash/_unicodeWords.js","../node_modules/lodash/camelCase.js","../node_modules/lodash/capitalize.js","../node_modules/lodash/deburr.js","../node_modules/lodash/eq.js","../node_modules/lodash/get.js","../node_modules/lodash/has.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/identity.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/keys.js","../node_modules/lodash/lodash.js","../node_modules/lodash/mapKeys.js","../node_modules/lodash/mapValues.js","../node_modules/lodash/memoize.js","../node_modules/lodash/property.js","../node_modules/lodash/snakeCase.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/toString.js","../node_modules/lodash/upperFirst.js","../node_modules/lodash/words.js","../node_modules/object-assign/index.js","../node_modules/object-inspect/index.js","../node_modules/perfect-scrollbar/src/lib/css.js","../node_modules/perfect-scrollbar/src/lib/dom.js","../node_modules/perfect-scrollbar/src/lib/class-names.js","../node_modules/perfect-scrollbar/src/lib/event-manager.js","../node_modules/perfect-scrollbar/src/process-scroll-diff.js","../node_modules/perfect-scrollbar/src/lib/util.js","../node_modules/perfect-scrollbar/src/update-geometry.js","../node_modules/perfect-scrollbar/src/handlers/drag-thumb.js","../node_modules/perfect-scrollbar/src/index.js","../node_modules/perfect-scrollbar/src/handlers/click-rail.js","../node_modules/perfect-scrollbar/src/handlers/keyboard.js","../node_modules/perfect-scrollbar/src/handlers/mouse-wheel.js","../node_modules/perfect-scrollbar/src/handlers/touch.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/property-expr/index.js","../node_modules/react-addons-update/index.js","../node_modules/react-dom/cjs/react-dom.production.min.js","../node_modules/react-dom/index.js","../node_modules/react-fast-compare/index.js","../node_modules/react-intl/lib/src/components/injectIntl.js","../node_modules/react-intl/lib/src/components/message.js","../node_modules/react-intl/lib/src/components/useIntl.js","../node_modules/react-intl/lib/src/utils.js","../node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-is/index.js","../node_modules/react-perfect-scrollbar/lib/index.js","../node_modules/react-perfect-scrollbar/lib/scrollbar.js","../node_modules/react-redux/es/components/Context.js","../node_modules/react-redux/es/utils/batch.js","../node_modules/react-redux/es/utils/Subscription.js","../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","../node_modules/react-redux/es/components/Provider.js","../node_modules/react-redux/es/hooks/useReduxContext.js","../node_modules/react-redux/es/hooks/useStore.js","../node_modules/react-redux/es/hooks/useDispatch.js","../node_modules/react-redux/es/hooks/useSelector.js","../node_modules/react-redux/es/index.js","../node_modules/react-router-dom/dom.ts","../node_modules/react-router-dom/index.tsx","../node_modules/react-router/lib/context.ts","../node_modules/react-router/lib/hooks.tsx","../node_modules/react-router/lib/components.tsx","../node_modules/react-transition-group/esm/config.js","../node_modules/react-transition-group/esm/Transition.js","../node_modules/react-transition-group/esm/utils/ChildMapping.js","../node_modules/react-transition-group/esm/TransitionGroup.js","../node_modules/react-transition-group/esm/TransitionGroupContext.js","../node_modules/react-transition-group/esm/utils/reflow.js","../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react.production.min.js","../node_modules/react/index.js","../node_modules/react/jsx-runtime.js","../node_modules/redux-persist/lib/storage/createWebStorage.js","../node_modules/redux-persist/lib/storage/getStorage.js","../node_modules/redux-persist/lib/storage/index.js","../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../node_modules/redux/es/redux.js","../node_modules/reselect/es/defaultMemoize.js","../node_modules/reselect/es/index.js","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/scheduler/index.js","../node_modules/set-function-length/index.js","../node_modules/side-channel/index.js","../node_modules/toposort/index.js","../node_modules/unfetch/src/index.mjs","../node_modules/url/node_modules/punycode/punycode.js","../node_modules/url/node_modules/qs/lib/formats.js","../node_modules/url/node_modules/qs/lib/index.js","../node_modules/url/node_modules/qs/lib/parse.js","../node_modules/url/node_modules/qs/lib/stringify.js","../node_modules/url/node_modules/qs/lib/utils.js","../node_modules/url/url.js","../node_modules/nanoclone/src/index.js","../node_modules/yup/es/util/printValue.js","../node_modules/yup/es/locale.js","../node_modules/yup/es/util/isSchema.js","../node_modules/yup/es/Condition.js","../node_modules/yup/es/util/toArray.js","../node_modules/yup/es/ValidationError.js","../node_modules/yup/es/util/runTests.js","../node_modules/yup/es/Reference.js","../node_modules/yup/es/util/createValidation.js","../node_modules/yup/es/util/reach.js","../node_modules/yup/es/util/ReferenceSet.js","../node_modules/yup/es/schema.js","../node_modules/yup/es/mixed.js","../node_modules/yup/es/util/isAbsent.js","../node_modules/yup/es/boolean.js","../node_modules/yup/es/string.js","../node_modules/yup/es/util/isodate.js","../node_modules/yup/es/date.js","../node_modules/yup/es/util/sortByKeyOrder.js","../node_modules/yup/es/object.js","../node_modules/yup/es/util/sortFields.js","../node_modules/@babel/runtime/helpers/extends.js","../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/clsx/dist/clsx.mjs","../node_modules/immer/src/utils/errors.ts","../node_modules/immer/src/utils/common.ts","../node_modules/immer/src/utils/plugins.ts","../node_modules/immer/src/core/scope.ts","../node_modules/immer/src/core/finalize.ts","../node_modules/immer/src/core/proxy.ts","../node_modules/immer/src/core/immerClass.ts","../node_modules/immer/src/core/current.ts","../node_modules/immer/src/plugins/es5.ts","../node_modules/immer/src/immer.ts","../node_modules/immer/src/utils/env.ts","../node_modules/tslib/tslib.es6.mjs","../webpack/bootstrap","../webpack/runtime/compat get default export","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/ensure chunk","../webpack/runtime/get javascript chunk filename","../webpack/runtime/get mini-css chunk filename","../webpack/runtime/global","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/load script","../webpack/runtime/make namespace object","../webpack/runtime/node module decorator","../webpack/runtime/publicPath","../webpack/runtime/css loading","../webpack/runtime/jsonp chunk loading","../webpack/runtime/nonce","../node_modules/@aws-amplify/auth/src/index.ts","../node_modules/@sentry/src/integration.ts","../node_modules/@sentry/src/integrations/inboundfilters.ts","../node_modules/@sentry/src/integrations/functiontostring.ts","../node_modules/@sentry/src/sdk.ts","../node_modules/@sentry/src/dsn.ts","../node_modules/@sentry/src/api.ts","../node_modules/@sentry/src/supports.ts","../node_modules/@sentry/src/vendor/supportsHistory.ts","../node_modules/@sentry/src/instrument/_handlers.ts","../node_modules/@sentry/src/instrument/history.ts","../node_modules/@sentry/src/envelope.ts","../node_modules/@sentry/src/error.ts","../node_modules/@sentry/src/metrics/envelope.ts","../node_modules/@sentry/src/metrics/utils.ts","../node_modules/@sentry/src/baseclient.ts","../node_modules/@sentry/src/utils/sdkMetadata.ts","../node_modules/src/debug-build.ts","../node_modules/src/eventbuilder.ts","../node_modules/src/helpers.ts","../node_modules/src/client.ts","../node_modules/@sentry/src/env.ts","../node_modules/src/userfeedback.ts","../node_modules/@sentry/src/clientreport.ts","../node_modules/@sentry/src/instrument/console.ts","../node_modules/@sentry/src/instrument/dom.ts","../node_modules/@sentry/src/instrument/xhr.ts","../node_modules/@sentry/src/instrument/fetch.ts","../node_modules/@sentry/src/severity.ts","../node_modules/@sentry/src/url.ts","../node_modules/src/integrations/breadcrumbs.ts","../node_modules/src/integrations/dedupe.ts","../node_modules/@sentry/src/instrument/globalError.ts","../node_modules/@sentry/src/instrument/globalUnhandledRejection.ts","../node_modules/src/integrations/globalhandlers.ts","../node_modules/src/integrations/httpcontext.ts","../node_modules/@sentry/src/aggregate-errors.ts","../node_modules/src/integrations/linkederrors.ts","../node_modules/src/integrations/trycatch.ts","../node_modules/src/stack-parsers.ts","../node_modules/@sentry/src/promisebuffer.ts","../node_modules/@sentry/src/ratelimit.ts","../node_modules/@sentry/src/transports/base.ts","../node_modules/src/transports/utils.ts","../node_modules/src/transports/fetch.ts","../node_modules/src/transports/xhr.ts","../node_modules/src/sdk.ts","../node_modules/@sentry/src/metrics/metric-summary.ts","../node_modules/@sentry/src/semanticAttributes.ts","../node_modules/@sentry/src/tracing/spanstatus.ts","../node_modules/@sentry/src/tracing/span.ts","../node_modules/@sentry/src/utils/hasTracingEnabled.ts","../node_modules/@sentry/src/tracing/trace.ts","../node_modules/@sentry/src/tracing/transaction.ts","../node_modules/@sentry/src/tracing/idletransaction.ts","../node_modules/@sentry/src/tracing/utils.ts","../node_modules/@sentry/src/tracing/errors.ts","../node_modules/@sentry/src/tracing/sampling.ts","../node_modules/@sentry/src/tracing/hubextensions.ts","../node_modules/@sentry-internal/src/common/debug-build.ts","../node_modules/@sentry-internal/src/browser/types.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/bindReporter.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getNavigationEntry.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getActivationStart.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/initMetric.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/generateUniqueID.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/observe.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/onHidden.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getCLS.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getVisibilityWatcher.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getFID.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getINP.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getLCP.ts","../node_modules/@sentry-internal/src/browser/web-vitals/onTTFB.ts","../node_modules/@sentry-internal/src/browser/instrument.ts","../node_modules/@sentry/src/span.ts","../node_modules/@sentry-internal/src/browser/metrics/utils.ts","../node_modules/@sentry-internal/src/browser/metrics/index.ts","../node_modules/@sentry/src/tracing/measurement.ts","../node_modules/@sentry-internal/src/common/fetch.ts","../node_modules/@sentry-internal/src/browser/request.ts","../node_modules/@sentry-internal/src/browser/browserTracingIntegration.ts","../node_modules/@sentry-internal/src/browser/backgroundtab.ts","../node_modules/@mui/x-date-pickers/AdapterDayjs/AdapterDayjs.js","../node_modules/@stripe/stripe-js/dist/index.mjs","layout/NavigationScroll.js","../node_modules/universal-cookie/esm/index.mjs","../node_modules/react-cookie/esm/index.mjs","../node_modules/@sentry/src/errorboundary.tsx","../node_modules/crisp-sdk-web/src/session.ts","../node_modules/@tabler/icons-react/src/icons/IconChevronRight.js","../node_modules/crisp-sdk-web/src/message.ts","../node_modules/crisp-sdk-web/src/user.ts","../node_modules/crisp-sdk-web/src/trigger.ts","../node_modules/crisp-sdk-web/src/index.ts","../node_modules/crisp-sdk-web/src/chat.ts","../node_modules/@tabler/icons-react/src/icons/IconDashboard.js","../node_modules/@tabler/icons-react/src/icons/IconDeviceAnalytics.js","../node_modules/@tabler/icons-react/src/icons/IconShoppingCart.js","../node_modules/@tabler/icons-react/src/icons/IconBrandFacebook.js","../node_modules/@tabler/icons-react/src/icons/IconPackage.js","../node_modules/@tabler/icons-react/src/icons/IconList.js","../node_modules/@tabler/icons-react/src/icons/IconQuestionMark.js","menu-items/dashboard.js","menu-items/index.js","../node_modules/@tabler/icons-react/src/icons/IconTallymark1.js","ui-component/extended/Breadcrumbs.js","views/albums/AlbumLayout.js","assets/images/error.svg","views/ui-elements/UnknownError.js","../node_modules/@mui/icons-material/esm/LockClock.js","../node_modules/@tabler/icons-react/src/icons/IconMenu2.js","layout/MainLayout/LogoSection/index.js","../node_modules/@tabler/icons-react/src/icons/IconDotsVertical.js","layout/MainLayout/Header/MobileSection/index.js","layout/MainLayout/Header/NotificationSection/NotificationList.js","layout/MainLayout/Header/NotificationSection/index.js","../node_modules/@tabler/icons-react/src/icons/IconSettings.js","../node_modules/@tabler/icons-react/src/icons/IconLogout.js","../node_modules/@mui/icons-material/esm/LockOutlined.js","layout/MainLayout/Header/ProfileSection/UpgradePlanCard.js","layout/MainLayout/Sidebar/MenuCard/index.js","layout/MainLayout/Header/ProfileSection/index.js","layout/MainLayout/Header/index.js","../node_modules/@tabler/icons-react/src/icons/IconEditCircle.js","../node_modules/@tabler/icons-react/src/icons/IconPhotoCircle.js","../node_modules/@tabler/icons-react/src/icons/IconUsers.js","../node_modules/@tabler/icons-react/src/icons/IconCards.js","../node_modules/@tabler/icons-react/src/icons/IconCsv.js","../node_modules/@tabler/icons-react/src/icons/IconTags.js","../node_modules/@tabler/icons-react/src/icons/IconBuildingStore.js","../node_modules/@tabler/icons-react/src/icons/IconBellPlus.js","../node_modules/@tabler/icons-react/src/icons/IconDeviceMobileMessage.js","menu-items/albums.js","layout/MainLayout/Sidebar/MenuList/NavItem/index.js","../node_modules/@tabler/icons-react/src/icons/IconChevronUp.js","../node_modules/@tabler/icons-react/src/icons/IconChevronDown.js","layout/MainLayout/Sidebar/MenuList/NavCollapse/index.js","layout/MainLayout/Sidebar/MenuList/NavGroup/index.js","layout/MainLayout/Sidebar/MenuList/index.js","layout/MainLayout/Sidebar/index.js","layout/MainLayout/index.js","ui-component/Loadable.js","utils/route-guard/AuthGuard.js","views/profile/Profile.js","views/profile/Security.js","views/profile/index.js","routes/MainRoutes.js","routes/AlbumRoutes.js","layout/MinimalLayout/index.js","layout/NavMotion.js","utils/route-guard/GuestGuard.js","routes/LoginRoutes.js","../node_modules/@mui/icons-material/esm/BugReport.js","views/public/Footer.js","../node_modules/@tabler/icons-react/src/icons/IconHome2.js","views/public/Header.js","views/public/PublicLayout.js","routes/VisitorRoutes.js","views/layout/PhotographLayout.js","routes/PhotographPublicRoutes.js","routes/index.js","../node_modules/@mui/material/locale/index.js","../node_modules/@mui/x-data-grid/utils/getGridLocalization.js","../node_modules/@mui/x-data-grid/locales/bgBG.js","webpack://eventpxl-admin-front/./src/assets/scss/_themes-vars.module.scss?9c0d","themes/palette.js","themes/typography.js","themes/compStyleOverride.js","themes/shadows.js","../node_modules/@mui/x-data-grid/locales/arSD.js","../node_modules/@mui/x-data-grid/locales/beBY.js","../node_modules/@mui/x-data-grid/locales/coreLocales.js","../node_modules/@mui/x-data-grid/locales/csCZ.js","../node_modules/@mui/x-data-grid/locales/daDK.js","../node_modules/@mui/x-data-grid/locales/deDE.js","../node_modules/@mui/x-data-grid/locales/elGR.js","../node_modules/@mui/x-data-grid/locales/enUS.js","../node_modules/@mui/x-data-grid/locales/esES.js","../node_modules/@mui/x-data-grid/locales/faIR.js","../node_modules/@mui/x-data-grid/locales/fiFI.js","../node_modules/@mui/x-data-grid/locales/frFR.js","../node_modules/@mui/x-data-grid/locales/heIL.js","../node_modules/@mui/x-data-grid/locales/huHU.js","../node_modules/@mui/x-data-grid/locales/itIT.js","../node_modules/@mui/x-data-grid/locales/jaJP.js","../node_modules/@mui/x-data-grid/locales/koKR.js","../node_modules/@mui/x-data-grid/locales/nbNO.js","../node_modules/@mui/x-data-grid/locales/nlNL.js","../node_modules/@mui/x-data-grid/locales/plPL.js","../node_modules/@mui/x-data-grid/locales/ptBR.js","../node_modules/@mui/x-data-grid/locales/roRO.js","../node_modules/@mui/x-data-grid/locales/ruRU.js","../node_modules/@mui/x-data-grid/locales/skSK.js","../node_modules/@mui/x-data-grid/locales/svSE.js","../node_modules/@mui/x-data-grid/locales/trTR.js","../node_modules/@mui/x-data-grid/locales/ukUA.js","../node_modules/@mui/x-data-grid/locales/urPK.js","../node_modules/@mui/x-data-grid/locales/viVN.js","../node_modules/@mui/x-data-grid/locales/zhCN.js","../node_modules/@mui/x-data-grid/locales/zhTW.js","themes/index.js","../node_modules/@formatjs/intl/lib/src/message.js","../node_modules/@formatjs/intl/lib/src/number.js","../node_modules/@formatjs/intl/lib/src/relativeTime.js","../node_modules/@formatjs/intl/lib/src/dateTime.js","../node_modules/@formatjs/intl/lib/src/plural.js","../node_modules/@formatjs/intl/lib/src/list.js","../node_modules/@formatjs/intl/lib/src/displayName.js","../node_modules/@formatjs/intl/lib/src/create-intl.js","../node_modules/react-intl/lib/src/components/provider.js","ui-component/Locales.js","ui-component/extended/Snackbar.js","App.js","../node_modules/redux-persist/es/integration/react.js","reportWebVitals.js","serviceWorker.js","aws-exports.js","index.js"],"sourceRoot":"","sourcesContent":["\r\nexport const BASE_PATH = '';\r\nexport const DASHBOARD_PATH = '/dashboard';\r\nexport const REGISTER_PATH = '/endregister';\r\nexport const AUTHORIZATION_CODE_PATH = '/forgot/code';\r\nexport const LOGIN_PATH = '/dashboard/login';\r\nexport const FORGOT_PATH = '/forgot';\r\n\r\nconst config = {\r\n fontFamily: `'Roboto', sans-serif`,\r\n borderRadius: 8,\r\n outlinedFilled: true,\r\n navType: 'light', // light, dark\r\n presetColor: 'theme1', // default, theme1, theme2, theme3, theme4, theme5, theme6\r\n locale: 'fr',\r\n forceLocale: false,\r\n rtlLayout: false,\r\n container: false\r\n};\r\n\r\nexport default config;\r\n","// action - account reducer\r\nexport const LOGIN = 'LOGIN';\r\nexport const LOGOUT = 'LOGOUT';\r\nexport const REGISTER = 'REGISTER';\r\nexport const ASK_FOR_REGISTRATION = 'ASK_FOR_REGISTRATION';\r\nexport const NEW_PASSWORD_REQUIRED = 'NEW_PASSWORD_REQUIRED';\r\nexport const END_REGISTER = 'END_REGISTER';\r\nexport const FIREBASE_STATE_CHANGED = 'FIREBASE_STATE_CHANGED';\r\nexport const CHANGE_PASSWORD_ERROR = 'CHANGE_PASSWORD_ERROR';\r\n","// action - state management\r\nimport { LOGIN, LOGOUT, REGISTER, NEW_PASSWORD_REQUIRED, CHANGE_PASSWORD_ERROR, END_REGISTER } from './actions';\r\n\r\n\r\nconst accountReducer = (state, action) => {\r\n switch (action.type) {\r\n case REGISTER: {\r\n const { user } = action.payload;\r\n return {\r\n ...state,\r\n user\r\n };\r\n }\r\n case NEW_PASSWORD_REQUIRED: {\r\n const { user } = action.payload;\r\n return {\r\n ...state,\r\n isLoggedIn: false,\r\n isRegistrationNeeded: true,\r\n isInitialized: true,\r\n user\r\n };\r\n }\r\n case END_REGISTER: {\r\n return {\r\n ...state,\r\n isRegistrationNeeded: false\r\n }\r\n }\r\n case CHANGE_PASSWORD_ERROR: {\r\n return {\r\n ...state,\r\n hasPasswordEditError: true\r\n }\r\n }\r\n case LOGIN: {\r\n const { user } = action.payload;\r\n return {\r\n ...state,\r\n isLoggedIn: true,\r\n isInitialized: true,\r\n user\r\n };\r\n }\r\n case LOGOUT: {\r\n return {\r\n ...state,\r\n isInitialized: true,\r\n isLoggedIn: false,\r\n user: null\r\n };\r\n }\r\n default: {\r\n return { ...state };\r\n }\r\n }\r\n};\r\n\r\nexport default accountReducer;\r\n","import { Auth } from \"@aws-amplify/auth\";\r\nimport * as Sentry from \"@sentry/browser\";\r\nimport axios from \"axios\";\r\nimport PropTypes from \"prop-types\";\r\nimport { createContext, useEffect, useReducer } from \"react\";\r\nimport accountReducer from \"store/accountReducer\";\r\nimport {\r\n END_REGISTER,\r\n LOGIN,\r\n LOGOUT,\r\n NEW_PASSWORD_REQUIRED,\r\n} from \"store/actions\";\r\nimport Loader from \"ui-component/Loader\";\r\n// constant\r\nconst initialState = {\r\n isLoggedIn: false,\r\n isInitialized: false,\r\n isRegistrationNeeded: false,\r\n user: null,\r\n};\r\n\r\nconst _mapUserFromCognitoUser = (cognitoUser) => {\r\n try {\r\n return {\r\n id: cognitoUser.attributes.sub,\r\n email: cognitoUser.attributes.email,\r\n };\r\n } catch (err) {\r\n console.log(err);\r\n throw err;\r\n }\r\n};\r\n\r\nconst _mapAWSErrorCode = (error) => {\r\n if (Object.keys(AWS_CODE_VERIFICATION_CODE).includes(error.code)) {\r\n return AWS_CODE_VERIFICATION_CODE[error.code];\r\n }\r\n return AWS_CODE_VERIFICATION_CODE[\"DEFAULT\"];\r\n};\r\n\r\nconst AWS_CODE_VERIFICATION_CODE = {\r\n ExpiredCodeException: \"le code a expiré\",\r\n LimitExceededException:\r\n \"Trop de requetes, merci d'attendre avant de réessayer\",\r\n CodeMismatchException: \"Mauvais code\",\r\n DEFAULT: \"Erreur inconnue, Veuillez reessayer.\",\r\n};\r\n\r\n// ==============================|| AWS Cognito CONTEXT & PROVIDER ||============================== //\r\nconst AWSCognitoContext = createContext(null);\r\n\r\nexport const AWSCognitoProvider = ({ children }) => {\r\n const [state, dispatch] = useReducer(accountReducer, initialState);\r\n\r\n const init = async () => {\r\n try {\r\n Auth.currentAuthenticatedUser()\r\n .then((user) => {\r\n console.log(user);\r\n const mappedUser = _mapUserFromCognitoUser(user);\r\n dispatch({\r\n type: LOGIN,\r\n payload: {\r\n isLoggedIn: true,\r\n user: mappedUser,\r\n },\r\n });\r\n Sentry.setContext({\r\n email: mappedUser.email,\r\n id: user.username,\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n logout();\r\n });\r\n } catch (err) {\r\n console.log(err);\r\n logout();\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n init();\r\n }, []);\r\n\r\n const login = async (email, password) => {\r\n return Auth.signIn(email, password)\r\n .then((user) => {\r\n if (user.challengeName === \"NEW_PASSWORD_REQUIRED\") {\r\n dispatch({\r\n type: NEW_PASSWORD_REQUIRED,\r\n payload: {\r\n isLoggedIn: true,\r\n user: user,\r\n },\r\n });\r\n } else {\r\n dispatch({\r\n type: LOGIN,\r\n payload: {\r\n isLoggedIn: true,\r\n user: _mapUserFromCognitoUser(user),\r\n },\r\n });\r\n }\r\n return Promise.resolve();\r\n })\r\n .catch((err) => {\r\n console.log(\"Dans mon catch\");\r\n console.error(err);\r\n return Promise.reject(err);\r\n });\r\n };\r\n\r\n const register = (user, password, requiredAttributes) =>\r\n new Promise((success, rej) => {\r\n return Auth.completeNewPassword(state.user, password, {\r\n given_name: \"given_name\",\r\n family_name: \"family_name\",\r\n gender: \"male\",\r\n address: JSON.stringify({\r\n street_address: \"street_address\",\r\n locality: \"locality\",\r\n postal_code: \"postal_code\",\r\n country: \"country\",\r\n formatted: `formatted`,\r\n }),\r\n })\r\n .then((result) => {\r\n init();\r\n dispatch({ type: END_REGISTER });\r\n success(result);\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n rej(err);\r\n });\r\n });\r\n\r\n const logout = async () => {\r\n try {\r\n await Auth.signOut();\r\n } catch (err) {\r\n console.error(err);\r\n } finally {\r\n dispatch({ type: LOGOUT });\r\n }\r\n };\r\n\r\n const resetPassword = (email) => {\r\n return Auth.forgotPassword(email);\r\n };\r\n\r\n const resetPassword2 = (email, code, newPassword) => {\r\n return Auth.forgotPasswordSubmit(email, code, newPassword)\r\n .then((ok) => Promise.resolve())\r\n .catch((err) => Promise.reject(_mapAWSErrorCode(err)));\r\n };\r\n\r\n const changePassword = (oldPassword, newPassword) => {\r\n return Auth.currentAuthenticatedUser()\r\n .then((user) => {\r\n return Auth.changePassword(user, oldPassword, newPassword)\r\n .then((e) => {\r\n return logout();\r\n })\r\n .catch((err) => Promise.reject(err));\r\n })\r\n .catch((err) => Promise.reject(err));\r\n };\r\n\r\n const getUserLetters = () => {\r\n if (state.user && state.user.name) {\r\n return `${state.user.name.toUpperCase().substring(0, 2)}`;\r\n }\r\n return \"\";\r\n };\r\n\r\n const askForRegistration = (\r\n firstName,\r\n lastName,\r\n email,\r\n phone,\r\n captchaValue\r\n ) => {\r\n return axios.post(\"https://api.sportpxl.com/contact-form\", {\r\n firstName,\r\n lastName,\r\n email,\r\n phone,\r\n token: captchaValue,\r\n });\r\n };\r\n\r\n if (state.isInitialized !== undefined && !state.isInitialized) {\r\n return ;\r\n }\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nAWSCognitoProvider.propTypes = {\r\n children: PropTypes.node,\r\n};\r\n\r\nexport default AWSCognitoContext;\r\n","import PropTypes from \"prop-types\";\r\nimport { createContext } from \"react\";\r\n\r\n// project import\r\nimport defaultConfig from \"config\";\r\nimport useLocalStorage from \"hooks/useLocalStorage\";\r\n\r\n// initial state\r\nconst initialState = {\r\n ...defaultConfig,\r\n onChangeMenuType: () => {},\r\n onChangePresetColor: () => {},\r\n onChangeLocale: () => {},\r\n onChangeRTL: () => {},\r\n onChangeContainer: () => {},\r\n onChangeFontFamily: () => {},\r\n onChangeBorderRadius: () => {},\r\n onChangeOutlinedField: () => {},\r\n};\r\n\r\n// ==============================|| CONFIG CONTEXT & PROVIDER ||============================== //\r\n\r\nconst ConfigContext = createContext(initialState);\r\n\r\nfunction ConfigProvider({ children }) {\r\n const [config, setConfig] = useLocalStorage(\"eventpxl-config\", {\r\n fontFamily: initialState.fontFamily,\r\n borderRadius: initialState.borderRadius,\r\n outlinedFilled: initialState.outlinedFilled,\r\n navType: initialState.navType,\r\n presetColor: initialState.presetColor,\r\n locale: initialState.locale,\r\n rtlLayout: initialState.rtlLayout,\r\n photoHelperDisplayed: false,\r\n });\r\n\r\n const onChangeMenuType = (navType) => {\r\n setConfig({\r\n ...config,\r\n navType,\r\n });\r\n };\r\n\r\n const onChangePresetColor = (presetColor) => {\r\n setConfig({\r\n ...config,\r\n presetColor,\r\n });\r\n };\r\n\r\n const onChangeLocale = (locale) => {\r\n setConfig({\r\n ...config,\r\n locale,\r\n forceLocale: true,\r\n });\r\n };\r\n\r\n const onChangeRTL = (rtlLayout) => {\r\n setConfig({\r\n ...config,\r\n rtlLayout,\r\n });\r\n };\r\n\r\n const onChangeContainer = () => {\r\n setConfig({\r\n ...config,\r\n container: !config.container,\r\n });\r\n };\r\n\r\n const onChangeFontFamily = (fontFamily) => {\r\n setConfig({\r\n ...config,\r\n fontFamily,\r\n });\r\n };\r\n\r\n const onChangeBorderRadius = (event, newValue) => {\r\n setConfig({\r\n ...config,\r\n borderRadius: newValue,\r\n });\r\n };\r\n\r\n const onChangeOutlinedField = (outlinedFilled) => {\r\n setConfig({\r\n ...config,\r\n outlinedFilled,\r\n });\r\n };\r\n\r\n const onChangePhotoHelperDisplayed = (photoHelperDisplayed) => {\r\n setConfig({\r\n ...config,\r\n photoHelperDisplayed,\r\n });\r\n };\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nConfigProvider.propTypes = {\r\n children: PropTypes.node,\r\n};\r\n\r\nexport { ConfigContext, ConfigProvider };\r\n","import { useState, useEffect } from 'react';\r\n\r\n// ==============================|| CONFIG - LOCAL STORAGE ||============================== //\r\n\r\nexport default function useLocalStorage(key, defaultValue) {\r\n const [value, setValue] = useState(() => {\r\n const storedValue = localStorage.getItem(key);\r\n return storedValue === null ? defaultValue : JSON.parse(storedValue);\r\n });\r\n\r\n useEffect(() => {\r\n const listener = (e) => {\r\n if (e.storageArea === localStorage && e.key === key) {\r\n setValue(e.newValue ? JSON.parse(e.newValue) : e.newValue);\r\n }\r\n };\r\n window.addEventListener('storage', listener);\r\n\r\n return () => {\r\n window.removeEventListener('storage', listener);\r\n };\r\n }, [key, defaultValue]);\r\n\r\n const setValueInLocalStorage = (newValue) => {\r\n setValue((currentValue) => {\r\n const result = typeof newValue === 'function' ? newValue(currentValue) : newValue;\r\n localStorage.setItem(key, JSON.stringify(result));\r\n return result;\r\n });\r\n };\r\n\r\n return [value, setValueInLocalStorage];\r\n}\r\n","import { useContext } from 'react';\r\nimport AuthContext from 'contexts/AWSCognitoContext';\r\n\r\n// ==============================|| AUTH HOOKS ||============================== //\r\n\r\nconst useAuth = () => {\r\n const context = useContext(AuthContext);\r\n\r\n if (!context) throw new Error('context must be use inside provider');\r\n\r\n return context;\r\n};\r\n\r\nexport default useAuth;\r\n","import { useContext } from 'react';\r\nimport { ConfigContext } from 'contexts/ConfigContext';\r\n\r\n// ==============================|| CONFIG - HOOKS ||============================== //\r\n\r\nconst useConfig = () => useContext(ConfigContext);\r\n\r\nexport default useConfig;\r\n","//eslint-disable formatjs/no-litteral-string-in-jsx\r\nimport {\r\n Avatar,\r\n Box,\r\n ClickAwayListener,\r\n Grid,\r\n List,\r\n ListItemButton,\r\n ListItemText,\r\n Paper,\r\n Popper,\r\n Typography,\r\n useMediaQuery,\r\n} from \"@mui/material\";\r\nimport { useTheme } from \"@mui/material/styles\";\r\nimport useConfig from \"hooks/useConfig\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport { injectIntl } from \"react-intl\";\r\nimport Transitions from \"ui-component/extended/Transitions\";\r\nconst LocalizationSection = ({ intl }) => {\r\n const { borderRadius, onChangeLocale } = useConfig();\r\n\r\n const theme = useTheme();\r\n const matchesXs = useMediaQuery(theme.breakpoints.down(\"md\"));\r\n\r\n const [open, setOpen] = useState(false);\r\n const anchorRef = useRef(null);\r\n const locale = intl.locale;\r\n const [language, setLanguage] = useState(locale);\r\n\r\n const handleListItemClick = (event, lng) => {\r\n setLanguage(lng);\r\n onChangeLocale(lng);\r\n setOpen(false);\r\n };\r\n\r\n const handleToggle = () => {\r\n setOpen((prevOpen) => !prevOpen);\r\n };\r\n\r\n const handleClose = (event) => {\r\n if (anchorRef.current && anchorRef.current.contains(event.target)) {\r\n return;\r\n }\r\n setOpen(false);\r\n };\r\n\r\n const prevOpen = useRef(open);\r\n useEffect(() => {\r\n if (prevOpen.current === true && open === false) {\r\n anchorRef.current.focus();\r\n }\r\n prevOpen.current = open;\r\n }, [open]);\r\n\r\n useEffect(() => {\r\n setLanguage(locale);\r\n }, [locale]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {language}\r\n \r\n \r\n \r\n\r\n \r\n {({ TransitionProps }) => (\r\n \r\n \r\n \r\n {open && (\r\n \r\n handleListItemClick(event, \"fr\")}\r\n >\r\n \r\n \r\n Français\r\n \r\n \r\n }\r\n />\r\n \r\n handleListItemClick(event, \"en\")}\r\n >\r\n \r\n English\r\n \r\n }\r\n />\r\n \r\n handleListItemClick(event, \"es\")}\r\n >\r\n \r\n Español\r\n \r\n }\r\n />\r\n \r\n handleListItemClick(event, \"pt\")}\r\n >\r\n \r\n \r\n Português\r\n \r\n \r\n }\r\n />\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default injectIntl(LocalizationSection);\r\n","// theme constant\r\nexport const gridSpacing = 4;\r\nexport const drawerWidth = 260;\r\nexport const appDrawerWidth = 320;\r\n","export var KEY_PREFIX = 'persist:';\nexport var FLUSH = 'persist/FLUSH';\nexport var REHYDRATE = 'persist/REHYDRATE';\nexport var PAUSE = 'persist/PAUSE';\nexport var PERSIST = 'persist/PERSIST';\nexport var PURGE = 'persist/PURGE';\nexport var REGISTER = 'persist/REGISTER';\nexport var DEFAULT_VERSION = -1;","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*\n autoMergeLevel1: \n - merges 1 level of substate\n - skips substate if already modified\n*/\nexport default function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object\n\n\n if (inboundState && _typeof(inboundState) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration\n\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n } // otherwise hard set the new value\n\n\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log(\"redux-persist/stateReconciler: rehydrated keys '\".concat(Object.keys(inboundState).join(', '), \"'\"));\n return newState;\n}","import { KEY_PREFIX, REHYDRATE } from './constants';\n// @TODO remove once flow < 0.63 support is no longer required.\nexport default function createPersistoid(config) {\n // defaults\n var blacklist = config.blacklist || null;\n var whitelist = config.whitelist || null;\n var transforms = config.transforms || [];\n var throttle = config.throttle || 0;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var serialize;\n\n if (config.serialize === false) {\n serialize = function serialize(x) {\n return x;\n };\n } else if (typeof config.serialize === 'function') {\n serialize = config.serialize;\n } else {\n serialize = defaultSerialize;\n }\n\n var writeFailHandler = config.writeFailHandler || null; // initialize stateful values\n\n var lastState = {};\n var stagedState = {};\n var keysToProcess = [];\n var timeIterator = null;\n var writePromise = null;\n\n var update = function update(state) {\n // add any changed keys to the queue\n Object.keys(state).forEach(function (key) {\n if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop\n\n if (lastState[key] === state[key]) return; // value unchanged? noop\n\n if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop\n\n keysToProcess.push(key); // add key to queue\n }); //if any key is missing in the new state which was present in the lastState,\n //add it for processing too\n\n Object.keys(lastState).forEach(function (key) {\n if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) {\n keysToProcess.push(key);\n }\n }); // start the time iterator if not running (read: throttle)\n\n if (timeIterator === null) {\n timeIterator = setInterval(processNextKey, throttle);\n }\n\n lastState = state;\n };\n\n function processNextKey() {\n if (keysToProcess.length === 0) {\n if (timeIterator) clearInterval(timeIterator);\n timeIterator = null;\n return;\n }\n\n var key = keysToProcess.shift();\n var endState = transforms.reduce(function (subState, transformer) {\n return transformer.in(subState, key, lastState);\n }, lastState[key]);\n\n if (endState !== undefined) {\n try {\n stagedState[key] = serialize(endState);\n } catch (err) {\n console.error('redux-persist/createPersistoid: error serializing state', err);\n }\n } else {\n //if the endState is undefined, no need to persist the existing serialized content\n delete stagedState[key];\n }\n\n if (keysToProcess.length === 0) {\n writeStagedState();\n }\n }\n\n function writeStagedState() {\n // cleanup any removed keys just before write.\n Object.keys(stagedState).forEach(function (key) {\n if (lastState[key] === undefined) {\n delete stagedState[key];\n }\n });\n writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);\n }\n\n function passWhitelistBlacklist(key) {\n if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false;\n if (blacklist && blacklist.indexOf(key) !== -1) return false;\n return true;\n }\n\n function onWriteFail(err) {\n // @TODO add fail handlers (typically storage full)\n if (writeFailHandler) writeFailHandler(err);\n\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('Error storing data', err);\n }\n }\n\n var flush = function flush() {\n while (keysToProcess.length !== 0) {\n processNextKey();\n }\n\n return writePromise || Promise.resolve();\n }; // return `persistoid`\n\n\n return {\n update: update,\n flush: flush\n };\n} // @NOTE in the future this may be exposed via config\n\nfunction defaultSerialize(data) {\n return JSON.stringify(data);\n}","import { KEY_PREFIX } from './constants';\nexport default function getStoredState(config) {\n var transforms = config.transforms || [];\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var debug = config.debug;\n var deserialize;\n\n if (config.deserialize === false) {\n deserialize = function deserialize(x) {\n return x;\n };\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize;\n } else {\n deserialize = defaultDeserialize;\n }\n\n return storage.getItem(storageKey).then(function (serialized) {\n if (!serialized) return undefined;else {\n try {\n var state = {};\n var rawState = deserialize(serialized);\n Object.keys(rawState).forEach(function (key) {\n state[key] = transforms.reduceRight(function (subState, transformer) {\n return transformer.out(subState, key, rawState);\n }, deserialize(rawState[key]));\n });\n return state;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log(\"redux-persist/getStoredState: Error restoring data \".concat(serialized), err);\n throw err;\n }\n }\n });\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial);\n}","import { KEY_PREFIX } from './constants';\nexport default function purgeStoredState(config) {\n var storage = config.storage;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n return storage.removeItem(storageKey, warnIfRemoveError);\n}\n\nfunction warnIfRemoveError(err) {\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('redux-persist/purgeStoredState: Error purging data stored state', err);\n }\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { FLUSH, PAUSE, PERSIST, PURGE, REHYDRATE, DEFAULT_VERSION } from './constants';\nimport autoMergeLevel1 from './stateReconciler/autoMergeLevel1';\nimport createPersistoid from './createPersistoid';\nimport defaultGetStoredState from './getStoredState';\nimport purgeStoredState from './purgeStoredState';\nvar DEFAULT_TIMEOUT = 5000;\n/*\n @TODO add validation / handling for:\n - persisting a reducer which has nested _persist\n - handling actions that fire before reydrate is called\n*/\n\nexport default function persistReducer(config, baseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n if (!config) throw new Error('config is required for persistReducer');\n if (!config.key) throw new Error('key is required in persistor config');\n if (!config.storage) throw new Error(\"redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`\");\n }\n\n var version = config.version !== undefined ? config.version : DEFAULT_VERSION;\n var debug = config.debug || false;\n var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler;\n var getStoredState = config.getStoredState || defaultGetStoredState;\n var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT;\n var _persistoid = null;\n var _purge = false;\n var _paused = true;\n\n var conditionalUpdate = function conditionalUpdate(state) {\n // update the persistoid only if we are rehydrated and not paused\n state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state);\n return state;\n };\n\n return function (state, action) {\n var _ref = state || {},\n _persist = _ref._persist,\n rest = _objectWithoutProperties(_ref, [\"_persist\"]); // $FlowIgnore need to update State type\n\n\n var restState = rest;\n\n if (action.type === PERSIST) {\n var _sealed = false;\n\n var _rehydrate = function _rehydrate(payload, err) {\n // dev warning if we are already sealed\n if (process.env.NODE_ENV !== 'production' && _sealed) console.error(\"redux-persist: rehydrate for \\\"\".concat(config.key, \"\\\" called after timeout.\"), payload, err); // only rehydrate if we are not already sealed\n\n if (!_sealed) {\n action.rehydrate(config.key, payload, err);\n _sealed = true;\n }\n };\n\n timeout && setTimeout(function () {\n !_sealed && _rehydrate(undefined, new Error(\"redux-persist: persist timed out for persist key \\\"\".concat(config.key, \"\\\"\")));\n }, timeout); // @NOTE PERSIST resumes if paused.\n\n _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set\n\n if (!_persistoid) _persistoid = createPersistoid(config); // @NOTE PERSIST can be called multiple times, noop after the first\n\n if (_persist) {\n // We still need to call the base reducer because there might be nested\n // uses of persistReducer which need to be aware of the PERSIST action\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n }\n\n if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.');\n action.register(config.key);\n getStoredState(config).then(function (restoredState) {\n var migrate = config.migrate || function (s, v) {\n return Promise.resolve(s);\n };\n\n migrate(restoredState, version).then(function (migratedState) {\n _rehydrate(migratedState);\n }, function (migrateErr) {\n if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr);\n\n _rehydrate(undefined, migrateErr);\n });\n }, function (err) {\n _rehydrate(undefined, err);\n });\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: {\n version: version,\n rehydrated: false\n }\n });\n } else if (action.type === PURGE) {\n _purge = true;\n action.result(purgeStoredState(config));\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === FLUSH) {\n action.result(_persistoid && _persistoid.flush());\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === PAUSE) {\n _paused = true;\n } else if (action.type === REHYDRATE) {\n // noop on restState if purging\n if (_purge) return _objectSpread({}, restState, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n }) // @NOTE if key does not match, will continue to default else below\n\n });\n\n if (action.key === config.key) {\n var reducedState = baseReducer(restState, action);\n var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined\n\n var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState;\n\n var _newState = _objectSpread({}, reconciledRest, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n })\n });\n\n return conditionalUpdate(_newState);\n }\n } // if we have not already handled PERSIST, straight passthrough\n\n\n if (!_persist) return baseReducer(state, action); // run base reducer:\n // is state modified ? return original : return updated\n\n var newState = baseReducer(restState, action);\n if (newState === restState) return state;\n return conditionalUpdate(_objectSpread({}, newState, {\n _persist: _persist\n }));\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { createStore } from 'redux';\nimport { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants';\nvar initialState = {\n registry: [],\n bootstrapped: false\n};\n\nvar persistorReducer = function persistorReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case REGISTER:\n return _objectSpread({}, state, {\n registry: [].concat(_toConsumableArray(state.registry), [action.key])\n });\n\n case REHYDRATE:\n var firstIndex = state.registry.indexOf(action.key);\n\n var registry = _toConsumableArray(state.registry);\n\n registry.splice(firstIndex, 1);\n return _objectSpread({}, state, {\n registry: registry,\n bootstrapped: registry.length === 0\n });\n\n default:\n return state;\n }\n};\n\nexport default function persistStore(store, options, cb) {\n // help catch incorrect usage of passing PersistConfig in as PersistorOptions\n if (process.env.NODE_ENV !== 'production') {\n var optionsToTest = options || {};\n var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate'];\n bannedKeys.forEach(function (k) {\n if (!!optionsToTest[k]) console.error(\"redux-persist: invalid option passed to persistStore: \\\"\".concat(k, \"\\\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.\"));\n });\n }\n\n var boostrappedCb = cb || false;\n\n var _pStore = createStore(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined);\n\n var register = function register(key) {\n _pStore.dispatch({\n type: REGISTER,\n key: key\n });\n };\n\n var rehydrate = function rehydrate(key, payload, err) {\n var rehydrateAction = {\n type: REHYDRATE,\n payload: payload,\n err: err,\n key: key // dispatch to `store` to rehydrate and `persistor` to track result\n\n };\n store.dispatch(rehydrateAction);\n\n _pStore.dispatch(rehydrateAction);\n\n if (boostrappedCb && persistor.getState().bootstrapped) {\n boostrappedCb();\n boostrappedCb = false;\n }\n };\n\n var persistor = _objectSpread({}, _pStore, {\n purge: function purge() {\n var results = [];\n store.dispatch({\n type: PURGE,\n result: function result(purgeResult) {\n results.push(purgeResult);\n }\n });\n return Promise.all(results);\n },\n flush: function flush() {\n var results = [];\n store.dispatch({\n type: FLUSH,\n result: function result(flushResult) {\n results.push(flushResult);\n }\n });\n return Promise.all(results);\n },\n pause: function pause() {\n store.dispatch({\n type: PAUSE\n });\n },\n persist: function persist() {\n store.dispatch({\n type: PERSIST,\n register: register,\n rehydrate: rehydrate\n });\n }\n });\n\n if (!(options && options.manualPersist)) {\n persistor.persist();\n }\n\n return persistor;\n}","import { combineReducers } from \"redux\";\r\nimport { persistReducer } from \"redux-persist\";\r\nimport storage from \"redux-persist/lib/storage\";\r\nimport albumPhotoReducer from \"./slices/albumPhoto\";\r\nimport albumReducer from \"./slices/albums\";\r\nimport cartReducer from \"./slices/cart\";\r\nimport contestantReducer from \"./slices/contestants\";\r\nimport dashboardReducer from \"./slices/dashboard\";\r\nimport ecommerceReducer from \"./slices/ecommerce\";\r\nimport menuReducer from \"./slices/menu\";\r\nimport packageReducer from \"./slices/packages\";\r\nimport snackbarReducer from \"./slices/snackbar\";\r\nimport superAthletesReducer from \"./slices/superathletes\";\r\nimport tagsReducer from \"./slices/tags\";\r\n// ==============================|| COMBINE REDUCER ||============================== //\r\n\r\nconst reducer = combineReducers({\r\n snackbar: snackbarReducer,\r\n albums: albumReducer,\r\n albumPhoto: albumPhotoReducer,\r\n contestants: contestantReducer,\r\n ecommerce: ecommerceReducer,\r\n dashboard: dashboardReducer,\r\n superathletes: superAthletesReducer,\r\n menu: menuReducer,\r\n cart: persistReducer(\r\n {\r\n key: \"cart\",\r\n storage,\r\n keyPrefix: \"eventpxl-\",\r\n },\r\n cartReducer\r\n ),\r\n tags: tagsReducer,\r\n packages: packageReducer,\r\n});\r\n\r\nexport default reducer;\r\n","// third-party\r\nimport { configureStore } from \"@reduxjs/toolkit\";\r\nimport { FormattedMessage } from \"react-intl\";\r\nimport {\r\n useDispatch as useAppDispatch,\r\n useSelector as useAppSelector,\r\n} from \"react-redux\";\r\nimport { persistStore } from \"redux-persist\";\r\n// project imports\r\nimport axiosServices from \"utils/axios\";\r\nimport { getErrorCode } from \"utils/errors\";\r\nimport rootReducer from \"./reducer\";\r\nimport { openSnackbar } from \"./slices/snackbar\";\r\n\r\n// ==============================|| REDUX - MAIN STORE ||============================== //\r\nconst store = configureStore({\r\n reducer: rootReducer,\r\n devTools: false,\r\n middleware: (getDefaultMiddleware) =>\r\n getDefaultMiddleware({ serializableCheck: false, immutableCheck: false }),\r\n});\r\n\r\naxiosServices.interceptors.response.use(\r\n (response) => {\r\n // If the response is successful, return it\r\n return response;\r\n },\r\n (error) => {\r\n // if error is 401 dont show snackbar\r\n if (error.response && error.response.status === 401) {\r\n return Promise.reject(error);\r\n }\r\n const code = getErrorCode(error);\r\n console.log(code);\r\n store.dispatch(\r\n openSnackbar({\r\n open: true,\r\n message: ,\r\n variant: \"alert\",\r\n alert: {\r\n color: \"error\",\r\n variant: \"filled\",\r\n },\r\n close: false,\r\n anchorOrigin: {\r\n vertical: \"bottom\",\r\n horizontal: \"center\",\r\n },\r\n transition: \"SlideLeft\",\r\n })\r\n );\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\nconst persister = persistStore(store);\r\n\r\nconst { dispatch } = store;\r\n\r\nconst useDispatch = () => useAppDispatch();\r\nconst useSelector = useAppSelector;\r\n\r\nexport { dispatch, persister, store, useDispatch, useSelector };\r\n","import { createSlice } from \"@reduxjs/toolkit\";\nimport update from \"react-addons-update\";\nimport { FormattedMessage } from \"react-intl\";\nimport { openSnackbar } from \"store/slices/snackbar\";\nimport axios from \"utils/axios\";\nimport { openSnackbarWithError } from \"utils/errors\";\nimport { dispatch } from \"../index\";\nconst initialState = {\n photos: {\n data: [],\n error: null,\n params: null,\n isLoading: false,\n totalCount: null,\n abortController: new AbortController(),\n replayLastRequest: false,\n },\n selectedPhotoKeys: [],\n isInQuickEntryMode: false,\n photo: {\n openModal: false,\n isLoading: false,\n isUpdating: false,\n isDeleting: false,\n data: null,\n key: null,\n index: null,\n },\n photoModal: null,\n isBatchDeleting: false,\n isBatchDeletingError: false,\n isBatchDeletingOk: false,\n isBatchAssigningTag: false,\n isBatchAssigningTagSuccess: false,\n};\n\nconst slice = createSlice({\n name: \"albumPhoto\",\n initialState,\n reducers: {\n setIsInQuickEntryModeSuccess(state, action) {\n state.isInQuickEntryMode = action.payload;\n },\n\n setPaginationParams(state, action) {\n state.photos.params = action.payload;\n },\n getAlbumPhotos: (state, action) => {\n state.photos.isLoading = true;\n state.photos.replayLastRequest = false;\n },\n\n replayLastRequest: (state, action) => {\n state.replayLastRequest = true;\n state.displayAlert = false;\n },\n\n getAlbumPhotosSuccess: (state, action) => {\n state.photos.isLoading = false;\n state.photos.totalCount = action.payload.total_count;\n state.photos.data = action.payload.data;\n state.photos.error = null;\n state.photos.abortController = new AbortController();\n },\n getAlbumPhotosFailure: (state, action) => {\n state.photos.error = action.payload;\n state.photos.isLoading = false;\n },\n\n getPhoto: (state, action) => {\n state.photo.key = action.payload;\n state.photo.openModal = true;\n state.photo.isLoading = true;\n },\n\n getPhotoSuccess: (state, action) => {\n state.photo.isLoading = false;\n state.photo.data = action.payload;\n state.photo.error = null;\n },\n getPhotoFailure: (state, action) => {\n state.photo.error = action.payload;\n state.photo.isLoading = false;\n },\n\n closeModal: (state, action) => {\n state.photo.openModal = false;\n state.photo.data = null;\n state.photo.key = null;\n },\n\n // ==== update photo ====\n\n patchPhoto: (state, action) => {\n state.photo.isUpdating = true;\n },\n\n patchPhotoSuccess: (state, action) => {\n state.photo.data = update(state.photo.data, {\n $set: action.payload,\n });\n state.photo.isUpdating = false;\n },\n\n patchPhotoFailure: (state, action) => {\n state.photo.isUpdating = false;\n },\n\n // ==== add tags ====\n addTagPhoto: (state, action) => {\n state.photo.isUpdating = true;\n },\n\n addTagPhotoSuccess: (state, action) => {\n state.photo.isUpdating = false;\n const photoIndexKey = state.photos.data.findIndex(\n (photo) => photo.key === action.payload.key\n );\n state.photos.data = update(state.photos.data, {\n [photoIndexKey]: {\n tags: { $set: action.payload.tags },\n },\n });\n state.photo.data = update(state.photo.data, {\n $set: action.payload,\n });\n },\n\n addTagPhotoFailure: (state, action) => {\n state.photo.isUpdating = false;\n },\n\n deleteTagPhoto: (state, action) => {\n state.photo.isUpdating = true;\n },\n\n deleteTagPhotoSuccess: (state, action) => {\n state.photo.isUpdating = false;\n const photoIndexKey = state.photos.data.findIndex(\n (photo) => photo.key === action.payload.key\n );\n state.photos.data = update(state.photos.data, {\n [photoIndexKey]: {\n tags: { $set: action.payload.tags },\n },\n });\n state.photo.data = update(state.photo.data, {\n $set: action.payload,\n });\n },\n\n deleteTagPhotoFailure: (state, action) => {\n state.photo.isUpdating = false;\n },\n\n // ==== add Identification ====\n\n addIdentification: (state, action) => {\n state.photo.isUpdating = true;\n },\n\n addIdentificationSuccess: (state, action) => {\n const { photoKey, contestant, identification } = action.payload;\n state.photo.data = update(state.photo.data, {\n identifications: {\n $push: [identification],\n },\n });\n state.photo.isUpdating = false;\n },\n\n addIdentificationFailure: (state, action) => {\n state.photo.isUpdating = false;\n },\n\n selectIdentification(state, action) {\n const indexIdentification = state.photo.data.identifications.findIndex(\n (iden) => iden.id === action.payload.id\n );\n state.photo.data.identifications = state.photo.data.identifications.map(\n (iden) => ({\n ...iden,\n selected: (iden.selected = false),\n })\n );\n\n state.photo.data.identifications = update(\n state.photo.data.identifications,\n {\n [indexIdentification]: {\n selected: { $set: true },\n },\n }\n );\n },\n\n unSelectedIdentification(state, action) {\n const selectedIdentificationIndex =\n state.photo.data.identifications.findIndex((id) => id.selected);\n state.photo.data.identifications = update(\n state.photo.data.identifications,\n {\n [selectedIdentificationIndex]: {\n selected: { $set: false },\n },\n }\n );\n },\n\n // ==== ========= ====\n\n // ==== delete identifcation ====\n deleteIdentification(state) {\n state.photo.isUpdating = true;\n },\n\n deleteIdentificationSuccess(state, action) {\n const { identificationId, photoKey, identificationBib } = action.payload;\n const photoIndexKey = state.photos.data.findIndex(\n (photo) => photo.key === photoKey\n );\n state.photos.data = update(state.photos.data, {\n [photoIndexKey]: {\n identifications: {\n $apply: (identifications) => {\n return identifications.filter(\n (iden) => iden.id !== identificationId\n );\n },\n },\n },\n });\n const identificationIndex = state.photo.data.identifications.findIndex(\n (iden) => iden.id === identificationId\n );\n state.photo.data = update(state.photo.data, {\n identifications: { $splice: [[identificationIndex, 1]] },\n });\n state.photo.isUpdating = false;\n },\n\n deleteIdentificationFailure(state) {\n state.photo.isUpdating = false;\n },\n // ==========================\n\n // ==== deletePhoto ====\n deletePhoto: (state, action) => {\n state.photo.isDeleting = true;\n },\n\n deletePhotoSuccess: (state, action) => {\n state.photos.data = [\n ...state.photos.data.filter((photo) => photo.key !== action.payload),\n ];\n state.photos.totalCount = state.photos.totalCount - 1;\n state.photo.data = null;\n state.photo.openModal = false;\n state.photo.isDeleting = false;\n },\n\n deletePhotoFailure: (state, action) => {\n state.photo.isDeleting = false;\n },\n\n // ==== batch deleting ====\n\n closeBatchDeletingPhotos(state) {\n state.isBatchDeletingOk = false;\n },\n\n batchDeletingPhotos(state) {\n state.isBatchDeleting = true;\n state.isBatchDeletingError = false;\n state.isBatchDeletingOk = false;\n },\n\n batchDeletingPhotosSuccess(state, action) {\n state.isBatchDeleting = false;\n state.isBatchDeletingError = false;\n state.isBatchDeletingOk = true;\n state.selectedPhotoKeys = [];\n },\n batchDeletingPhotosFailure(state) {\n state.isBatchDeleting = false;\n state.isBatchDeletingError = true;\n state.isBatchDeletingOk = false;\n },\n\n // ==== batch assign tags ====\n closeAssignTagDialog(state) {\n state.isBatchAssigningTagSuccess = false;\n },\n\n batchAssignTagPhotos(state) {\n state.isBatchAssigningTag = true;\n },\n\n batchAssignTagPhotosSuccess(state, action) {\n state.isBatchAssigningTag = false;\n state.photos.data = update(state.photos.data, {\n $apply: (photos) => {\n return photos.map((photo) => {\n const photoTags = action.payload.filter(\n (pt) => pt.photo_key === photo.key\n );\n if (photoTags.length > 0) {\n photo.tags = photo.tags.concat(photoTags.map((t) => t.tag));\n }\n // If photoTag and photoTag is not already present in the photo tags\n return photo;\n });\n },\n });\n state.isBatchAssigningTagSuccess = true;\n },\n\n batchAssignTagPhotosFailure(state) {\n state.isBatchAssigningTag = false;\n state.isBatchAssigningTagSuccess = false;\n },\n\n addUploadedPhoto(state, action) {\n state.photos.data = update(state.photos.data, {\n $push: [action.payload],\n });\n },\n\n setBib(state, action) {\n state.photo.isUpdating = true;\n },\n\n setBibSuccess(state, action) {\n const { updatedIdentifications } = action.payload;\n // Find if identifications are present in the state photos and if they are present update them....\n updatedIdentifications.forEach((updatedIden) => {\n const photoIndex = state.photos.data.findIndex(\n (photo) => photo.key === updatedIden.photo_key\n );\n if (photoIndex >= 0) {\n const identificationIndex = state.photos.data[\n photoIndex\n ].identifications.findIndex((iden) => iden.id === updatedIden.id);\n state.photos.data = update(state.photos.data, {\n [photoIndex]: {\n identifications: {\n [identificationIndex]: {\n $set: updatedIden,\n },\n },\n },\n });\n }\n });\n const index = updatedIdentifications.findIndex(\n (updatedIden) => updatedIden.photo_key === state.photo.key\n );\n const indexOfIdentificationOfCurrentPhoto =\n state.photo.data.identifications.findIndex(\n (iden) => iden.id === updatedIdentifications[index].id\n );\n // Update current photo identification\n state.photo.data = update(state.photo.data, {\n identifications: {\n [indexOfIdentificationOfCurrentPhoto]: {\n $set: updatedIdentifications[index],\n },\n },\n });\n state.photo.isUpdating = false;\n },\n selectPhoto(state, action) {\n // If already selected remove other push\n if (state.selectedPhotoKeys.includes(action.payload)) {\n state.selectedPhotoKeys = state.selectedPhotoKeys.filter(\n (key) => key !== action.payload\n );\n } else {\n state.selectedPhotoKeys.push(action.payload);\n }\n },\n\n selectAllPhotos(state) {\n state.selectedPhotoKeys = state.photos.data.map((photo) => photo.key);\n },\n\n unSelectAllPhotos(state) {\n state.selectedPhotoKeys = [];\n },\n },\n});\n\nexport default slice.reducer;\n\nasync function _fetchPhotos(dispatch, albumId, params, controller) {\n try {\n dispatch(slice.actions.getAlbumPhotos());\n dispatch(slice.actions.setPaginationParams(params));\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/photos`,\n {\n params: params,\n signal: controller ? controller.signal : null,\n }\n );\n dispatch(slice.actions.getAlbumPhotosSuccess(response.data));\n return response.data;\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.getAlbumPhotosFailure(error));\n throw error;\n }\n}\n\nexport function getAlbumPhotos(\n id,\n bib,\n identificationStatus,\n awsStatus,\n tag_id,\n filename,\n orderBy,\n offset = 0,\n limit = 100\n) {\n return async (dispatch, getState) => {\n const tagId = tag_id === \"all\" ? null : tag_id;\n try {\n const controller = getState().albumPhoto.photos.abortController;\n const aws_status = String(awsStatus);\n const params = {\n bib: bib === \"\" ? null : bib,\n filename: filename === \"\" ? null : filename,\n identification_status:\n identificationStatus === \"all\" ? null : identificationStatus,\n tag_id: tagId,\n aws_status: aws_status === \"all\" ? null : awsStatus,\n order_by: orderBy,\n offset,\n limit,\n };\n await _fetchPhotos(dispatch, id, params, controller);\n } catch (error) {\n console.log(\n `Cancelled request for ${bib} with identificationStatus=${identificationStatus} & Status=${awsStatus} & TagId=${tagId} & ${offset} & ${limit}`\n );\n dispatch(slice.actions.getAlbumPhotosFailure(error));\n }\n };\n}\n\nexport function replayLastPhotosRequest() {\n return async (dispatch, getState) => {\n await _fetchPhotos(\n dispatch,\n getState().albumPhoto.photos.params,\n getState().albumPhoto.photos.abortController\n );\n };\n}\n\nexport function openPhotoModal(albumId, photoKey) {\n return async () => {\n dispatch(slice.actions.getPhoto(photoKey));\n try {\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}`\n );\n dispatch(slice.actions.getPhotoSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getPhotoFailure(error));\n }\n };\n}\n\nexport function getPrevPhotoModal(albumId) {\n return async (_, getState) => {\n const photoKey = getState().albumPhoto.photo.key;\n const oldParams = getState().albumPhoto.photos.params;\n const index = getState().albumPhoto.photos.data.findIndex(\n (photo) => photo.key === photoKey\n );\n let backPhotoKey = null;\n let data = getState().albumPhoto.photos.data;\n if (index < 0) {\n throw new Error(\"Unknown\");\n }\n if (index === 0) {\n const newParams = {\n ...oldParams,\n offset: oldParams.offset - oldParams.limit,\n };\n if (newParams.offset < 0) {\n dispatch(\n openSnackbar({\n open: true,\n message: \"Il n'y a pas de photos précédentes ...\",\n variant: \"alert\",\n alert: {\n color: \"warning\",\n },\n })\n );\n return;\n }\n dispatch(\n openSnackbar({\n open: true,\n message: \"Chargement de la nouvelle page en cours ...\",\n variant: \"alert\",\n alert: {\n color: \"info\",\n },\n })\n );\n const controller = getState().albumPhoto.photos.abortController;\n data = await _fetchPhotos(dispatch, albumId, newParams, controller);\n backPhotoKey = data.data[data.data.length - 1].key;\n } else {\n backPhotoKey = data[index - 1].key;\n }\n dispatch(slice.actions.getPhoto(backPhotoKey));\n try {\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/photos/${backPhotoKey}`\n );\n dispatch(slice.actions.getPhotoSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getPhotoFailure(error));\n }\n };\n}\n\nexport function getNextPhotoModal(albumId) {\n return async (_, getState) => {\n const photoKey = getState().albumPhoto.photo.key;\n const oldParams = getState().albumPhoto.photos.params;\n const index = getState().albumPhoto.photos.data.findIndex(\n (photo) => photo.key === photoKey\n );\n let nextPhotoKey = null;\n if (index < 0) {\n throw new Error(\"Unknown\");\n }\n if (index === getState().albumPhoto.photos.data.length - 1) {\n if (\n oldParams.offset + getState().albumPhoto.photos.data.length <\n getState().albumPhoto.photos.totalCount\n ) {\n dispatch(\n openSnackbar({\n open: true,\n message: \"Chargement de la nouvelle page en cours ...\",\n variant: \"alert\",\n alert: {\n color: \"info\",\n },\n })\n );\n const controller = getState().albumPhoto.photos.abortController;\n const newParams = {\n ...oldParams,\n offset: oldParams.offset + oldParams.limit,\n };\n const newData = await _fetchPhotos(\n dispatch,\n albumId,\n newParams,\n controller\n );\n nextPhotoKey = newData.data[0].key;\n } else {\n dispatch(\n openSnackbar({\n open: true,\n message: \"Il n'y a pas de photos suivantes ...\",\n variant: \"alert\",\n alert: {\n color: \"warning\",\n },\n })\n );\n return;\n }\n } else {\n nextPhotoKey = getState().albumPhoto.photos.data[index + 1].key;\n }\n dispatch(slice.actions.getPhoto(nextPhotoKey));\n const newPhotoResponse = await axios.get(\n `/api/v1/photograph_albums/${albumId}/photos/${nextPhotoKey}`\n );\n dispatch(slice.actions.getPhotoSuccess(newPhotoResponse.data));\n };\n}\n\nexport function addIdentification(albumId, photoKey, bib) {\n return async () => {\n dispatch(slice.actions.addIdentification());\n try {\n const response = await axios.post(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/identifications`,\n {\n bib,\n }\n );\n dispatch(\n slice.actions.addIdentificationSuccess({\n identification: response.data,\n contestant: response.data.contestant,\n photoKey: photoKey,\n })\n );\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n dispatch(slice.actions.addIdentificationFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function selectedIdentification(identification) {\n return async () => {\n dispatch(slice.actions.selectIdentification(identification));\n };\n}\n\nexport function unSelectedIdentification(identification) {\n return async () => {\n dispatch(slice.actions.unSelectedIdentification(identification));\n };\n}\n\nexport function deleteIdentification(\n albumId,\n photoKey,\n identificationId,\n identifcationBib,\n contestantBib\n) {\n return async () => {\n try {\n dispatch(slice.actions.deleteIdentification());\n await axios.delete(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/identifications/${identificationId}`\n );\n dispatch(\n slice.actions.deleteIdentificationSuccess({\n photoKey,\n identificationId,\n identifcationBib,\n })\n );\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n dispatch(slice.actions.deleteIdentificationFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function closePhotoModal() {\n return async () => {\n dispatch(slice.actions.closeModal());\n };\n}\n\nexport function deletePhoto(albumId, photoKey) {\n return async () => {\n try {\n dispatch(slice.actions.deletePhoto());\n await axios.delete(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}`\n );\n dispatch(slice.actions.deletePhotoSuccess(photoKey));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n console.error(error);\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n dispatch(slice.actions.deletePhotoFailure(error));\n }\n };\n}\n\nexport function batchDeletingPhotos(albumId, photoKeys) {\n return async () => {\n try {\n dispatch(slice.actions.batchDeletingPhotos());\n await axios.post(\n `/api/v1/photograph_albums/${albumId}/batch-delete-photos`,\n {\n photo_ids: photoKeys,\n }\n );\n dispatch(slice.actions.batchDeletingPhotosSuccess(photoKeys));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.batchDeletingPhotosFailure());\n }\n };\n}\n\nexport function closeBatchDeletingPhotos() {\n return async () => {\n dispatch(slice.actions.closeBatchDeletingPhotos());\n };\n}\n\nexport function batchAssignTagPhotos(albumId, photoKeys, tagIds) {\n return async () => {\n try {\n dispatch(slice.actions.batchAssignTagPhotos());\n const response = await axios.post(\n `/api/v1/photograph_albums/${albumId}/batch-assign-tags`,\n {\n tag_ids: tagIds,\n photo_ids: photoKeys,\n }\n );\n dispatch(slice.actions.batchAssignTagPhotosSuccess(response.data));\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.batchAssignTagPhotosFailure());\n }\n };\n}\n\nexport function addUploadedPhoto(photo) {\n return async () => {\n dispatch(slice.actions.addUploadedPhoto(photo));\n };\n}\n\nexport function closeAssignTagDialog() {\n return async () => {\n dispatch(slice.actions.closeAssignTagDialog());\n };\n}\n\nexport function patchPhoto(albumId, photoKey, patchBody) {\n return async (dispatch, getState) => {\n try {\n dispatch(slice.actions.patchPhoto());\n const response = await axios.put(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}`,\n {\n ...patchBody,\n }\n );\n dispatch(slice.actions.patchPhotoSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n dispatch(slice.actions.patchPhotoFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function addTagPhoto(albumId, photoKey, tagId) {\n return async (dispatch, getState) => {\n try {\n dispatch(slice.actions.addTagPhoto());\n const response = await axios.post(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/tags`,\n {\n tag_id: tagId,\n }\n );\n dispatch(slice.actions.addTagPhotoSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n dispatch(slice.actions.addTagPhotoFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function deleteTagPhoto(albumId, photoKey, tagId) {\n return async (dispatch, getState) => {\n try {\n dispatch(slice.actions.deleteTagPhoto());\n const response = await axios.delete(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/tags/${tagId}`\n );\n console.log(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/tags/${tagId}`\n );\n dispatch(slice.actions.deleteTagPhotoSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n dispatch(slice.actions.deleteTagPhotoFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function setBib(albumId, photoKey, identificationId, newBib) {\n return async (dispatch, getState) => {\n try {\n dispatch(slice.actions.setBib());\n const response = await axios.post(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/identifications/${identificationId}/set-bib`,\n {\n bib: newBib,\n }\n );\n const updatedIdentifications = response.data;\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n })\n );\n\n dispatch(\n slice.actions.setBibSuccess({\n updatedIdentifications,\n })\n );\n } catch (error) {\n console.log(error);\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function selectPhoto(photoKey) {\n return async (dispatch) => {\n dispatch(slice.actions.selectPhoto(photoKey));\n };\n}\n\nexport function selectAllPhotos() {\n return async (dispatch, getState) => {\n dispatch(slice.actions.selectAllPhotos());\n };\n}\n\nexport function unSelectAllPhotos() {\n return async (dispatch, getState) => {\n dispatch(slice.actions.unSelectAllPhotos());\n };\n}\n\nexport function setIsInQuickEntryMode(quickEntryMode) {\n return async (dispatch) => {\n dispatch(slice.actions.setIsInQuickEntryModeSuccess(quickEntryMode));\n if (quickEntryMode) {\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"info\",\n },\n })\n );\n }\n };\n}\n","import { createSlice } from \"@reduxjs/toolkit\";\nimport { FormattedMessage } from \"react-intl\";\nimport { openSnackbar } from \"store/slices/snackbar\";\nimport axios from \"utils/axios\";\nimport { getErrorCode, openSnackbarWithError } from \"utils/errors\";\nimport {\n fromBackToFrontAlbum,\n fromFrontToBackAlbum,\n} from \"views/albums/album-utils\";\nimport { dispatch } from \"../index\";\n\nconst initialState = {\n error: null,\n // ==== albums ====\n albums: [],\n isLoading: true,\n isPosting: false,\n postingError: null,\n // ==== album ====\n albumPosted: null,\n album: null,\n isLoadingAlbum: true,\n displayAlert: false,\n scriptStatus: {\n is_correct_identifications_running: false,\n nb_identifications_to_process: 0,\n nb_photos_to_process: 0,\n isAvailable: false,\n },\n // ==== User subscriptions ====,\n isLoadingUserSubscriptions: false,\n userSubscriptions: [],\n countMailNotSent: 0,\n isDispatchingUserSubscriptionEmail: false,\n mailHasBeenDispatched: false,\n // ==== Tags ====\n tags: [],\n isLoadingTags: false,\n // Handle Pin\n isPinning: false,\n\n // ==== Orders ====\n orders: {\n isLoading: true,\n data: [],\n },\n};\n\nconst slice = createSlice({\n name: \"album\",\n initialState,\n reducers: {\n resetAlbum(state) {\n state.album = null;\n },\n\n startLoading(state, action) {\n state.album = null;\n state.isLoading = true;\n },\n\n startPosting(state, action) {\n state.isPosting = true;\n state.photos = [];\n },\n\n // ===== ALBUMS =====\n getAlbums(state) {\n state.isLoading = true;\n },\n\n getAlbumsSuccess(state, action) {\n state.albums = action.payload.data;\n state.totalAlbumsCount = action.payload.total_count;\n state.isLoading = false;\n },\n\n getAlbumsFailure(state) {\n state.isLoading = false;\n },\n\n // ==== album ====\n\n getAlbum(state) {\n state.album = null;\n state.isLoadingAlbum = true;\n },\n\n getAlbumSuccess(state, action) {\n const hadPendingAnalysis = state.album\n ? state.album.has_pending_analysis\n : false;\n const hasPendingAnalysis = action.payload.has_pending_analysis;\n const hadPendingFaceAnalysis = state.album\n ? state.album.is_correct_identifications_running\n : false;\n const hasPendingFaceAnalysis =\n action.payload.is_correct_identifications_running;\n if (\n (hadPendingAnalysis && !hasPendingAnalysis) ||\n (hadPendingFaceAnalysis && !hasPendingFaceAnalysis)\n ) {\n state.displayAlert = true;\n } else {\n state.displayAlert = false;\n }\n state.album = fromBackToFrontAlbum(action.payload);\n state.has_pending_analysis = state.album.has_pending_analysis;\n state.isLoadingAlbum = false;\n },\n\n getAlbumFailure(state) {\n state.album = null;\n state.isLoadingAlbum = false;\n },\n\n createAlbumSuccess(state, action) {\n state.isPosting = false;\n state.albumPosted = fromBackToFrontAlbum(action.payload);\n state.postingError = null;\n },\n\n createAlbumFailure(state, action) {\n state.isPosting = false;\n state.postingError = action.payload;\n },\n\n editAlbumSuccess(state, action) {\n state.isPosting = false;\n state.album = fromBackToFrontAlbum(action.payload);\n state.postingError = null;\n },\n\n editAlbumFailure(state, action) {\n state.isPosting = false;\n state.postingError = action.payload;\n },\n\n // ====== UPLOAD IN PROGRESS ======\n syncUploadProgress(state, action) {\n state.album.has_pending_analysis = true;\n state.album.presigned_count =\n state.album.presigned_count + action.payload;\n },\n\n // ====== USER SUBSCRIPTIONS ======\n\n fetchUserSubscriptions(state) {\n state.isLoadingUserSubscriptions = true;\n },\n\n fetchUserSubscriptionsSuccess(state, action) {\n state.isLoadingUserSubscriptions = false;\n state.userSubscriptions = action.payload.data;\n state.countMailNotSent = action.payload.count_mail_not_sent;\n },\n\n fetchUserSubscriptionsCountFailure(state) {\n state.isLoadingUserSubscriptions = false;\n },\n\n dispatchUserSubscriptionEmail(state) {\n state.isDispatchingUserSubscriptionEmail = true;\n },\n\n dispatchUserSubscriptionEmailSuccess(state) {\n state.isDispatchingUserSubscriptionEmail = false;\n state.mailHasBeenDispatched = true;\n },\n\n dispatchUserSubscriptionEmailFailure(state) {\n state.isDispatchingUserSubscriptionEmail = false;\n state.mailHasBeenDispatched = false;\n },\n\n removedAlert(state) {\n state.displayAlert = false;\n },\n\n startCorrectIdentificationService(state) {\n state.album.is_correct_identifications_running = true;\n },\n\n startCorrectIdentificationServiceSuccess(state) {\n state.album.is_correct_identifications_running = true;\n },\n\n startCorrectIdentificationServiceFailure(state) {\n state.album.is_correct_identifications_running = false;\n },\n\n // ==== set pinned photo ====\n setPinnedPhoto(state, action) {\n state.album.isPinning = true;\n },\n\n setPinnedPhotoSuccess(state, action) {\n state.album.isPinning = false;\n state.album.main_photo_key = action.payload.photoKey;\n },\n\n setPinnedPhotoFailure(state, action) {\n state.album.isPinning = false;\n },\n\n // ==== orders ====\n getAlbumOrders(state) {\n state.orders.isLoading = true;\n },\n\n getAlbumOrdersSuccess(state, action) {\n state.orders.isLoading = false;\n state.orders.data = action.payload;\n },\n\n getAlbumOrdersFailure(state) {\n state.orders.isLoading = false;\n },\n\n scriptAvailableStatus(state, action) {\n console.log(\"scriptAvailableStatus\", action.payload);\n state.scriptStatus = action.payload;\n },\n },\n});\n\nexport default slice.reducer;\n\nexport function getAlbums(nameStartsWith, offset, limit = 100) {\n return async () => {\n try {\n dispatch(slice.actions.getAlbums());\n const response = await axios.get(\"/api/v1/photograph_albums\", {\n params: {\n name_starts_with: nameStartsWith,\n offset,\n limit,\n },\n });\n dispatch(slice.actions.getAlbumsSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getAlbumsFailure());\n }\n };\n}\n\nexport function getAlbum(id, withRefresh = false) {\n return async (dispatch, getState) => {\n try {\n if (!withRefresh) {\n dispatch(slice.actions.getAlbum());\n }\n const response = await axios.get(`/api/v1/photograph_albums/${id}`);\n if (\n withRefresh &&\n !response.data.is_correct_identifications_running &&\n getState().albums.album &&\n getState().albums.album.is_correct_identifications_running\n ) {\n dispatch(\n openSnackbar({\n open: true,\n message:\n \"Le script de reconnaissance vient de s'éxécuter avec succès...\",\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: true,\n })\n );\n }\n dispatch(slice.actions.getAlbumSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getAlbumFailure());\n }\n };\n}\n\nexport function getScriptStatus(albumId) {\n return async () => {\n try {\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/script`\n );\n dispatch(\n slice.actions.scriptAvailableStatus({\n ...response.data,\n isAvailable:\n !response.data.is_correct_identifications_running &&\n response.data.nb_identifications_to_process > 0,\n })\n );\n } catch (error) {\n console.log(error);\n }\n };\n}\n\nexport function createAlbum(album, navigate) {\n return async () => {\n try {\n dispatch(slice.actions.startPosting());\n const response = await axios.post(\n `/api/v1/photograph_albums`,\n fromFrontToBackAlbum(album)\n );\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n dispatch(slice.actions.createAlbumSuccess(response.data));\n navigate(`/dashboard/albums/${response.data.id}/photos`, {\n replace: true,\n });\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.createAlbumFailure(getErrorCode(error)));\n }\n };\n}\n\nexport function editAlbum(album, navigate, albumId) {\n return async () => {\n try {\n dispatch(slice.actions.startPosting());\n const response = await axios.put(\n `/api/v1/photograph_albums/${albumId}`,\n fromFrontToBackAlbum(album)\n );\n dispatch(slice.actions.editAlbumSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n navigate(`/dashboard/albums/${response.data.id}`);\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.editAlbumFailure(getErrorCode(error)));\n }\n };\n}\n\nexport function deleteAlbum(album, navigate) {\n return async () => {\n try {\n await axios.delete(`/api/v1/photograph_albums/${album.id}`);\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n navigate(\"/dashboard/albums\");\n } catch (error) {\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n console.error(error);\n }\n };\n}\n\nexport function syncUploadProgress(nbPhotos) {\n return async () => {\n dispatch(slice.actions.syncUploadProgress(nbPhotos));\n };\n}\n\nexport function fetchUserSubscriptionsCount(albumId) {\n return async () => {\n try {\n dispatch(slice.actions.fetchUserSubscriptions());\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/user_subscriptions`\n );\n dispatch(slice.actions.fetchUserSubscriptionsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.fetchUserSubscriptionsCountFailure(error));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n console.error(error);\n }\n };\n}\n\nexport function fetchUserSubscriptions(albumId) {\n return async () => {\n try {\n dispatch(slice.actions.fetchUserSubscriptions());\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/user_subscriptions`\n );\n dispatch(slice.actions.fetchUserSubscriptionsSuccess(response.data));\n } catch (error) {\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n console.error(error);\n }\n };\n}\n\nexport function dispatchUserSubscriptionEmails(albumId) {\n return async () => {\n try {\n dispatch(slice.actions.dispatchUserSubscriptionEmail());\n await axios.post(\n `/api/v1/photograph_albums/${albumId}/user_subscriptions/launch-mail`\n );\n dispatch(slice.actions.dispatchUserSubscriptionEmailSuccess());\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n setTimeout(() => {\n dispatch(fetchUserSubscriptionsCount(albumId));\n }, 8000);\n } catch (error) {\n dispatch(slice.actions.dispatchUserSubscriptionEmailFailure());\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n console.error(error);\n }\n };\n}\n\nexport function removedAlert(albumId) {\n return async () => {\n dispatch(slice.actions.removedAlert());\n };\n}\n\nexport function startCorrectIdentificationService(albumId) {\n return async () => {\n dispatch(slice.actions.startCorrectIdentificationService());\n try {\n await axios.post(\n `/api/v1/photograph_albums/${albumId}/start-correct-identification-service`\n );\n dispatch(slice.actions.startCorrectIdentificationServiceSuccess());\n } catch (error) {\n console.error(error);\n openSnackbarWithError(error, dispatch);\n dispatch(slice.actions.startCorrectIdentificationServiceFailure());\n }\n };\n}\n\nexport function setPinnedPhoto(albumId, photoKey) {\n return async (dispatch) => {\n try {\n dispatch(slice.actions.setPinnedPhoto(photoKey));\n await axios.post(\n `/api/v1/photograph_albums/${albumId}/photos/${photoKey}/pin`\n );\n dispatch(\n slice.actions.setPinnedPhotoSuccess({\n photoKey: photoKey,\n })\n );\n dispatch(\n openSnackbar({\n open: true,\n message: \"Nouvelle photo épinglée !\",\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n dispatch(slice.actions.setPinnedPhotoFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function getAlbumOrders(albumid) {\n return async (dispatch) => {\n try {\n dispatch(slice.actions.getAlbumOrders());\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumid}/orders`\n );\n dispatch(slice.actions.getAlbumOrdersSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getAlbumOrdersFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n","import { createSelector, createSlice } from \"@reduxjs/toolkit\";\nimport { sum } from \"lodash\";\nimport update from \"react-addons-update\";\nimport { FormattedMessage } from \"react-intl\";\nimport { openSnackbar } from \"store/slices/snackbar\";\nimport { dispatch } from \"../index\";\nimport { setConflictCartAlbum, startLoadingAlbum } from \"./ecommerce\";\n\nconst initialState = {\n products: [],\n total: 0,\n albumId: null,\n address: null,\n email: null,\n};\n\nconst slice = createSlice({\n name: \"cart\",\n initialState,\n reducers: {\n hasError(state, action) {\n state.error = action.payload;\n },\n\n addProductSuccess(state, action) {\n const obj = {\n type: action.payload.type,\n key: action.payload.key,\n package_id: null,\n package: null,\n photo: {\n key: action.payload.key,\n name: action.payload.name,\n },\n quantity: 1,\n contestant: action.payload.contestant,\n selfieImg: action.payload.selfieImg,\n pack_selfie_id: action.payload.packSelfieId,\n detailedData: action.payload.detailedData,\n };\n const index = state.products.findIndex((p) => p.key === obj.key);\n if (index === -1) {\n state.products = update(state.products, {\n $push: [obj],\n });\n } else {\n throw new Error(\"Product already in cart\");\n }\n },\n\n updateProductFormat(state, action) {\n const { productKey, selectedPackage } = action.payload;\n const index = state.products.findIndex((p) => p.key === productKey);\n if (index !== -1 && selectedPackage) {\n state.products = update(state.products, {\n [index]: {\n package_id: { $set: selectedPackage.id },\n package: { $set: selectedPackage },\n unit_price: { $set: selectedPackage.unit_price },\n quantity: {\n $apply: (x) => {\n if (selectedPackage.is_download) {\n return 1;\n }\n return x;\n },\n },\n },\n });\n }\n },\n\n updateProductQuantity(state, action) {\n const { productKey, newQuantity } = action.payload;\n const index = state.products.findIndex((p) => p.key === productKey);\n if (index !== -1) {\n state.products = update(state.products, {\n [index]: {\n quantity: { $set: newQuantity },\n },\n });\n }\n },\n\n removeProductSuccess(state, action) {\n state.products = state.products.filter(\n (p) => p.key !== action.payload.key\n );\n },\n\n clearCart(state) {\n state.products = [];\n state.albumId = null;\n },\n\n clearAddressAndEmail(state) {\n state.address = initialState.address;\n state.email = initialState.email;\n },\n\n selectAlbumId(state, action) {\n state.albumId = action.payload;\n },\n\n // SET STEP\n setStepSuccess(state, action) {\n state.step = action.payload;\n },\n\n // SET NEXT STEP\n setNextStepSuccess(state) {\n state.step += 1;\n },\n\n // SET BACK STEP\n setBackStepSuccess(state) {\n state.step -= 1;\n },\n\n setAddress(state, action) {\n state.address = action.payload;\n },\n\n setEmail(state, action) {\n state.email = action.payload;\n },\n\n unValidateFormat(state, action) {\n const productKey = action.payload;\n const index = state.products.findIndex((p) => p.key === productKey);\n state.products = update(state.products, {\n [index]: {\n package_id: { $set: null },\n package: { $set: null },\n quantity: { $set: 1 },\n unit_price: { $set: 0 },\n },\n });\n state.total = 0;\n state.formats = [];\n },\n },\n});\n\n// Reducer\nexport default slice.reducer;\n\nexport const hasProducts = createSelector(\n (state) => state.cart.products,\n (products) => {\n return products && products.length > 0;\n }\n);\n\nexport const isProductInCart = createSelector(\n [(state) => state.cart.products, (state, photoKey) => photoKey],\n // Output selector gets (`items, category)` as args\n (products, photoKey) => products.find((product) => product.key === photoKey)\n);\n\nexport const packAthletesSelector = createSelector(\n (state) => state.cart.products,\n (products) => {\n return products.filter((p) => p.type === \"athlete\");\n }\n);\n\nexport const packSelfiesSelector = createSelector(\n (state) => state.cart.products,\n (products) => {\n return products.filter((p) => p.type === \"selfie\");\n }\n);\n\nexport const totalQuantitySelector = createSelector(\n (state) => state.cart.products,\n (products) => {\n return sum(products.map((p) => p.quantity));\n }\n);\n\nexport function addProduct(product) {\n return async (dispatch, getState) => {\n try {\n window.gtag(\"event\", \"add_to_cart\", {\n currency: \"EUR\",\n item: product,\n });\n const albumId = getState().cart.albumId || product.photograph_album_id;\n if (product.photograph_album_id !== albumId) {\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n dispatch(setConflictCartAlbum(true, product));\n } else {\n dispatch(slice.actions.selectAlbumId(product.photograph_album_id));\n dispatch(slice.actions.addProductSuccess({ ...product }));\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n }\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function addPackAthleteProduct(contestant, albumId) {\n return async (dispatch, getState) => {\n try {\n const product = {\n key: `athlete${contestant.bib}`,\n type: \"athlete\",\n name: \"Pack participant\",\n quantity: 1,\n contestant: contestant,\n photograph_album_id: albumId,\n };\n const albumCartId = getState().cart.albumId;\n if (albumCartId !== albumId) {\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n dispatch(setConflictCartAlbum(true, product));\n } else {\n dispatch(slice.actions.addProductSuccess(product));\n dispatch(slice.actions.selectAlbumId(albumId));\n }\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function removePackAthleteProduct(contestant) {\n return async (dispatch, _) => {\n try {\n dispatch(\n slice.actions.removeProductSuccess({\n key: `athlete${contestant.bib}`,\n })\n );\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function addPackSelfieProduct(packSelfieId, albumId, selfieImg, data) {\n console.log(\"addPackSelfieProduct\", {\n packSelfieId,\n albumId,\n selfieImg,\n });\n return async (dispatch, getState) => {\n try {\n const product = {\n key: `selfie${packSelfieId}`,\n type: \"selfie\",\n name: `Pack Selfie #${packSelfieId}`,\n quantity: 1,\n photograph_album_id: albumId,\n package_id: packSelfieId,\n packSelfieId,\n detailedData: {\n ...data,\n packSelfieId: packSelfieId,\n },\n selfieImg: selfieImg,\n };\n const albumCartId = getState().cart.albumId;\n console.log(`albumCartId: ${albumCartId}, albumId: ${albumId}`);\n if (albumCartId !== albumId) {\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n dispatch(setConflictCartAlbum(true, product));\n } else {\n dispatch(slice.actions.addProductSuccess(product));\n dispatch(slice.actions.selectAlbumId(albumId));\n }\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function removePackSelfieProduct(packSelfieId) {\n return async (dispatch, _) => {\n try {\n dispatch(\n slice.actions.removeProductSuccess({\n key: `selfie${packSelfieId}`,\n })\n );\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function updateProductFormat(productKey, package_id) {\n return async (_, getState) => {\n try {\n const checkoutAlbum = getState().ecommerce.checkoutAlbum;\n const selectedPackage = checkoutAlbum.album_packages.find(\n (p) => p.id === package_id\n );\n if (!selectedPackage) {\n dispatch(\n openSnackbar({\n open: true,\n message:\n \"Impossible de choisir ce format, veuillez réessayer après avoir raffraichit la page\",\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n } else {\n dispatch(\n slice.actions.updateProductFormat({\n productKey,\n selectedPackage,\n })\n );\n }\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function updateProductQuantity(productKey, newQuantity) {\n return async () => {\n try {\n dispatch(\n slice.actions.updateProductQuantity({\n productKey,\n newQuantity,\n })\n );\n } catch (error) {\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function removeProduct(key, format) {\n return async () => {\n try {\n window.gtag(\"event\", \"remove_from_cart\", {\n currency: \"EUR\",\n key,\n });\n dispatch(\n slice.actions.removeProductSuccess({\n key,\n })\n );\n } catch (error) {\n dispatch(slice.actions.hasError(error));\n }\n };\n}\n\nexport function clearCart() {\n return async () => {\n dispatch(slice.actions.clearCart());\n };\n}\n\nexport function endOrder() {\n return () => {\n dispatch(slice.actions.clearCart());\n dispatch(slice.actions.clearAddressAndEmail());\n };\n}\n\nexport function addAddressAndEmail(values) {\n return () => {\n dispatch(slice.actions.setAddress(values));\n dispatch(slice.actions.setEmail(values.email1));\n };\n}\n\nexport function navigateToCartAlbum(navigate) {\n return async (dispatch, getState) => {\n dispatch(startLoadingAlbum());\n navigate(`/albums/${getState().cart.albumId}`, { replace: true });\n };\n}\n\nexport function verifyPackageProducts() {\n return async (dispatch, getState) => {\n const checkoutAlbum = getState().ecommerce.checkoutAlbum;\n const packageIds = checkoutAlbum.album_packages.map((f) => f.id);\n const photos = getState().cart.products;\n photos.forEach((p) => {\n if (!packageIds.includes(p.package_id)) {\n dispatch(slice.actions.unValidateFormat(p.key));\n }\n });\n };\n}\n","import { createSlice, current } from \"@reduxjs/toolkit\";\nimport update from \"react-addons-update\";\nimport { FormattedMessage } from \"react-intl\";\nimport { openSnackbar } from \"store/slices/snackbar\";\nimport axios from \"utils/axios\";\nimport { getErrorCode } from \"utils/errors\";\nimport { dispatch } from \"../index\";\n\nconst initialState = {\n isContestantsLoading: true,\n isErrorContestants: false,\n contestants: null,\n isPatchingContestant: false,\n isPostingContestant: false,\n isDeletingContestant: false,\n isUpsertingContestants: false,\n isDeletingAllContestants: false,\n isDeletingAllContestantsFailure: false,\n isDeletingAllContestantsSucceeded: false,\n isErasingContestant: false,\n insertedContestants: [],\n updatedContestants: [],\n notUpsertedContestants: [],\n page: 0,\n limit: 100,\n // ==== modalContestant ====\n contestant: {\n id: null,\n openModal: false,\n isLoading: false,\n data: null,\n error: null,\n },\n};\n\nconst slice = createSlice({\n name: \"contacts\",\n initialState,\n reducers: {\n getContestants(state, page) {\n state.isContestantsLoading = true;\n state.isErrorContestants = false;\n state.page = page;\n state.contestants = null;\n },\n setPaginationParams(state, action) {\n state.params = action.payload;\n },\n getContestantsSuccess(state, action) {\n state.isContestantsLoading = false;\n state.isErrorContestants = false;\n state.contestants = action.payload.data;\n state.totalContestantsCount = action.payload.total_count;\n state.page = action.payload.request.offset;\n state.limit = action.payload.request.limit;\n },\n getContestantsError(state, action) {\n state.isContestantsLoading = false;\n state.isErrorContestants = true;\n state.contestants = null;\n },\n patchContestant(state) {\n state.isPatchingContestant = true;\n },\n patchContestantSuccess(state, action) {\n state.isPatchingContestant = false;\n const index = state.contestants.findIndex(\n (c) => c.id === action.payload.id\n );\n\n state.contestants = update(state.contestants, {\n [index]: {\n $set: action.payload,\n },\n });\n state.contestant = action.payload;\n },\n patchContestantFailure(state, action) {\n state.isPatchingContestant = false;\n },\n // ==== POST ====\n postContestant(state) {\n state.isPostingContestant = true;\n },\n postContestantSuccess(state, action) {\n state.isPostingContestant = false;\n state.contestants.data.push(action.payload);\n // state.rowConstestants.data.push(action.payload)\n },\n postContestantFailure(state) {\n state.isPostingContestant = false;\n },\n // ==== DELETE ====\n deleteContestant(state) {\n state.isDeletingContestant = true;\n },\n deleteContestantSuccess(state, action) {\n state.isDeletingContestant = false;\n // state.rowConstestants.data = state.rowConstestants.data.filter(c => c.id !== action.payload)\n // state.rowConstestants.total_count = state.rowConstestants.total_count - 1;\n // TODO\n },\n deleteContestantFailure(state) {\n state.isDeletingContestant = false;\n },\n\n // ==== ERASE ====\n eraseContestant(state) {\n state.isErasingContestant = true;\n },\n eraseContestantSuccess(state, action) {\n state.isErasingContestant = false;\n state.contestants = state.contestants.filter(\n (c) => c.id !== action.payload\n );\n state.contestants.total_count = state.contestants.total_count - 1;\n state.contestant.id = null;\n state.contestant.openModal = false;\n state.contestant.isLoading = false;\n state.contestant.data = null;\n },\n eraseContestantFailure(state) {\n state.isErasingContestant = false;\n },\n\n // ==== UPSERT ====\n upsertContestants(state) {\n state.isUpsertingContestants = true;\n state.insertedContestants = [];\n state.updatedContestants = [];\n state.notUpsertedContestants = [];\n },\n upsertContestantsSuccess(state) {\n state.isUpsertingContestants = false;\n },\n upsertContestantsFailure(state) {\n state.isUpsertingContestants = false;\n },\n upsertContestantFailure(state, action) {\n state.notUpsertedContestants.push(action.payload.contestant);\n },\n upsertContestantSuccess(state, action) {\n const { contestant, response } = action.payload;\n if (response.status === 201) {\n state.insertedContestants.push(response.data);\n } else {\n state.updatedContestants.push(contestant);\n }\n if (state.contestants) {\n const index = current(state).contestants.findIndex(\n (c) => c.id === contestant.id\n );\n if (index !== -1) {\n const previousIds = current(state).contestants[index].identifications;\n state.contestants = update(state.contestants, {\n [index]: {\n $set: {\n ...response.data,\n identifications: previousIds,\n },\n },\n });\n }\n }\n },\n // ==== DELETE ALL CONTESANTS ====\n deleteAllContestants(state) {\n state.isDeletingAllContestants = true;\n state.isDeletingAllContestantsSucceeded = false;\n state.isDeletingAllContestantsFailure = false;\n },\n deleteAllContestantsSuccess(state, action) {\n state.isDeletingAllContestants = false;\n state.isDeletingAllContestantsSucceeded = true;\n state.isDeletingAllContestantsFailure = false;\n },\n deleteAllContestantsFailure(state) {\n state.isDeletingAllContestants = false;\n state.isDeletingAllContestantsFailure = true;\n state.isDeletingAllContestantsSucceeded = false;\n },\n // =================================================\n getContestant(state, action) {\n state.contestant.id = action.payload;\n state.contestant.openModal = true;\n state.contestant.isLoading = true;\n },\n getContestantSuccess(state, action) {\n state.contestant.isLoading = false;\n state.contestant.data = action.payload;\n state.contestant.error = null;\n },\n getContestantFailure(state, action) {\n state.contestant.error = action.payload;\n state.contestant.isLoading = false;\n },\n closeAthleteModal(state) {\n state.contestant.id = null;\n state.contestant.openModal = false;\n state.contestant.isLoading = false;\n state.contestant.data = null;\n state.contestant.error = null;\n },\n },\n});\n\n// Reducer\nexport default slice.reducer;\n\n// ----------------------------------------------------------------------\n\nexport function getContestants(\n albumId,\n offset = 0,\n limit = 100,\n bibOrLastNameSearch = null\n) {\n return async () => {\n try {\n dispatch(slice.actions.getContestants());\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/contestants`,\n {\n params: {\n bib_or_last_name: bibOrLastNameSearch,\n offset,\n limit,\n },\n }\n );\n dispatch(slice.actions.getContestantsSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getContestantsError(error));\n }\n };\n}\n\nexport function patchContestant(albumId, contestantId, contestant) {\n return async () => {\n try {\n dispatch(slice.actions.patchContestant());\n let response = await axios.patch(\n `/api/v1/photograph_albums/${albumId}/contestants/${contestantId}`,\n { ...contestant }\n );\n dispatch(slice.actions.patchContestantSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.patchContestantFailure(error));\n }\n };\n}\n\nexport function postContestant(albumId, contestant) {\n return async () => {\n try {\n dispatch(slice.actions.postContestant());\n const response = await axios.post(\n `/api/v1/photograph_albums/${albumId}/contestants`,\n { ...contestant }\n );\n dispatch(slice.actions.postContestantSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n const errorCode = getErrorCode(error);\n console.error(error);\n dispatch(slice.actions.postContestantFailure(error));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n }\n };\n}\n\nexport function upsertContestants(albumId, constestants) {\n return async (dispatch) => {\n // Ensure dispatch is passed as an argument\n try {\n dispatch(slice.actions.upsertContestants());\n const promises = constestants.map(\n (\n c,\n index // Add index argument to map function\n ) =>\n new Promise((resolve, reject) => {\n setTimeout(() => {\n // Add setTimeout to introduce delay\n axios\n .post(\n `/api/v1/photograph_albums/${albumId}/contestants/upsert`,\n {\n ...c,\n }\n )\n .then((response) => {\n console.log(response);\n dispatch(\n slice.actions.upsertContestantSuccess({\n contestant: c,\n response,\n })\n );\n resolve(); // Resolve promise after dispatching\n })\n .catch((response) => {\n console.log(response);\n dispatch(\n slice.actions.upsertContestantFailure({\n contestant: c,\n error: response,\n })\n );\n reject(); // Reject promise after dispatching\n });\n }, index * 400); // Multiply index by delay time (400ms)\n })\n );\n await Promise.all(promises);\n dispatch(slice.actions.upsertContestantsSuccess());\n } catch (e) {\n console.log(e);\n }\n };\n}\n\nexport function deleteContestant(albumId, contestantId) {\n return async () => {\n try {\n dispatch(slice.actions.deleteContestant());\n await axios.delete(\n `/api/v1/photograph_albums/${albumId}/contestants/${contestantId}`\n );\n dispatch(slice.actions.deleteContestantSuccess(contestantId));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n const errorCode = getErrorCode(error);\n console.error(error);\n dispatch(slice.actions.deleteContestantFailure(error));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n }\n };\n}\n// Erase delete identification + contestant when delete, delete only the contestant\nexport function eraseContestant(albumId, contestantId) {\n return async () => {\n try {\n dispatch(slice.actions.eraseContestant());\n await axios.delete(\n `/api/v1/photograph_albums/${albumId}/contestants/${contestantId}/erase`\n );\n dispatch(slice.actions.eraseContestantSuccess(contestantId));\n dispatch(\n openSnackbar({\n open: true,\n message: \"Le participant et ses identifications ont été supprimés\",\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.eraseContestantFailure());\n }\n };\n}\n\nexport function deleteContestants(albumId) {\n return async () => {\n try {\n dispatch(slice.actions.deleteAllContestants());\n await axios.delete(\n `/api/v1/photograph_albums/${albumId}/contestants/delete-or-clear`\n );\n dispatch(slice.actions.deleteAllContestantsSuccess());\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n const errorCode = getErrorCode(error);\n console.error(error);\n dispatch(slice.actions.deleteAllContestantsFailure(error));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n }\n };\n}\n\nexport function openAthleteModal(albumId, contestantId) {\n return async () => {\n dispatch(slice.actions.getContestant(contestantId));\n try {\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/contestants/${contestantId}`\n );\n dispatch(slice.actions.getContestantSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getContestantFailure(error));\n }\n };\n}\n\nexport function closeAthleteModal() {\n return async () => {\n dispatch(slice.actions.closeAthleteModal());\n };\n}\n\nexport function getPrevAthleteModal(albumId) {\n return async (_, getState) => {\n const contestantId = getState().contestants.contestant.id;\n const oldParams = getState().contestants.params;\n const index = getState().contestants.contestants.findIndex(\n (contestant) => contestant.id === contestantId\n );\n let backContestantId = null;\n let data = getState().contestants.contestants;\n if (index < 0) {\n throw new Error(\"Unknown\");\n }\n if (index === 0) {\n const newParams = {\n ...oldParams,\n offset: oldParams.offset - oldParams.limit,\n };\n //TODO\n if (newParams.offset < 0) {\n dispatch(\n openSnackbar({\n open: true,\n message: \"Il n'y a pas de photos précédentes ...\",\n variant: \"alert\",\n alert: {\n color: \"warning\",\n },\n })\n );\n return;\n }\n dispatch(\n openSnackbar({\n open: true,\n message: \"Chargement de la nouvelle page en cours ...\",\n variant: \"alert\",\n alert: {\n color: \"info\",\n },\n })\n );\n const controller = getState().contestants.abortController;\n data = await _fetchContestants(dispatch, albumId, newParams, controller);\n backContestantId = data.data[data.data.length - 1].id;\n } else {\n backContestantId = data[index - 1].id;\n }\n dispatch(slice.actions.getContestant(backContestantId));\n try {\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/contestants/${backContestantId}`\n );\n dispatch(slice.actions.getContestantSuccess(response.data));\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.getContestantFailure(error));\n }\n };\n}\n\nexport function getNextAthleteModal(albumId) {\n return async (_, getState) => {\n const contestantId = getState().contestants.contestant.id;\n const oldParams = getState().contestants.params;\n const index = getState().contestants.contestants.findIndex(\n (contestant) => contestant.id === contestantId\n );\n let nextContestantId = null;\n let data = getState().contestants.contestants;\n if (index < 0) {\n throw new Error(\"Unknown\");\n }\n if (index === data.length - 1) {\n const newParams = {\n ...oldParams,\n offset: oldParams.offset + oldParams.limit,\n };\n dispatch(\n openSnackbar({\n open: true,\n message: \"Chargement de la nouvelle page en cours ...\",\n variant: \"alert\",\n alert: {\n color: \"info\",\n },\n })\n );\n const controller = getState().contestants.abortController;\n data = await _fetchContestants(dispatch, albumId, newParams, controller);\n nextContestantId = data.data[0].id;\n } else {\n nextContestantId = data[index + 1].id;\n }\n dispatch(slice.actions.getContestant(nextContestantId));\n try {\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/contestants/${nextContestantId}`\n );\n dispatch(slice.actions.getContestantSuccess(response.data));\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.getContestantFailure(error));\n }\n };\n}\n\n// ======= private functions =======\n\nasync function _fetchContestants(dispatch, albumId, params, controller) {\n try {\n dispatch(slice.actions.getContestants());\n dispatch(slice.actions.setPaginationParams(params));\n console.log(\n `request contestants : bib=${params.bib} identificationStatus=${params.identification_status} & aws_status=${params.aws_status} & tag_id=${params.tag_id} [offset=${params.offset} & limit=${params.limit}]`\n );\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/contestants`,\n {\n params: params,\n signal: controller ? controller.signal : null,\n }\n );\n dispatch(slice.actions.getContestantsSuccess(response.data));\n return response.data;\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.getContestantsError(error));\n throw error;\n }\n}\n","import { createSlice, current } from \"@reduxjs/toolkit\";\nimport update from \"react-addons-update\";\nimport { FormattedMessage } from \"react-intl\";\nimport { openSnackbar } from \"store/slices/snackbar\";\nimport axios from \"utils/axios\";\nimport { getErrorCode, openSnackbarWithError } from \"utils/errors\";\nimport { dispatch } from \"../index\";\n\nconst initialState = {\n error: null,\n isLoadingStats: true,\n notifications: {\n data: [],\n isLoading: false,\n },\n detailedStats: {\n isLoading: true,\n data: null,\n hasError: false,\n },\n photograph: {\n isLoading: true,\n data: null,\n hasError: false,\n },\n hasStatsError: false,\n publicProfile: {\n data: null,\n error: null,\n isLoading: true,\n isPosting: false,\n },\n orders: {\n data: [],\n error: null,\n isLoading: false,\n },\n order: {\n data: null,\n error: null,\n isLoading: true,\n isPostingShipment: false,\n },\n purchases: {\n isLoading: false,\n error: null,\n data: [],\n },\n};\n\nconst slice = createSlice({\n name: \"dashboard\",\n initialState,\n reducers: {\n getNotifcations(state, action) {\n state.notifications.isLoading = true;\n },\n\n getNotifcationsSuccess(state, action) {\n state.notifications.data = action.payload;\n state.notifications.isLoading = false;\n },\n\n getNotifcationsFailure(state, action) {\n state.notifications.data = [];\n state.notifications.isLoading = false;\n state.notifications.error = action.payload;\n },\n\n readAllNotifications(state, action) {\n state.notifications.isReadingAllPosting = true;\n },\n\n readAllNotificationsSuccess(state, action) {\n state.notifications.isReadingAllPosting = false;\n state.notifications.data = state.notifications.data.map((notif) => ({\n ...notif,\n read: true,\n }));\n },\n\n getPublicProfile(state, action) {\n state.publicProfile.isLoading = true;\n },\n\n getPublicProfileSuccess(state, action) {\n state.publicProfile.data = action.payload;\n state.publicProfile.isLoading = false;\n state.publicProfile.error = null;\n },\n\n getPublicProfileFailure(state, action) {\n state.publicProfile.data = null;\n state.publicProfile.isLoading = false;\n state.publicProfile.error = action.payload;\n },\n\n putPublicProfile(state, action) {\n state.publicProfile.isPosting = true;\n },\n\n putPublicProfileSuccess(state, action) {\n state.publicProfile = update(state.publicProfile, {\n data: { $set: action.payload },\n });\n state.publicProfile.isPosting = false;\n },\n\n putPublicProfileFailure(state, action) {\n state.publicProfile.isPosting = false;\n state.publicProfile.error = action.payload;\n },\n\n fetchDetailedStats(state, action) {\n state.isLoadingStats = true;\n },\n\n fetchDetailedStatsSuccess(state, action) {\n state.detailedStats.data = action.payload;\n // state.detailedStats.data.moneyEarnByMonths = Object.fromEntries(\n // Object.entries( state.detailedStats.data.moneyEarnByMonths)\n // .map(([key, value]) => [key, value / 100])\n // );\n state.detailedStats.isLoading = false;\n state.detailedStats.hasError = false;\n },\n\n fetchDetailedStatsFailure(state, action) {\n state.detailedStats.data = null;\n state.detailedStats.isLoading = false;\n state.detailedStats.hasError = true;\n },\n\n fetchPhotograph(state, action) {\n state.photograph.isLoading = true;\n },\n fetchPhotographSuccess(state, action) {\n state.photograph.data = action.payload;\n state.photograph.isLoading = false;\n state.photograph.hasError = false;\n },\n fetchPhotographFailure(state, action) {\n state.photograph.data = null;\n state.photograph.isLoading = false;\n state.photograph.hasError = true;\n },\n\n decrementSuperAthleteCount(state) {\n state.photograph.data.super_athletes_count =\n state.photograph.data.super_athletes_count - 1;\n },\n\n getOrders(state, action) {\n state.orders.isLoading = true;\n },\n getOrdersSuccess(state, action) {\n state.orders.data = action.payload;\n state.orders.isLoading = false;\n },\n getOrdersFailure(state, action) {\n state.orders.data = [];\n state.orders.isLoading = false;\n state.orders.error = action.payload;\n },\n getOrder(state, action) {\n state.order.isLoading = true;\n },\n getOrderSuccess(state, action) {\n state.order.data = action.payload;\n state.order.isLoading = false;\n },\n getOrderFailure(state, action) {\n state.order.data = null;\n state.order.isLoading = false;\n state.order.error = action.payload;\n },\n postShipment(state, action) {\n state.order.isPostingShipment = true;\n },\n postShipmentSuccess(state, action) {\n state.order.isPostingShipment = false;\n state.order.data = action.payload;\n },\n postShipmentFailure(state, action) {\n state.order.isPostingShipment = false;\n state.order.errorPostingShipment = action.payload;\n },\n addPhotographNbImportedPhotos(state, action) {\n const addedPhotos = action.payload;\n state.photograph.data.nb_imported_photos =\n current(state).photograph.data.nb_imported_photos + addedPhotos;\n },\n addTotalLimit(state, action) {\n const addedLimit = action.payload;\n state.photograph.data.total_limit =\n current(state).photograph.data.total_limit + addedLimit;\n },\n fetchPurchase(state) {\n state.purchases.isLoading = true;\n state.purchases.error = null;\n },\n\n fetchPurchaseOk(state, action) {\n state.purchases.isLoading = false;\n state.purchases.data = action.payload;\n state.purchases.error = null;\n },\n fetchPurchaseError(state, action) {\n state.purchases.isLoading = false;\n state.purchases.data = [];\n state.purchases.error = action.payload;\n },\n },\n});\n\n// Reducer\nexport default slice.reducer;\n\n// ----------------------------------------------------------------------\n\nexport function fetchDetailedStats() {\n return async () => {\n try {\n dispatch(slice.actions.fetchDetailedStats());\n const response = await axios.get(\"/api/v1/detailed-stats\");\n dispatch(slice.actions.fetchDetailedStatsSuccess(response.data));\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.fetchDetailedStatsFailure());\n }\n };\n}\n\nexport function fetchPhotograph() {\n return async () => {\n try {\n dispatch(slice.actions.fetchPhotograph());\n const response = await axios.get(\"/api/v1/me\");\n dispatch(slice.actions.fetchPhotographSuccess(response.data));\n } catch (error) {\n console.log(\"error in fetchPhotograph\");\n console.log(error);\n dispatch(slice.actions.fetchPhotographFailure());\n }\n };\n}\n\nexport function getPublicProfile() {\n return async () => {\n try {\n dispatch(slice.actions.getPublicProfile());\n const response = await axios.get(\"/api/v1/public-profile\");\n console.log(response);\n dispatch(slice.actions.getPublicProfileSuccess(response.data));\n } catch (error) {\n console.log(error);\n openSnackbarWithError(error, dispatch);\n dispatch(slice.actions.getPublicProfileFailure());\n }\n };\n}\n\nexport function putPublicProfile(data) {\n return async () => {\n try {\n dispatch(slice.actions.putPublicProfile());\n const response = await axios.put(\"/api/v1/public-profile\", data);\n dispatch(slice.actions.putPublicProfileSuccess(response.data));\n dispatch(\n openSnackbar({\n open: true,\n message: \"Profil mis à jour avec succès\",\n variant: \"default\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n openSnackbarWithError(error, dispatch);\n dispatch(slice.actions.putPublicProfileFailure(error));\n }\n };\n}\n\nexport function getOrders() {\n return async () => {\n try {\n dispatch(slice.actions.getOrders());\n const response = await axios.get(\"/api/v1/orders\");\n dispatch(slice.actions.getOrdersSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getOrdersFailure(error));\n }\n };\n}\n\nexport function getOrder(id) {\n return async () => {\n try {\n dispatch(slice.actions.getOrder());\n const response = await axios.get(`/api/v1/orders/${id}`);\n dispatch(slice.actions.getOrderSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getOrderFailure(error));\n }\n };\n}\n\nexport function postShipment(orderId, shipmentTrackingNumber) {\n return async () => {\n try {\n dispatch(slice.actions.postShipment());\n const response = await axios.post(`/api/v1/orders/${orderId}/shipped`, {\n shipment_tracking_number: shipmentTrackingNumber,\n });\n dispatch(slice.actions.postShipmentSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.postShipmentFailure(error.message));\n }\n };\n}\n\nexport function addPhotographNbImportedPhotos(nbPhotosAdded) {\n return async () => {\n dispatch(slice.actions.addPhotographNbImportedPhotos(nbPhotosAdded));\n };\n}\n\nexport function decrementSuperAthleteCount(nbAthletes) {\n return async () => {\n dispatch(slice.actions.decrementSuperAthleteCount(nbAthletes));\n };\n}\n\nexport function purchase(credits) {\n return async () => {\n try {\n await axios.post(`/api/v1/purchase`, {\n credits,\n });\n dispatch(slice.actions.addTotalLimit(credits));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"default\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n } catch (error) {\n const errorCode = getErrorCode(error);\n dispatch(\n openSnackbar({\n open: true,\n message: errorCode,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n }\n };\n}\n\nexport function getPurchasesHistory() {\n return async () => {\n try {\n dispatch(slice.actions.fetchPurchase());\n const response = await axios.get(`/api/v1/purchases`);\n dispatch(slice.actions.fetchPurchaseOk(response.data));\n } catch (error) {\n dispatch(slice.actions.fetchPurchaseError(error));\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n }\n };\n}\n\nexport function getNotifications() {\n return async () => {\n try {\n dispatch(slice.actions.getNotifcations());\n const response = await axios.get(\"/api/v1/notifications\");\n dispatch(slice.actions.getNotifcationsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getNotifcationsFailure(error));\n }\n };\n}\n\nexport function readAllNotifications(id) {\n return async () => {\n try {\n dispatch(slice.actions.readAllNotifications());\n await axios.post(`/api/v1/notifications/read-all`);\n dispatch(slice.actions.readAllNotificationsSuccess());\n } catch (error) {\n console.log(error);\n }\n };\n}\n","import { createSlice } from \"@reduxjs/toolkit\";\nimport { FormattedMessage } from \"react-intl\";\nimport axios from \"utils/axios\";\nimport { getErrorCode, openSnackbarWithError } from \"utils/errors\";\nimport {\n calculateTotalPrices,\n fromBackToFrontAlbum,\n} from \"views/albums/album-utils\";\nimport { dispatch } from \"../index\";\nimport { addProduct, endOrder } from \"./cart\";\nimport { openSnackbar } from \"./snackbar\";\n\n// ----------------------------------------------------------------------\n\nconst initialState = {\n error: null,\n albums: [],\n totalAlbumsCount: 0,\n isLoading: true,\n album: {\n error: null,\n data: null,\n isLoading: true,\n photos: [],\n totalPhotosCount: 0,\n isPhotosLoading: true,\n photosError: false,\n isSubscribing: false,\n },\n contestants: {\n isLoading: true,\n totalCount: 0,\n data: [],\n error: null,\n },\n contestant: {\n isLoading: true,\n data: null,\n error: null,\n },\n isCartConflictAlbum: false,\n conflictedProduct: null,\n order: {\n orderCreatedId: null,\n isInPaymentProcess: false,\n error: null,\n orderCreatedEmail: null,\n },\n photograph: {\n isLoading: true,\n isLoadingAlbum: true,\n data: null,\n error: false,\n albums: [],\n offset: 0,\n limit: 50,\n totalAlbumsCount: 0,\n },\n checkoutAlbum: null,\n isLoadingCheckoutAlbum: true,\n isCheckoutAlbumError: false,\n // ============\n isComputingTotalAndPackages: false,\n total: 0,\n packages: [],\n packAthlete: null,\n packAthletes: [],\n otherProducts: [],\n isRelativePhotosDialogOpen: false,\n relativePhotoKey: null,\n};\n\nconst slice = createSlice({\n name: \"ecommerce\",\n initialState,\n reducers: {\n startLoading(state, action) {\n state.isLoading = true;\n },\n\n hasError(state, action) {\n state.error = action.payload;\n state.isLoading = false;\n },\n\n openRelativePhotosDialog(state, action) {\n state.isRelativePhotosDialogOpen = true;\n state.relativePhotoKey = action.payload;\n },\n\n closeRelativePhotosDialog(state) {\n state.isRelativePhotosDialogOpen = false;\n state.relativePhotoKey = null;\n },\n\n //============ GET ALBUMS ===========\n\n getAlbums(state) {\n state.isLoading = true;\n },\n\n getAlbumsSuccess(state, action) {\n state.albums = action.payload.data;\n state.totalAlbumsCount = action.payload.total_count;\n state.isLoading = false;\n },\n\n getAlbumsFailure(state) {\n state.isLoading = false;\n state.albums = [];\n state.totalAlbumsCount = 0;\n },\n\n // ========== GET 1 ALBUM ============\n\n getAlbum(state) {\n state.album.isLoading = true;\n state.album.error = false;\n },\n\n getAlbumSuccess(state, action) {\n state.album.data = fromBackToFrontAlbum(action.payload);\n state.album.isLoading = false;\n },\n\n getAlbumFailure(state, action) {\n state.album.isLoading = false;\n state.album.data = null;\n state.album.error = true;\n },\n\n // ======== GET 1 ALBUM PHOTO ==========\n\n getAlbumPhotos(state) {\n state.album.isPhotosLoading = true;\n },\n\n getAlbumPhotosSuccess(state, action) {\n state.album.photos = action.payload.data;\n state.album.totalPhotosCount = action.payload.total_count;\n state.album.isPhotosLoading = false;\n },\n\n getAlbumPhotosFailure(state, action) {\n state.album.photos = [];\n state.album.totalPhotosCount = 0;\n state.album.isPhotosLoading = false;\n state.album.photosError = action.payload;\n },\n\n // ======== GET 1 ALBUM CONTESTANT =========\n\n getAlbumContestant(state) {\n state.contestant.isLoading = true;\n },\n\n getAlbumContestantSuccess(state, action) {\n state.contestant.isLoading = false;\n state.contestant.data = action.payload;\n },\n\n getAlbumContestantFailure(state, action) {\n state.contestant.isLoading = false;\n state.contestant.data = null;\n state.contestant.error = action.payload;\n },\n\n // ======== CART ========\n\n setConflictCartAlbum(state, action) {\n state.isCartConflictAlbum = action.payload.value;\n state.conflictedProduct = action.payload.conflictedProduct;\n },\n\n startOrderPayment(state, action) {\n state.order.isInPaymentProcess = true;\n state.order.error = null;\n },\n\n orderError(state, action) {\n state.order.isInPaymentProcess = false;\n state.order.error = action.payload;\n },\n\n orderCreated(state, action) {\n state.order = {\n isInPaymentProcess: false,\n error: null,\n orderCreatedId: action.payload.order_id,\n orderCreatedEmail: action.payload.order_email,\n };\n },\n\n closeConfirmationOrder(state, action) {\n state.order = {\n ...initialState.order,\n };\n },\n // ===== PHOTOGRAPH SECTION ======\n\n getPhotograph(state) {\n state.photograph.isLoading = true;\n },\n\n getPhotographSuccess(state, action) {\n state.photograph.isLoading = false;\n state.photograph.data = action.payload;\n },\n\n getPhotographFailure(state, action) {\n state.photograph.isLoading = false;\n state.photograph.error = true;\n },\n\n getPhotographAlbums(state) {\n state.photograph.isLoadingAlbum = true;\n state.photograph.error = false;\n },\n\n getPhotographAlbumsSuccess(state, action) {\n state.photograph.isLoadingAlbum = false;\n state.photograph.totalAlbumsCount = action.payload.total_count;\n state.photograph.albums = action.payload.data;\n },\n\n getPhotographAlbumsFailure(state, action) {\n state.photograph.isLoadingAlbum = false;\n state.photograph.albums = [];\n state.photograph.totalAlbumsCount = 0;\n state.photograph.error = true;\n },\n // ===== SUBSCRIBE =====\n\n subscribeAlbum(state) {\n state.album.isSubscribing = true;\n },\n\n subscribeAlbumSuccess(state, action) {\n state.album.isSubscribing = false;\n },\n\n subscribeAlbumFailure(state, action) {\n state.album.isSubscribing = false;\n },\n\n // ===== CHECKOUT ALBUM =====\n\n getCheckoutAlbum(state) {\n state.isLoadingCheckoutAlbum = true;\n state.isCheckoutAlbumError = false;\n },\n\n noCheckoutAlbum(state) {\n state.isLoadingCheckoutAlbum = false;\n state.isCheckoutAlbumError = false;\n state.checkoutAlbum = null;\n },\n\n getCheckoutAlbumSuccess(state, action) {\n state.isLoadingCheckoutAlbum = false;\n state.checkoutAlbum = fromBackToFrontAlbum(action.payload);\n },\n\n getCheckoutAlbumFailure(state, action) {\n state.isLoadingCheckoutAlbum = false;\n state.checkoutAlbum = null;\n state.isCheckoutAlbumError = true;\n },\n\n computePricesAndPackages(state, action) {\n state.isComputingTotalAndPackages = false;\n },\n computePricesAndPackagesSuccess(state, action) {\n state.isComputingTotalAndPackages = true;\n state.total = action.payload.total;\n state.packages = action.payload.packages;\n state.packAthlete = action.payload.packAthlete;\n },\n computePricesAndPackagesFailure(state, action) {\n state.isComputingTotalAndPackages = true;\n },\n\n setCToken(state, action) {\n state.cToken = action.payload;\n },\n\n // ======================\n getPublicAlbumContestants(state) {\n state.contestants.isLoading = true;\n },\n\n getPublicAlbumContestantsSuccess(state, action) {\n state.contestants.isLoading = false;\n state.contestants.totalCount = action.payload.total_count;\n state.contestants.data = action.payload.data;\n },\n\n getPublicAlbumContestantsFailure(state, action) {\n state.contestants.isLoading = false;\n state.contestants.error = action.payload;\n },\n },\n});\n\n// Reducer\nexport default slice.reducer;\n\n// ----------------------------------------------------------------------\n\nexport function openRelativePhotosDialog(photoKey) {\n return async () => {\n dispatch(slice.actions.openRelativePhotosDialog(photoKey));\n };\n}\n\nexport function closeRelativePhotosDialog(photoKey) {\n return async () => {\n dispatch(slice.actions.closeRelativePhotosDialog(photoKey));\n };\n}\n\nexport function getPublicAlbums(nameStartsWith, offset, limit = 100) {\n return async (_, getState) => {\n dispatch(slice.actions.getAlbums());\n // ==== TODO this when API will be able to receive CTOKEN... but keep the code\n //const cToken = await window.grecaptcha.execute('')\n // ====\n try {\n const response = await axios.get(`/api/v1/public/albums`, {\n params: {\n offset,\n limit,\n name_starts_with: nameStartsWith,\n },\n });\n dispatch(slice.actions.getAlbumsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getAlbumsFailure());\n }\n };\n}\n\nexport function getPublicAlbumsByPhotographs(\n photographId,\n nameStartsWith,\n offset,\n limit = 100\n) {\n return async (_, getState) => {\n dispatch(slice.actions.getAlbums());\n // ==== TODO this when API will be able to receive CTOKEN... but keep the code\n //const cToken = await window.grecaptcha.execute('')\n // ====\n try {\n const response = await axios.get(\n `/api/v1/public/photographs/${photographId}/albums`,\n {\n params: {\n offset,\n limit,\n name_starts_with: nameStartsWith,\n },\n }\n );\n dispatch(slice.actions.getAlbumsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getAlbumsFailure());\n }\n };\n}\n\nexport function getPublicAlbumPhotos(\n photographUrlId,\n albumId,\n bibOrLastName,\n hasNoIdentification,\n tagId,\n offset,\n limit,\n ak\n) {\n return async () => {\n dispatch(slice.actions.getAlbumPhotos());\n try {\n const response = await axios.get(\n `/api/v1/public/photographs/${photographUrlId}/albums/${albumId}/photos`,\n {\n params: {\n offset,\n limit,\n bib_or_last_name: bibOrLastName === \"\" ? null : bibOrLastName,\n identification_status: !hasNoIdentification ? null : \"incorrect\",\n tag_id: tagId,\n ak,\n },\n }\n );\n dispatch(slice.actions.getAlbumPhotosSuccess(response.data));\n } catch (error) {\n console.log(getErrorCode(error));\n dispatch(slice.actions.getAlbumPhotosFailure(getErrorCode(error)));\n }\n };\n}\n\nexport function getPublicAlbumContestants(photographUrlId, albumId, filter) {\n return async () => {\n dispatch(slice.actions.getPublicAlbumContestants());\n try {\n const response = await axios.get(\n `/api/v1/public/photographs/${photographUrlId}/albums/${albumId}/contestants`,\n {\n params: {\n gender:\n filter.gender && filter.gender !== \"all\" ? filter.gender : null,\n offset: filter.page * filter.limit,\n limit: filter.limit,\n },\n }\n );\n dispatch(slice.actions.getPublicAlbumContestantsSuccess(response.data));\n } catch (error) {\n dispatch(\n slice.actions.getPublicAlbumContestantsFailure(getErrorCode(error))\n );\n }\n };\n}\n\nexport function getPublicAlbumContestant(photographId, albumId, bibOrLastName) {\n return async () => {\n dispatch(slice.actions.getAlbumContestant());\n try {\n const response = await axios.get(\n `/api/v1/public/photographs/${photographId}/albums/${albumId}/contestants/${bibOrLastName}`,\n {\n validateStatus: (status) => {\n // Ignore bad request\n return status === 200 || status === 400 || status === 404;\n },\n }\n );\n dispatch(slice.actions.getAlbumContestantSuccess(response.data));\n } catch (error) {\n console.log(error);\n dispatch(slice.actions.getAlbumContestantFailure(getErrorCode(error)));\n }\n };\n}\n\nexport function getPublicPhotograph(urlId) {\n return async () => {\n dispatch(slice.actions.getPhotograph());\n try {\n const response = await axios.get(`/api/v1/public/photographs/${urlId}`);\n dispatch(slice.actions.getPhotographSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getPhotographFailure(error));\n }\n };\n}\n\nexport function getPublicPhotographAlbums(\n urlId,\n searchBibText,\n offset,\n limit = 100\n) {\n return async () => {\n dispatch(slice.actions.getPhotographAlbums());\n try {\n const response = await axios.get(\n `/api/v1/public/photographs/${urlId}/albums`,\n {\n params: {\n offset,\n limit,\n },\n }\n );\n dispatch(slice.actions.getPhotographAlbumsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getPhotographAlbumsFailure(error));\n }\n };\n}\n\nexport function getPublicAlbum(albumId, accessKey) {\n return async () => {\n dispatch(slice.actions.getAlbum());\n try {\n const response = await axios.get(\n `/api/v1/public/albums/${albumId}?ak=${accessKey}`\n );\n dispatch(slice.actions.getAlbumSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getAlbumFailure());\n }\n };\n}\n\nexport function getPublicAlbumByPhotograph(photographId, albumId, accessKey) {\n return async () => {\n dispatch(slice.actions.getAlbum());\n try {\n const response = await axios.get(\n `/api/v1/public/photographs/${photographId}/albums/${albumId}?ak=${accessKey}`\n );\n dispatch(slice.actions.getAlbumSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getAlbumFailure());\n }\n };\n}\n\nexport function setConflictCartAlbum(value, conflictedProduct = null) {\n return async () => {\n dispatch(\n slice.actions.setConflictCartAlbum({\n value,\n conflictedProduct,\n })\n );\n };\n}\n\nexport function addConflictedProduct() {\n return async (dispatch, getState) => {\n const { ecommerce } = getState();\n dispatch(addProduct(ecommerce.conflictedProduct));\n dispatch(setConflictCartAlbum(false, null));\n };\n}\n\nexport function startLoadingAlbum() {\n return async () => {\n dispatch(slice.actions.startLoading());\n };\n}\n\nexport function handleFreePayment(email) {\n return async (dispatch, getState) => {\n try {\n dispatch(slice.actions.startOrderPayment());\n const { cart, ecommerce } = getState();\n const sanitizedPhotos = cart.products.map((product) => ({\n type: product.type,\n key: product.key,\n package_id: product.package_id,\n quantity: product.quantity,\n contestant_id: product.contestant ? product.contestant.id : null,\n pack_selfie_id: product.pack_selfie_id,\n }));\n const { data } = await axios.post(\"/api/v1/public/create-payment\", {\n email: email,\n photograph_album_id: cart.albumId,\n total_price: Number((ecommerce.total * 100).toFixed(0)),\n products: sanitizedPhotos,\n });\n dispatch(\n slice.actions.orderCreated({\n order_id: data.order_id,\n order_email: data.order_email,\n })\n );\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n dispatch(endOrder());\n } catch (err) {\n const errorCode = getErrorCode(err);\n console.error(err);\n dispatch(slice.actions.orderError(errorCode));\n }\n };\n}\n\nexport function handlePayment(cardElement, stripe) {\n return async (dispatch, getState) => {\n dispatch(slice.actions.startOrderPayment());\n const { cart, ecommerce } = getState();\n try {\n const sanitizedPhotos = cart.products.map((product) => ({\n type: product.type,\n key: product.key,\n package_id: product.package_id,\n quantity: product.quantity,\n contestant_id: product.contestant ? product.contestant.id : null,\n pack_selfie_id: product.pack_selfie_id,\n }));\n const { data } = await axios.post(\"/api/v1/public/create-payment\", {\n email: cart.email,\n phone: cart.address.phone,\n first_name: cart.address.first_name,\n last_name: cart.address.last_name,\n address1: cart.address.address1,\n address2: cart.address.address2,\n postal_code: cart.address.postal_code,\n city: cart.address.city,\n country: cart.address.country,\n photograph_album_id: cart.albumId,\n total_price: Number((ecommerce.total * 100).toFixed(0)),\n products: sanitizedPhotos,\n });\n\n if (!data.is_free_order) {\n const paymentMethodReq = await stripe.createPaymentMethod({\n type: \"card\",\n card: cardElement,\n });\n if (paymentMethodReq.error) {\n dispatch(slice.actions.orderError(paymentMethodReq.error.message));\n return;\n }\n const { error } = await stripe.confirmCardPayment(data.client_secret, {\n payment_method: paymentMethodReq.paymentMethod.id,\n });\n window.gtag(\"event\", \"purchase\", {\n value: cart.total,\n email: cart.email,\n country: cart.address.country,\n photograph_album_id: cart.albumId,\n });\n if (error) {\n dispatch(slice.actions.orderError(error.message));\n return;\n }\n }\n dispatch(\n slice.actions.orderCreated({\n order_id: data.order_id,\n order_email: data.order_email,\n })\n );\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n dispatch(endOrder());\n } catch (err) {\n const errorCode = getErrorCode(err);\n dispatch(slice.actions.orderError(errorCode));\n }\n };\n}\n\nexport function closeConfirmationOrder() {\n return async () => {\n dispatch(slice.actions.closeConfirmationOrder());\n };\n}\n\nexport function subscribeToAlbum(\n photographId,\n albumId,\n email,\n bib,\n navigate,\n captchaValue\n) {\n return async (dispatch) => {\n dispatch(slice.actions.subscribeAlbum());\n try {\n await axios.post(\n `/api/v1/public/photographs/${photographId}/albums/${albumId}/subscribe`,\n {\n email,\n bib,\n token: captchaValue,\n }\n );\n dispatch(slice.actions.subscribeAlbumSuccess());\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n setTimeout(() => {\n navigate();\n }, 8000);\n } catch (error) {\n dispatch(slice.actions.subscribeAlbumFailure());\n const code = getErrorCode(error);\n if (code === \"BadRequest\") {\n dispatch(\n openSnackbar({\n open: true,\n message: (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n } else {\n openSnackbarWithError(error, dispatch);\n }\n }\n };\n}\n\nexport function getAlbumTags(albumId) {\n return async () => {\n dispatch(slice.actions.getAlbumTags());\n try {\n const response = await axios.get(`/api/v1/public/albums/${albumId}/tags`);\n dispatch(slice.actions.getAlbumTagsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getAlbumTagsFailure());\n }\n };\n}\n\nexport function getCheckoutAlbum(albumId) {\n return async (dispatch) => {\n dispatch(slice.actions.getCheckoutAlbum());\n try {\n const response = await axios.get(`/api/v1/public/albums/${albumId}`);\n dispatch(slice.actions.getCheckoutAlbumSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getCheckoutAlbumFailure());\n }\n };\n}\n\nexport function noCheckoutAlbum() {\n return async () => {\n console.log(\"no checkout album\");\n dispatch(slice.actions.noCheckoutAlbum());\n };\n}\n\nexport function computePricesAndPackages(products, checkoutAlbum) {\n return async () => {\n dispatch(slice.actions.computePricesAndPackages());\n const { total, packages, packAthlete } = calculateTotalPrices(\n products,\n checkoutAlbum\n );\n dispatch(\n slice.actions.computePricesAndPackagesSuccess({\n total,\n packages,\n packAthlete,\n })\n );\n };\n}\n","import { createSlice } from '@reduxjs/toolkit';\r\n\r\n// initial state\r\nconst initialState = {\r\n openItem: ['dashboard'],\r\n drawerOpen: false\r\n};\r\n\r\n// ==============================|| SLICE - MENU ||============================== //\r\n\r\nconst menu = createSlice({\r\n name: 'menu',\r\n initialState,\r\n reducers: {\r\n activeItem(state, action) {\r\n state.openItem = action.payload;\r\n },\r\n\r\n openDrawer(state, action) {\r\n state.drawerOpen = action.payload;\r\n }\r\n }\r\n});\r\n\r\nexport default menu.reducer;\r\n\r\nexport const { activeItem, openDrawer } = menu.actions;\r\n","import { createSlice } from \"@reduxjs/toolkit\";\nimport update from \"react-addons-update\";\nimport axios from \"utils/axios\";\nimport { openSnackbarWithError } from \"utils/errors\";\nimport {\n fromBackToFrontPackage,\n fromFrontToBackPackage,\n} from \"views/packages/utils\";\nimport { dispatch } from \"../index\";\nconst initialState = {\n photographPackages: [],\n isLoadingPhotographPackages: false,\n\n // == creation ==\n isPostingPhotographPackage: false,\n photographPackageCreated: null,\n\n // == edit ==\n isEditingPhotographPackage: false,\n photographPackageEdited: null,\n\n // == deletion ==\n isDeletingPhotographPackage: false,\n};\n\nconst slice = createSlice({\n name: \"packages\",\n initialState,\n reducers: {\n getPhotographPackages(state) {\n state.isLoading = true;\n state.photographPackages = [];\n },\n getPhotographPackagesSuccess(state, action) {\n state.isLoading = false;\n state.photographPackages = action.payload.map((pp) => ({\n ...pp,\n unit_prices: pp.unit_prices.map((up) => ({\n ...up,\n unit_price: up.unit_price / 100,\n })),\n }));\n },\n getPhotographPackagesFailure(state) {\n state.isLoading = false;\n },\n\n // == creation ==\n savePhotographPackage(state) {\n state.isPostingPhotographPackage = true;\n state.photographPackageCreated = null;\n },\n savePhotographPackageSuccess(state, action) {\n state.isPostingPhotographPackage = false;\n const sanitizedPackage = fromBackToFrontPackage(action.payload);\n state.photographPackageCreated = { ...sanitizedPackage };\n state.photographPackages = update(state.photographPackages, {\n $splice: [[0, 0, { ...sanitizedPackage }]],\n });\n },\n savePhotographPackageFailure(state, action) {\n state.isPostingPhotographPackage = false;\n },\n\n // == edit ==\n editPhotographPackage(state) {\n state.isEditingPhotographPackage = true;\n state.photographPackageEdited = null;\n },\n\n editPhotographPackageSuccess(state, action) {\n state.isEditingPhotographPackage = false;\n const sanitizedPackage = fromBackToFrontPackage(action.payload);\n state.photographPackageEdited = { ...sanitizedPackage };\n state.photographPackages = update(state.photographPackages, {\n $splice: [\n [\n state.photographPackages.findIndex(\n (pp) => pp.id === action.payload.id\n ),\n 1,\n { ...sanitizedPackage },\n ],\n ],\n });\n },\n\n editPhotographPackageFailure(state, action) {\n state.isEditingPhotographPackage = false;\n },\n // == deletion ==\n deletePhotographPackage(state) {\n state.isDeletingPhotographPackage = true;\n },\n deletePhotographPackageSuccess(state, action) {\n state.isDeletingPhotographPackage = false;\n // delete the package from the list\n state.photographPackages = state.photographPackages.filter(\n (photographPackage) => photographPackage.id !== action.payload.id\n );\n },\n deletePhotographPackageFailure(state, action) {\n state.isDeletingPhotographPackage = false;\n },\n\n // == reset popup ==\n resetPhotographPackageCreatedAndEdited(state) {\n state.photographPackageCreated = null;\n state.photographPackageEdited = null;\n },\n },\n});\n\nexport function getPhotographPackages() {\n return async () => {\n try {\n dispatch(slice.actions.getPhotographPackages());\n const response = await axios.get(\"/api/v1/photograph_packages\");\n dispatch(slice.actions.getPhotographPackagesSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getPhotographPackagesFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function savePhotographPackage(photographPackage) {\n return async () => {\n try {\n dispatch(slice.actions.savePhotographPackage());\n const packageSanitized = fromFrontToBackPackage(photographPackage);\n const response = await axios.post(\n \"/api/v1/photograph_packages\",\n packageSanitized\n );\n dispatch(slice.actions.savePhotographPackageSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.savePhotographPackageFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function editPhotographPackage(packageId, photographPackage) {\n return async () => {\n try {\n dispatch(slice.actions.editPhotographPackage());\n const response = await axios.put(\n `/api/v1/photograph_packages/${packageId}`,\n fromFrontToBackPackage(photographPackage)\n );\n dispatch(slice.actions.editPhotographPackageSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.editPhotographPackageFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function deletePhotographPackage(photographPackageId) {\n return async () => {\n try {\n dispatch(slice.actions.deletePhotographPackage());\n await axios.delete(`/api/v1/photograph_packages/${photographPackageId}`);\n dispatch(\n slice.actions.deletePhotographPackageSuccess({\n id: photographPackageId,\n })\n );\n } catch (error) {\n dispatch(slice.actions.deletePhotographPackageFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function resetPhotographPackagePopup() {\n return async () => {\n dispatch(slice.actions.resetPhotographPackageCreatedAndEdited());\n };\n}\n\nexport default slice.reducer;\n","import { createSlice } from '@reduxjs/toolkit';\r\n\r\nconst initialState = {\r\n action: false,\r\n open: false,\r\n message: 'Note archived',\r\n anchorOrigin: {\r\n vertical: 'bottom',\r\n horizontal: 'center'\r\n },\r\n variant: 'default',\r\n alert: {\r\n color: 'primary',\r\n variant: 'filled'\r\n },\r\n transition: 'Fade',\r\n close: true,\r\n actionButton: false\r\n};\r\n\r\n// ==============================|| SLICE - SNACKBAR ||============================== //\r\n\r\nconst snackbar = createSlice({\r\n name: 'snackbar',\r\n initialState,\r\n reducers: {\r\n openSnackbar(state, action) {\r\n const { open, message, anchorOrigin, variant, alert, transition, close, actionButton } = action.payload;\r\n\r\n state.action = !state.action;\r\n state.open = open || initialState.open;\r\n state.message = message || initialState.message;\r\n state.anchorOrigin = anchorOrigin || initialState.anchorOrigin;\r\n state.variant = variant || initialState.variant;\r\n state.alert = {\r\n color: alert?.color || initialState.alert.color,\r\n variant: alert?.variant || initialState.alert.variant\r\n };\r\n state.transition = transition || initialState.transition;\r\n state.close = close === false ? close : initialState.close;\r\n state.actionButton = actionButton || initialState.actionButton;\r\n },\r\n\r\n closeSnackbar(state) {\r\n state.open = false;\r\n }\r\n }\r\n});\r\n\r\nexport default snackbar.reducer;\r\n\r\nexport const { closeSnackbar, openSnackbar } = snackbar.actions;\r\n","import { createSlice } from \"@reduxjs/toolkit\";\nimport update from \"react-addons-update\";\nimport axios from \"utils/axios\";\nimport { openSnackbarWithError } from \"utils/errors\";\nimport { dispatch } from \"../index\";\nimport { decrementSuperAthleteCount } from \"./dashboard\";\nimport { openSnackbar } from \"./snackbar\";\n\nconst initialState = {\n data: [],\n params: null,\n total: 0,\n page: 0,\n limit: 100,\n isLoading: false,\n isError: false,\n // === Popup ===\n isAddingAthlete: false,\n isLoadingAthlete: false,\n isPosting: false,\n isPostingError: false,\n openedAthlete: null,\n isDeleting: false,\n};\n\nconst slice = createSlice({\n name: \"superathletes\",\n initialState,\n reducers: {\n getSuperAthletes(state, action) {\n state.isLoading = true;\n },\n getSuperAthletesSuccess(state, action) {\n state.isLoading = false;\n state.isError = false;\n state.data = action.payload.data;\n state.total = action.payload.total_count;\n state.page = action.payload.request.offset;\n state.limit = action.payload.request.limit;\n },\n getSuperAthletesFailure(state, action) {\n state.superAthletes = [];\n state.isLoading = false;\n state.isError = true;\n },\n\n setPaginationParams(state, action) {\n state.params = action.payload;\n },\n\n // =====================================\n postSuperAthlete(state, action) {\n state.isPosting = true;\n state.isPostingError = false;\n },\n\n postSuperAthleteSuccess(state, action) {\n state.isPosting = false;\n state.isPostingError = false;\n state.data.push(action.payload);\n if (!action.payload.isAddingMore) {\n state.isAddingAthlete = false;\n }\n },\n\n postSuperAthleteFailure(state, action) {\n state.isPosting = false;\n state.isPostingError = true;\n state.error = action.payload;\n },\n\n // =====================================\n getSuperAthlete(state, action) {\n state.isLoadingAthlete = true;\n },\n\n getSuperAthleteSuccess(state, action) {\n state.openedAthlete = action.payload;\n state.isLoadingAthlete = false;\n },\n\n getSuperAthleteFailure(state, action) {\n state.isLoadingAthlete = false;\n state.error = action.payload;\n },\n\n closeSuperAthlete(state, action) {\n state.isLoadingAthlete = false;\n state.openedAthlete = null;\n },\n\n isAddingAthlete(state, action) {\n state.isAddingAthlete = action.payload;\n },\n\n // =====================================\n putSuperAthlete(state, action) {\n state.isPosting = true;\n state.isPostingError = false;\n },\n\n putSuperAthleteSuccess(state, action) {\n state.isPosting = false;\n state.isPostingError = false;\n const index = state.data.findIndex((sa) => sa.id === action.payload.id);\n state.openedAthlete = null;\n state.data = update(state.data, {\n [index]: {\n $set: action.payload,\n },\n });\n },\n\n putSuperAthleteFailure(state, action) {\n state.isPosting = false;\n state.isPostingError = true;\n state.error = action.payload;\n },\n\n // =====================================\n deleteSuperAthlete(state, action) {\n state.isDeleting = true;\n state.isDeletingError = false;\n },\n\n deleteSuperAthleteSuccess(state, action) {\n state.isDeleting = false;\n state.isDeletingError = false;\n const index = state.data.findIndex((sa) => sa.id === action.payload);\n state.data = update(state.data, { $splice: [[index, 1]] });\n state.openedAthlete = null;\n },\n\n deleteSuperAthleteFailure(state, action) {\n state.isDeleting = false;\n state.isDeletingError = true;\n state.error = action.payload;\n },\n },\n});\n\n// Reducer\nexport default slice.reducer;\n\n// ----------------------------------------------------------------------\n\nexport function getSuperAthletes(lastName, offset = 0, limit = 100) {\n return async (dispatch) => {\n dispatch(slice.actions.getSuperAthletes());\n try {\n dispatch(\n slice.actions.setPaginationParams({\n lastName: lastName !== \"\" ? lastName : null,\n\n offset,\n limit,\n })\n );\n const response = await axios.get(\"/api/v1/super_athletes\", {\n params: {\n lastName: lastName !== \"\" ? lastName : null,\n offset,\n limit,\n },\n });\n dispatch(slice.actions.getSuperAthletesSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getSuperAthletesFailure(error));\n }\n };\n}\n\nexport function getSuperAthlete(id) {\n return async (dispatch) => {\n dispatch(slice.actions.getSuperAthlete());\n try {\n const response = await axios.get(`/api/v1/super_athletes/${id}`);\n dispatch(slice.actions.getSuperAthleteSuccess(response.data));\n } catch (error) {\n console.error(error);\n dispatch(slice.actions.getSuperAthleteFailure(error));\n }\n };\n}\n\nexport function postSuperAthlete(data, isSaveWithAddingMore = false) {\n dispatch(slice.actions.postSuperAthlete());\n return async (dispatch) => {\n try {\n const response = await axios.post(\"/api/v1/super_athletes\", data, {\n headers: {\n \"Content-Type\": \"multipart/form-data\",\n },\n });\n dispatch(\n slice.actions.postSuperAthleteSuccess({\n ...response.data,\n isAddingMore: isSaveWithAddingMore,\n })\n );\n } catch (error) {\n console.log(error);\n openSnackbarWithError(error, dispatch);\n dispatch(slice.actions.postSuperAthleteFailure(error));\n }\n };\n}\n\nexport function putSuperAthlete(data) {\n dispatch(slice.actions.putSuperAthlete());\n return async (dispatch) => {\n try {\n const response = await axios.put(\n `/api/v1/super_athletes/${data.id}`,\n data\n );\n dispatch(slice.actions.putSuperAthleteSuccess(response.data));\n } catch (error) {\n openSnackbarWithError(error, dispatch);\n dispatch(slice.actions.putSuperAthleteFailure(error));\n }\n };\n}\n\nexport function deleteSuperAthlete(superAthleteId, navigate) {\n dispatch(slice.actions.deleteSuperAthlete());\n return async (dispatch) => {\n try {\n await axios.delete(`/api/v1/super_athletes/${superAthleteId}`);\n dispatch(slice.actions.deleteSuperAthleteSuccess(superAthleteId));\n dispatch(\n openSnackbar({\n open: true,\n message: \"Athlète supprimé de votre effectif.\",\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n dispatch(decrementSuperAthleteCount());\n navigate(\"/dashboard/superathletes\");\n } catch (error) {\n console.error(error);\n openSnackbarWithError(error, dispatch);\n dispatch(slice.actions.deleteSuperAthleteFailure(error));\n }\n };\n}\n\nexport function closeAthleteModal() {\n return async (dispatch) => {\n dispatch(slice.actions.closeSuperAthlete(null));\n };\n}\n\nexport function setIsAddingAthlete(value) {\n return async (dispatch) => {\n dispatch(slice.actions.isAddingAthlete(value));\n };\n}\n","// third-party\nimport { createSlice } from \"@reduxjs/toolkit\";\nimport { update } from \"lodash\";\nimport { createSelector } from \"reselect\";\nimport axios from \"utils/axios\";\nimport { openSnackbarWithError } from \"utils/errors\";\nimport { dispatch } from \"../index\";\nimport { openSnackbar } from \"./snackbar\";\nconst initialState = {\n tags: [],\n isLoading: false,\n isPosting: false,\n isDeleting: false,\n};\n\nconst slice = createSlice({\n name: \"tags\",\n initialState,\n reducers: {\n getTags(state) {\n state.isLoading = true;\n },\n getTagsSuccess(state, action) {\n state.isLoading = false;\n state.tags = action.payload;\n },\n getTagsFailure(state) {\n state.isLoading = false;\n },\n postTag(state) {\n state.isPosting = true;\n },\n postTagSuccess(state, action) {\n state.isPosting = false;\n state.tags.push(action.payload);\n console.log(state.tags);\n },\n postTagFailure(state) {\n state.isPosting = false;\n },\n deleteTag(state) {\n state.isDeleting = true;\n },\n\n deleteTagSuccess(state, action) {\n state.isDeleting = false;\n const tagId = action.payload;\n state.tags = state.tags.filter((t) => t.id !== tagId);\n },\n\n deleteTagFailure(state) {\n state.isDeleting = false;\n },\n\n patchTag(state) {\n state.isUploading = true;\n },\n\n patchTagSuccess(state, action) {\n state.isUploading = false;\n const tag = action.payload;\n const index = state.tags.findIndex((t) => t.id === tag.id);\n state.tags = update(state.tags, {\n [index]: {\n $set: tag,\n },\n });\n },\n\n patchTagFailure(state) {\n state.isUploading = false;\n },\n },\n});\n\nexport const tagNamesSelector = createSelector(\n (state) => state.tags.tags,\n (tags) => {\n return tags.map((tag) => ({\n id: tag.id,\n name: tag.name,\n value: tag.name,\n inputValue: tag.name,\n title: tag.name,\n }));\n }\n);\n\nexport function getTags(albumId) {\n return async () => {\n try {\n dispatch(slice.actions.getTags());\n const response = await axios.get(\n `/api/v1/photograph_albums/${albumId}/tags`\n );\n dispatch(slice.actions.getTagsSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.getTagsFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function postTag(albumId, tagName) {\n return async () => {\n try {\n dispatch(slice.actions.postTag());\n const response = await axios.post(\n `/api/v1/photograph_albums/${albumId}/tags`,\n {\n name: tagName,\n }\n );\n dispatch(slice.actions.postTagSuccess(response.data));\n } catch (error) {\n dispatch(slice.actions.postTagFailure());\n openSnackbarWithError(error, dispatch);\n }\n };\n}\n\nexport function patchTag(albumId, tagId, tag) {\n return async () => {\n try {\n dispatch(slice.actions.patchTag());\n const response = await axios.patch(\n `/api/v1/photograph_albums/${albumId}/tags/${tagId}`,\n {\n ...tag,\n }\n );\n dispatch(slice.actions.patchTagSuccess(response.data));\n } catch (err) {\n dispatch(slice.actions.patchTagFailure());\n }\n };\n}\n\nexport function deleteTag(albumId, tagId) {\n return async () => {\n try {\n dispatch(slice.actions.deleteTag());\n await axios.delete(`/api/v1/photograph_albums/${albumId}/tags/${tagId}`);\n dispatch(\n openSnackbar({\n open: true,\n message: \"Tag correctement supprimé...\",\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: false,\n })\n );\n dispatch(slice.actions.deleteTagSuccess(tagId));\n } catch (error) {\n dispatch(slice.actions.deleteTagFailure());\n }\n };\n}\nexport default slice.reducer;\n","// material-ui\r\nimport LinearProgress from '@mui/material/LinearProgress';\r\nimport { styled } from '@mui/material/styles';\r\n\r\n// styles\r\nconst LoaderWrapper = styled('div')({\r\n position: 'fixed',\r\n top: 0,\r\n left: 0,\r\n zIndex: 1301,\r\n width: '100%'\r\n});\r\n\r\n// ==============================|| LOADER ||============================== //\r\n\r\nconst Loader = () => (\r\n \r\n \r\n \r\n);\r\n\r\nexport default Loader;\r\n","var _defs, _g;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgLogo(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 614,\n height: 232,\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n xmlSpace: \"preserve\",\n overflow: \"hidden\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: -0.352076,\n y: -0.0913482,\n width: 3743268,\n height: 1414395\n })), /*#__PURE__*/React.createElement(\"image\", {\n width: 883,\n height: 501,\n xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA3MAAAH1CAYAAABcP6eWAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFxEAABcRAcom8z8AADT8SURBVHhe7d0LvGVXXSf4CKQCyMsXDQwMGIuk6ux97q0i4aEyRFseYRDatqWlu/1o7J5haKcfaH9a6HHoTNv64aM8MrYCRnPrJgQSUzYkqXvOua+qVEICSEAQzOiIDkEwIKggzyR1zzl79jq1wr0JO5x67L3PPrW/38/n/ykg95611j6LT9av9t5rnQUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDLXHD55WdfcPmhRz75uuseMa8V+r/7NwbnxCEBNM/i8tHHJcub/9eZUxuvjkM7IZ3lzYuLP6fc6iwffUJsci50l9cvKRpH2fXU5aMPj01O1fa5eiKqvkZhXsSm5kK6vPZjReMoq2IzJ+3Mm8snU+XPe5qpe2Dz59Kr3/PhzvLhD+b/rp3LWnjH0T9MDmxe0zl4cFccFkCzLC6vPi1d3szOlEqWNu+MQzsh+eLih4o+p+xKDqy/PjbZeGGhmS6t3100jlJraf1obPKEtH2unog6rtE8Bbp8EbZcNIayKjZz0s60uXwyVcW8p5ny7/sN+67/cLZwzXvzum0ua9+7PpTl64SP7x64Owc0lAVy/i+cpc2PFH1WqbW0/tmTuQs1S+FvzgvHUHqt/Vhs8oSYq9PVco3yoN9ZXt8Xm2w0Ya55Jcy1R/59/+rCte/Nv/fD3zQP5qUW3nlrtnd584+EOaCxLJCbG15mpa5wG5s7YebqdHVdo9D3cAc3NttYwlzzSphrj/z7FuYAqmaBfNZZ4Y5ZTY8VrsYmG6u7vPGcwr6XXKfy3oy5Ol2d1yhZ2rg+NttYwlzzSphrj/z7FuYAqmaBfFx6YPOyos8ru8L1jk02UtWL30lNHtM7+Q1hzNXp6r5GYUOL2HQjCXPNK2GuPfLvW5gDqJoF8nHp8tqeos8ru5q8EUpdG590Dmy+LTZ5UszV6WZxjcImQrH5xhHmmlfCXHvk37cwB1A1C+Rt4THIos8stRq8EUpd7w6e6uYZ5up0s7hGnaX1L4Z2YxcaRZhrXglz7ZF/38IcQNUskLeFDUqKPrP8auZGKDVtfHJSxxHsZK5ON6trlI/l/U38SwphrnklzLVH/n0LcwBVs0C+v3DnrOhzS60GboRS18YnpxNkzdXpZnmNTvXx2SoJc80rYa498u9bmAOomgXy/dX3qOHJbwBSpaoXvZM6heMIdjJXp5v1NWrageLCXPNKmGuP/PsW5gCqZoF8fyFk5aGj8k1AmrQLYF0bn+T12tjkKTFXp5v5NcrnUbjLG7szc8Jc80qYa4/8+xbmAKpmgfzN5uEuVZlquRt5iscR7GSuTteEaxTG1ZQDxYW55pUw1x759y3MAVTNAvmbhd0Wiz67/GrGRih1bHwSFtWxuVNmrk7XmGvUkPdChbnmlTDXHvn3LcwBVM0CuVgtAWdp4/rY3MzUtfHJqR5HsJO5Ol2TrlETHiUW5ppXwlx75N+3MAdQNQvkYsny+iuKPr/smvVGKHU8Upp/J++PzZ0Wc3W6pl2jzvLmxbFrMyHMNa+EufbIv29hDqBqFsjFwplZ4b22ojbKrFnevahv45NyHic1V6drXJib8YHiwlzzSphrj/z7FuYAqmaB/OCSA+uvL2qj1JrhRig1bXzy2bIOkzZXp2viNcrHObMDxYW55pUw1x759y3MAVTNAvnBTY4pKGij/JrNRih1vBeY12kdR7CTuTpdU69RCFWxi7US5ppXwlx75N+3MAdQNQvkby1sUlLUTpk1i41Qatn4pITjCHYyV6dr8jWaxYHiwlzzSphrj/z7FuYAqlb5oiK8d7a0frS+2rg2Dq0UYQOHwnGVWSWHnhNR9SI3VNl3Y8zV6RodEmZwoHhTw9zkrn/hnDi1CgGpqH+lVbiLX9DuqVX5855mSpYPv2n/jR/NFq97f17vq75+733Z3qtuys4/sJntyedtGbU3D3PnLW3cMatHxQGmqnrxV/aCfhbm7XHEaera+KSM4wh2Mlena3SYyyuEjjoPFG9qmCtb2EipqH9lVf75PxSbghO2cNXm/u7Vt/5M/v/7n6669i6t/1R3+fAllww+etsrBx+7639Z++M7y6hXrv3xXa9cu2Pt3w4+7s4c0EwWyNPVsVFI/i+j2h49qmk8pRxHsJO5Ol3Tw9ykltaPxu5WTpgrp4Q55sXlH/nMFW/98F0f+60/vOsDZdTbPvyZj771w5+9+tI77tgVmwBoFgvk6eIxBTXcyarnTK567jSWv6mLuTrdXIS5vOo6kkOYK6eEOebBwYPZQy/74Kfe/ubbP/3/5PWhMuqyD376jjd94NPXCHNAY1kgn5j0wOZlReMrs+rYCKWmjU9KO45gJ3N1unkJc8er+l1chblySphjHghzQCtZIJ+Y8P5X0fhKrRo2Qql6cRurkvf/zNXp5inM1XGguDBXTglzzANhDmglC+QTl4et1aIxllyVbYRSy8YnFQZSc3W6eQpzk1ra/EiVu8QJc+WUMMc8EOaAVrJAPnHhsbCiMZZZVW6EUsvGJxV+3+bqdHMX5vKq8roLc+WUMMc8EOaAVrJAPjnhfbCicZZZVS2c6tj4pOzjCHYyV6ebxzB3vDZeFYdQKmGunBLmmAfCHNBKFsgnJx/Tax84xtKrgkN169j4pIrjCHYyV6eb2zC3VM2B4sJcOSXMMQ+EOaCVLJBPTngfbB7fO6t6UXu8qt2d0Fydbm7DXF7hEeOyDxQX5sopYY55IMwBrWSBfPLqCEbh/bbY3GmraeOTSo4j2MlcnW6ew9ykSj5QXJgrp4Q55oEwB7SSBfLJq+OYgs7S5p/G5k5bLRuf5IvJ2FxlzNXp5j7M5ZUcWH99HM5pE+bKKWGOeSDMAa1kgXxq6thMpKwFVOV9rfA4gp3M1enOhDB3vMp5ZFeYK6eEOeaBMAe0kgXyqekur19SNN5Sq4SNUOrY+KSKDVuKmKvTnSlhrqwDxYW5ckqYYx4Ic0ArWSCfmvB+WHhPrGjMpVUJd7yqXsyGqvI4gp3M1enOlDAXKjxqfLrvYQpz5ZQwxzwQ5oBWOpMWf+FuWRxWLcK7PUX9KLNOZyOUejY+2fxIbK5y5up0dQTeOv6C4L463YAtzJVTwhzzQJgDWskC+dRNjiko6EeZdTobodSz8cn6K2JzlTNXp6sjzB2/K139O6P31en8hYYwV04Jc8wDYQ5oJQvk05MsbVxf1Jcy61QPU65h45PKjyPYyVydro4wd1874b22op8pvZZO/UBxYa6cEuaYB8Ic0EoWyKens7x5cVFfyqz7FtAno46NT8ICMjZXC3N1urrCXBB2nCz6mSoqHCh+Ku+PCnPllDDHPBDmgFayQD59dWz9H95/i82dkKoXsWVsznKyzNXp6gxzQdUh4n51CgeKC3PllDDHPBDmgFayQD599bybduLvDdWz8Uk9xxHsZK5OV3eYC0LIKvrZSurA5mWx2RMizJVTwhzzQJgDWskC+fTFYwoas2tkHeGyruMIdjJXp5tFmAt/eRAegyz6+WrqxA8UF+bKKWGOeSDMAa1kgVyOcMegqE9l1oluAlH9Y5/1HUewk7k63SzCXDB5R7Pqv9CIdXzjlbU9selvSZgrp4Q55oEwB7SSBXI5wp2qoj6VWQ+2kN6pno1P6juOYCdzdbpZhbkgXd54VdHvVFEneqC4MFdOCXPMA2EOaCUL5PKkS+urRf0qrU5gI5SqF695H2o9jmAnc3W6WYa5oPL5t7NO4L1NYa6cEuaYB8Ic0EoWyOWpZ6v2jVfF5r5JHRufhEVjbK525up0sw5zTTtQXJgrp4Q55oEwB7SSBXK5wp2ror6VVt/ifbXKNz7Jg2LdxxHsZK5ON+swF4Q+NOVAcWGunBLmmAfCHNBKFsjlyvvx2gf2q+x6sJ0kq9/4pP7jCHYyV6drQpgL6jxQPPwFyoP9JYMwV04Jc8wDYQ5oJQvkcoVFZdWPOnYObL4tNvcNdWx8MovjCHYyV6drSpgLqg4Y96sHOVBcmCunhDnmgTAHtJIFcvnCHayi/pVWeVh84CYkVS9aZ3UcwU7m6nRNCnNBCFlFn1NJFRwoLsyVU8Ic80CYA1rJArl8dRxTsHMjlDo2PmnCtTVXp2tamJv1geLCXDklzDEPhDmglSyQq1H9+2vbd8pq2PhkZscR7GSuTte0MBfUeaD48Xa2DxQX5sopYY55IMwBrWSBXI3Ql6I+lln3vcNWdXBMDqy/fjKoGTNXp2timAtmdaC4MFdOCXPMA2EOaCUL5GocP2+r2mMKwkYolW98sjTb4wh2Mlena2qYC6oOVjsrWdq4vo42JwNrAGEOhDmgpSyQqxM2ZCjqZ2kVHimreLOV+xbFTWCuTtfkMBf+giPcNSv63CoqPH4szJVTwhzzQJgDWqnJi795NzmmoOCazFN9qwOZ62auTtf0axT6V+eB4lXfHY/DmjlhDoQ5oKUskKsV7mwVXZe5qAYcR7CTuTrdPFyjWg8Ur7jikGZOmANhDmgpC+RqdZY3Ly66LvNQTXts1Vydbl6uUdhUp+jz563icGZOmANhDmgpC+Tq1fmeUGnVkOMIdjJXp5una5TPsfoOFK+o4lBmTpgDYQ5oKQvk6lV+DlwF1ZTjCHYyV6ebp2sU3imt90Dx8isOZeaEORDmgJayQK5ePKagnkOTy6gGHUewk7k63bxdo1oPFK+g4jBmTpgDYQ5oKQvkelR+TEGJ1aTjCHYyV6ebx2s0j3eu76s4hJkT5kCYA1rKArkeneX1fUXXp4nVpOMIdjJXp5vXaxQ+t6i9plfs/swJcyDMAS1lgVyfudjwoWHHEexkrk43r9eo7gPFy6rY/ZkT5kCYA1rKArk+83C+VtOOI9jJXJ1unq9R6HttB4qXVLHrMyfMgTAHtJQFcr3SpfXPFl2nRlQDjyPYyVydbt6v0bwdKB67PXPCHAhzQEtZINcrvyavfeA1ako18TiCnczV6c6EazRPB4rHLs+cMAfCHNBSFsj1Clv+N3Ir9oYeR7CTuTrdmXKN5uL90rxid2dOmANhDmgpC+T6pUsb1xZdq1lWU48j2Mlcne5MuUbzcqB47O7MCXMgzAEtZYFcvyYeU9DU4wh2MlenO5Ou0TwcKB67OnPCHAhzQEtVvfjLF2OrYSFQV81DKAnCEQCF12sW1eDjCHYyV6c70wJv0w8Uj92cuXw+CXO0njAHtFLlC+SaKzyaFYfWaOEIgKL+z6Y2XhW71Wjm6nRnWpgLQptFfWlCxS7OnDAHwhzQUhbIsxGOAEibcExBw48j2Mlcne5MDHNNPlA8dnHmhDkQ5oCWskCenfTA5mVFY6i18j7E7jSeuTrdmRjmgjCuJh4oHrs3c8IcCHNAS1kgz87kmIKCMdRZTT+OYCdzdbozNcwFTTxQPHZt5oQ5EOaAlrJAnq1wJEDROOqoeTiOYCdzdbozOcwFTTtQPHZr5oS5hjp48KGLy+v7Fq9ce1Z61caFofL/Dz1z8XfXnrX7NwaPiT9FSYQ5oJUskGers7x5cdE46qh5W6CZq9Od6WEuSBt0oHjs0swJc810/hW3PTq9YuNT3atvvieft3dP6srNu7tvv+me5MrDPxx/jJIIc0ArWSDP3kw2d5iT4wh2Mlena0OYa9KB4rFLMyfMNVMIc52ljS8sXPverPv2o8fr6luyhWtuzbpXbT4//hglEeaAVrJAnr3ZnKU1H8cR7GSuTteGMBc05UDx2J2ZE+aa6XiY2/xc9x23bF/PK4/kgS4PdcsbPxJ/jJIIc0ArWSDP3uLy0cfVujCdo+MIdjJXp2tLmAuacKB47MrMCXPNJMzVS5gDWskCuRlqPaZgjo4j2Mlcna5NYS4I/SnqZ10VuzFzwlwzCXP1EuaAVrJAbobO8vq+ovFUUfN0HMFO5up0bQtzsz5QPHZj5oS5ZhLm6iXMAa1kgdwcaQ279M3bcQQ7mavTtS3MBWHMszpQPHZh5oS5ZhLm6iXMAa1kgdwcdRyKPM+LMnN1ujaGuWBWB4rH5mdOmGsmYa5ewhzQShbIzREeGQubkxSNq5Saw+MIdjJXp2trmAtmcaB4bHrmhLlmEubqJcwBrWSB3Cz5GF77wDGVV/N3HMFO5up0bQ5zQR2PKu+s2OzMCXPNJMzVS5gDWskCuVnC5iSVHFMwp8cR7GSuTtf2MFf3geKx2ZkT5ppJmKuXMAe0kgVy86RLG9cWje20ak6PI9jJXJ2u7WEuyBfJtR0oHpucOWGumYS5eglzQCtZIDfPZDFaMLbTqXk9jmAnc3U6Ye64ug4Uj83NnDDXTMJcvYQ5oJUskJspbFZSNL5TqXk+jmAnc3U6YW5b6GvRGMqs2NTMCXPNJMzVS5gDWim+o3X0zKmNa+PQ5tpkq/XC8Z18hTt98WPnmrk6XeXXaHnztbGpxgvviIa/yCgcR0kVm5q57vL6JUX9K6s6y+v7YlOcBGGuXsIcAABQCmGuXiHMvfn2Tx180+2fvjOvPymj3vzBT3/istv/6t3CHAAAtIgwV69Ls+whl33wrte86YOfXnrj7Z96Wxn15g99+orLPvBXv3T0aPaw2AwAAHCmE+YAAADmkDAHAAAwh4Q5AACAOSTMAQAAzCFhDgAAYA4JcwAAAHNImAMAAJhDwhwAAMA8Opg9tHNg/a+LwtzC0uZz408BAAAwzQWXf+js896+/r3JlUe+r/vOzXMrq6XNc9PfPbyQLq3/bffqm+8f5t5+U/7n4Z867+23fG/h75ZUYYx7D6w8/fwrbnh0HD4AAMB86vzu2u48YH02uerwFzsHNr9QWS1t5LX+xbyt8TeC3I5Klje+nCxv/l3h75ZVV258Mb3q6Jc6V6z9izh8AACA+ZQur+1JlzdGC9fcevzdtcrq5smfRUEuVLg7d9/PVFbvuCVbvO4Psr1Lh/9VHD4AAMB86l6xen66tH735FHHgpB1RtWVh7OFd96adZY2fjYOHwAAYD4JcwAAAHMovfzQnmR549jCO27JulfdVHEdKQ5ZofJ/Vvw7Jdbbj2aL174v23tg81/G4QMAAMyncGcuWVr/evfKw+PJ5iRV1fLmKP5ZHObyf5YsbQ7v9ztl14GN8cLVt4zdmQMAAObe7sHHz0mW1hYXrtjcv7h8dF9VlV55eCE5cOQHugc271n8/dvvF+QWr3t/1lleu3n/VTfvLfrdMmvhqpv3d65b+844fAAAAKZ6+cGHhruARWEuWdq4Pv4UAAAATXL+Fbc9Og9thWEuXd5YiT8GAABAkwhzAAAAc0iYAwAAmFPp0ubvFL4zt7zx2/FHAAAAaBphDgAAYA4JcwAAAHNImAMAAJhDwhwAQMnuWT3//PFG+prxWuc140HDajX5xWGv+3Pj/sJPjwfpP97qJT887ne74/WFx8fuz1zo1/hI+rrC/ldR4Xta7/7ieGXxf4hdqEXWT39sfGThPxX2qeQahj/X8jnZS/7P8VrylNiFqcaD7pPzOfMfJ/P5AZ952hU+czX9hezo4uNic5wkYa5mnYsetesZF//js/e/+CfP3v/CUmrXvhf8xFnPuvgxsQUAYNaGg+QV2fv2Zdlti1l2S8PqPbFuzevmhSwPTtmwl35ptJp+Ml/wf/BYP71mvJ7+wlZv7/OzXucJcUi1GveTH81uWcgm17BoDGVXuB63789GhzpXxy5UbnxDpzNcT76Wvb+mMYb68DOyYT99b3a086jYjamy1cUfysNWlr23gn6G73ejm4039j49NsdJEubqdc7+l+7etf9F413PfGm268KXnH4980ezPBxmZ1/4gjQ2AQDM2lY/+SdhkZqtpZOw1NTKVvNaz/sZ+nokD09H88oD3iTcbHaz0Vr6yVE/uTH/mVeO1zq74/BqMeolvzzpR97Hor6XXeE6jNa64/Gg+yOxC5UaHdr7rjC+or5UUdmRbjZc63x+fCT5vtiFE5INFp47HCTDcH2KPvd0Ksy74aDztfHg5PrENmGuXudc+JJzd+1/wRdCANu1/4WnX894Ufjzq7v2P39vbAIAmLV5CXPfqkLfJwEvhLtbFrLhavq3o7XOdVur6Uuyoxc9LA61MuPB7nNG/c77wh2cov5VUaGtYS+9/c7lpz48dqMSW4PkpaPN7jhbKz8gFdXku8yD+vBQ+rOxCydMmGs2Ya5ewhwAtMCZEOZ2VhZqMx/P5I5dHgoG6XvzBfgrskvPekgcciXGg737h6vdr2SHawo94U5lCHT99N/ELpRuvL7w7cOVzsdCuCrqQxUVHqkd9dLfi104KcJcswlz9RLmAKAFzrQwt7Mmd3luzkPdkYVstJoczgad58ZhV2K4kv6HyftVdT1umY9ruJp+dryx/0mxC6UKG3/U+nhluCM3SP9yvPqMJ8YunBRhrtmEuXoJcwDQAmdymLuvJqEuDyWj9eTro9X0V7KDnV1x+KUKj3SO+slmrQFocier89bYhdLcfeN537s1SP82O1zPXbkQwCZt9ZIfj104acJcswlz9RLmAKAF2hDm7qv7Hr8cDdKbxv0958VLUKr8Ou4Zrnf/LmziUdSHsit8d6ON9J5jveQHYhdKkQfEq0JQLGqzipqE0n7nitj8KRHmmk2Yq5cwBwAt0KYwF2ryrlkIDhvJJ7JD1Tx2Oex1XjnZbbOuTUNCQO2nN5W12ctWv/MPh5vVhKKiChvX5CHsz7JD53137MIpEeaaTZirlzAHAC3QtjB3X00CxHryxa1e5+J4KUqVB7p313VnaxJQQ3jsdS+JzZ+y7I7OrmE/+YO6duY8fmcxOZaHpBfGLpwyYa7ZhLl6CXMA0AJtDXOhQgAaraV/c+yGvc+Ol6M047XkKcO19DPZTTW9c5a3szVIPzle63xn7MIpGfY7/3utm7iEu6QryZti86dFmGs2Ya5ewhwAtECbw1yoybl0g/Tj4xvOL31HyOGhzj8PIStbL2677IqPW/56bP6kjVf3PHHYqzGA3rwYrv1HxoPdj4ldOC3CXLMJc/US5gCgBdoe5kJlt4UQlNyQHTzrofGylCb/3Ctre9xyMw8cq8lX7+119sXmT0oeBN8S+hrO6iv6/DIr9HW0lt49vjH5wdj8aRPmmk2Yq5cwBwAtIMzlC/XwztnNeeDqd/7XeFlKM15fePxwNf2LWg7e7ufjCHfnVtKV2PwJGw/2PCcPQsfCXCj87BJrcr3zfg576aWx+VIIc80mzNVLmAOAFhDmjld4tHC42vl01us8IV6a0ox76UuG691xFSHjgRW+x3CY+Hgt+Sex+amy7Kxvm+yGmQesos8su8I7ecOV9LbxYPc5sQulEOaaTZirlzAHAC0gzG3X5K7WIP3VeGlKNeolv1nb45ZH87DU7/zpib6LloeUnzl+lELx55VZ2eFuNlpPv3zvSrIYmy+NMNds6YH1q/av3JEtXHvbN2r/jX+UJQc2luOPUCJhDgBaQJjbrhA08gX7X1dyd27wrMeM+ukd4UiE8DhkUfulVTxLb9jr/OfY/IMaD/Z9z7Cf3FnHpieTxyvDXbl++gux+VIJc82WHti4dPH3P/CxzvL6N2rx2veHP18Xf4QSCXMA0ALC3P1rcr5aL/138fKUKv/8i4ZrNb2XFoLpavLF8cbep8fmC40G6a9lt+4r/Iyya3Lns5euZwdfXvpGM4EwB9uEOQBogarDXNgZcfL5OytfbH9TrYUq/ow6KzxuODk0u6LAkYeZXw2hpo5z3CZnuPXS34tNf5N7B+nCcLXz1bCzZNHvl1nhPb7hIP3bcX/hvNh86YQ52CbMAUALVB3mhr10POx3vj7sdb4aFsOT6nWO5f/bdg3SUWg/LPgnW+OHCuezVdivB6sQBEZr6b1Zr3tBvESlyg5d8MhhP/3A5A5gQftlVrh2o43ueOvQ3hfH5u9neKjTq2PTk0lQDyG5l/yr2HQlhDnYJswBQAtUGeYmZ4n1ks+P+8kPjnvJ3vGg0xmvL6TjQfc547XkB8ar6fePN/L/3Et+OP/vP5qHvEuG/eT/GK2mV4S7Y1u9zt9nm3moy4NPCARFbVRRk4BT0XtdwXiw75nDjaSeO2I3hzuN6UfG1z35EbH5ifFq8uPZkfC919CHcIfw0N53xaYrI8zBNmEOAFqg0jAX3tvqp3dllz/xkbG5E5Yd7Owab5z/pPFg4RWjQXL9fXfuKt88JK8QgEb95MbYlUrkwfW1k5Ba8eOW39h0pNf9+dh0HiZ3P2Y4SP9kshlLwe+UWeEO62g1+auvX588JTZfGWEOtglzANAClYe5XvqZ8bv3fFds7pTloe6lo430M5NdFysOdJP3u3rJndnRzqNi86ULYXW0khyp5THHw/l4VpPPZ5ud/zG0Pex3XlfHe3uTOTV5Vy55xWTQFRPmYJswBwAtMC9hLhj3kh8YrnW/XPXjiZOFey+9+1hF783dJzx6GnacDGGrqB9l1WQTmvCoYz/5b/m1O3e42vlC+G6KfrbMOr4BS3IgDrdywhxsE+YAoAXmKcwFw17n58PjgVXeVZo8mhjuAK4mPx6brUweDv71ZDwVXP+dFT5/2E+/kn8fHw7vIRb9TJkVNjwZraYfH68vPD4OtXLCHGwT5gCgBeYtzI2ve84jhv3kj6s+5DrcVcrD3L+PzVYmO+usbxv19h6atFfQjzIrhJyq7wKGCu2MNrujrV76kjjMWghzsE2YA4AWmLcwFwx7nX+b3bw4eXywqN0yKrxTNlpN3xCbrFS2uvi04Vr3s5MNXgr6Mm91/JHOzm/E4dVGmINtwhwAtMA8hrnxjZ3dw9X0S6HfRe2WUSEsjgbpVbHJyg17e39qcrZexY9bVl2TnUAHnY+Nbzv/0XFotRHmYJswBwAtMI9hLjt60cPCOXRVbq1/PJQkN8QmazHqJe+o43HLqirMo9FGeu94pfs/xSHVSpiDbcIcALTAPIa5IA9zB6vc1j9s4DFcSY/E5mqRHe08YThI/zK0XdSnJtdk05jwaOpK51ficGonzME2YQ4AWmBew9xkm/1bFip7b24S5vrJLbG52ox73X802uiOqwgkVdbkYPJ++gdhg5o4lNoJc7BNmAOAFpjfMJf++mRL/4J2y6hJmOt1bo7N1Wq00nlbeNyyyg1eyqxw7t9orfuVcT+9MA5hJoQ52CbMAUALzHGYe0PlYW4Gd+aC8VrnO7cG6Z9U+U5gWZWt5nPnlvBIavKLsfszI8zBNmEOAFpgbsPcSvpb4R2tKsPcqJeux+ZqNz7U/ZHhZvfe8N0U9a8pNXlPrp9sZpdfcHbs+swIc7BNmAOAFpjfO3Odd1e6AcpkN8v0v8fmZiJv/9eqHOPpVjiAfLjW+cI9h9I9scszJczBNmEOAFpgHsPc+H1PfsSw1/loOJetqN0yanLOXK+zFJuciexo51HDQfdDk8ct+8X9nFWF+RL6Neynr4rdnTlhDrYJcwDQAvMY5rJe94J80b5VxaL9voqPD74+Njkz497eZ4/W0rvDJiNF/ZxVTa5PL7k+drMRhDnYJswBQAvMY5gbHar2WIJQ2W2Loe//LjY5U8Ne8kuT8a4W97Xuyo4sZMPV9K48aD41drERhDnYJswBQAvMW5gbr3V25wv2v6/yTtXkEcI8sIRrE5udqezoRQ8b9pP3hLPcivpbZ2Vr+VzJr8241/lnsXuNIczBNmEOAFpg3sLcaCVdqTrUTBbuK+k9x1Y6z4rNzty9g3RhuJ5+KVzToj7XVdmt+7LRoc7VsVuNIszBNmEOAFpgXsJcdvDlDx31O28JRwaMK37ccPIYYS/9VHb94uNi840wXNn778PGLFV8VydS8ey9O8c3pv8gdqlRhDnYJswBQAvUEeayXvc7YnMnLTv61IeP19IXjAbJkRAm6ggyx8+YSw7HLjRGlp31kDzQ9mZxXMEkIG12s61B8tLYncYR5mCbMAcALVB5mOund2WXP/GRsblvKdx9yzbPfey4v3DeuJ/85KifvmG4lt4e+ha2wa9rA5Ds1slOlv8ldqtRQpjIQ8XnwhlvRX2vosJGMyFAbq2kb4ndaCRhDrYJcwDQAlWGuXH+maN8AZwHo2vCmW35n8v3q0FyYDRIrxr10t8Ph4AP+8ktw37nE3mIm2zFH0LV8btx5S/OH6zCdRhtdMdbK8mL4iVqnLyfPzXc7I7qui7xsdMPf+5g51GxC40kzME2YQ4AWqDSMJdXuJsWNiyZBLP3PEiFfx4qBLfDeeWL8ar6M62yI91s61DyyXCHMF6ixhn2058d1Rnmbpq8K/eH4/WFb49daCRhDrYJcwDQAlWHuXmrEC5Hg87b4uVpnPFKsjhc73yhzl0tJ49Z5mF71EvfGrvRSMIcbBPmAKAFhLntCtdguNEdjde7z4uXp1GyQxc8ctRPPxAOEC/qf5U1uVsazvZb7b4sdqdxhDnYJswBQAsIc9sVQtKwl7wn7BoZL0+jjPqd35g8rlrTRjAPrPC45dYg/cvx6p4nxi41ijAH24Q5AGgBYe54hfGHsDIedH8iXppGGfbSf3rf+4RF/a+rwqHhx3qda2O3GkWYg23CHAC0gDB3vCZ35frJLUcvvehh8dI0xt037t89Wu9+9njYLO5/XRU2XZlsiHJj55LYvcYQ5mCbMAcALSDMxYX6ejI8dqjz3HhZGiOcvTc8lGyGjVmK+j6LmhxVsJp8bnxjZ3fsZiMIc7BNmAOAFmh7mJscnTA5JDz99XhJGmW0kvyXcNdwVu/JPVhNdv3sp6vZpc15v1CYg23CHAC0QOvDXB7khv3kPWGnyHhJGiMcXD463L03fD9FfZ9l3Xd+4HAl/Q+xuzMnzME2YQ4AWqDNYS7cXRqud/9ifOPC98bL0Rhfu2H/k4aryf8XDlIv6nsTKtsMj1umX7n3hr37Y7dnSpiDbcIcALRAW8Pc5K7SWvcvmxJEHmjUS38/3DUs6nuTahKI+533ja97ziNi12dGmINtwhwAtEDbwtzk8cDbwh255P/N//tCvAyNMlzpvjq7eWE+vpP4zuHWSvorsfszI8zBNmEOAFqgTWEu28zHGTbuWEvXsusXnxYvQaMcO5R+/3Az+Wp2uHnvyT1YTYLOWnJsayX5oTiMmRDmYJswBwAt0IYwNzkbLTwOuJF8dbyWXpo18Cy54IvXLz4uDwwfC7tXFo2jyZXdPNnd8o7x4FmPicOpnTAH24Q5AGiBMzXMZaHyRX0IceHP4SBdOXbD3mfHYTfSaCW9Yh7ekyuqyfUORzwMkt+Kw6mdMAfbhDkAaIEzKcxNAkU+jrAD5ORxytXk2CgPceO1zsVxuI01vLFzSXZT3u/14rHNQ03C82Y32+rt/UdxWLUS5mCbMAcALTDPYe4bd9+O5CHo5sXJDpUhDI3Wux8dDZI35v/sgjjMRhuv7k2G6+nfhXEUjXOeKgTS4Vpy53hj/5Pi8GojzME2YQ4AWqDqMDfZPTKErdOpcMcq3G0LOzzurDy8bfU7w+Fa+hejXro+XE1fd+yGvc8bry98exxe44Ut/cPW/uFOYtH1m8eaPG7ZT6+JQ6yNMAfbhDkAaIFKw1we5Eb9zlYeVj4xHKQfzxf4f36yNeylf5Ev0P9sNEj/aNhL3j/s7T006ie/nQ3S12arnZeP1zrP+vKh8747DmfujHrJGyfvyeXXqvAalliTjWBq2CVz8qhruEN3qPOzcZi1EOZgmzAHAC1QZZgL70/lIeyzWe/p544Hux+THV183ElXr/sd4xvOf3R26VkPiV0+Y2z19/7YaLM7Cte/6PqVWeHx061eck8ejv88fC9FP1NmhTuqW2vJ5+++sbM7DrdywhxsE+YAoAUqDXOH8wVwP70rhLHYHNHd15//tOEgvSvcwSq6dmXWN3aa7CevH692zx+udr5Yyx26sAnNSjLIsrO+LQ67UsIcbBPmAKAFKg9zvfQz43fv+a7YHLns6EUPy4PVal3HEIR3C4er6YfvC9XDXvIfJ0c2VPxo5+R9ybztca/785OBV0yYg23CHAC0gDBXv+FK53V1hKlQk0dd15Ovjw+l3x+bz8PkUx8+HKTvreNw8skcWE2/cu8Ne/fH5isjzME2YQ4AWkCYq9dWv/MPR5vde2p5b201/17z0DhcSf9TbP4bxoPuc0LIC9990e+WWZM+hPB49KKHx+YrIczBNmEOAFpAmKvPeLDve4b99M/DsQpF16vsmryz1k82w2OdsQv3M1rZ+/rwM0W/W2ZNHrcMfeklvxybroQwB9uEOQBoAWGuPqNe+nu1vSd3ZHJ49+fHaw++m+R48KzHDFc6H6sjXE7C0Eb33vw/XxSbL50wB9uEOQBoAWGuHsOV9N9MDjqv4Do/sMIxBJNz3nrdS2LzD2q8krxotJnmAaj4s8qs7ObFbNhP7sg2L3hsbL5UwhxsE+YAoAWEueqN++mFw43ul8P1KLpOZdfkGIJe8o7Y/FSjQ8nlddwx/MYRCSvpW2LTpaojzGWb3XNjc9Boj3ruT3zPrv0v+jthDgDOYMJctcJxAMNB+pHJFv394utUZmVHF/LQkf75eH3h8bELU41vTP/BsJ98opYz7/KgNVrvjsernZfF5kszCXOreZgLm8uE+VxiTebyWh7mPtB5QmwOTso5z3jBC8+54MWvOucZL3xl5XXhC/9lHrx+adfi878WQ9jplzAHAM0jzFVr1Ou8rbb35PLvcbSRDrdWkhfF5k9Yttp9eXjPrpbHLfPAOeond45X9zwxNl+KbHPhuVvv7AzHS3uyrStKrvwz7/2dPcN7/tt5N9/7f+8e1FJvevra8HfO742PdM+PQ2SOnb3vhWu7nv2ybNeF/3M9dcGLvzmQnU4JcwDQPMJcdYYrnX+RHcmvbQ0BKVR8hPENsfmTVusGLaGv/fSa2HQp8pD43GNX7BmO33RedqzseuPxP7O37smy366x3tnJjt2y/3lxiMyxh+1//vWTkFUUlOahhDkAaB5hrhrj1e75o7X0b8LdrqJrU3aFxziHg84Hs0NPfGTswknLVhefNlxNPh8CaFEbZVaYb5PHOlc6PxObP22TMLeUh7nL8uB1BtQor/EVe7JjNy3+YBwic0yYAwBKJ8yVbzzYfc5wkNxSxxluocI7YqP19Mtho5XYhVOWf1//W227bobjE1aTv8l65WwqIszRZMIcAFA6Ya58o5Vkchh3OCy76LqUWZMDufPwNbyh8wux+dOSZWc9ZNRL12sLouEw8ZVkkGWXPiR24ZQJczSZMAcAlE6YK9d4NX3JcKM7Cte06JqUWZOt/kMY6nd62cGzHhq7cNrGKwvpaKP7pcmukA9os+yahNHwiOhK8urY/CkT5mgyYQ4AKJ0wV57x9clThqudT+ehovB6lF3hMcXRoPPX4V232IXSjFfS10yOU6jj7mI+T0Yb6ZfuPdR9Rmz+lAhzNJkwBwCUTpgrR7gzNurtPVTbbpDr+XcWNirpdf5Z7EKpJu/99ZL3TwJdQftlV3bLQjbsd943vu45j4hdOGnCHE0mzAEApRPmyjFc6bwmBJI63pMLFULj1kpyIDZfifFq+v2jje49tT4y2kt+OTZ/0oQ5mkyYAwBKJ8ydvmM3dJ83XM9DTw3vmIWabHgy6Pzp+N3PrPy6jnqdX6vtbmM+D0eb3XuO9bqndK6aMEeTCXMAQOmEudOTHTrvu4f97p+GgFV0DcquSeBZS45t9ZIfjl2oVHbwgscO++kdtbwH2I9BtZe3t3nuY2MXTpgwR5MJcwBA6YS50zMapG+v685VqNDWqN/5r7H5Wmzd2Ll4skPnek13HsMYVzpvic2fMGGOJhPmAIDSCXOnLut1XxnuWFVx7YoqvFM27KfvHQ8uPid2oTajQfI7tT1uuZ5mo/XueLzSfVls/oQIczSZMAcAlE6YOzX39jr7Rmvpl7LDNT1emV/L0Vrni+N+txu7UKus13nCaDX9ZHZTTePN29laS+786rv2PDF2YSphjiYT5gCA0glzJy872nnUcHXv7WH3yqJxl13huwl3AIeHkp+LXZiJ4UryinC2XW13Im9dzI6tJNfE5qcS5mgyYQ4AKJ0wd/JGveQ3a31PLmzZ30/flZ111rfFLszMqN89GMYejhIo6muZNQmxN+XXuZ/8dGz+WxLmaDJhDgAonTB3cvLx/NPRZndc22Yg4Y5cP71rPOg+OXZhprJe99zRIPlcuENX1N+yK7SzNUj+ZjxIvi924UEJczSZMAcAlE6YO3HjGzu7h/08yNT13lgIjOHsul7y47ELjTBcSf51dvNifQekhzuTg2SQHXz5Q2MXCglzNJkwBwCUTpg7MdnBzq7RID0SgkXRWKuoyRb9vc5bYxcaIzt60cNG/WSzrmsRQmN2y2KWh8hXxy4UEuZoMmEOACjdsJ/8ZFiUh8Oawx2nUuu2fAHeS/4+HKwdm5tL4V210SB5U3b7/sljj4VjLbvel1+71eRj2fWLj4vdaJQ8ZC2M1pKvTd6fK+p/2RXm0kY6PDZYeG7swjcZ37TvouzqvVn2m+dn2W+dARXG8fa92bEj+58Xh8gcO3v/8zd2Pftl2STQzWM98yWTQHf2wgvSOCQAYNbGg70/MlrvfHQ0SP9o2C+3Ruvdj456yeFs84LHxubm0r15cBkO0o+E8RSNs+warebfx2b3g+N+0ug7MsNB8urRTQu1XJNQoyPdPxn10rdmH7rg7NiF+8mOLu7bWjrvz7beuPsz9775vL+a9zr2ht2f2bp8z533Htm3GIfIHNv1jOf/57MvfPHa2YsvWJ3LesaLVsPdxYdf+MKnxCEBALMWHpkb33D+o8N2+2VX+Nzx+sK3Z9nsd2E8HZPx9LrfkR385jFWUZPrdt2THxGbb7TxFdXMnaKaXJe1zndmB88qfHcun2cPGf/mnu/62q+d/6Sv/sqeJ857hXF85Q3nPj6MKw4RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4BScddb/D6uVi1GiXIF5AAAAAElFTkSuQmCC\",\n preserveAspectRatio: \"none\",\n id: \"img1\"\n }), /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip2\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M526709 790334 4267091 790334 4267091 2204728 526709 2204728Z\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n })))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-1203 -261)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0)\",\n transform: \"matrix(0.000164028 0 0 0.000164028 1203 261)\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip2)\",\n transform: \"matrix(1.00077 0 0 1 -527115 -790334)\"\n }, /*#__PURE__*/React.createElement(\"use\", {\n width: \"100%\",\n height: \"100%\",\n xlinkHref: \"#img1\",\n transform: \"scale(6098.55 6098.55)\"\n }))))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgLogo);\nexport default __webpack_public_path__ + \"static/media/logo.df762280ad8392aa393b30d456263d39.svg\";\nexport { ForwardRef as ReactComponent };","import { useTheme } from \"@mui/material/styles\";\r\nimport logoWhite from \"assets/images/logo.svg\";\r\n\r\nconst Logo = () => {\r\n const theme = useTheme();\r\n return \"eventpxl\";\r\n};\r\n\r\nexport default Logo;\r\n","import {\n Box,\n LinearProgress,\n Stack,\n Typography,\n linearProgressClasses,\n} from \"@mui/material\";\nimport { styled, useTheme } from \"@mui/material/styles\";\nimport PropTypes from \"prop-types\";\nimport { FormattedMessage } from \"react-intl\";\nimport { useSelector } from \"react-redux\";\n\nconst BorderLinearProgress = styled(LinearProgress)(({ theme }) => ({\n height: 10,\n borderRadius: 30,\n [`&.${linearProgressClasses.colorPrimary}`]: {\n backgroundColor:\n theme.palette.mode === \"dark\" ? theme.palette.dark.light : \"#fff\",\n },\n [`& .${linearProgressClasses.bar}`]: {\n borderRadius: 5,\n backgroundColor: theme.palette.secondary.dark,\n },\n}));\n\nexport function RemainingCredits({ displayDetail = false }) {\n const theme = useTheme();\n\n const { data, isLoading } = useSelector(\n (state) => state.dashboard.photograph\n );\n\n if (isLoading) {\n return null;\n }\n\n if (!data) {\n return null;\n }\n const percent = Math.min(\n Math.round((data.nb_imported_photos / data.total_limit) * 100),\n 100\n );\n\n const remaining = data.total_limit - data.nb_imported_photos;\n\n return (\n \n \n \n \n \n \n \n \n \n {displayDetail && (\n \n \n \n )}\n \n {!displayDetail && (\n \n \n \n )}\n\n \n \n );\n}\n\nRemainingCredits.propTypes = {\n displayDetail: PropTypes.bool,\n};\n\nexport default RemainingCredits;\n","import PropTypes from \"prop-types\";\r\nimport React from \"react\";\r\n\r\n// material-ui\r\nimport {\r\n Card,\r\n CardContent,\r\n CardHeader,\r\n Divider,\r\n Typography,\r\n} from \"@mui/material\";\r\nimport { useTheme } from \"@mui/material/styles\";\r\n\r\n// constant\r\nconst headerSX = {\r\n \"& .MuiCardHeader-action\": { mr: 0 },\r\n padding: 2,\r\n};\r\n\r\n// ==============================|| CUSTOM MAIN CARD ||============================== //\r\n\r\nconst MainCard = React.forwardRef(\r\n (\r\n {\r\n border = true,\r\n boxShadow,\r\n children,\r\n content = true,\r\n contentClass = \"\",\r\n contentSX = {},\r\n darkTitle,\r\n secondary,\r\n shadow,\r\n sx = {},\r\n title,\r\n ...others\r\n },\r\n ref\r\n ) => {\r\n const theme = useTheme();\r\n\r\n return (\r\n \r\n {/* card header and action */}\r\n {!darkTitle && title && (\r\n \r\n )}\r\n {darkTitle && title && (\r\n {title}}\r\n action={secondary}\r\n />\r\n )}\r\n\r\n {/* content & header divider */}\r\n {title && }\r\n\r\n {/* card content */}\r\n {content && (\r\n \r\n {children}\r\n \r\n )}\r\n {!content && children}\r\n \r\n );\r\n }\r\n);\r\n\r\nMainCard.propTypes = {\r\n border: PropTypes.bool,\r\n boxShadow: PropTypes.bool,\r\n children: PropTypes.node,\r\n content: PropTypes.bool,\r\n contentClass: PropTypes.string,\r\n contentSX: PropTypes.object,\r\n darkTitle: PropTypes.bool,\r\n secondary: PropTypes.oneOfType([\r\n PropTypes.node,\r\n PropTypes.string,\r\n PropTypes.object,\r\n ]),\r\n shadow: PropTypes.string,\r\n sx: PropTypes.object,\r\n title: PropTypes.oneOfType([\r\n PropTypes.node,\r\n PropTypes.string,\r\n PropTypes.object,\r\n ]),\r\n};\r\n\r\nexport default MainCard;\r\n","import PropTypes from 'prop-types';\r\n\r\nimport React from 'react';\r\n\r\n// material-ui\r\nimport { useTheme } from '@mui/material/styles';\r\nimport { Card, CardContent, CardHeader, Divider, Typography } from '@mui/material';\r\n\r\n// ==============================|| CUSTOM SUB CARD ||============================== //\r\n\r\nconst SubCard = React.forwardRef(\r\n ({ children, content, contentClass, darkTitle, secondary, sx = {}, contentSX = {}, title, ...others }, ref) => {\r\n const theme = useTheme();\r\n\r\n return (\r\n \r\n {/* card header and action */}\r\n {!darkTitle && title && (\r\n {title}} action={secondary} />\r\n )}\r\n {darkTitle && title && (\r\n {title}} action={secondary} />\r\n )}\r\n\r\n {/* content & header divider */}\r\n {title && (\r\n \r\n )}\r\n\r\n {/* card content */}\r\n {content && (\r\n \r\n {children}\r\n \r\n )}\r\n {!content && children}\r\n \r\n );\r\n }\r\n);\r\n\r\nSubCard.propTypes = {\r\n children: PropTypes.node,\r\n content: PropTypes.bool,\r\n contentClass: PropTypes.string,\r\n darkTitle: PropTypes.bool,\r\n secondary: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]),\r\n sx: PropTypes.object,\r\n contentSX: PropTypes.object,\r\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object])\r\n};\r\n\r\nSubCard.defaultProps = {\r\n content: true\r\n};\r\n\r\nexport default SubCard;\r\n","import { __read } from 'tslib';\nimport { useRef, useState } from 'react';\nimport { wrap } from 'popmotion';\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * @library\n *\n * ```jsx\n * import * as React from \"react\"\n * import { Frame, useCycle } from \"framer\"\n *\n * export function MyComponent() {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @motion\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nfunction useCycle() {\n var items = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n items[_i] = arguments[_i];\n }\n var index = useRef(0);\n var _a = __read(useState(items[index.current]), 2), item = _a[0], setItem = _a[1];\n return [\n item,\n function (next) {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next;\n setItem(items[index.current]);\n },\n ];\n}\n\nexport { useCycle };\n","var wrap = function (min, max, v) {\n var rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\n\r\n// third-party\r\nimport { motion, useCycle } from 'framer-motion';\r\n\r\n// ==============================|| ANIMATION BUTTON ||============================== //\r\n\r\nconst AnimateButton = React.forwardRef(({ children, type, direction, offset, scale }, ref) => {\r\n let offset1;\r\n let offset2;\r\n switch (direction) {\r\n case 'up':\r\n case 'left':\r\n offset1 = offset;\r\n offset2 = 0;\r\n break;\r\n case 'right':\r\n case 'down':\r\n default:\r\n offset1 = 0;\r\n offset2 = offset;\r\n break;\r\n }\r\n\r\n const [x, cycleX] = useCycle(offset1, offset2);\r\n const [y, cycleY] = useCycle(offset1, offset2);\r\n\r\n switch (type) {\r\n case 'rotate':\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n case 'slide':\r\n if (direction === 'up' || direction === 'down') {\r\n return (\r\n cycleY()}\r\n onHoverStart={() => cycleY()}\r\n >\r\n {children}\r\n \r\n );\r\n }\r\n return (\r\n cycleX()} onHoverStart={() => cycleX()}>\r\n {children}\r\n \r\n );\r\n\r\n case 'scale':\r\n default:\r\n if (typeof scale === 'number') {\r\n scale = {\r\n hover: scale,\r\n tap: scale\r\n };\r\n }\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n});\r\n\r\nAnimateButton.propTypes = {\r\n children: PropTypes.node,\r\n offset: PropTypes.number,\r\n type: PropTypes.oneOf(['slide', 'scale', 'rotate']),\r\n direction: PropTypes.oneOf(['up', 'down', 'left', 'right']),\r\n scale: PropTypes.oneOfType([PropTypes.number, PropTypes.object])\r\n};\r\n\r\nAnimateButton.defaultProps = {\r\n type: 'scale',\r\n offset: 10,\r\n direction: 'right',\r\n scale: {\r\n hover: 1,\r\n tap: 0.9\r\n }\r\n};\r\n\r\nexport default AnimateButton;\r\n","import PropTypes from \"prop-types\";\r\n\r\n// material-ui\r\nimport MuiAvatar from \"@mui/material/Avatar\";\r\nimport { useTheme } from \"@mui/material/styles\";\r\n\r\n// ==============================|| AVATAR ||============================== //\r\n\r\nconst Avatar = ({ color, outline, size, sx, off = false, ...others }) => {\r\n const theme = useTheme();\r\n\r\n const colorSX = color &&\r\n !outline && {\r\n color: theme.palette.background.paper,\r\n bgcolor: `${color}.main`,\r\n };\r\n const outlineSX = outline && {\r\n color: color ? `${color}.main` : `primary.main`,\r\n bgcolor: theme.palette.background.paper,\r\n border: \"2px solid\",\r\n borderColor: color ? `${color}.main` : `primary.main`,\r\n };\r\n let sizeSX = {};\r\n switch (size) {\r\n case \"badge\":\r\n sizeSX = {\r\n width: theme.spacing(3.5),\r\n height: theme.spacing(3.5),\r\n };\r\n break;\r\n case \"xs\":\r\n sizeSX = {\r\n width: theme.spacing(4.25),\r\n height: theme.spacing(4.25),\r\n };\r\n break;\r\n case \"sm\":\r\n sizeSX = {\r\n width: theme.spacing(5),\r\n height: theme.spacing(5),\r\n };\r\n break;\r\n case \"lg\":\r\n sizeSX = {\r\n width: theme.spacing(9),\r\n height: theme.spacing(9),\r\n };\r\n break;\r\n case \"xl\":\r\n sizeSX = {\r\n width: theme.spacing(10.25),\r\n height: theme.spacing(10.25),\r\n };\r\n break;\r\n case \"md\":\r\n sizeSX = {\r\n width: theme.spacing(7.5),\r\n height: theme.spacing(7.5),\r\n };\r\n break;\r\n default:\r\n sizeSX = {};\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nAvatar.propTypes = {\r\n color: PropTypes.string,\r\n outline: PropTypes.bool,\r\n size: PropTypes.string,\r\n sx: PropTypes.object,\r\n};\r\n\r\nexport default Avatar;\r\n","import PropTypes from 'prop-types';\r\n\r\n// material-ui\r\nimport { useTheme } from '@mui/material/styles';\r\nimport MuiChip from '@mui/material/Chip';\r\n\r\n// ==============================|| CHIP ||============================== //\r\n\r\nconst Chip = ({ chipcolor, disabled, sx = {}, variant, ...others }) => {\r\n const theme = useTheme();\r\n\r\n let defaultSX = {\r\n color: theme.palette.mode === 'dark' ? theme.palette.primary.light : theme.palette.primary.main,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.primary.main : theme.palette.primary.light,\r\n ':hover': {\r\n color: theme.palette.primary.light,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.primary.dark + 90 : theme.palette.primary.dark\r\n }\r\n };\r\n\r\n let outlineSX = {\r\n color: theme.palette.primary.main,\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.primary.main,\r\n ':hover': {\r\n color: theme.palette.mode === 'dark' ? theme.palette.primary.light : theme.palette.primary.light,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.primary.main : theme.palette.primary.dark\r\n }\r\n };\r\n\r\n switch (chipcolor) {\r\n case 'secondary':\r\n if (variant === 'outlined')\r\n outlineSX = {\r\n color: theme.palette.secondary.main,\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.secondary.main,\r\n ':hover': {\r\n color: theme.palette.mode === 'dark' ? theme.palette.secondary.light : theme.palette.secondary.main,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.secondary.dark : theme.palette.secondary.light\r\n }\r\n };\r\n else\r\n defaultSX = {\r\n color: theme.palette.mode === 'dark' ? theme.palette.secondary.light : theme.palette.secondary.main,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.secondary.dark : theme.palette.secondary.light,\r\n ':hover': {\r\n color: theme.palette.secondary.light,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.secondary.dark + 90 : theme.palette.secondary.main\r\n }\r\n };\r\n break;\r\n case 'success':\r\n if (variant === 'outlined')\r\n outlineSX = {\r\n color: theme.palette.success.dark,\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.success.dark,\r\n ':hover': {\r\n color: theme.palette.mode === 'dark' ? theme.palette.success.light : theme.palette.success.dark,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.success.dark : theme.palette.success.light + 60\r\n }\r\n };\r\n else\r\n defaultSX = {\r\n color: theme.palette.mode === 'dark' ? theme.palette.success.light : theme.palette.success.dark,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.success.dark : theme.palette.success.light + 60,\r\n ':hover': {\r\n color: theme.palette.success.light,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.success.dark + 90 : theme.palette.success.dark\r\n }\r\n };\r\n break;\r\n case 'error':\r\n if (variant === 'outlined')\r\n outlineSX = {\r\n color: theme.palette.error.main,\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.error.main,\r\n ':hover': {\r\n color: theme.palette.mode === 'dark' ? theme.palette.error.light : theme.palette.error.dark,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.error.dark : theme.palette.error.light\r\n }\r\n };\r\n else\r\n defaultSX = {\r\n color: theme.palette.mode === 'dark' ? theme.palette.error.light : theme.palette.error.dark,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.error.dark : theme.palette.error.light + 60,\r\n ':hover': {\r\n color: theme.palette.error.light,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.error.dark + 90 : theme.palette.error.dark\r\n }\r\n };\r\n break;\r\n case 'orange':\r\n if (variant === 'outlined')\r\n outlineSX = {\r\n color: theme.palette.orange?.dark,\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.orange?.main,\r\n ':hover': {\r\n color: theme.palette.orange?.dark,\r\n bgcolor: theme.palette.orange?.light\r\n }\r\n };\r\n else\r\n defaultSX = {\r\n color: theme.palette.orange?.dark,\r\n bgcolor: theme.palette.orange?.light,\r\n ':hover': {\r\n color: theme.palette.orange?.light,\r\n bgcolor: theme.palette.orange?.dark\r\n }\r\n };\r\n break;\r\n case 'warning':\r\n if (variant === 'outlined')\r\n outlineSX = {\r\n color: theme.palette.warning.dark,\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.warning.dark,\r\n ':hover': {\r\n color: theme.palette.warning.dark,\r\n bgcolor: theme.palette.warning.light\r\n }\r\n };\r\n else\r\n defaultSX = {\r\n color: theme.palette.warning.dark,\r\n bgcolor: theme.palette.warning.light,\r\n ':hover': {\r\n color: theme.palette.warning.light,\r\n bgcolor: theme.palette.mode === 'dark' ? theme.palette.warning.dark + 90 : theme.palette.warning.dark\r\n }\r\n };\r\n break;\r\n default:\r\n }\r\n\r\n if (disabled) {\r\n if (variant === 'outlined')\r\n outlineSX = {\r\n color: theme.palette.grey[500],\r\n bgcolor: 'transparent',\r\n border: '1px solid',\r\n borderColor: theme.palette.grey[500],\r\n ':hover': {\r\n color: theme.palette.grey[500],\r\n bgcolor: 'transparent'\r\n }\r\n };\r\n else\r\n defaultSX = {\r\n color: theme.palette.grey[500],\r\n bgcolor: theme.palette.grey[50],\r\n ':hover': {\r\n color: theme.palette.grey[500],\r\n bgcolor: theme.palette.grey[50]\r\n }\r\n };\r\n }\r\n\r\n let SX = defaultSX;\r\n if (variant === 'outlined') {\r\n SX = outlineSX;\r\n }\r\n SX = { ...SX, ...sx };\r\n return ;\r\n};\r\n\r\nChip.propTypes = {\r\n sx: PropTypes.object,\r\n chipcolor: PropTypes.string,\r\n variant: PropTypes.string,\r\n disabled: PropTypes.bool\r\n};\r\n\r\nexport default Chip;\r\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\n\r\n// material-ui\r\nimport { Collapse, Fade, Box, Grow, Slide, Zoom } from '@mui/material';\r\n\r\n// ==============================|| TRANSITIONS ||============================== //\r\n\r\nconst Transitions = React.forwardRef(({ children, position, type, direction, ...others }, ref) => {\r\n let positionSX = {\r\n transformOrigin: '0 0 0'\r\n };\r\n\r\n switch (position) {\r\n case 'top-right':\r\n positionSX = {\r\n transformOrigin: 'top right'\r\n };\r\n break;\r\n case 'top':\r\n positionSX = {\r\n transformOrigin: 'top'\r\n };\r\n break;\r\n case 'bottom-left':\r\n positionSX = {\r\n transformOrigin: 'bottom left'\r\n };\r\n break;\r\n case 'bottom-right':\r\n positionSX = {\r\n transformOrigin: 'bottom right'\r\n };\r\n break;\r\n case 'bottom':\r\n positionSX = {\r\n transformOrigin: 'bottom'\r\n };\r\n break;\r\n case 'top-left':\r\n default:\r\n positionSX = {\r\n transformOrigin: '0 0 0'\r\n };\r\n break;\r\n }\r\n\r\n return (\r\n \r\n {type === 'grow' && (\r\n \r\n {children}\r\n \r\n )}\r\n {type === 'collapse' && (\r\n \r\n {children}\r\n \r\n )}\r\n {type === 'fade' && (\r\n \r\n {children}\r\n \r\n )}\r\n {type === 'slide' && (\r\n \r\n {children}\r\n \r\n )}\r\n {type === 'zoom' && (\r\n \r\n {children}\r\n \r\n )}\r\n \r\n );\r\n});\r\n\r\nTransitions.propTypes = {\r\n children: PropTypes.node,\r\n type: PropTypes.oneOf(['grow', 'fade', 'collapse', 'slide', 'zoom']),\r\n position: PropTypes.oneOf(['top-left', 'top-right', 'top', 'bottom-left', 'bottom-right', 'bottom']),\r\n direction: PropTypes.oneOf(['up', 'down', 'left', 'right'])\r\n};\r\n\r\nTransitions.defaultProps = {\r\n type: 'grow',\r\n position: 'top-left',\r\n direction: 'up'\r\n};\r\n\r\nexport default Transitions;\r\n","/**\r\n * axios setup to use mock service\r\n */\r\n\r\nimport { Auth } from \"@aws-amplify/auth\";\r\nimport axios from \"axios\";\r\n\r\nconst axiosServices = axios.create({\r\n baseURL: process.env.REACT_APP_BASE_API_URL,\r\n});\r\n\r\naxiosServices.interceptors.request.use(\r\n async (request) => {\r\n try {\r\n const connectedUser = await Auth.currentAuthenticatedUser();\r\n if (connectedUser && connectedUser.signInUserSession) {\r\n const token = connectedUser.signInUserSession.idToken.jwtToken;\r\n request.headers.Authorization = `Bearer ${token}`;\r\n }\r\n return request;\r\n } catch (err) {\r\n return request;\r\n }\r\n },\r\n (error) => Promise.reject(error.response && error.response.data)\r\n);\r\n\r\nexport default axiosServices;\r\n","export const fromIsoDateToLocaleDate = (date, locale = \"fr\") => {\n const d = new Date(date);\n return d\n ? `${d.toLocaleDateString(locale)} ${d.toLocaleTimeString(locale)}`\n : \"\";\n};\n\nexport const fromIsoDateToLocaleOnlyDate = (date, locale = \"fr\") => {\n const d = new Date(date);\n return d ? `${d.toLocaleDateString(locale)}` : \"\";\n};\n","import { FormattedMessage } from \"react-intl\";\nimport { openSnackbar } from \"store/slices/snackbar\";\n\nexport const getErrorCode = (err) => {\n if (err.response && err.response.data && err.response.data.code) {\n return err.response.data.code;\n }\n return \"Exceptions::default\";\n};\n\nexport const openSnackbarWithSuccess = (message, dispatch) => {\n dispatch(\n openSnackbar({\n open: true,\n message: ,\n variant: \"alert\",\n alert: {\n color: \"success\",\n },\n close: true,\n })\n );\n};\n\nexport const openSnackbarWithError = (\n error,\n dispatch,\n isPlainTextError = false\n) => {\n console.error(error);\n\n const errorCode = getErrorCode(error);\n dispatch(\n openSnackbar({\n open: true,\n message: isPlainTextError ? (\n error\n ) : (\n \n ),\n variant: \"alert\",\n alert: {\n color: \"error\",\n },\n close: false,\n })\n );\n};\n","export const inIframe = () => {\n try {\n return window.self !== window.top;\n } catch (e) {\n return false;\n }\n}\n\nexport const getWidgetAlbumUrl = (photographId, albumId) => {\n return `${process.env.REACT_APP_PUBLIC_URL}/photographs/${photographId}/albums/${albumId}`\n}\n","import * as Yup from 'yup';\n\nexport const passwordValidator = () => {\n return Yup.string().max(99).required('Requis').matches(\n /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\\^$*.\\[\\]{}\\(\\)?\\-\"!@#%&\\/,><\\':;|_~`])\\S{8,99}$/,\n \"Doit contenir 8 caractères, une majuscule, une minuscule, un nombre et un caractère spécial.\"\n )\n}","import { Chip } from \"@mui/material\";\nimport PropTypes from \"prop-types\";\nimport { useIntl } from \"react-intl\";\nimport { ALBUM_ACCESSIBILITY } from \"./album-utils\";\n\nconst AlbumAccessibility = ({ album }) => {\n const intl = useIntl();\n\n return (\n \n );\n};\n\nAlbumAccessibility.propTypes = {\n album: PropTypes.object.isRequired,\n};\n\nexport default AlbumAccessibility;\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('clock', 'IconClock', [\n ['path', { d: 'M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0', key: 'svg-0' }],\n ['path', { d: 'M12 7v5l3 3', key: 'svg-1' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('checks', 'IconChecks', [\n ['path', { d: 'M7 12l5 5l10 -10', key: 'svg-0' }],\n ['path', { d: 'M2 12l5 5m5 -5l5 -5', key: 'svg-1' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('user-exclamation', 'IconUserExclamation', [\n ['path', { d: 'M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0', key: 'svg-0' }],\n [\n 'path',\n {\n d: 'M6 21v-2a4 4 0 0 1 4 -4h4c.348 0 .686 .045 1.008 .128',\n key: 'svg-1',\n },\n ],\n ['path', { d: 'M19 16v3', key: 'svg-2' }],\n ['path', { d: 'M19 22v.01', key: 'svg-3' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('bike', 'IconBike', [\n ['path', { d: 'M5 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0', key: 'svg-0' }],\n ['path', { d: 'M19 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0', key: 'svg-1' }],\n ['path', { d: 'M12 19l0 -4l-3 -3l5 -4l2 3l3 0', key: 'svg-2' }],\n ['path', { d: 'M17 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0', key: 'svg-3' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('motorbike', 'IconMotorbike', [\n ['path', { d: 'M5 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0', key: 'svg-0' }],\n ['path', { d: 'M19 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0', key: 'svg-1' }],\n ['path', { d: 'M7.5 14h5l4 -4h-10.5m1.5 4l4 -4', key: 'svg-2' }],\n ['path', { d: 'M13 6h2l1.5 3l2 4', key: 'svg-3' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('car', 'IconCar', [\n ['path', { d: 'M7 17m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0', key: 'svg-0' }],\n ['path', { d: 'M17 17m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0', key: 'svg-1' }],\n [\n 'path',\n {\n d: 'M5 17h-2v-6l2 -5h9l4 5h1a2 2 0 0 1 2 2v4h-2m-4 0h-6m-6 -6h15m-6 0v-5',\n key: 'svg-2',\n },\n ],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('face-id', 'IconFaceId', [\n ['path', { d: 'M4 8v-2a2 2 0 0 1 2 -2h2', key: 'svg-0' }],\n ['path', { d: 'M4 16v2a2 2 0 0 0 2 2h2', key: 'svg-1' }],\n ['path', { d: 'M16 4h2a2 2 0 0 1 2 2v2', key: 'svg-2' }],\n ['path', { d: 'M16 20h2a2 2 0 0 0 2 -2v-2', key: 'svg-3' }],\n ['path', { d: 'M9 10l.01 0', key: 'svg-4' }],\n ['path', { d: 'M15 10l.01 0', key: 'svg-5' }],\n ['path', { d: 'M9.5 15a3.5 3.5 0 0 0 5 0', key: 'svg-6' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('sailboat', 'IconSailboat', [\n [\n 'path',\n {\n d: 'M2 20a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1',\n key: 'svg-0',\n },\n ],\n ['path', { d: 'M4 18l-1 -3h18l-1 3', key: 'svg-1' }],\n ['path', { d: 'M11 12h7l-7 -9v9', key: 'svg-2' }],\n ['path', { d: 'M8 7l-2 5', key: 'svg-3' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('id-off', 'IconIdOff', [\n [\n 'path',\n {\n d: 'M8 4h10a3 3 0 0 1 3 3v10m-1.437 2.561c-.455 .279 -.99 .439 -1.563 .439h-12a3 3 0 0 1 -3 -3v-10c0 -1.083 .573 -2.031 1.433 -2.559',\n key: 'svg-0',\n },\n ],\n ['path', { d: 'M8.175 8.178a2 2 0 1 0 2.646 2.65', key: 'svg-1' }],\n ['path', { d: 'M15 8h2', key: 'svg-2' }],\n ['path', { d: 'M16 12h1', key: 'svg-3' }],\n ['path', { d: 'M7 16h9', key: 'svg-4' }],\n ['path', { d: 'M3 3l18 18', key: 'svg-5' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('lock', 'IconLock', [\n [\n 'path',\n {\n d: 'M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z',\n key: 'svg-0',\n },\n ],\n ['path', { d: 'M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0', key: 'svg-1' }],\n ['path', { d: 'M8 11v-4a4 4 0 1 1 8 0v4', key: 'svg-2' }],\n]);\n","import createReactComponent from '../createReactComponent';\nexport default createReactComponent('link-off', 'IconLinkOff', [\n ['path', { d: 'M9 15l3 -3m2 -2l1 -1', key: 'svg-0' }],\n [\n 'path',\n { d: 'M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464', key: 'svg-1' },\n ],\n ['path', { d: 'M3 3l18 18', key: 'svg-2' }],\n [\n 'path',\n {\n d: 'M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463',\n key: 'svg-3',\n },\n ],\n]);\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import { Stack, Tooltip, Typography } from \"@mui/material\";\nimport {\n IconAlertTriangle,\n IconBike,\n IconCar,\n IconChecks,\n IconClock,\n IconFaceId,\n IconIdOff,\n IconLinkOff,\n IconLock,\n IconLockOpen,\n IconMotorbike,\n IconRun,\n IconSailboat,\n IconSubscript,\n IconUserCheck,\n IconUserExclamation,\n IconUserStar,\n} from \"@tabler/icons-react\";\nimport _ from \"lodash\";\nimport { FormattedMessage } from \"react-intl\";\nimport Chip from \"ui-component/extended/Chip\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport {\n findCorrespondingUnitPrice,\n fromBackToFrontPackage,\n fromFrontToBackPackage,\n} from \"views/packages/utils\";\n\nexport const formatBytes = (size_in_bytes, decimals = 2) => {\n if (size_in_bytes === 0) return \"0\";\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = [\"Octets\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(size_in_bytes) / Math.log(k));\n return (\n parseFloat((size_in_bytes / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i]\n );\n};\n\nexport const resolveImageURI = (photoKey) => {\n return `${process.env.REACT_APP_CLOUDFRONT_URL}/minified/${photoKey}`;\n};\n\nexport const bibFromSuperAthlete = (superAthlete) => {\n if (superAthlete.first_name) {\n return `${superAthlete.first_name[0]}.${superAthlete.last_name}`;\n }\n return superAthlete.last_name;\n};\n\nconst GENDER = {\n Male: \"Homme\",\n Female: \"Femme\",\n};\n\nconst AWS_STATUS = {\n all: {\n text: ,\n chip: (\n }\n />\n ),\n miniChip: (\n \n ),\n },\n presigned: {\n text: ,\n chip: (\n }\n label={}\n />\n ),\n miniChip: ,\n },\n errored: {\n text: ,\n chip: (\n }\n label={}\n />\n ),\n miniChip: ,\n },\n analyzed: {\n text: ,\n chip: (\n }\n size={\"small\"}\n label={}\n />\n ),\n miniChip: ,\n },\n};\n\nconst IDENTIFICATION_STATUS = {\n NO_ONE: {\n text: ,\n chip: (\n }\n label={}\n />\n ),\n },\n INCORRECT: {\n text: ,\n chip: (\n }\n label={}\n />\n ),\n },\n CORRECT: {\n text: ,\n chip: (\n }\n size={\"small\"}\n chipcolor={\"success\"}\n label={}\n />\n ),\n },\n};\n\nconst ALGO_SPORT = {\n running: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n bmx: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n motorcycle: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n car: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n without_bibs: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n super_athletes: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n boat: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n no_rekognition: {\n description: (\n \n ),\n title: ,\n icon: ,\n },\n};\n\nexport const ALBUM_ACCESSIBILITY = {\n opened: {\n icon: ,\n short: ,\n description: ,\n color: \"success\",\n },\n closed: {\n icon: ,\n short: ,\n description: ,\n color: \"error\",\n },\n subscription: {\n icon: ,\n short: ,\n description: (\n \n ),\n color: \"warning\",\n },\n not_indexed: {\n icon: ,\n short: ,\n description: (\n \n ),\n color: \"info\",\n },\n selfie_only: {\n icon: ,\n short: ,\n description: (\n \n ),\n color: \"info\",\n },\n};\n\nexport const algoSportIcon = (sportAlgo) => {\n if (Object.keys(ALGO_SPORT).includes(sportAlgo.toLowerCase())) {\n return ALGO_SPORT[sportAlgo].icon;\n }\n return \"\";\n};\n\nexport const algoSportChip = (sportAlgo) => {\n if (Object.keys(ALGO_SPORT).includes(sportAlgo.toLowerCase())) {\n const algoSport = ALGO_SPORT[sportAlgo.toLowerCase()];\n const uuid = uuidv4();\n\n return (\n \n );\n }\n return \"\";\n};\n\nexport const algoSportText = (sportAlgo) => {\n if (Object.keys(ALGO_SPORT).includes(sportAlgo.toLowerCase())) {\n const algoSport = ALGO_SPORT[sportAlgo.toLowerCase()];\n return (\n \n {algoSport.title}\n \n );\n }\n return \"\";\n};\n\nexport const algoSportDescription = (sportAlgo) => {\n if (Object.keys(ALGO_SPORT).includes(sportAlgo.toLowerCase())) {\n return ALGO_SPORT[sportAlgo.toLowerCase()].description;\n }\n return \"\";\n};\n\nexport const displayName = (last_name, first_name) => {\n if (first_name) {\n // Capitalize first letter of last name and first letter of first name\n return `${first_name.charAt(0).toUpperCase()}${first_name.slice(\n 1\n )} ${last_name.charAt(0).toUpperCase()}${last_name.slice(1)}`;\n }\n return `${last_name.charAt(0).toUpperCase()}${last_name.slice(1)}`;\n};\n\nexport const awsStatusText = (status) => {\n if (Object.keys(AWS_STATUS).includes(status)) {\n return AWS_STATUS[status].text;\n }\n return \"\";\n};\n\nexport const awsStatusChip = (status) => {\n if (Object.keys(AWS_STATUS).includes(status)) {\n return AWS_STATUS[status].chip;\n }\n return \"\";\n};\n\nexport const awsStatusMiniChip = (status) => {\n if (Object.keys(AWS_STATUS).includes(status)) {\n return AWS_STATUS[status].miniChip;\n }\n return \"\";\n};\n\nexport const identificationStatusChip = (idStatus) => {\n if (Object.keys(IDENTIFICATION_STATUS).includes(idStatus)) {\n return IDENTIFICATION_STATUS[idStatus].chip;\n }\n return \"\";\n};\n\nexport const identificationStatusText = (idStatus) => {\n if (Object.keys(IDENTIFICATION_STATUS).includes(idStatus)) {\n return IDENTIFICATION_STATUS[idStatus].text;\n }\n return \"\";\n};\n\nexport const genderText = (value) => {\n if (Object.keys(GENDER).includes(value)) {\n return GENDER[value];\n }\n return \"N/A\";\n};\n\nexport const renderPrice = (priceInCent) => {\n if (priceInCent == null) {\n return \"\";\n }\n return priceInCent / 100;\n};\n\nexport const fromFrontToBackAlbum = (album) => {\n console.log(\"fromFrontToBackAlbum\", album);\n const album_packages = album.album_packages.map((pa) =>\n fromFrontToBackPackage(pa)\n );\n return {\n ...album,\n sport_name: \"event\",\n pack_athlete_unit_price: album.pack_athlete_unit_price\n ? album.pack_athlete_unit_price * 100\n : null,\n album_packages: album_packages,\n };\n};\n\nexport const fromBackToFrontAlbum = (album) => {\n const album_packages = album.album_packages\n .sort((a, b) => (a.is_download ? -1 : 1))\n .map((pa) => fromBackToFrontPackage(pa));\n return {\n ...album,\n pack_athlete_unit_price: album.pack_athlete_unit_price\n ? album.pack_athlete_unit_price / 100\n : null,\n album_packages: album_packages,\n };\n};\n\nexport const calculateTotalPrices = (photos, album) => {\n // We have 3 types of products: photo, athlete and selfie\n const partition = _.partition(photos, (p) => p.type === \"photo\");\n const photosOnly = partition[0];\n const otherProductsOnly = partition[1];\n const productsByPackage = _.groupBy(\n photosOnly.filter((p) => p.package_id !== null),\n (p) => p.package_id\n );\n let packages = [];\n _.forOwn(productsByPackage, (products, key) => {\n const quantity = products.reduce((acc, p) => acc + p.quantity, 0);\n const packagee = products[0].package;\n const unitPriceEntity = findCorrespondingUnitPrice(packagee, quantity);\n packages.push({\n package: packagee,\n packageQuantity: quantity,\n packageUnitPrice: unitPriceEntity,\n packageTotal: quantity * unitPriceEntity.unit_price,\n });\n });\n\n const qtyPackAthlete = otherProductsOnly.length;\n const totalPackAthlete = qtyPackAthlete * album.pack_athlete_unit_price;\n\n const packAthlete = {\n quantity: qtyPackAthlete,\n unitPrice: album.pack_athlete_unit_price,\n total: totalPackAthlete,\n };\n\n const total =\n packages.reduce((acc, f) => acc + f.packageTotal, 0) + totalPackAthlete;\n return {\n total,\n packages,\n packAthlete,\n };\n};\n\nexport function numberToColor(nb) {\n const colors = [\n \"#ff0000\",\n \"#ff8000\",\n \"#ffff00\",\n \"#80ff00\",\n \"#00ff00\",\n \"#00ff80\",\n \"#00ffff\",\n \"#0080ff\",\n \"#0000ff\",\n \"#8000ff\",\n \"#ff00ff\",\n \"#ff0080\",\n \"#ff8080\",\n \"#ffbf80\",\n \"#ffff80\",\n \"#bfff80\",\n \"#80ff80\",\n \"#80ffb3\",\n \"#80ffff\",\n\n // more color\n ];\n return colors[nb % colors.length];\n}\n\nexport function stringToColor(string) {\n let hash = 0;\n let i;\n\n /* eslint-disable no-bitwise */\n for (i = 0; i < string.length; i += 1) {\n hash = string.charCodeAt(i) + ((hash << 5) - hash);\n }\n\n let color = \"#\";\n\n for (i = 0; i < 3; i += 1) {\n const value = (hash >> (i * 8)) & 0xff;\n color += `00${value.toString(16)}`.slice(-2);\n }\n /* eslint-enable no-bitwise */\n\n return color;\n}\n\nexport const stringAvatar = (name, sx = null) => {\n // if name has a space between 2 first words, we take the first letter of each word, otherwise we take the first 2 letters\n return {\n sx: {\n bgcolor: stringToColor(name),\n color: \"white\",\n ...sx,\n },\n children: `${name.split(\" \")[0].substring(0, 1)}${\n name.split(\" \").length > 1\n ? name.split(\" \")[1].substring(0, 1)\n : name.split(\" \")[0].substring(1, 2)\n }`,\n };\n};\n\nexport const EXIF_FLASH = {\n 0: \"No flash\",\n 1: \"Flash\",\n 5: \"Flash, strobe return light not detected\",\n 7: \"Flash, strobe return light detected\",\n 9: \"Compulsory flash, red-eye reduction\",\n 13: \"Compulsory flash, red-eye reduction, return light not detected\",\n 15: \"Compulsory flash, red-eye reduction, return light detected\",\n 16: \"No flash, compulsory\",\n 24: \"No flash, auto\",\n 25: \"Flash, auto\",\n 29: \"Flash, auto, red-eye reduction\",\n 31: \"Flash, auto, red-eye reduction, return light not detected\",\n 32: \"Flash, auto, red-eye reduction, return light detected\",\n};\n\nexport const getFlashText = (flashDecimalValue) => {\n if (Object.keys(EXIF_FLASH).includes(flashDecimalValue)) {\n return EXIF_FLASH[flashDecimalValue];\n }\n return \"N/A\";\n};\n\nexport const getExposureTime = (exposureTimeDecimal) => {\n if (!exposureTimeDecimal || exposureTimeDecimal === 0) {\n return \"N/A\";\n }\n return `1/${Math.round(\n 1 / exposureTimeDecimal\n )} s (${exposureTimeDecimal} s)`;\n};\n\nexport const getFNumber = (fNumber) => {\n if (!fNumber) {\n return \"N/A\";\n }\n return `f/${fNumber}`;\n};\n\nexport const getFocalLength = (focalLength) => {\n if (!focalLength) {\n return \"N/A\";\n }\n return `${focalLength} mm`;\n};\n\nexport const getAvatarUrl = (userUid, avatarId) => {\n return `https://photos.eventpxl.com/avatars/${process.env.REACT_APP_ENVIRONMENT}/${userUid}/${avatarId}`;\n};\n\nexport const minificationStatus = (minification) => {\n if (minification === \"minified\") {\n return (\n \n }\n chipcolor={\"primary\"}\n />\n );\n }\n return (\n \n }\n chipcolor={\"primary\"}\n />\n );\n};\n\nexport const bibWithMaxSize = (bib) => {\n if (!bib) {\n return \"\";\n }\n return (\n \n {bib.length > 8 ? bib.slice(0, 10) + \"..\" : bib}\n \n );\n};\n\nexport const identificationStatus = (identification) => {\n if (!identification.bib) {\n return ;\n }\n if (identification.bib === identification.bib_set_by_manually) {\n return (\n \n );\n }\n if (\n identification.bib === identification.bib_set_by_detect_text &&\n !identification.bib_set_by_face_matching\n ) {\n if (!identification.face_id) {\n return ;\n } else {\n return ;\n }\n }\n\n if (\n identification.bib === identification.bib_set_by_face_matching &&\n identification.bib === identification.bib_set_by_detect_text\n ) {\n return ;\n }\n\n if (\n identification.bib === identification.bib_set_by_face_matching &&\n identification.bib !== identification.bib_set_by_detect_text\n ) {\n return (\n \n );\n }\n};\n\nexport const displayContestantName = (contestant) => {\n if (!contestant) {\n return \"\";\n }\n if (contestant.first_name && contestant.last_name) {\n return `${contestant.last_name} ${contestant.first_name}`;\n }\n};\n\nexport const identificationHistory = (identification) => {\n let history = [];\n if (identification.bib_set_by_manually) {\n history.push(`${identification.bib_set_by_manually} forcé par vous`);\n }\n if (identification.bib_set_by_face_matching) {\n history.push(`${identification.bib_set_by_face_matching} par script`);\n }\n if (identification.bib_set_by_detect_text) {\n history.push(`${identification.bib_set_by_face_matching} lû`);\n }\n return (\n \n {history.map((h) => (\n {h}\n ))}\n \n );\n};\n\nexport const isFreeAlbum = (album) => {\n // Album is free when one of the album.album_packages.unit_prices is 0\n return album.album_packages.some((ap) =>\n ap.unit_prices.some((up) => Number(up.unit_price) === 0)\n );\n};\n\nexport const creditIncrementType = (incrementType) => {\n return ;\n};\n","export function fromFrontToBackPackage(photographPackage) {\n return {\n ...photographPackage,\n unit_prices: photographPackage.unit_prices.map((unitPrice) => {\n return {\n ...unitPrice,\n unit_price: Number((unitPrice.unit_price * 100).toFixed(0))\n }\n })\n }\n}\n\n\nexport function fromBackToFrontPackage(photographPackage) {\n return {\n ...photographPackage,\n unit_prices: photographPackage.unit_prices.map((unitPrice) => {\n return {\n ...unitPrice,\n unit_price: (unitPrice.unit_price / 100).toFixed(2)\n }\n })\n }\n}\n\nexport function findCorrespondingUnitPrice(packagee, nbPhotos) {\n return [...packagee.unit_prices].sort((up1, up2) => up2.nb_photos - up1.nb_photos).find(price => {\n return price.nb_photos <= nbPhotos\n })\n}\n","import ShoppingCartTwoToneIcon from \"@mui/icons-material/ShoppingCartTwoTone\";\nimport {\n Badge,\n Button,\n Dialog,\n DialogActions,\n DialogTitle,\n Fab,\n} from \"@mui/material\";\nimport { styled, useTheme } from \"@mui/material/styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { useState } from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport { useNavigate } from \"react-router-dom\";\nimport { useSelector } from \"store\";\nimport { totalQuantitySelector } from \"store/slices/cart\";\nimport { inIframe } from \"utils/iframe\";\n\nconst StyledBadge = styled(Badge)(({ theme }) => ({\n \"& .MuiBadge-badge\": {\n right: 0,\n top: 3,\n border: `2px solid ${theme.palette.background.paper}`,\n padding: \"0 4px\",\n },\n}));\n\nconst FloatingCart = () => {\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const totalQuantity = useSelector(totalQuantitySelector);\n const navigate = useNavigate();\n const [isCheckoutModal, setIsCheckoutModal] = useState(false);\n\n const handleRedirection = () => {\n if (inIframe()) {\n setIsCheckoutModal(true);\n } else {\n navigate(\"/checkout\", { replace: true });\n }\n };\n\n const redirect = () => {\n setIsCheckoutModal(false);\n window.open(\n process.env.REACT_APP_PUBLIC_URL + \"/checkout\",\n \"_blank\",\n \"noopener,noreferrer\"\n );\n };\n\n const notRedirect = () => {\n setIsCheckoutModal(false);\n };\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FloatingCart;\n","var _g;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgImgErrorBgDark(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 676,\n height: 391,\n viewBox: \"0 0 676 391\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.09\n }, /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 4.49127 197.53)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 342.315 387.578)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 28.0057 211.105)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 365.829 374.002)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 51.52 224.68)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 389.344 360.428)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 75.0345 238.255)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 412.858 346.852)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 98.5488 251.83)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 436.372 333.277)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 122.063 265.405)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 459.887 319.703)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 145.578 278.979)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 483.401 306.127)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 169.092 292.556)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 506.916 292.551)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 192.597 306.127)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 530.43 278.977)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 216.111 319.703)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 553.944 265.402)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 239.626 333.277)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 577.459 251.827)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M263.231 346.905L601.064 151.871\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 600.973 238.252)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 286.654 360.428)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 624.487 224.677)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 310.169 374.002)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 648.002 211.102)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 333.683 387.578)\",\n stroke: \"#8492C4\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 671.516 197.527)\",\n stroke: \"#8492C4\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgImgErrorBgDark);\nexport default __webpack_public_path__ + \"static/media/img-error-bg-dark.420ab71701e87632a9bc888f520aaf10.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgImgErrorBg(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 676,\n height: 391,\n viewBox: \"0 0 676 391\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.09\n }, /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 4.49127 197.53)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 342.315 387.578)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 28.0057 211.105)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 365.829 374.002)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 51.52 224.68)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 389.344 360.428)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 75.0345 238.255)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 412.858 346.852)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 98.5488 251.83)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 436.372 333.277)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 122.063 265.405)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 459.887 319.703)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 145.578 278.979)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 483.401 306.127)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 169.092 292.556)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 506.916 292.551)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 192.597 306.127)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 530.43 278.977)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 216.111 319.703)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 553.944 265.402)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 239.626 333.277)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 577.459 251.827)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M263.231 346.905L601.064 151.871\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 600.973 238.252)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 286.654 360.428)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 624.487 224.677)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 310.169 374.002)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 648.002 211.102)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(0.866041 -0.499972 -0.866041 -0.499972 333.683 387.578)\",\n stroke: \"black\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n y1: -0.5,\n x2: 390.089,\n y2: -0.5,\n transform: \"matrix(-0.866041 -0.499972 -0.866041 0.499972 671.516 197.527)\",\n stroke: \"black\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgImgErrorBg);\nexport default __webpack_public_path__ + \"static/media/img-error-bg.0eedc18716766059c1f22d18ace87386.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _rect2, _rect3, _rect4, _g, _rect5, _rect6, _rect7, _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgImgErrorBlue(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 676,\n height: 395,\n viewBox: \"0 0 676 395\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 26.998,\n height: 26.8293,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 361.873 290.126)\",\n fill: \"#E3F2FD\"\n })), _rect2 || (_rect2 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24.2748,\n height: 24.1231,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 364.249 291.115)\",\n fill: \"#90CAF9\"\n })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 26.998,\n height: 26.8293,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 291.67 86.4912)\",\n fill: \"#E3F2FD\"\n })), _rect4 || (_rect4 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24.2748,\n height: 24.1231,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 294.046 87.48)\",\n fill: \"#90CAF9\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n filter: \"url(#filter0_d)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M370.694 211.828L365.394 208.768V215.835L365.404 215.829C365.459 216.281 365.785 216.724 366.383 217.069L417.03 246.308C418.347 247.068 420.481 247.068 421.798 246.308L468.671 219.248C469.374 218.842 469.702 218.301 469.654 217.77V210.861L464.282 213.962L418.024 187.257C416.708 186.497 414.573 186.497 413.257 187.257L370.694 211.828Z\",\n fill: \"url(#paint0_linear)\"\n }))), _rect5 || (_rect5 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 59.6284,\n height: 63.9858,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 364 208.812)\",\n fill: \"#90CAF9\"\n })), _rect6 || (_rect6 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 59.6284,\n height: 63.9858,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 364 208.812)\",\n fill: \"url(#paint1_linear)\"\n })), _rect7 || (_rect7 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 56.6816,\n height: 60.8238,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 366.645 208.761)\",\n fill: \"url(#paint2_linear)\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M421.238 206.161C421.238 206.434 421.62 206.655 422.092 206.655L432.159 206.656C435.164 206.656 437.6 208.063 437.601 209.798C437.602 211.533 435.166 212.939 432.162 212.938L422.09 212.937C421.62 212.937 421.24 213.157 421.24 213.428L421.241 215.814C421.241 216.087 421.624 216.308 422.096 216.308L432.689 216.309C438.917 216.31 443.967 213.395 443.965 209.799C443.964 206.202 438.914 203.286 432.684 203.286L422.086 203.284C421.617 203.284 421.236 203.504 421.237 203.775L421.238 206.161Z\",\n fill: \"#1E88E5\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M413.422 213.43C413.422 213.157 413.039 212.936 412.567 212.936L402.896 212.935C399.891 212.935 397.455 211.528 397.454 209.793C397.453 208.059 399.889 206.652 402.894 206.653L412.57 206.654C413.039 206.654 413.419 206.435 413.419 206.164L413.418 203.777C413.418 203.504 413.035 203.283 412.563 203.283L402.366 203.282C396.138 203.281 391.089 206.197 391.09 209.793C391.091 213.389 396.141 216.305 402.371 216.306L412.573 216.307C413.042 216.307 413.423 216.088 413.423 215.817L413.422 213.43Z\",\n fill: \"#1E88E5\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M407.999 198.145L411.211 201.235C411.266 201.288 411.332 201.336 411.405 201.379C411.813 201.614 412.461 201.669 412.979 201.49C413.59 201.278 413.787 200.821 413.421 200.469L410.209 197.379C409.843 197.027 409.051 196.913 408.441 197.124C407.831 197.335 407.633 197.793 407.999 198.145Z\",\n fill: \"#1E88E5\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M416.235 200.853C416.235 201.058 416.38 201.244 416.613 201.379C416.846 201.513 417.168 201.597 417.524 201.597C418.236 201.596 418.813 201.263 418.813 200.852L418.812 197.021C418.811 196.61 418.234 196.277 417.522 196.277C416.811 196.278 416.234 196.611 416.234 197.022L416.235 200.853Z\",\n fill: \"#1E88E5\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M421.627 200.47C421.317 200.769 421.412 201.143 421.82 201.379C421.893 201.421 421.977 201.459 422.069 201.491C422.68 201.703 423.472 201.588 423.838 201.236L427.047 198.147C427.413 197.794 427.215 197.337 426.605 197.126C425.994 196.915 425.203 197.029 424.836 197.381L421.627 200.47Z\",\n fill: \"#1E88E5\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M427.056 221.447L423.844 218.357C423.478 218.005 422.686 217.891 422.076 218.102C421.466 218.314 421.268 218.771 421.634 219.123L424.846 222.213C424.901 222.266 424.967 222.314 425.04 222.357C425.448 222.592 426.097 222.647 426.614 222.468C427.225 222.257 427.423 221.799 427.056 221.447Z\",\n fill: \"#1E88E5\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M418.82 218.739C418.82 218.328 418.243 217.995 417.531 217.995C416.819 217.995 416.242 218.329 416.242 218.74L416.243 222.57C416.244 222.776 416.388 222.962 416.621 223.096C416.854 223.231 417.177 223.314 417.533 223.314C418.245 223.314 418.822 222.981 418.821 222.57L418.82 218.739Z\",\n fill: \"#1E88E5\"\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M413.428 219.122C413.794 218.77 413.596 218.312 412.986 218.101C412.375 217.89 411.584 218.004 411.217 218.356L408.008 221.445C407.698 221.744 407.793 222.118 408.201 222.354C408.274 222.396 408.358 222.434 408.45 222.466C409.061 222.678 409.853 222.563 410.219 222.211L413.428 219.122Z\",\n fill: \"#1E88E5\"\n })), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"filter\", {\n id: \"filter0_d\",\n x: 301.394,\n y: 186.687,\n width: 232.264,\n height: 208.191,\n filterUnits: \"userSpaceOnUse\",\n colorInterpolationFilters: \"sRGB\"\n }, /*#__PURE__*/React.createElement(\"feFlood\", {\n floodOpacity: 0,\n result: \"BackgroundImageFix\"\n }), /*#__PURE__*/React.createElement(\"feColorMatrix\", {\n in: \"SourceAlpha\",\n type: \"matrix\",\n values: \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\n }), /*#__PURE__*/React.createElement(\"feOffset\", {\n dy: 84\n }), /*#__PURE__*/React.createElement(\"feGaussianBlur\", {\n stdDeviation: 32\n }), /*#__PURE__*/React.createElement(\"feColorMatrix\", {\n type: \"matrix\",\n values: \"0 0 0 0 0.129412 0 0 0 0 0.588235 0 0 0 0 0.952941 0 0 0 0.2 0\"\n }), /*#__PURE__*/React.createElement(\"feBlend\", {\n mode: \"normal\",\n in2: \"BackgroundImageFix\",\n result: \"effect1_dropShadow\"\n }), /*#__PURE__*/React.createElement(\"feBlend\", {\n mode: \"normal\",\n in: \"SourceGraphic\",\n in2: \"effect1_dropShadow\",\n result: \"shape\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint0_linear\",\n x1: 417.526,\n y1: 205.789,\n x2: 365.394,\n y2: 216.782,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"#2196F3\"\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#B1DCFF\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint1_linear\",\n x1: 0.503035,\n y1: 2.68177,\n x2: 20.3032,\n y2: 42.2842,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"#FAFAFA\",\n stopOpacity: 0.74\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#91CBFA\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint2_linear\",\n x1: -18.5494,\n y1: -44.8799,\n x2: 14.7845,\n y2: 40.5766,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"#FAFAFA\",\n stopOpacity: 0.74\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#91CBFA\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgImgErrorBlue);\nexport default __webpack_public_path__ + \"static/media/img-error-blue.60aad3ce9a3467e56f98c9070ab2ff68.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _rect2, _rect3, _rect4, _g, _rect5, _rect6, _mask, _g2, _mask2, _g3, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgImgErrorPurple(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 710,\n height: 391,\n viewBox: \"0 0 710 391\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 26.9258,\n height: 26.7576,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 161.088 154.333)\",\n fill: \"#EDE7F6\"\n })), _rect2 || (_rect2 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24.9267,\n height: 24.7709,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 162.809 155.327)\",\n fill: \"#B39DDB\"\n })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 26.9258,\n height: 26.7576,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 536.744 181.299)\",\n fill: \"#EDE7F6\"\n })), _rect4 || (_rect4 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24.9267,\n height: 24.7709,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 538.465 182.292)\",\n fill: \"#B39DDB\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n filter: \"url(#filter0_d)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M67.7237 137.573V134.673H64.009V140.824L64.0177 140.829C64.0367 141.477 64.4743 142.121 65.3305 142.615L103.641 164.733C105.393 165.744 108.232 165.744 109.983 164.733L204.044 110.431C204.879 109.949 205.316 109.324 205.355 108.693L205.355 108.692V108.68C205.358 108.628 205.358 108.576 205.355 108.523L205.362 102.335L200.065 104.472L165.733 84.6523C163.982 83.6413 161.142 83.6413 159.391 84.6523L67.7237 137.573Z\",\n fill: \"url(#paint0_linear)\"\n }))), _rect5 || (_rect5 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 115.933,\n height: 51.5596,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 62.1588 134.683)\",\n fill: \"#673AB7\"\n })), _rect6 || (_rect6 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 115.933,\n height: 51.5596,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 62.1588 134.683)\",\n fill: \"url(#paint1_linear)\",\n fillOpacity: 0.3\n })), _mask || (_mask = /*#__PURE__*/React.createElement(\"mask\", {\n id: \"mask0\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: 64,\n y: 78,\n width: 141,\n height: 81\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 115.933,\n height: 51.5596,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 62.1588 134.683)\",\n fill: \"#673AB7\"\n }))), _g2 || (_g2 = /*#__PURE__*/React.createElement(\"g\", {\n mask: \"url(#mask0)\"\n })), _mask2 || (_mask2 = /*#__PURE__*/React.createElement(\"mask\", {\n id: \"mask1\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: 64,\n y: 78,\n width: 141,\n height: 81\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 115.933,\n height: 51.5596,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 62.1588 134.683)\",\n fill: \"#673AB7\"\n }))), _g3 || (_g3 = /*#__PURE__*/React.createElement(\"g\", {\n mask: \"url(#mask1)\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 64.3732,\n height: 64.3732,\n rx: 5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 111.303 81.6006)\",\n fill: \"#5E35B1\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n opacity: 0.7,\n x: 0.866041,\n width: 63.3732,\n height: 63.3732,\n rx: 4.5,\n transform: \"matrix(0.866041 -0.499972 0.866041 0.499972 79.1848 87.8305)\",\n stroke: \"#5E35B1\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"filter\", {\n id: \"filter0_d\",\n x: 0.0090332,\n y: 83.894,\n width: 269.353,\n height: 229.597,\n filterUnits: \"userSpaceOnUse\",\n colorInterpolationFilters: \"sRGB\"\n }, /*#__PURE__*/React.createElement(\"feFlood\", {\n floodOpacity: 0,\n result: \"BackgroundImageFix\"\n }), /*#__PURE__*/React.createElement(\"feColorMatrix\", {\n in: \"SourceAlpha\",\n type: \"matrix\",\n values: \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\n }), /*#__PURE__*/React.createElement(\"feOffset\", {\n dy: 84\n }), /*#__PURE__*/React.createElement(\"feGaussianBlur\", {\n stdDeviation: 32\n }), /*#__PURE__*/React.createElement(\"feColorMatrix\", {\n type: \"matrix\",\n values: \"0 0 0 0 0.403922 0 0 0 0 0.227451 0 0 0 0 0.717647 0 0 0 0.2 0\"\n }), /*#__PURE__*/React.createElement(\"feBlend\", {\n mode: \"normal\",\n in2: \"BackgroundImageFix\",\n result: \"effect1_dropShadow\"\n }), /*#__PURE__*/React.createElement(\"feBlend\", {\n mode: \"normal\",\n in: \"SourceGraphic\",\n in2: \"effect1_dropShadow\",\n result: \"shape\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint0_linear\",\n x1: 200.346,\n y1: 102.359,\n x2: 71.0293,\n y2: 158.071,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"#A491C8\"\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#D7C5F8\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint1_linear\",\n x1: 8.1531,\n y1: -0.145767,\n x2: 57.1962,\n y2: 72.3003,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"white\"\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"white\",\n stopOpacity: 0\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgImgErrorPurple);\nexport default __webpack_public_path__ + \"static/media/img-error-purple.8b0303a844445096e3b8166de52777af.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _rect, _rect2, _rect3, _rect4, _path5, _path6, _path7, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgImgErrorText(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 676,\n height: 391,\n viewBox: \"0 0 676 391\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M267.744 237.142L279.699 230.24L300.636 242.329L288.682 249.231L313.566 263.598L286.344 279.314L261.46 264.947L215.984 291.203L197.779 282.558L169.334 211.758L169.092 211.618L196.313 195.902L267.744 237.142ZM219.359 265.077L240.523 252.859L204.445 232.029L205.487 234.589L219.359 265.077Z\",\n fill: \"#FFAB91\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M469.959 120.206L481.913 113.304L502.851 125.392L490.897 132.294L515.78 146.661L488.559 162.377L463.675 148.011L418.199 174.266L399.994 165.621L371.548 94.8211L371.307 94.6816L398.528 78.9654L469.959 120.206ZM421.574 148.141L442.737 135.922L406.66 115.093L407.701 117.653L421.574 148.141Z\",\n fill: \"#FFAB91\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M204.523 235.027V232.237L219.401 265.014L240.555 252.926V255.018L218.936 267.339L204.523 235.027Z\",\n fill: \"#D84315\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M406.738 118.09V115.301L421.616 148.078L442.77 135.99V138.082L421.151 150.402L406.738 118.09Z\",\n fill: \"#D84315\"\n })), _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 109.114,\n height: 136.405,\n transform: \"matrix(0.866025 -0.5 0.866025 0.5 220.507 181.925)\",\n fill: \"url(#paint0_linear)\"\n })), _rect2 || (_rect2 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 40.2357,\n height: 70.0545,\n transform: \"matrix(0.866025 -0.5 0.866025 0.5 280.437 201.886)\",\n fill: \"url(#paint1_linear)\"\n })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 25.1147,\n width: 80.1144,\n height: 107.405,\n transform: \"matrix(0.866025 -0.5 0.866025 0.5 223.872 194.482)\",\n stroke: \"#1565C0\",\n strokeWidth: 29\n })), _rect4 || (_rect4 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 25.1147,\n width: 80.1144,\n height: 107.405,\n transform: \"matrix(0.866025 -0.5 0.866025 0.5 223.872 194.482)\",\n stroke: \"url(#paint2_linear)\",\n strokeWidth: 29\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M279.517 230.177L267.662 237.15L196.064 195.772L168.866 211.58L169.331 212.097L170.096 214.002L196.436 198.795L267.866 240.035L279.821 233.133L298.211 243.751L300.787 242.265L279.517 230.177ZM291.278 250.695L288.804 252.124L311.1 264.996L313.805 263.418L291.278 250.695Z\",\n fill: \"#D84315\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M481.732 113.24L469.877 120.214L398.279 78.8359L371.081 94.6433L371.546 95.1603L372.311 97.0652L398.651 81.8581L470.081 123.099L482.036 116.196L500.426 126.814L503.002 125.328L481.732 113.24ZM493.493 133.759L491.019 135.187L513.315 148.06L516.02 146.482L493.493 133.759Z\",\n fill: \"#D84315\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M288.674 252.229V249.207L291.929 251.067L288.674 252.229Z\",\n fill: \"#D84315\"\n })), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint0_linear\",\n x1: 77.7511,\n y1: 139.902,\n x2: -10.8629,\n y2: 8.75671,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"#3076C8\"\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 0.992076,\n stopColor: \"#91CBFA\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint1_linear\",\n x1: 25.8162,\n y1: 51.0447,\n x2: 68.7073,\n y2: -5.41524,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"#2E75C7\"\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"#4283CC\"\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"paint2_linear\",\n x1: -16.1224,\n y1: -47.972,\n x2: 123.494,\n y2: 290.853,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n stopColor: \"white\"\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"white\",\n stopOpacity: 0\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgImgErrorText);\nexport default __webpack_public_path__ + \"static/media/img-error-text.ce72d50194ce4edc04c8e0dde77b288a.svg\";\nexport { ForwardRef as ReactComponent };","import HomeTwoToneIcon from \"@mui/icons-material/HomeTwoTone\";\nimport {\n Button,\n Card,\n CardContent,\n CardMedia,\n Grid,\n Typography,\n} from \"@mui/material\";\nimport { styled, useTheme } from \"@mui/material/styles\";\nimport { Link } from \"react-router-dom\";\nimport { gridSpacing } from \"store/constant\";\nimport AnimateButton from \"ui-component/extended/AnimateButton\";\n\nimport imageDarkBackground from \"assets/images/maintenance/img-error-bg-dark.svg\";\nimport imageBackground from \"assets/images/maintenance/img-error-bg.svg\";\nimport imageBlue from \"assets/images/maintenance/img-error-blue.svg\";\nimport imagePurple from \"assets/images/maintenance/img-error-purple.svg\";\nimport imageText from \"assets/images/maintenance/img-error-text.svg\";\nimport { FormattedMessage } from \"react-intl\";\n\nconst CardMediaWrapper = styled(\"div\")({\n maxWidth: 720,\n margin: \"0 auto\",\n position: \"relative\",\n});\n\nconst ErrorWrapper = styled(\"div\")({\n maxWidth: 350,\n margin: \"0 auto\",\n textAlign: \"center\",\n});\n\nconst ErrorCard = styled(Card)({\n minHeight: \"100vh\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n});\n\nconst CardMediaBlock = styled(\"img\")({\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n animation: \"3s bounce ease-in-out infinite\",\n});\n\nconst CardMediaBlue = styled(\"img\")({\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n animation: \"15s wings ease-in-out infinite\",\n});\n\nconst CardMediaPurple = styled(\"img\")({\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n animation: \"12s wings ease-in-out infinite\",\n});\n\n// ==============================|| ERROR PAGE ||============================== //\n\nconst Error = () => {\n const theme = useTheme();\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\" \"}\n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Error;\n","import { Box, Typography } from \"@mui/material\";\nimport { useTheme } from \"@mui/styles\";\nimport { PropTypes } from \"prop-types\";\nimport { useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\n\nexport const PhotographLogo = ({\n photographId,\n photographName,\n photographUrlId,\n}) => {\n const theme = useTheme();\n const [hasError, setHasError] = useState(null);\n const navigate = useNavigate();\n\n if (hasError) {\n return (\n \n {photographName}\n \n );\n }\n return (\n navigate(`/photographs/${photographUrlId}`)}\n component={\"img\"}\n src={`${process.env.REACT_APP_CLOUDFRONT_URL}/logos/${photographId}`}\n maxHeight={50}\n maxWidth={\"25%\"}\n onError={(e) => {\n setHasError(true);\n }}\n type={\"image\"}\n alt={photographName}\n sx={{\n \"&:hover\": {\n cursor: \"pointer\",\n },\n fontSize: 24,\n }}\n />\n );\n};\n\nPhotographLogo.propTypes = {\n photographId: PropTypes.string.isRequired,\n photographName: PropTypes.string.isRequired,\n photographUrlId: PropTypes.string.isRequired,\n};\n\nexport default PhotographLogo;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nimport {\n\tICookieStorageData,\n\tICognitoStorage,\n} from 'amazon-cognito-identity-js';\n\n/**\n * Parameters for user sign up\n */\nexport interface SignUpParams {\n\tusername: string;\n\tpassword: string;\n\tattributes?: object;\n\tvalidationData?: { [key: string]: any };\n\tclientMetadata?: { [key: string]: string };\n\tautoSignIn?: AutoSignInOptions;\n}\n\nexport interface AuthCache {\n\tsetItem();\n\tgetItem();\n\tremoveItem();\n}\n\n/**\n * Auth instance options\n */\nexport interface AuthOptions {\n\tuserPoolId?: string;\n\tuserPoolWebClientId?: string;\n\tidentityPoolId?: string;\n\tregion?: string;\n\tmandatorySignIn?: boolean;\n\tcookieStorage?: ICookieStorageData;\n\toauth?: OAuthOpts;\n\trefreshHandlers?: object;\n\tstorage?: ICognitoStorage;\n\tauthenticationFlowType?: string;\n\tidentityPoolRegion?: string;\n\tclientMetadata?: any;\n\tendpoint?: string;\n\tsignUpVerificationMethod?: 'code' | 'link';\n}\n\nexport enum CognitoHostedUIIdentityProvider {\n\tCognito = 'COGNITO',\n\tGoogle = 'Google',\n\tFacebook = 'Facebook',\n\tAmazon = 'LoginWithAmazon',\n\tApple = 'SignInWithApple',\n}\n\nexport type LegacyProvider =\n\t| 'google'\n\t| 'facebook'\n\t| 'amazon'\n\t| 'developer'\n\t| string;\n\nexport type FederatedSignInOptions = {\n\tprovider: CognitoHostedUIIdentityProvider;\n\tcustomState?: string;\n};\n\nexport type FederatedSignInOptionsCustom = {\n\tcustomProvider: string;\n\tcustomState?: string;\n};\n\nexport function isFederatedSignInOptions(\n\tobj: any\n): obj is FederatedSignInOptions {\n\tconst keys: (keyof FederatedSignInOptions)[] = ['provider'];\n\treturn obj && !!keys.find(k => obj.hasOwnProperty(k));\n}\n\nexport function isFederatedSignInOptionsCustom(\n\tobj: any\n): obj is FederatedSignInOptionsCustom {\n\tconst keys: (keyof FederatedSignInOptionsCustom)[] = ['customProvider'];\n\treturn obj && !!keys.find(k => obj.hasOwnProperty(k));\n}\n\nexport function hasCustomState(obj: any): boolean {\n\tconst keys: (keyof (\n\t\t| FederatedSignInOptions\n\t\t| FederatedSignInOptionsCustom\n\t))[] = ['customState'];\n\treturn obj && !!keys.find(k => obj.hasOwnProperty(k));\n}\n\n/**\n * Details for multi-factor authentication\n */\nexport interface MfaRequiredDetails {\n\tchallengeName: any;\n\tchallengeParameters: any;\n}\n\n/**\n * interface for federatedResponse\n */\nexport interface FederatedResponse {\n\t// access token\n\ttoken: string;\n\t// identity id\n\tidentity_id?: string;\n\t// the universal time when token expired\n\texpires_at: number;\n}\n\n/**\n * interface for federatedUser\n */\nexport interface FederatedUser {\n\tname: string;\n\temail?: string;\n\tpicture?: string;\n}\n\nexport interface AwsCognitoOAuthOpts {\n\tdomain: string;\n\tscope: Array;\n\tredirectSignIn: string;\n\tredirectSignOut: string;\n\tresponseType: string;\n\toptions?: object;\n\turlOpener?: (url: string, redirectUrl: string) => Promise;\n}\n\nexport function isCognitoHostedOpts(\n\toauth: OAuthOpts\n): oauth is AwsCognitoOAuthOpts {\n\treturn (oauth).redirectSignIn !== undefined;\n}\n\nexport interface Auth0OAuthOpts {\n\tdomain: string;\n\tclientID: string;\n\tscope: string;\n\tredirectUri: string;\n\taudience: string;\n\tresponseType: string;\n\treturnTo: string;\n\turlOpener?: (url: string, redirectUrl: string) => Promise;\n}\n\n// Replacing to fix typings\n// export interface OAuth {\n// awsCognito?: awsCognitoOAuthOpts,\n// auth0?: any\n// }\n\nexport type OAuthOpts = AwsCognitoOAuthOpts | Auth0OAuthOpts;\n\nexport interface ConfirmSignUpOptions {\n\tforceAliasCreation?: boolean;\n\tclientMetadata?: ClientMetaData;\n}\n\nexport interface SignOutOpts {\n\tglobal?: boolean;\n}\n\nexport interface CurrentUserOpts {\n\tbypassCache: boolean;\n}\n\nexport interface GetPreferredMFAOpts {\n\tbypassCache: boolean;\n}\n\nexport type UsernamePasswordOpts = {\n\tusername: string;\n\tpassword: string;\n\tvalidationData?: { [key: string]: any };\n};\n\nexport enum AuthErrorTypes {\n\tNoConfig = 'noConfig',\n\tMissingAuthConfig = 'missingAuthConfig',\n\tEmptyUsername = 'emptyUsername',\n\tInvalidUsername = 'invalidUsername',\n\tEmptyPassword = 'emptyPassword',\n\tEmptyCode = 'emptyCode',\n\tSignUpError = 'signUpError',\n\tNoMFA = 'noMFA',\n\tInvalidMFA = 'invalidMFA',\n\tEmptyChallengeResponse = 'emptyChallengeResponse',\n\tNoUserSession = 'noUserSession',\n\tDefault = 'default',\n\tDeviceConfig = 'deviceConfig',\n\tNetworkError = 'networkError',\n\tAutoSignInError = 'autoSignInError',\n}\n\nexport type AuthErrorMessages = { [key in AuthErrorTypes]: AuthErrorMessage };\n\nexport interface AuthErrorMessage {\n\tmessage: string;\n\tlog?: string;\n}\n\n// We can extend this in the future if needed\nexport type SignInOpts = UsernamePasswordOpts;\n\nexport type ClientMetaData =\n\t| {\n\t\t\t[key: string]: string;\n\t }\n\t| undefined;\n\nexport function isUsernamePasswordOpts(obj: any): obj is UsernamePasswordOpts {\n\treturn !!(obj as UsernamePasswordOpts).username;\n}\n\nexport interface IAuthDevice {\n\tid: string;\n\tname: string;\n}\n\nexport interface AutoSignInOptions {\n\tenabled: boolean;\n\tclientMetaData?: ClientMetaData;\n\tvalidationData?: { [key: string]: any };\n}\n\nexport enum GRAPHQL_AUTH_MODE {\n\tAPI_KEY = 'API_KEY',\n\tAWS_IAM = 'AWS_IAM',\n\tOPENID_CONNECT = 'OPENID_CONNECT',\n\tAMAZON_COGNITO_USER_POOLS = 'AMAZON_COGNITO_USER_POOLS',\n\tAWS_LAMBDA = 'AWS_LAMBDA',\n}\n","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\n// Logging constants\nconst AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;\nconst AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;\nconst AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;\nconst AWS_CLOUDWATCH_CATEGORY = 'Logging';\nconst AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';\nconst NO_CREDS_ERROR_STRING = 'No credentials';\nconst RETRY_ERROR_CODES = [\n\t'ResourceNotFoundException',\n\t'InvalidSequenceTokenException',\n];\n\nexport {\n\tAWS_CLOUDWATCH_BASE_BUFFER_SIZE,\n\tAWS_CLOUDWATCH_CATEGORY,\n\tAWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE,\n\tAWS_CLOUDWATCH_MAX_EVENT_SIZE,\n\tAWS_CLOUDWATCH_PROVIDER_NAME,\n\tNO_CREDS_ERROR_STRING,\n\tRETRY_ERROR_CODES,\n};\n","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nimport { InputLogEvent } from '@aws-sdk/client-cloudwatch-logs';\nimport { LoggingProvider } from '../types';\nimport { AWS_CLOUDWATCH_CATEGORY } from '../Util/Constants';\nimport { Logger } from './logger-interface';\n\nconst LOG_LEVELS = {\n\tVERBOSE: 1,\n\tDEBUG: 2,\n\tINFO: 3,\n\tWARN: 4,\n\tERROR: 5,\n};\n\nexport enum LOG_TYPE {\n\tDEBUG = 'DEBUG',\n\tERROR = 'ERROR',\n\tINFO = 'INFO',\n\tWARN = 'WARN',\n\tVERBOSE = 'VERBOSE',\n}\n\n/**\n * Write logs\n * @class Logger\n */\nexport class ConsoleLogger implements Logger {\n\tname: string;\n\tlevel: LOG_TYPE | string;\n\tprivate _pluggables: LoggingProvider[];\n\tprivate _config: object;\n\n\t/**\n\t * @constructor\n\t * @param {string} name - Name of the logger\n\t */\n\tconstructor(name: string, level: LOG_TYPE | string = LOG_TYPE.WARN) {\n\t\tthis.name = name;\n\t\tthis.level = level;\n\t\tthis._pluggables = [];\n\t}\n\n\tstatic LOG_LEVEL = null;\n\n\t_padding(n) {\n\t\treturn n < 10 ? '0' + n : '' + n;\n\t}\n\n\t_ts() {\n\t\tconst dt = new Date();\n\t\treturn (\n\t\t\t[this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(\n\t\t\t\t':'\n\t\t\t) +\n\t\t\t'.' +\n\t\t\tdt.getMilliseconds()\n\t\t);\n\t}\n\n\tconfigure(config?: object) {\n\t\tif (!config) return this._config;\n\n\t\tthis._config = config;\n\n\t\treturn this._config;\n\t}\n\n\t/**\n\t * Write log\n\t * @method\n\t * @memeberof Logger\n\t * @param {LOG_TYPE|string} type - log type, default INFO\n\t * @param {string|object} msg - Logging message or object\n\t */\n\t_log(type: LOG_TYPE | string, ...msg) {\n\t\tlet logger_level_name = this.level;\n\t\tif (ConsoleLogger.LOG_LEVEL) {\n\t\t\tlogger_level_name = ConsoleLogger.LOG_LEVEL;\n\t\t}\n\t\tif (typeof (window) !== 'undefined' && (window).LOG_LEVEL) {\n\t\t\tlogger_level_name = (window).LOG_LEVEL;\n\t\t}\n\t\tconst logger_level = LOG_LEVELS[logger_level_name];\n\t\tconst type_level = LOG_LEVELS[type];\n\t\tif (!(type_level >= logger_level)) {\n\t\t\t// Do nothing if type is not greater than or equal to logger level (handle undefined)\n\t\t\treturn;\n\t\t}\n\n\t\tlet log = console.log.bind(console);\n\t\tif (type === LOG_TYPE.ERROR && console.error) {\n\t\t\tlog = console.error.bind(console);\n\t\t}\n\t\tif (type === LOG_TYPE.WARN && console.warn) {\n\t\t\tlog = console.warn.bind(console);\n\t\t}\n\n\t\tconst prefix = `[${type}] ${this._ts()} ${this.name}`;\n\t\tlet message = '';\n\n\t\tif (msg.length === 1 && typeof msg[0] === 'string') {\n\t\t\tmessage = `${prefix} - ${msg[0]}`;\n\t\t\tlog(message);\n\t\t} else if (msg.length === 1) {\n\t\t\tmessage = `${prefix} ${msg[0]}`;\n\t\t\tlog(prefix, msg[0]);\n\t\t} else if (typeof msg[0] === 'string') {\n\t\t\tlet obj = msg.slice(1);\n\t\t\tif (obj.length === 1) {\n\t\t\t\tobj = obj[0];\n\t\t\t}\n\t\t\tmessage = `${prefix} - ${msg[0]} ${obj}`;\n\t\t\tlog(`${prefix} - ${msg[0]}`, obj);\n\t\t} else {\n\t\t\tmessage = `${prefix} ${msg}`;\n\t\t\tlog(prefix, msg);\n\t\t}\n\n\t\tfor (const plugin of this._pluggables) {\n\t\t\tconst logEvent: InputLogEvent = { message, timestamp: Date.now() };\n\t\t\tplugin.pushLogs([logEvent]);\n\t\t}\n\t}\n\n\t/**\n\t * Write General log. Default to INFO\n\t * @method\n\t * @memeberof Logger\n\t * @param {string|object} msg - Logging message or object\n\t */\n\tlog(...msg) {\n\t\tthis._log(LOG_TYPE.INFO, ...msg);\n\t}\n\n\t/**\n\t * Write INFO log\n\t * @method\n\t * @memeberof Logger\n\t * @param {string|object} msg - Logging message or object\n\t */\n\tinfo(...msg) {\n\t\tthis._log(LOG_TYPE.INFO, ...msg);\n\t}\n\n\t/**\n\t * Write WARN log\n\t * @method\n\t * @memeberof Logger\n\t * @param {string|object} msg - Logging message or object\n\t */\n\twarn(...msg) {\n\t\tthis._log(LOG_TYPE.WARN, ...msg);\n\t}\n\n\t/**\n\t * Write ERROR log\n\t * @method\n\t * @memeberof Logger\n\t * @param {string|object} msg - Logging message or object\n\t */\n\terror(...msg) {\n\t\tthis._log(LOG_TYPE.ERROR, ...msg);\n\t}\n\n\t/**\n\t * Write DEBUG log\n\t * @method\n\t * @memeberof Logger\n\t * @param {string|object} msg - Logging message or object\n\t */\n\tdebug(...msg) {\n\t\tthis._log(LOG_TYPE.DEBUG, ...msg);\n\t}\n\n\t/**\n\t * Write VERBOSE log\n\t * @method\n\t * @memeberof Logger\n\t * @param {string|object} msg - Logging message or object\n\t */\n\tverbose(...msg) {\n\t\tthis._log(LOG_TYPE.VERBOSE, ...msg);\n\t}\n\n\taddPluggable(pluggable: LoggingProvider) {\n\t\tif (pluggable && pluggable.getCategoryName() === AWS_CLOUDWATCH_CATEGORY) {\n\t\t\tthis._pluggables.push(pluggable);\n\t\t\tpluggable.configure(this._config);\n\t\t}\n\t}\n\n\tlistPluggables() {\n\t\treturn this._pluggables;\n\t}\n}\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nimport { ConsoleLogger as Logger } from './Logger';\n\nconst logger = new Logger('Hub');\n\nconst AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&\ntypeof Symbol.for === 'function'\n\t? Symbol.for('amplify_default')\n\t: '@@amplify_default') as Symbol;\ninterface IPattern {\n\tpattern: RegExp;\n\tcallback: HubCallback;\n}\n\ninterface IListener {\n\tname: string;\n\tcallback: HubCallback;\n}\n\nexport type HubCapsule = {\n\tchannel: string;\n\tpayload: HubPayload;\n\tsource: string;\n\tpatternInfo?: string[];\n};\n\nexport type HubPayload = {\n\tevent: string;\n\tdata?: any;\n\tmessage?: string;\n};\n\nexport type HubCallback = (capsule: HubCapsule) => void;\n\nexport type LegacyCallback = { onHubCapsule: HubCallback };\n\nfunction isLegacyCallback(callback: any): callback is LegacyCallback {\n\treturn (callback).onHubCapsule !== undefined;\n}\n\nexport class HubClass {\n\tname: string;\n\tprivate listeners: IListener[] = [];\n\tprivate patterns: IPattern[] = [];\n\n\tprotectedChannels = [\n\t\t'core',\n\t\t'auth',\n\t\t'api',\n\t\t'analytics',\n\t\t'interactions',\n\t\t'pubsub',\n\t\t'storage',\n\t\t'ui',\n\t\t'xr',\n\t];\n\n\tconstructor(name: string) {\n\t\tthis.name = name;\n\t}\n\n\t// Note - Need to pass channel as a reference for removal to work and not anonymous function\n\tremove(channel: string | RegExp, listener: HubCallback) {\n\t\tif (channel instanceof RegExp) {\n\t\t\tconst pattern = this.patterns.find(\n\t\t\t\t({ pattern }) => pattern.source === channel.source\n\t\t\t);\n\t\t\tif (!pattern) {\n\t\t\t\tlogger.warn(`No listeners for ${channel}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.patterns = [...this.patterns.filter(x => x !== pattern)];\n\t\t} else {\n\t\t\tconst holder = this.listeners[channel];\n\t\t\tif (!holder) {\n\t\t\t\tlogger.warn(`No listeners for ${channel}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.listeners[channel] = [\n\t\t\t\t...holder.filter(({ callback }) => callback !== listener),\n\t\t\t];\n\t\t}\n\t}\n\n\tdispatch(\n\t\tchannel: string,\n\t\tpayload: HubPayload,\n\t\tsource: string = '',\n\t\tampSymbol?: Symbol\n\t) {\n\t\tif (this.protectedChannels.indexOf(channel) > -1) {\n\t\t\tconst hasAccess = ampSymbol === AMPLIFY_SYMBOL;\n\n\t\t\tif (!hasAccess) {\n\t\t\t\tlogger.warn(\n\t\t\t\t\t`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst capsule: HubCapsule = {\n\t\t\tchannel,\n\t\t\tpayload: { ...payload },\n\t\t\tsource,\n\t\t\tpatternInfo: [],\n\t\t};\n\n\t\ttry {\n\t\t\tthis._toListeners(capsule);\n\t\t} catch (e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t}\n\n\tlisten(\n\t\tchannel: string | RegExp,\n\t\tcallback?: HubCallback | LegacyCallback,\n\t\tlistenerName = 'noname'\n\t) {\n\t\tlet cb: HubCallback;\n\t\t// Check for legacy onHubCapsule callback for backwards compatability\n\t\tif (isLegacyCallback(callback)) {\n\t\t\tlogger.warn(\n\t\t\t\t`WARNING onHubCapsule is Deprecated. Please pass in a callback.`\n\t\t\t);\n\t\t\tcb = callback.onHubCapsule.bind(callback);\n\t\t} else if (typeof callback !== 'function') {\n\t\t\tthrow new Error('No callback supplied to Hub');\n\t\t} else {\n\t\t\tcb = callback;\n\t\t}\n\n\t\tif (channel instanceof RegExp) {\n\t\t\tthis.patterns.push({\n\t\t\t\tpattern: channel,\n\t\t\t\tcallback: cb,\n\t\t\t});\n\t\t} else {\n\t\t\tlet holder = this.listeners[channel];\n\n\t\t\tif (!holder) {\n\t\t\t\tholder = [];\n\t\t\t\tthis.listeners[channel] = holder;\n\t\t\t}\n\n\t\t\tholder.push({\n\t\t\t\tname: listenerName,\n\t\t\t\tcallback: cb,\n\t\t\t});\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis.remove(channel, cb);\n\t\t};\n\t}\n\n\tprivate _toListeners(capsule: HubCapsule) {\n\t\tconst { channel, payload } = capsule;\n\t\tconst holder = this.listeners[channel];\n\n\t\tif (holder) {\n\t\t\tholder.forEach(listener => {\n\t\t\t\tlogger.debug(`Dispatching to ${channel} with `, payload);\n\t\t\t\ttry {\n\t\t\t\t\tlistener.callback(capsule);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tlogger.error(e);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (this.patterns.length > 0) {\n\t\t\tif (!payload.message) {\n\t\t\t\tlogger.warn(`Cannot perform pattern matching without a message key`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst payloadStr = payload.message;\n\n\t\t\tthis.patterns.forEach(pattern => {\n\t\t\t\tconst match = payloadStr.match(pattern.pattern);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst [, ...groups] = match;\n\t\t\t\t\tconst dispatchingCapsule: HubCapsule = {\n\t\t\t\t\t\t...capsule,\n\t\t\t\t\t\tpatternInfo: groups,\n\t\t\t\t\t};\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpattern.callback(dispatchingCapsule);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlogger.error(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\n/*We export a __default__ instance of HubClass to use it as a \npseudo Singleton for the main messaging bus, however you can still create\nyour own instance of HubClass() for a separate \"private bus\" of events.*/\nexport const Hub = new HubClass('__default__');\n/**\n * @deprecated use named import\n */\nexport default Hub;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nlet dataMemory = {};\n\n/** @class */\nexport class MemoryStorage {\n\t/**\n\t * This is used to set a specific item in storage\n\t * @param {string} key - the key for the item\n\t * @param {object} value - the value\n\t * @returns {string} value that was set\n\t */\n\tstatic setItem(key: string, value: any) {\n\t\tdataMemory[key] = value;\n\t\treturn dataMemory[key];\n\t}\n\n\t/**\n\t * This is used to get a specific key from storage\n\t * @param {string} key - the key for the item\n\t * This is used to clear the storage\n\t * @returns {string} the data item\n\t */\n\tstatic getItem(key: string) {\n\t\treturn Object.prototype.hasOwnProperty.call(dataMemory, key)\n\t\t\t? dataMemory[key]\n\t\t\t: undefined;\n\t}\n\n\t/**\n\t * This is used to remove an item from storage\n\t * @param {string} key - the key being set\n\t * @returns {string} value - value that was deleted\n\t */\n\tstatic removeItem(key: string) {\n\t\treturn delete dataMemory[key];\n\t}\n\n\t/**\n\t * This is used to clear the storage\n\t * @returns {string} nothing\n\t */\n\tstatic clear() {\n\t\tdataMemory = {};\n\t\treturn dataMemory;\n\t}\n}\n\nexport class StorageHelper {\n\tprivate storageWindow: any;\n\t/**\n\t * This is used to get a storage object\n\t * @returns {object} the storage\n\t */\n\tconstructor() {\n\t\ttry {\n\t\t\tthis.storageWindow = window.localStorage;\n\t\t\tthis.storageWindow.setItem('aws.amplify.test-ls', 1);\n\t\t\tthis.storageWindow.removeItem('aws.amplify.test-ls');\n\t\t} catch (exception) {\n\t\t\tthis.storageWindow = MemoryStorage;\n\t\t}\n\t}\n\n\t/**\n\t * This is used to return the storage\n\t * @returns {object} the storage\n\t */\n\tgetStorage(): any {\n\t\treturn this.storageWindow;\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default StorageHelper;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nconst MIME_MAP = [\n\t{ type: 'text/plain', ext: 'txt' },\n\t{ type: 'text/html', ext: 'html' },\n\t{ type: 'text/javascript', ext: 'js' },\n\t{ type: 'text/css', ext: 'css' },\n\t{ type: 'text/csv', ext: 'csv' },\n\t{ type: 'text/yaml', ext: 'yml' },\n\t{ type: 'text/yaml', ext: 'yaml' },\n\t{ type: 'text/calendar', ext: 'ics' },\n\t{ type: 'text/calendar', ext: 'ical' },\n\n\t{ type: 'image/apng', ext: 'apng' },\n\t{ type: 'image/bmp', ext: 'bmp' },\n\t{ type: 'image/gif', ext: 'gif' },\n\t{ type: 'image/x-icon', ext: 'ico' },\n\t{ type: 'image/x-icon', ext: 'cur' },\n\t{ type: 'image/jpeg', ext: 'jpg' },\n\t{ type: 'image/jpeg', ext: 'jpeg' },\n\t{ type: 'image/jpeg', ext: 'jfif' },\n\t{ type: 'image/jpeg', ext: 'pjp' },\n\t{ type: 'image/jpeg', ext: 'pjpeg' },\n\t{ type: 'image/png', ext: 'png' },\n\t{ type: 'image/svg+xml', ext: 'svg' },\n\t{ type: 'image/tiff', ext: 'tif' },\n\t{ type: 'image/tiff', ext: 'tiff' },\n\t{ type: 'image/webp', ext: 'webp' },\n\n\t{ type: 'application/json', ext: 'json' },\n\t{ type: 'application/xml', ext: 'xml' },\n\t{ type: 'application/x-sh', ext: 'sh' },\n\t{ type: 'application/zip', ext: 'zip' },\n\t{ type: 'application/x-rar-compressed', ext: 'rar' },\n\t{ type: 'application/x-tar', ext: 'tar' },\n\t{ type: 'application/x-bzip', ext: 'bz' },\n\t{ type: 'application/x-bzip2', ext: 'bz2' },\n\t{ type: 'application/pdf', ext: 'pdf' },\n\t{ type: 'application/java-archive', ext: 'jar' },\n\t{ type: 'application/msword', ext: 'doc' },\n\t{ type: 'application/vnd.ms-excel', ext: 'xls' },\n\t{ type: 'application/vnd.ms-excel', ext: 'xlsx' },\n\n\t{ type: 'message/rfc822', ext: 'eml' },\n];\n\nexport const isEmpty = (obj = {}) => Object.keys(obj).length === 0;\n\nexport const sortByField = (list, field, dir) => {\n\tif (!list || !list.sort) {\n\t\treturn false;\n\t}\n\n\tconst dirX = dir && dir === 'desc' ? -1 : 1;\n\tlist.sort(function(a, b) {\n\t\tconst a_val = a[field];\n\t\tconst b_val = b[field];\n\n\t\tif (typeof b_val === 'undefined') {\n\t\t\treturn typeof a_val === 'undefined' ? 0 : 1 * dirX;\n\t\t}\n\n\t\tif (typeof a_val === 'undefined') {\n\t\t\treturn -1 * dirX;\n\t\t}\n\n\t\tif (a_val < b_val) {\n\t\t\treturn -1 * dirX;\n\t\t}\n\t\tif (a_val > b_val) {\n\t\t\treturn 1 * dirX;\n\t\t}\n\n\t\treturn 0;\n\t});\n\n\treturn true;\n};\n\nexport const objectLessAttributes = (obj, less) => {\n\tconst ret = Object.assign({}, obj);\n\tif (less) {\n\t\tif (typeof less === 'string') {\n\t\t\tdelete ret[less];\n\t\t} else {\n\t\t\tless.forEach(attr => {\n\t\t\t\tdelete ret[attr];\n\t\t\t});\n\t\t}\n\t}\n\n\treturn ret;\n};\n\nexport const filenameToContentType = (\n\tfilename,\n\tdefVal = 'application/octet-stream'\n) => {\n\tconst name = filename.toLowerCase();\n\n\tconst filtered = MIME_MAP.filter(mime => name.endsWith('.' + mime.ext));\n\treturn filtered.length > 0 ? filtered[0].type : defVal;\n};\n\nexport const isTextFile = contentType => {\n\tconst type = contentType.toLowerCase();\n\tif (type.startsWith('text/')) {\n\t\treturn true;\n\t}\n\treturn (\n\t\t'application/json' === type ||\n\t\t'application/xml' === type ||\n\t\t'application/sh' === type\n\t);\n};\n\nexport const generateRandomString = () => {\n\tlet result = '';\n\tconst chars =\n\t\t'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\tfor (let i = 32; i > 0; i -= 1) {\n\t\tresult += chars[Math.floor(Math.random() * chars.length)];\n\t}\n\treturn result;\n};\n\nexport const makeQuerablePromise = promise => {\n\tif (promise.isResolved) return promise;\n\n\tlet isPending = true;\n\tlet isRejected = false;\n\tlet isFullfilled = false;\n\n\tconst result = promise.then(\n\t\tdata => {\n\t\t\tisFullfilled = true;\n\t\t\tisPending = false;\n\t\t\treturn data;\n\t\t},\n\t\te => {\n\t\t\tisRejected = true;\n\t\t\tisPending = false;\n\t\t\tthrow e;\n\t\t}\n\t);\n\n\tresult.isFullfilled = () => isFullfilled;\n\tresult.isPending = () => isPending;\n\tresult.isRejected = () => isRejected;\n\n\treturn result;\n};\n\nexport const isWebWorker = () => {\n\tif (typeof self === 'undefined') {\n\t\treturn false;\n\t}\n\tconst selfContext = self as { WorkerGlobalScope? };\n\treturn typeof selfContext.WorkerGlobalScope !== 'undefined' &&\n\t\tself instanceof selfContext.WorkerGlobalScope;\n};\n\nexport const browserOrNode = () => {\n\tconst isBrowser =\n\t\ttypeof window !== 'undefined' && typeof window.document !== 'undefined';\n\tconst isNode =\n\t\ttypeof process !== 'undefined' &&\n\t\tprocess.versions != null &&\n\t\tprocess.versions.node != null;\n\n\treturn {\n\t\tisBrowser,\n\t\tisNode,\n\t};\n};\n\n/**\n * transfer the first letter of the keys to lowercase\n * @param {Object} obj - the object need to be transferred\n * @param {Array} whiteListForItself - whitelist itself from being transferred\n * @param {Array} whiteListForChildren - whitelist its children keys from being transferred\n */\nexport const transferKeyToLowerCase = (\n\tobj,\n\twhiteListForItself = [],\n\twhiteListForChildren = []\n) => {\n\tif (!isStrictObject(obj)) return obj;\n\tconst ret = {};\n\n\tfor (const key in obj) {\n\t\tif (obj.hasOwnProperty(key)) {\n\t\t\tconst transferedKey = whiteListForItself.includes(key)\n\t\t\t\t? key\n\t\t\t\t: key[0].toLowerCase() + key.slice(1);\n\n\t\t\tret[transferedKey] = whiteListForChildren.includes(key)\n\t\t\t\t? obj[key]\n\t\t\t\t: transferKeyToLowerCase(\n\t\t\t\t\t\tobj[key],\n\t\t\t\t\t\twhiteListForItself,\n\t\t\t\t\t\twhiteListForChildren\n\t\t\t\t );\n\t\t}\n\t}\n\n\treturn ret;\n};\n\n/**\n * transfer the first letter of the keys to lowercase\n * @param {Object} obj - the object need to be transferred\n * @param {Array} whiteListForItself - whitelist itself from being transferred\n * @param {Array} whiteListForChildren - whitelist its children keys from being transferred\n */\nexport const transferKeyToUpperCase = (\n\tobj,\n\twhiteListForItself = [],\n\twhiteListForChildren = []\n) => {\n\tif (!isStrictObject(obj)) return obj;\n\tconst ret = {};\n\n\tfor (const key in obj) {\n\t\tif (obj.hasOwnProperty(key)) {\n\t\t\tconst transferredKey = whiteListForItself.includes(key)\n\t\t\t\t? key\n\t\t\t\t: key[0].toUpperCase() + key.slice(1);\n\n\t\t\tret[transferredKey] = whiteListForChildren.includes(key)\n\t\t\t\t? obj[key]\n\t\t\t\t: transferKeyToUpperCase(\n\t\t\t\t\t\tobj[key],\n\t\t\t\t\t\twhiteListForItself,\n\t\t\t\t\t\twhiteListForChildren\n\t\t\t\t );\n\t\t}\n\t}\n\treturn ret;\n};\n\n/**\n * Return true if the object is a strict object\n * which means it's not Array, Function, Number, String, Boolean or Null\n * @param obj the Object\n */\nexport const isStrictObject = obj => {\n\treturn (\n\t\tobj instanceof Object &&\n\t\t!(obj instanceof Array) &&\n\t\t!(obj instanceof Function) &&\n\t\t!(obj instanceof Number) &&\n\t\t!(obj instanceof String) &&\n\t\t!(obj instanceof Boolean)\n\t);\n};\n\n/**\n * @deprecated use per-function imports\n */\nexport class JS {\n\tstatic isEmpty = isEmpty;\n\tstatic sortByField = sortByField;\n\tstatic objectLessAttributes = objectLessAttributes;\n\tstatic filenameToContentType = filenameToContentType;\n\tstatic isTextFile = isTextFile;\n\tstatic generateRandomString = generateRandomString;\n\tstatic makeQuerablePromise = makeQuerablePromise;\n\tstatic isWebWorker = isWebWorker;\n\tstatic browserOrNode = browserOrNode;\n\tstatic transferKeyToLowerCase = transferKeyToLowerCase;\n\tstatic transferKeyToUpperCase = transferKeyToUpperCase;\n\tstatic isStrictObject = isStrictObject;\n}\n\n/**\n * @deprecated use per-function imports\n */\nexport default JS;\n","import { DelayFunction } from '../types';\nimport { ConsoleLogger as Logger } from '../Logger/ConsoleLogger';\nconst logger = new Logger('Util');\n\nexport class NonRetryableError extends Error {\n\tpublic readonly nonRetryable = true;\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t}\n}\n\nconst isNonRetryableError = (obj: any): obj is NonRetryableError => {\n\tconst key: keyof NonRetryableError = 'nonRetryable';\n\treturn obj && obj[key];\n};\n\n/**\n * @private\n * Internal use of Amplify only\n */\nexport async function retry(\n\tfunctionToRetry: (...args: any[]) => T,\n\targs: any[],\n\tdelayFn: DelayFunction,\n\tonTerminate?: Promise\n): Promise {\n\tif (typeof functionToRetry !== 'function') {\n\t\tthrow Error('functionToRetry must be a function');\n\t}\n\n\treturn new Promise(async (resolve, reject) => {\n\t\tlet attempt = 0;\n\t\tlet terminated = false;\n\t\tlet timeout: any;\n\t\tlet wakeUp: any = () => {}; // will be replaced with a resolver()\n\n\t\t// used after the loop if terminated while waiting for a timer.\n\t\tlet lastError: Error;\n\n\t\tonTerminate &&\n\t\t\tonTerminate.then(() => {\n\t\t\t\t// signal not to try anymore.\n\t\t\t\tterminated = true;\n\n\t\t\t\t// stop sleeping if we're sleeping.\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\twakeUp();\n\t\t\t});\n\n\t\twhile (!terminated) {\n\t\t\tattempt++;\n\n\t\t\tlogger.debug(\n\t\t\t\t`${\n\t\t\t\t\tfunctionToRetry.name\n\t\t\t\t} attempt #${attempt} with this vars: ${JSON.stringify(args)}`\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\treturn resolve(await functionToRetry(...args));\n\t\t\t} catch (err) {\n\t\t\t\tlastError = err;\n\t\t\t\tlogger.debug(`error on ${functionToRetry.name}`, err);\n\n\t\t\t\tif (isNonRetryableError(err)) {\n\t\t\t\t\tlogger.debug(`${functionToRetry.name} non retryable error`, err);\n\t\t\t\t\treturn reject(err);\n\t\t\t\t}\n\n\t\t\t\tconst retryIn = delayFn(attempt, args, err);\n\t\t\t\tlogger.debug(`${functionToRetry.name} retrying in ${retryIn} ms`);\n\n\t\t\t\t// we check `terminated` again here because it could have flipped\n\t\t\t\t// in the time it took `functionToRetry` to return.\n\t\t\t\tif (retryIn === false || terminated) {\n\t\t\t\t\treturn reject(err);\n\t\t\t\t} else {\n\t\t\t\t\tawait new Promise(r => {\n\t\t\t\t\t\twakeUp = r; // export wakeUp for onTerminate handling\n\t\t\t\t\t\ttimeout = setTimeout(wakeUp, retryIn);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// reached if terminated while waiting for a timer.\n\t\treject(lastError);\n\t});\n}\n\nconst MAX_DELAY_MS = 5 * 60 * 1000;\n\n/**\n * @private\n * Internal use of Amplify only\n */\nexport function jitteredBackoff(\n\tmaxDelayMs: number = MAX_DELAY_MS\n): DelayFunction {\n\tconst BASE_TIME_MS = 100;\n\tconst JITTER_FACTOR = 100;\n\n\treturn attempt => {\n\t\tconst delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();\n\t\treturn delay > maxDelayMs ? false : delay;\n\t};\n}\n\n/**\n * @private\n * Internal use of Amplify only\n */\nexport const jitteredExponentialRetry = (\n\tfunctionToRetry: (...args: any[]) => T,\n\targs: any[],\n\tmaxDelayMs: number = MAX_DELAY_MS,\n\tonTerminate?: Promise\n): Promise =>\n\tretry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { browserOrNode } from '../JS';\nimport { NonRetryableError } from '../Util';\n\nconst logger = new Logger('CognitoCredentials');\n\nconst waitForInit = new Promise((res, rej) => {\n\tif (!browserOrNode().isBrowser) {\n\t\tlogger.debug('not in the browser, directly resolved');\n\t\treturn res();\n\t}\n\tconst ga =\n\t\twindow['gapi'] && window['gapi'].auth2 ? window['gapi'].auth2 : null;\n\tif (ga) {\n\t\tlogger.debug('google api already loaded');\n\t\treturn res();\n\t} else {\n\t\tsetTimeout(() => {\n\t\t\treturn res();\n\t\t}, 2000);\n\t}\n});\n\nexport class GoogleOAuth {\n\tpublic initialized = false;\n\n\tconstructor() {\n\t\tthis.refreshGoogleToken = this.refreshGoogleToken.bind(this);\n\t\tthis._refreshGoogleTokenImpl = this._refreshGoogleTokenImpl.bind(this);\n\t}\n\n\tpublic async refreshGoogleToken() {\n\t\tif (!this.initialized) {\n\t\t\tlogger.debug('need to wait for the Google SDK loaded');\n\t\t\tawait waitForInit;\n\t\t\tthis.initialized = true;\n\t\t\tlogger.debug('finish waiting');\n\t\t}\n\n\t\treturn this._refreshGoogleTokenImpl();\n\t}\n\n\tprivate _refreshGoogleTokenImpl() {\n\t\tlet ga = null;\n\t\tif (browserOrNode().isBrowser)\n\t\t\tga = window['gapi'] && window['gapi'].auth2 ? window['gapi'].auth2 : null;\n\t\tif (!ga) {\n\t\t\tlogger.debug('no gapi auth2 available');\n\t\t\treturn Promise.reject('no gapi auth2 available');\n\t\t}\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tga.getAuthInstance()\n\t\t\t\t.then(googleAuth => {\n\t\t\t\t\tif (!googleAuth) {\n\t\t\t\t\t\tlogger.debug('google Auth undefined');\n\t\t\t\t\t\trej(new NonRetryableError('google Auth undefined'));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst googleUser = googleAuth.currentUser.get();\n\t\t\t\t\t// refresh the token\n\t\t\t\t\tif (googleUser.isSignedIn()) {\n\t\t\t\t\t\tlogger.debug('refreshing the google access token');\n\t\t\t\t\t\tgoogleUser\n\t\t\t\t\t\t\t.reloadAuthResponse()\n\t\t\t\t\t\t\t.then(authResponse => {\n\t\t\t\t\t\t\t\tconst { id_token, expires_at } = authResponse;\n\t\t\t\t\t\t\t\tres({ token: id_token, expires_at });\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\t\tif (err && err.error === 'network_error') {\n\t\t\t\t\t\t\t\t\t// Not using NonRetryableError so handler will be retried\n\t\t\t\t\t\t\t\t\trej('Network error reloading google auth response');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\tnew NonRetryableError(\n\t\t\t\t\t\t\t\t\t\t\t'Failed to reload google auth response'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\trej(new NonRetryableError('User is not signed in with Google'));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tlogger.debug('Failed to refresh google token', err);\n\t\t\t\t\trej(new NonRetryableError('Failed to refresh google token'));\n\t\t\t\t});\n\t\t});\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default GoogleOAuth;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { browserOrNode } from '../JS';\nimport { NonRetryableError } from '../Util';\n\nconst logger = new Logger('CognitoCredentials');\n\nconst waitForInit = new Promise((res, rej) => {\n\tif (!browserOrNode().isBrowser) {\n\t\tlogger.debug('not in the browser, directly resolved');\n\t\treturn res();\n\t}\n\tconst fb = window['FB'];\n\tif (fb) {\n\t\tlogger.debug('FB SDK already loaded');\n\t\treturn res();\n\t} else {\n\t\tsetTimeout(() => {\n\t\t\treturn res();\n\t\t}, 2000);\n\t}\n});\n\nexport class FacebookOAuth {\n\tpublic initialized = false;\n\n\tconstructor() {\n\t\tthis.refreshFacebookToken = this.refreshFacebookToken.bind(this);\n\t\tthis._refreshFacebookTokenImpl = this._refreshFacebookTokenImpl.bind(this);\n\t}\n\n\tpublic async refreshFacebookToken() {\n\t\tif (!this.initialized) {\n\t\t\tlogger.debug('need to wait for the Facebook SDK loaded');\n\t\t\tawait waitForInit;\n\t\t\tthis.initialized = true;\n\t\t\tlogger.debug('finish waiting');\n\t\t}\n\n\t\treturn this._refreshFacebookTokenImpl();\n\t}\n\n\tprivate _refreshFacebookTokenImpl() {\n\t\tlet fb = null;\n\t\tif (browserOrNode().isBrowser) fb = window['FB'];\n\t\tif (!fb) {\n\t\t\tconst errorMessage = 'no fb sdk available';\n\t\t\tlogger.debug(errorMessage);\n\t\t\treturn Promise.reject(new NonRetryableError(errorMessage));\n\t\t}\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tfb.getLoginStatus(\n\t\t\t\tfbResponse => {\n\t\t\t\t\tif (!fbResponse || !fbResponse.authResponse) {\n\t\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\t\t'no response from facebook when refreshing the jwt token';\n\t\t\t\t\t\tlogger.debug(errorMessage);\n\t\t\t\t\t\t// There is no definitive indication for a network error in\n\t\t\t\t\t\t// fbResponse, so we are treating it as an invalid token.\n\t\t\t\t\t\trej(new NonRetryableError(errorMessage));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst response = fbResponse.authResponse;\n\t\t\t\t\t\tconst { accessToken, expiresIn } = response;\n\t\t\t\t\t\tconst date = new Date();\n\t\t\t\t\t\tconst expires_at = expiresIn * 1000 + date.getTime();\n\t\t\t\t\t\tif (!accessToken) {\n\t\t\t\t\t\t\tconst errorMessage = 'the jwtToken is undefined';\n\t\t\t\t\t\t\tlogger.debug(errorMessage);\n\t\t\t\t\t\t\trej(new NonRetryableError(errorMessage));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tres({\n\t\t\t\t\t\t\ttoken: accessToken,\n\t\t\t\t\t\t\texpires_at,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ scope: 'public_profile,email' }\n\t\t\t);\n\t\t});\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default FacebookOAuth;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { GoogleOAuth as GoogleOAuthClass } from './GoogleOAuth';\nimport { FacebookOAuth as FacebookOAuthClass } from './FacebookOAuth';\n\nexport const GoogleOAuth = new GoogleOAuthClass();\nexport const FacebookOAuth = new FacebookOAuthClass();\n","import { ConsoleLogger as LoggerClass } from './Logger';\n\nconst logger = new LoggerClass('Amplify');\n\nexport class AmplifyClass {\n\t// Everything that is `register`ed is tracked here\n\tprivate _components = [];\n\tprivate _config = {};\n\n\t// All modules (with `getModuleName()`) are stored here for dependency injection\n\tprivate _modules = {};\n\n\t// for backward compatibility to avoid breaking change\n\t// if someone is using like Amplify.Auth\n\tAuth = null;\n\tAnalytics = null;\n\tAPI = null;\n\tCredentials = null;\n\tStorage = null;\n\tI18n = null;\n\tCache = null;\n\tPubSub = null;\n\tInteractions = null;\n\tPushnotification = null;\n\tUI = null;\n\tXR = null;\n\tPredictions = null;\n\tDataStore = null;\n\tGeo = null;\n\n\tLogger = LoggerClass;\n\tServiceWorker = null;\n\n\tregister(comp) {\n\t\tlogger.debug('component registered in amplify', comp);\n\t\tthis._components.push(comp);\n\t\tif (typeof comp.getModuleName === 'function') {\n\t\t\tthis._modules[comp.getModuleName()] = comp;\n\t\t\tthis[comp.getModuleName()] = comp;\n\t\t} else {\n\t\t\tlogger.debug('no getModuleName method for component', comp);\n\t\t}\n\n\t\t// Finally configure this new component(category) loaded\n\t\t// With the new modularization changes in Amplify V3, all the Amplify\n\t\t// component are not loaded/registered right away but when they are\n\t\t// imported (and hence instantiated) in the client's app. This ensures\n\t\t// that all new components imported get correctly configured with the\n\t\t// configuration that Amplify.configure() was called with.\n\t\tcomp.configure(this._config);\n\t}\n\n\tconfigure(config?) {\n\t\tif (!config) return this._config;\n\n\t\tthis._config = Object.assign(this._config, config);\n\t\tlogger.debug('amplify config', this._config);\n\n\t\t// Dependency Injection via property-setting.\n\t\t// This avoids introducing a public method/interface/setter that's difficult to remove later.\n\t\t// Plus, it reduces `if` statements within the `constructor` and `configure` of each module\n\t\tObject.entries(this._modules).forEach(([Name, comp]) => {\n\t\t\t// e.g. Auth.*\n\t\t\tObject.keys(comp).forEach(property => {\n\t\t\t\t// e.g. Auth[\"Credentials\"] = this._modules[\"Credentials\"] when set\n\t\t\t\tif (this._modules[property]) {\n\t\t\t\t\tcomp[property] = this._modules[property];\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis._components.map(comp => {\n\t\t\tcomp.configure(this._config);\n\t\t});\n\n\t\treturn this._config;\n\t}\n\n\taddPluggable(pluggable) {\n\t\tif (\n\t\t\tpluggable &&\n\t\t\tpluggable['getCategory'] &&\n\t\t\ttypeof pluggable['getCategory'] === 'function'\n\t\t) {\n\t\t\tthis._components.map(comp => {\n\t\t\t\tif (\n\t\t\t\t\tcomp['addPluggable'] &&\n\t\t\t\t\ttypeof comp['addPluggable'] === 'function'\n\t\t\t\t) {\n\t\t\t\t\tcomp.addPluggable(pluggable);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport const Amplify = new AmplifyClass();\n\n/**\n * @deprecated use named import\n */\nexport default Amplify;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { SmithyException as __SmithyException } from \"@aws-sdk/smithy-client\";\nimport { MetadataBearer as $MetadataBearer } from \"@aws-sdk/types\";\n\nexport enum AmbiguousRoleResolutionType {\n AUTHENTICATED_ROLE = \"AuthenticatedRole\",\n DENY = \"Deny\",\n}\n\n/**\n *

A provider representing an Amazon Cognito user pool and its client ID.

\n */\nexport interface CognitoIdentityProvider {\n /**\n *

The provider name for an Amazon Cognito user pool. For example,\n * cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789.

\n */\n ProviderName?: string;\n\n /**\n *

The client ID for the Amazon Cognito user pool.

\n */\n ClientId?: string;\n\n /**\n *

TRUE if server-side token validation is enabled for the identity provider’s\n * token.

\n *

Once you set ServerSideTokenCheck to TRUE for an identity pool, that\n * identity pool will check with the integrated user pools to make sure that the user has not\n * been globally signed out or deleted before the identity pool provides an OIDC token or AWS\n * credentials for the user.

\n *

If the user is signed out or deleted, the identity pool will return a 400 Not\n * Authorized error.

\n */\n ServerSideTokenCheck?: boolean;\n}\n\nexport namespace CognitoIdentityProvider {\n export const filterSensitiveLog = (obj: CognitoIdentityProvider): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the CreateIdentityPool action.

\n */\nexport interface CreateIdentityPoolInput {\n /**\n *

A string that you provide.

\n */\n IdentityPoolName: string | undefined;\n\n /**\n *

TRUE if the identity pool supports unauthenticated logins.

\n */\n AllowUnauthenticatedIdentities: boolean | undefined;\n\n /**\n *

Enables or disables the Basic (Classic) authentication flow. For more information, see\n * Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.

\n */\n AllowClassicFlow?: boolean;\n\n /**\n *

Optional key:value pairs mapping provider names to provider app IDs.

\n */\n SupportedLoginProviders?: { [key: string]: string };\n\n /**\n *

The \"domain\" by which Cognito will refer to your users. This name acts as a\n * placeholder that allows your backend and the Cognito service to communicate about the\n * developer provider. For the DeveloperProviderName, you can use letters as well\n * as period (.), underscore (_), and dash\n * (-).

\n *

Once you have set a developer provider name, you cannot change it. Please take care\n * in setting this parameter.

\n */\n DeveloperProviderName?: string;\n\n /**\n *

A list of OpendID Connect provider ARNs.

\n */\n OpenIdConnectProviderARNs?: string[];\n\n /**\n *

An array of Amazon Cognito user pools and their client IDs.

\n */\n CognitoIdentityProviders?: CognitoIdentityProvider[];\n\n /**\n *

An array of Amazon Resource Names (ARNs) of the SAML provider for your identity\n * pool.

\n */\n SamlProviderARNs?: string[];\n\n /**\n *

Tags to assign to the identity pool. A tag is a label that you can apply to identity\n * pools to categorize and manage them in different ways, such as by purpose, owner,\n * environment, or other criteria.

\n */\n IdentityPoolTags?: { [key: string]: string };\n}\n\nexport namespace CreateIdentityPoolInput {\n export const filterSensitiveLog = (obj: CreateIdentityPoolInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

An object representing an Amazon Cognito identity pool.

\n */\nexport interface IdentityPool {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

A string that you provide.

\n */\n IdentityPoolName: string | undefined;\n\n /**\n *

TRUE if the identity pool supports unauthenticated logins.

\n */\n AllowUnauthenticatedIdentities: boolean | undefined;\n\n /**\n *

Enables or disables the Basic (Classic) authentication flow. For more information, see\n * Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.

\n */\n AllowClassicFlow?: boolean;\n\n /**\n *

Optional key:value pairs mapping provider names to provider app IDs.

\n */\n SupportedLoginProviders?: { [key: string]: string };\n\n /**\n *

The \"domain\" by which Cognito will refer to your users.

\n */\n DeveloperProviderName?: string;\n\n /**\n *

A list of OpendID Connect provider ARNs.

\n */\n OpenIdConnectProviderARNs?: string[];\n\n /**\n *

A list representing an Amazon Cognito user pool and its client ID.

\n */\n CognitoIdentityProviders?: CognitoIdentityProvider[];\n\n /**\n *

An array of Amazon Resource Names (ARNs) of the SAML provider for your identity\n * pool.

\n */\n SamlProviderARNs?: string[];\n\n /**\n *

The tags that are assigned to the identity pool. A tag is a label that you can apply to\n * identity pools to categorize and manage them in different ways, such as by purpose, owner,\n * environment, or other criteria.

\n */\n IdentityPoolTags?: { [key: string]: string };\n}\n\nexport namespace IdentityPool {\n export const filterSensitiveLog = (obj: IdentityPool): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown when the service encounters an error during processing the request.

\n */\nexport interface InternalErrorException extends __SmithyException, $MetadataBearer {\n name: \"InternalErrorException\";\n $fault: \"server\";\n /**\n *

The message returned by an InternalErrorException.

\n */\n message?: string;\n}\n\nexport namespace InternalErrorException {\n export const filterSensitiveLog = (obj: InternalErrorException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown for missing or bad input parameter(s).

\n */\nexport interface InvalidParameterException extends __SmithyException, $MetadataBearer {\n name: \"InvalidParameterException\";\n $fault: \"client\";\n /**\n *

The message returned by an InvalidParameterException.

\n */\n message?: string;\n}\n\nexport namespace InvalidParameterException {\n export const filterSensitiveLog = (obj: InvalidParameterException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown when the total number of user pools has exceeded a preset limit.

\n */\nexport interface LimitExceededException extends __SmithyException, $MetadataBearer {\n name: \"LimitExceededException\";\n $fault: \"client\";\n /**\n *

The message returned by a LimitExceededException.

\n */\n message?: string;\n}\n\nexport namespace LimitExceededException {\n export const filterSensitiveLog = (obj: LimitExceededException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown when a user is not authorized to access the requested resource.

\n */\nexport interface NotAuthorizedException extends __SmithyException, $MetadataBearer {\n name: \"NotAuthorizedException\";\n $fault: \"client\";\n /**\n *

The message returned by a NotAuthorizedException

\n */\n message?: string;\n}\n\nexport namespace NotAuthorizedException {\n export const filterSensitiveLog = (obj: NotAuthorizedException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown when a user tries to use a login which is already linked to another\n * account.

\n */\nexport interface ResourceConflictException extends __SmithyException, $MetadataBearer {\n name: \"ResourceConflictException\";\n $fault: \"client\";\n /**\n *

The message returned by a ResourceConflictException.

\n */\n message?: string;\n}\n\nexport namespace ResourceConflictException {\n export const filterSensitiveLog = (obj: ResourceConflictException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown when a request is throttled.

\n */\nexport interface TooManyRequestsException extends __SmithyException, $MetadataBearer {\n name: \"TooManyRequestsException\";\n $fault: \"client\";\n /**\n *

Message returned by a TooManyRequestsException

\n */\n message?: string;\n}\n\nexport namespace TooManyRequestsException {\n export const filterSensitiveLog = (obj: TooManyRequestsException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the DeleteIdentities action.

\n */\nexport interface DeleteIdentitiesInput {\n /**\n *

A list of 1-60 identities that you want to delete.

\n */\n IdentityIdsToDelete: string[] | undefined;\n}\n\nexport namespace DeleteIdentitiesInput {\n export const filterSensitiveLog = (obj: DeleteIdentitiesInput): any => ({\n ...obj,\n });\n}\n\nexport enum ErrorCode {\n ACCESS_DENIED = \"AccessDenied\",\n INTERNAL_SERVER_ERROR = \"InternalServerError\",\n}\n\n/**\n *

An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and\n * IdentityId.

\n */\nexport interface UnprocessedIdentityId {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

The error code indicating the type of error that occurred.

\n */\n ErrorCode?: ErrorCode | string;\n}\n\nexport namespace UnprocessedIdentityId {\n export const filterSensitiveLog = (obj: UnprocessedIdentityId): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful DeleteIdentities\n * operation.

\n */\nexport interface DeleteIdentitiesResponse {\n /**\n *

An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and\n * IdentityId.

\n */\n UnprocessedIdentityIds?: UnprocessedIdentityId[];\n}\n\nexport namespace DeleteIdentitiesResponse {\n export const filterSensitiveLog = (obj: DeleteIdentitiesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the DeleteIdentityPool action.

\n */\nexport interface DeleteIdentityPoolInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace DeleteIdentityPoolInput {\n export const filterSensitiveLog = (obj: DeleteIdentityPoolInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown when the requested resource (for example, a dataset or record) does not\n * exist.

\n */\nexport interface ResourceNotFoundException extends __SmithyException, $MetadataBearer {\n name: \"ResourceNotFoundException\";\n $fault: \"client\";\n /**\n *

The message returned by a ResourceNotFoundException.

\n */\n message?: string;\n}\n\nexport namespace ResourceNotFoundException {\n export const filterSensitiveLog = (obj: ResourceNotFoundException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the DescribeIdentity action.

\n */\nexport interface DescribeIdentityInput {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId: string | undefined;\n}\n\nexport namespace DescribeIdentityInput {\n export const filterSensitiveLog = (obj: DescribeIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

A description of the identity.

\n */\nexport interface IdentityDescription {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

The provider names.

\n */\n Logins?: string[];\n\n /**\n *

Date on which the identity was created.

\n */\n CreationDate?: Date;\n\n /**\n *

Date on which the identity was last modified.

\n */\n LastModifiedDate?: Date;\n}\n\nexport namespace IdentityDescription {\n export const filterSensitiveLog = (obj: IdentityDescription): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the DescribeIdentityPool action.

\n */\nexport interface DescribeIdentityPoolInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace DescribeIdentityPoolInput {\n export const filterSensitiveLog = (obj: DescribeIdentityPoolInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

An exception thrown when a dependent service such as Facebook or Twitter is not\n * responding

\n */\nexport interface ExternalServiceException extends __SmithyException, $MetadataBearer {\n name: \"ExternalServiceException\";\n $fault: \"client\";\n /**\n *

The message returned by an ExternalServiceException

\n */\n message?: string;\n}\n\nexport namespace ExternalServiceException {\n export const filterSensitiveLog = (obj: ExternalServiceException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the GetCredentialsForIdentity action.

\n */\nexport interface GetCredentialsForIdentityInput {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId: string | undefined;\n\n /**\n *

A set of optional name-value pairs that map provider names to provider tokens. The\n * name-value pair will follow the syntax \"provider_name\":\n * \"provider_user_identifier\".

\n *

Logins should not be specified when trying to get credentials for an unauthenticated\n * identity.

\n *

The Logins parameter is required when using identities associated with external\n * identity providers such as FaceBook. For examples of Logins maps, see the code\n * examples in the External Identity Providers section of the Amazon Cognito Developer\n * Guide.

\n */\n Logins?: { [key: string]: string };\n\n /**\n *

The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were\n * received in the token from the identity provider. For example, a SAML-based identity\n * provider. This parameter is optional for identity providers that do not support role\n * customization.

\n */\n CustomRoleArn?: string;\n}\n\nexport namespace GetCredentialsForIdentityInput {\n export const filterSensitiveLog = (obj: GetCredentialsForIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Credentials for the provided identity ID.

\n */\nexport interface Credentials {\n /**\n *

The Access Key portion of the credentials.

\n */\n AccessKeyId?: string;\n\n /**\n *

The Secret Access Key portion of the credentials

\n */\n SecretKey?: string;\n\n /**\n *

The Session Token portion of the credentials

\n */\n SessionToken?: string;\n\n /**\n *

The date at which these credentials will expire.

\n */\n Expiration?: Date;\n}\n\nexport namespace Credentials {\n export const filterSensitiveLog = (obj: Credentials): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful GetCredentialsForIdentity\n * operation.

\n */\nexport interface GetCredentialsForIdentityResponse {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

Credentials for the provided identity ID.

\n */\n Credentials?: Credentials;\n}\n\nexport namespace GetCredentialsForIdentityResponse {\n export const filterSensitiveLog = (obj: GetCredentialsForIdentityResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown if the identity pool has no role associated for the given auth type\n * (auth/unauth) or if the AssumeRole fails.

\n */\nexport interface InvalidIdentityPoolConfigurationException extends __SmithyException, $MetadataBearer {\n name: \"InvalidIdentityPoolConfigurationException\";\n $fault: \"client\";\n /**\n *

The message returned for an InvalidIdentityPoolConfigurationException\n *

\n */\n message?: string;\n}\n\nexport namespace InvalidIdentityPoolConfigurationException {\n export const filterSensitiveLog = (obj: InvalidIdentityPoolConfigurationException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the GetId action.

\n */\nexport interface GetIdInput {\n /**\n *

A standard AWS account ID (9+ digits).

\n */\n AccountId?: string;\n\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

A set of optional name-value pairs that map provider names to provider tokens. The\n * available provider names for Logins are as follows:

\n *
    \n *
  • \n *

    Facebook: graph.facebook.com\n *

    \n *
  • \n *
  • \n *

    Amazon Cognito user pool:\n * cognito-idp..amazonaws.com/,\n * for example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789.\n *

    \n *
  • \n *
  • \n *

    Google: accounts.google.com\n *

    \n *
  • \n *
  • \n *

    Amazon: www.amazon.com\n *

    \n *
  • \n *
  • \n *

    Twitter: api.twitter.com\n *

    \n *
  • \n *
  • \n *

    Digits: www.digits.com\n *

    \n *
  • \n *
\n */\n Logins?: { [key: string]: string };\n}\n\nexport namespace GetIdInput {\n export const filterSensitiveLog = (obj: GetIdInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a GetId request.

\n */\nexport interface GetIdResponse {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n}\n\nexport namespace GetIdResponse {\n export const filterSensitiveLog = (obj: GetIdResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the GetIdentityPoolRoles action.

\n */\nexport interface GetIdentityPoolRolesInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace GetIdentityPoolRolesInput {\n export const filterSensitiveLog = (obj: GetIdentityPoolRolesInput): any => ({\n ...obj,\n });\n}\n\nexport enum MappingRuleMatchType {\n CONTAINS = \"Contains\",\n EQUALS = \"Equals\",\n NOT_EQUAL = \"NotEqual\",\n STARTS_WITH = \"StartsWith\",\n}\n\n/**\n *

A rule that maps a claim name, a claim value, and a match type to a role\n * ARN.

\n */\nexport interface MappingRule {\n /**\n *

The claim name that must be present in the token, for example, \"isAdmin\" or\n * \"paid\".

\n */\n Claim: string | undefined;\n\n /**\n *

The match condition that specifies how closely the claim value in the IdP token must\n * match Value.

\n */\n MatchType: MappingRuleMatchType | string | undefined;\n\n /**\n *

A brief string that the claim must match, for example, \"paid\" or \"yes\".

\n */\n Value: string | undefined;\n\n /**\n *

The role ARN.

\n */\n RoleARN: string | undefined;\n}\n\nexport namespace MappingRule {\n export const filterSensitiveLog = (obj: MappingRule): any => ({\n ...obj,\n });\n}\n\n/**\n *

A container for rules.

\n */\nexport interface RulesConfigurationType {\n /**\n *

An array of rules. You can specify up to 25 rules per identity provider.

\n *

Rules are evaluated in order. The first one to match specifies the role.

\n */\n Rules: MappingRule[] | undefined;\n}\n\nexport namespace RulesConfigurationType {\n export const filterSensitiveLog = (obj: RulesConfigurationType): any => ({\n ...obj,\n });\n}\n\nexport enum RoleMappingType {\n RULES = \"Rules\",\n TOKEN = \"Token\",\n}\n\n/**\n *

A role mapping.

\n */\nexport interface RoleMapping {\n /**\n *

The role mapping type. Token will use cognito:roles and\n * cognito:preferred_role claims from the Cognito identity provider token to\n * map groups to roles. Rules will attempt to match claims from the token to map to a\n * role.

\n */\n Type: RoleMappingType | string | undefined;\n\n /**\n *

If you specify Token or Rules as the Type,\n * AmbiguousRoleResolution is required.

\n *

Specifies the action to be taken if either no rules match the claim value for the\n * Rules type, or there is no cognito:preferred_role claim and\n * there are multiple cognito:roles matches for the Token\n * type.

\n */\n AmbiguousRoleResolution?: AmbiguousRoleResolutionType | string;\n\n /**\n *

The rules to be used for mapping users to roles.

\n *

If you specify Rules as the role mapping type, RulesConfiguration is\n * required.

\n */\n RulesConfiguration?: RulesConfigurationType;\n}\n\nexport namespace RoleMapping {\n export const filterSensitiveLog = (obj: RoleMapping): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful GetIdentityPoolRoles\n * operation.

\n */\nexport interface GetIdentityPoolRolesResponse {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId?: string;\n\n /**\n *

The map of roles associated with this pool. Currently only authenticated and\n * unauthenticated roles are supported.

\n */\n Roles?: { [key: string]: string };\n\n /**\n *

How users for a specific identity provider are to mapped to roles. This is a\n * String-to-RoleMapping object map. The string identifies the identity\n * provider, for example, \"graph.facebook.com\" or\n * \"cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id\".

\n */\n RoleMappings?: { [key: string]: RoleMapping };\n}\n\nexport namespace GetIdentityPoolRolesResponse {\n export const filterSensitiveLog = (obj: GetIdentityPoolRolesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the GetOpenIdToken action.

\n */\nexport interface GetOpenIdTokenInput {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId: string | undefined;\n\n /**\n *

A set of optional name-value pairs that map provider names to provider tokens. When\n * using graph.facebook.com and www.amazon.com, supply the access_token returned from the\n * provider's authflow. For accounts.google.com, an Amazon Cognito user pool provider, or any\n * other OpenId Connect provider, always include the id_token.

\n */\n Logins?: { [key: string]: string };\n}\n\nexport namespace GetOpenIdTokenInput {\n export const filterSensitiveLog = (obj: GetOpenIdTokenInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful GetOpenIdToken request.

\n */\nexport interface GetOpenIdTokenResponse {\n /**\n *

A unique identifier in the format REGION:GUID. Note that the IdentityId returned may\n * not match the one passed on input.

\n */\n IdentityId?: string;\n\n /**\n *

An OpenID token, valid for 10 minutes.

\n */\n Token?: string;\n}\n\nexport namespace GetOpenIdTokenResponse {\n export const filterSensitiveLog = (obj: GetOpenIdTokenResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

The provided developer user identifier is already registered with Cognito under a\n * different identity ID.

\n */\nexport interface DeveloperUserAlreadyRegisteredException extends __SmithyException, $MetadataBearer {\n name: \"DeveloperUserAlreadyRegisteredException\";\n $fault: \"client\";\n /**\n *

This developer user identifier is already registered with Cognito.

\n */\n message?: string;\n}\n\nexport namespace DeveloperUserAlreadyRegisteredException {\n export const filterSensitiveLog = (obj: DeveloperUserAlreadyRegisteredException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the GetOpenIdTokenForDeveloperIdentity action.

\n */\nexport interface GetOpenIdTokenForDeveloperIdentityInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

A set of optional name-value pairs that map provider names to provider tokens. Each\n * name-value pair represents a user from a public provider or developer provider. If the user\n * is from a developer provider, the name-value pair will follow the syntax\n * \"developer_provider_name\": \"developer_user_identifier\". The developer\n * provider is the \"domain\" by which Cognito will refer to your users; you provided this\n * domain while creating/updating the identity pool. The developer user identifier is an\n * identifier from your backend that uniquely identifies a user. When you create an identity\n * pool, you can specify the supported logins.

\n */\n Logins: { [key: string]: string } | undefined;\n\n /**\n *

The expiration time of the token, in seconds. You can specify a custom expiration\n * time for the token so that you can cache it. If you don't provide an expiration time, the\n * token is valid for 15 minutes. You can exchange the token with Amazon STS for temporary AWS\n * credentials, which are valid for a maximum of one hour. The maximum token duration you can\n * set is 24 hours. You should take care in setting the expiration time for a token, as there\n * are significant security implications: an attacker could use a leaked token to access your\n * AWS resources for the token's duration.

\n * \n *

Please provide for a small grace period, usually no more than 5 minutes, to account for clock skew.

\n *
\n */\n TokenDuration?: number;\n}\n\nexport namespace GetOpenIdTokenForDeveloperIdentityInput {\n export const filterSensitiveLog = (obj: GetOpenIdTokenForDeveloperIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful GetOpenIdTokenForDeveloperIdentity\n * request.

\n */\nexport interface GetOpenIdTokenForDeveloperIdentityResponse {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

An OpenID token.

\n */\n Token?: string;\n}\n\nexport namespace GetOpenIdTokenForDeveloperIdentityResponse {\n export const filterSensitiveLog = (obj: GetOpenIdTokenForDeveloperIdentityResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the ListIdentities action.

\n */\nexport interface ListIdentitiesInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

The maximum number of identities to return.

\n */\n MaxResults: number | undefined;\n\n /**\n *

A pagination token.

\n */\n NextToken?: string;\n\n /**\n *

An optional boolean parameter that allows you to hide disabled identities. If\n * omitted, the ListIdentities API will include disabled identities in the response.

\n */\n HideDisabled?: boolean;\n}\n\nexport namespace ListIdentitiesInput {\n export const filterSensitiveLog = (obj: ListIdentitiesInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

The response to a ListIdentities request.

\n */\nexport interface ListIdentitiesResponse {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId?: string;\n\n /**\n *

An object containing a set of identities and associated mappings.

\n */\n Identities?: IdentityDescription[];\n\n /**\n *

A pagination token.

\n */\n NextToken?: string;\n}\n\nexport namespace ListIdentitiesResponse {\n export const filterSensitiveLog = (obj: ListIdentitiesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the ListIdentityPools action.

\n */\nexport interface ListIdentityPoolsInput {\n /**\n *

The maximum number of identities to return.

\n */\n MaxResults: number | undefined;\n\n /**\n *

A pagination token.

\n */\n NextToken?: string;\n}\n\nexport namespace ListIdentityPoolsInput {\n export const filterSensitiveLog = (obj: ListIdentityPoolsInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

A description of the identity pool.

\n */\nexport interface IdentityPoolShortDescription {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId?: string;\n\n /**\n *

A string that you provide.

\n */\n IdentityPoolName?: string;\n}\n\nexport namespace IdentityPoolShortDescription {\n export const filterSensitiveLog = (obj: IdentityPoolShortDescription): any => ({\n ...obj,\n });\n}\n\n/**\n *

The result of a successful ListIdentityPools action.

\n */\nexport interface ListIdentityPoolsResponse {\n /**\n *

The identity pools returned by the ListIdentityPools action.

\n */\n IdentityPools?: IdentityPoolShortDescription[];\n\n /**\n *

A pagination token.

\n */\n NextToken?: string;\n}\n\nexport namespace ListIdentityPoolsResponse {\n export const filterSensitiveLog = (obj: ListIdentityPoolsResponse): any => ({\n ...obj,\n });\n}\n\nexport interface ListTagsForResourceInput {\n /**\n *

The Amazon Resource Name (ARN) of the identity pool that the tags are assigned\n * to.

\n */\n ResourceArn: string | undefined;\n}\n\nexport namespace ListTagsForResourceInput {\n export const filterSensitiveLog = (obj: ListTagsForResourceInput): any => ({\n ...obj,\n });\n}\n\nexport interface ListTagsForResourceResponse {\n /**\n *

The tags that are assigned to the identity pool.

\n */\n Tags?: { [key: string]: string };\n}\n\nexport namespace ListTagsForResourceResponse {\n export const filterSensitiveLog = (obj: ListTagsForResourceResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the LookupDeveloperIdentityInput action.

\n */\nexport interface LookupDeveloperIdentityInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

A unique ID used by your backend authentication process to identify a user.\n * Typically, a developer identity provider would issue many developer user identifiers, in\n * keeping with the number of users.

\n */\n DeveloperUserIdentifier?: string;\n\n /**\n *

The maximum number of identities to return.

\n */\n MaxResults?: number;\n\n /**\n *

A pagination token. The first call you make will have NextToken set to\n * null. After that the service will return NextToken values as needed. For\n * example, let's say you make a request with MaxResults set to 10, and there are\n * 20 matches in the database. The service will return a pagination token as a part of the\n * response. This token can be used to call the API again and get results starting from the\n * 11th match.

\n */\n NextToken?: string;\n}\n\nexport namespace LookupDeveloperIdentityInput {\n export const filterSensitiveLog = (obj: LookupDeveloperIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful LookupDeveloperIdentity\n * action.

\n */\nexport interface LookupDeveloperIdentityResponse {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n\n /**\n *

This is the list of developer user identifiers associated with an identity ID.\n * Cognito supports the association of multiple developer user identifiers with an identity\n * ID.

\n */\n DeveloperUserIdentifierList?: string[];\n\n /**\n *

A pagination token. The first call you make will have NextToken set to\n * null. After that the service will return NextToken values as needed. For\n * example, let's say you make a request with MaxResults set to 10, and there are\n * 20 matches in the database. The service will return a pagination token as a part of the\n * response. This token can be used to call the API again and get results starting from the\n * 11th match.

\n */\n NextToken?: string;\n}\n\nexport namespace LookupDeveloperIdentityResponse {\n export const filterSensitiveLog = (obj: LookupDeveloperIdentityResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the MergeDeveloperIdentities action.

\n */\nexport interface MergeDeveloperIdentitiesInput {\n /**\n *

User identifier for the source user. The value should be a\n * DeveloperUserIdentifier.

\n */\n SourceUserIdentifier: string | undefined;\n\n /**\n *

User identifier for the destination user. The value should be a\n * DeveloperUserIdentifier.

\n */\n DestinationUserIdentifier: string | undefined;\n\n /**\n *

The \"domain\" by which Cognito will refer to your users. This is a (pseudo) domain\n * name that you provide while creating an identity pool. This name acts as a placeholder that\n * allows your backend and the Cognito service to communicate about the developer provider.\n * For the DeveloperProviderName, you can use letters as well as period (.),\n * underscore (_), and dash (-).

\n */\n DeveloperProviderName: string | undefined;\n\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace MergeDeveloperIdentitiesInput {\n export const filterSensitiveLog = (obj: MergeDeveloperIdentitiesInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Returned in response to a successful MergeDeveloperIdentities\n * action.

\n */\nexport interface MergeDeveloperIdentitiesResponse {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId?: string;\n}\n\nexport namespace MergeDeveloperIdentitiesResponse {\n export const filterSensitiveLog = (obj: MergeDeveloperIdentitiesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Thrown if there are parallel requests to modify a resource.

\n */\nexport interface ConcurrentModificationException extends __SmithyException, $MetadataBearer {\n name: \"ConcurrentModificationException\";\n $fault: \"client\";\n /**\n *

The message returned by a ConcurrentModificationException.

\n */\n message?: string;\n}\n\nexport namespace ConcurrentModificationException {\n export const filterSensitiveLog = (obj: ConcurrentModificationException): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the SetIdentityPoolRoles action.

\n */\nexport interface SetIdentityPoolRolesInput {\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

The map of roles associated with this pool. For a given role, the key will be either\n * \"authenticated\" or \"unauthenticated\" and the value will be the Role ARN.

\n */\n Roles: { [key: string]: string } | undefined;\n\n /**\n *

How users for a specific identity provider are to mapped to roles. This is a string\n * to RoleMapping object map. The string identifies the identity provider,\n * for example, \"graph.facebook.com\" or\n * \"cognito-idp-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id\".

\n *

Up to 25 rules can be specified per identity provider.

\n */\n RoleMappings?: { [key: string]: RoleMapping };\n}\n\nexport namespace SetIdentityPoolRolesInput {\n export const filterSensitiveLog = (obj: SetIdentityPoolRolesInput): any => ({\n ...obj,\n });\n}\n\nexport interface TagResourceInput {\n /**\n *

The Amazon Resource Name (ARN) of the identity pool to assign the tags to.

\n */\n ResourceArn: string | undefined;\n\n /**\n *

The tags to assign to the identity pool.

\n */\n Tags: { [key: string]: string } | undefined;\n}\n\nexport namespace TagResourceInput {\n export const filterSensitiveLog = (obj: TagResourceInput): any => ({\n ...obj,\n });\n}\n\nexport interface TagResourceResponse {}\n\nexport namespace TagResourceResponse {\n export const filterSensitiveLog = (obj: TagResourceResponse): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the UnlinkDeveloperIdentity action.

\n */\nexport interface UnlinkDeveloperIdentityInput {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId: string | undefined;\n\n /**\n *

An identity pool ID in the format REGION:GUID.

\n */\n IdentityPoolId: string | undefined;\n\n /**\n *

The \"domain\" by which Cognito will refer to your users.

\n */\n DeveloperProviderName: string | undefined;\n\n /**\n *

A unique ID used by your backend authentication process to identify a user.

\n */\n DeveloperUserIdentifier: string | undefined;\n}\n\nexport namespace UnlinkDeveloperIdentityInput {\n export const filterSensitiveLog = (obj: UnlinkDeveloperIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n *

Input to the UnlinkIdentity action.

\n */\nexport interface UnlinkIdentityInput {\n /**\n *

A unique identifier in the format REGION:GUID.

\n */\n IdentityId: string | undefined;\n\n /**\n *

A set of optional name-value pairs that map provider names to provider\n * tokens.

\n */\n Logins: { [key: string]: string } | undefined;\n\n /**\n *

Provider names to unlink from this identity.

\n */\n LoginsToRemove: string[] | undefined;\n}\n\nexport namespace UnlinkIdentityInput {\n export const filterSensitiveLog = (obj: UnlinkIdentityInput): any => ({\n ...obj,\n });\n}\n\nexport interface UntagResourceInput {\n /**\n *

The Amazon Resource Name (ARN) of the identity pool that the tags are assigned\n * to.

\n */\n ResourceArn: string | undefined;\n\n /**\n *

The keys of the tags to remove from the user pool.

\n */\n TagKeys: string[] | undefined;\n}\n\nexport namespace UntagResourceInput {\n export const filterSensitiveLog = (obj: UntagResourceInput): any => ({\n ...obj,\n });\n}\n\nexport interface UntagResourceResponse {}\n\nexport namespace UntagResourceResponse {\n export const filterSensitiveLog = (obj: UntagResourceResponse): any => ({\n ...obj,\n });\n}\n","import { HeaderBag, HttpMessage, HttpResponse as IHttpResponse } from \"@aws-sdk/types\";\n\ntype HttpResponseOptions = Partial & {\n statusCode: number;\n};\n\nexport interface HttpResponse extends IHttpResponse {}\n\nexport class HttpResponse {\n public statusCode: number;\n public headers: HeaderBag;\n public body?: any;\n\n constructor(options: HttpResponseOptions) {\n this.statusCode = options.statusCode;\n this.headers = options.headers || {};\n this.body = options.body;\n }\n\n static isInstance(response: unknown): response is HttpResponse {\n //determine if response is a valid HttpResponse\n if (!response) return false;\n const resp = response as any;\n return typeof resp.statusCode === \"number\" && typeof resp.headers === \"object\";\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { Endpoint, HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag } from \"@aws-sdk/types\";\n\ntype HttpRequestOptions = Partial & Partial & { method?: string };\n\nexport interface HttpRequest extends IHttpRequest {}\n\nexport class HttpRequest implements HttpMessage, Endpoint {\n public method: string;\n public protocol: string;\n public hostname: string;\n public port?: number;\n public path: string;\n public query: QueryParameterBag;\n public headers: HeaderBag;\n public body?: any;\n\n constructor(options: HttpRequestOptions) {\n this.method = options.method || \"GET\";\n this.hostname = options.hostname || \"localhost\";\n this.port = options.port;\n this.query = options.query || {};\n this.headers = options.headers || {};\n this.body = options.body;\n this.protocol = options.protocol\n ? options.protocol.substr(-1) !== \":\"\n ? `${options.protocol}:`\n : options.protocol\n : \"https:\";\n this.path = options.path ? (options.path.charAt(0) !== \"/\" ? `/${options.path}` : options.path) : \"/\";\n }\n\n static isInstance(request: unknown): request is HttpRequest {\n //determine if request is a valid httpRequest\n if (!request) return false;\n const req: any = request;\n return (\n \"method\" in req &&\n \"protocol\" in req &&\n \"hostname\" in req &&\n \"path\" in req &&\n typeof req[\"query\"] === \"object\" &&\n typeof req[\"headers\"] === \"object\"\n );\n }\n\n clone(): HttpRequest {\n const cloned = new HttpRequest({\n ...this,\n headers: { ...this.headers },\n });\n if (cloned.query) cloned.query = cloneQuery(cloned.query);\n return cloned;\n }\n}\n\nfunction cloneQuery(query: QueryParameterBag): QueryParameterBag {\n return Object.keys(query).reduce((carry: QueryParameterBag, paramName: string) => {\n const param = query[paramName];\n return {\n ...carry,\n [paramName]: Array.isArray(param) ? [...param] : param,\n };\n }, {});\n}\n","import { CreateIdentityPoolCommandInput, CreateIdentityPoolCommandOutput } from \"../commands/CreateIdentityPoolCommand\";\nimport { DeleteIdentitiesCommandInput, DeleteIdentitiesCommandOutput } from \"../commands/DeleteIdentitiesCommand\";\nimport { DeleteIdentityPoolCommandInput, DeleteIdentityPoolCommandOutput } from \"../commands/DeleteIdentityPoolCommand\";\nimport { DescribeIdentityCommandInput, DescribeIdentityCommandOutput } from \"../commands/DescribeIdentityCommand\";\nimport {\n DescribeIdentityPoolCommandInput,\n DescribeIdentityPoolCommandOutput,\n} from \"../commands/DescribeIdentityPoolCommand\";\nimport {\n GetCredentialsForIdentityCommandInput,\n GetCredentialsForIdentityCommandOutput,\n} from \"../commands/GetCredentialsForIdentityCommand\";\nimport { GetIdCommandInput, GetIdCommandOutput } from \"../commands/GetIdCommand\";\nimport {\n GetIdentityPoolRolesCommandInput,\n GetIdentityPoolRolesCommandOutput,\n} from \"../commands/GetIdentityPoolRolesCommand\";\nimport { GetOpenIdTokenCommandInput, GetOpenIdTokenCommandOutput } from \"../commands/GetOpenIdTokenCommand\";\nimport {\n GetOpenIdTokenForDeveloperIdentityCommandInput,\n GetOpenIdTokenForDeveloperIdentityCommandOutput,\n} from \"../commands/GetOpenIdTokenForDeveloperIdentityCommand\";\nimport { ListIdentitiesCommandInput, ListIdentitiesCommandOutput } from \"../commands/ListIdentitiesCommand\";\nimport { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from \"../commands/ListIdentityPoolsCommand\";\nimport {\n ListTagsForResourceCommandInput,\n ListTagsForResourceCommandOutput,\n} from \"../commands/ListTagsForResourceCommand\";\nimport {\n LookupDeveloperIdentityCommandInput,\n LookupDeveloperIdentityCommandOutput,\n} from \"../commands/LookupDeveloperIdentityCommand\";\nimport {\n MergeDeveloperIdentitiesCommandInput,\n MergeDeveloperIdentitiesCommandOutput,\n} from \"../commands/MergeDeveloperIdentitiesCommand\";\nimport {\n SetIdentityPoolRolesCommandInput,\n SetIdentityPoolRolesCommandOutput,\n} from \"../commands/SetIdentityPoolRolesCommand\";\nimport { TagResourceCommandInput, TagResourceCommandOutput } from \"../commands/TagResourceCommand\";\nimport {\n UnlinkDeveloperIdentityCommandInput,\n UnlinkDeveloperIdentityCommandOutput,\n} from \"../commands/UnlinkDeveloperIdentityCommand\";\nimport { UnlinkIdentityCommandInput, UnlinkIdentityCommandOutput } from \"../commands/UnlinkIdentityCommand\";\nimport { UntagResourceCommandInput, UntagResourceCommandOutput } from \"../commands/UntagResourceCommand\";\nimport { UpdateIdentityPoolCommandInput, UpdateIdentityPoolCommandOutput } from \"../commands/UpdateIdentityPoolCommand\";\nimport {\n CognitoIdentityProvider,\n ConcurrentModificationException,\n CreateIdentityPoolInput,\n Credentials,\n DeleteIdentitiesInput,\n DeleteIdentitiesResponse,\n DeleteIdentityPoolInput,\n DescribeIdentityInput,\n DescribeIdentityPoolInput,\n DeveloperUserAlreadyRegisteredException,\n ExternalServiceException,\n GetCredentialsForIdentityInput,\n GetCredentialsForIdentityResponse,\n GetIdInput,\n GetIdResponse,\n GetIdentityPoolRolesInput,\n GetIdentityPoolRolesResponse,\n GetOpenIdTokenForDeveloperIdentityInput,\n GetOpenIdTokenForDeveloperIdentityResponse,\n GetOpenIdTokenInput,\n GetOpenIdTokenResponse,\n IdentityDescription,\n IdentityPool,\n IdentityPoolShortDescription,\n InternalErrorException,\n InvalidIdentityPoolConfigurationException,\n InvalidParameterException,\n LimitExceededException,\n ListIdentitiesInput,\n ListIdentitiesResponse,\n ListIdentityPoolsInput,\n ListIdentityPoolsResponse,\n ListTagsForResourceInput,\n ListTagsForResourceResponse,\n LookupDeveloperIdentityInput,\n LookupDeveloperIdentityResponse,\n MappingRule,\n MergeDeveloperIdentitiesInput,\n MergeDeveloperIdentitiesResponse,\n NotAuthorizedException,\n ResourceConflictException,\n ResourceNotFoundException,\n RoleMapping,\n RulesConfigurationType,\n SetIdentityPoolRolesInput,\n TagResourceInput,\n TagResourceResponse,\n TooManyRequestsException,\n UnlinkDeveloperIdentityInput,\n UnlinkIdentityInput,\n UnprocessedIdentityId,\n UntagResourceInput,\n UntagResourceResponse,\n} from \"../models/models_0\";\nimport { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { SmithyException as __SmithyException } from \"@aws-sdk/smithy-client\";\nimport {\n Endpoint as __Endpoint,\n HeaderBag as __HeaderBag,\n MetadataBearer as __MetadataBearer,\n ResponseMetadata as __ResponseMetadata,\n SerdeContext as __SerdeContext,\n} from \"@aws-sdk/types\";\n\nexport const serializeAws_json1_1CreateIdentityPoolCommand = async (\n input: CreateIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.CreateIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1CreateIdentityPoolInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DeleteIdentitiesCommand = async (\n input: DeleteIdentitiesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DeleteIdentities\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DeleteIdentitiesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DeleteIdentityPoolCommand = async (\n input: DeleteIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DeleteIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DeleteIdentityPoolInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DescribeIdentityCommand = async (\n input: DescribeIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DescribeIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DescribeIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DescribeIdentityPoolCommand = async (\n input: DescribeIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DescribeIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DescribeIdentityPoolInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetCredentialsForIdentityCommand = async (\n input: GetCredentialsForIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetCredentialsForIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetCredentialsForIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetIdCommand = async (\n input: GetIdCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetId\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetIdInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetIdentityPoolRolesCommand = async (\n input: GetIdentityPoolRolesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetIdentityPoolRoles\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetIdentityPoolRolesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetOpenIdTokenCommand = async (\n input: GetOpenIdTokenCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetOpenIdToken\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (\n input: GetOpenIdTokenForDeveloperIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1ListIdentitiesCommand = async (\n input: ListIdentitiesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListIdentities\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1ListIdentitiesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1ListIdentityPoolsCommand = async (\n input: ListIdentityPoolsCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListIdentityPools\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1ListIdentityPoolsInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1ListTagsForResourceCommand = async (\n input: ListTagsForResourceCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListTagsForResource\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1LookupDeveloperIdentityCommand = async (\n input: LookupDeveloperIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.LookupDeveloperIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1LookupDeveloperIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1MergeDeveloperIdentitiesCommand = async (\n input: MergeDeveloperIdentitiesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.MergeDeveloperIdentities\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1MergeDeveloperIdentitiesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1SetIdentityPoolRolesCommand = async (\n input: SetIdentityPoolRolesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.SetIdentityPoolRoles\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1SetIdentityPoolRolesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1TagResourceCommand = async (\n input: TagResourceCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.TagResource\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UnlinkDeveloperIdentityCommand = async (\n input: UnlinkDeveloperIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UnlinkDeveloperIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1UnlinkDeveloperIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UnlinkIdentityCommand = async (\n input: UnlinkIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UnlinkIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1UnlinkIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UntagResourceCommand = async (\n input: UntagResourceCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UntagResource\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UpdateIdentityPoolCommand = async (\n input: UpdateIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UpdateIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1IdentityPool(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const deserializeAws_json1_1CreateIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1CreateIdentityPoolCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n const response: CreateIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1CreateIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"LimitExceededException\":\n case \"com.amazonaws.cognitoidentity#LimitExceededException\":\n response = {\n ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DeleteIdentitiesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DeleteIdentitiesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1DeleteIdentitiesResponse(data, context);\n const response: DeleteIdentitiesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DeleteIdentitiesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DeleteIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DeleteIdentityPoolCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: DeleteIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DeleteIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DescribeIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DescribeIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityDescription(data, context);\n const response: DescribeIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DescribeIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DescribeIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DescribeIdentityPoolCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n const response: DescribeIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DescribeIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetCredentialsForIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetCredentialsForIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetCredentialsForIdentityResponse(data, context);\n const response: GetCredentialsForIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetCredentialsForIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidIdentityPoolConfigurationException\":\n case \"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException\":\n response = {\n ...(await deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetIdCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetIdCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetIdResponse(data, context);\n const response: GetIdCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetIdCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"LimitExceededException\":\n case \"com.amazonaws.cognitoidentity#LimitExceededException\":\n response = {\n ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetIdentityPoolRolesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetIdentityPoolRolesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetIdentityPoolRolesResponse(data, context);\n const response: GetIdentityPoolRolesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetIdentityPoolRolesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetOpenIdTokenCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetOpenIdTokenCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetOpenIdTokenResponse(data, context);\n const response: GetOpenIdTokenCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse(data, context);\n const response: GetOpenIdTokenForDeveloperIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"DeveloperUserAlreadyRegisteredException\":\n case \"com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException\":\n response = {\n ...(await deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1ListIdentitiesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1ListIdentitiesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1ListIdentitiesResponse(data, context);\n const response: ListIdentitiesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1ListIdentitiesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1ListIdentityPoolsCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1ListIdentityPoolsCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1ListIdentityPoolsResponse(data, context);\n const response: ListIdentityPoolsCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1ListIdentityPoolsCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1ListTagsForResourceCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1ListTagsForResourceCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);\n const response: ListTagsForResourceCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1ListTagsForResourceCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1LookupDeveloperIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1LookupDeveloperIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1LookupDeveloperIdentityResponse(data, context);\n const response: LookupDeveloperIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1LookupDeveloperIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1MergeDeveloperIdentitiesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1MergeDeveloperIdentitiesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1MergeDeveloperIdentitiesResponse(data, context);\n const response: MergeDeveloperIdentitiesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1SetIdentityPoolRolesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1SetIdentityPoolRolesCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: SetIdentityPoolRolesCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1SetIdentityPoolRolesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ConcurrentModificationException\":\n case \"com.amazonaws.cognitoidentity#ConcurrentModificationException\":\n response = {\n ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1TagResourceCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1TagResourceCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1TagResourceResponse(data, context);\n const response: TagResourceCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1TagResourceCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1UnlinkDeveloperIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UnlinkDeveloperIdentityCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: UnlinkDeveloperIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1UnlinkIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UnlinkIdentityCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: UnlinkIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UnlinkIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1UntagResourceCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UntagResourceCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1UntagResourceResponse(data, context);\n const response: UntagResourceCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UntagResourceCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1UpdateIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UpdateIdentityPoolCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n const response: UpdateIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UpdateIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ConcurrentModificationException\":\n case \"com.amazonaws.cognitoidentity#ConcurrentModificationException\":\n response = {\n ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"LimitExceededException\":\n case \"com.amazonaws.cognitoidentity#LimitExceededException\":\n response = {\n ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nconst deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ConcurrentModificationException(body, context);\n const contents: ConcurrentModificationException = {\n name: \"ConcurrentModificationException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1DeveloperUserAlreadyRegisteredException(body, context);\n const contents: DeveloperUserAlreadyRegisteredException = {\n name: \"DeveloperUserAlreadyRegisteredException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1ExternalServiceExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ExternalServiceException(body, context);\n const contents: ExternalServiceException = {\n name: \"ExternalServiceException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1InternalErrorExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1InternalErrorException(body, context);\n const contents: InternalErrorException = {\n name: \"InternalErrorException\",\n $fault: \"server\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1InvalidIdentityPoolConfigurationException(body, context);\n const contents: InvalidIdentityPoolConfigurationException = {\n name: \"InvalidIdentityPoolConfigurationException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1InvalidParameterExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1InvalidParameterException(body, context);\n const contents: InvalidParameterException = {\n name: \"InvalidParameterException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1LimitExceededExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1LimitExceededException(body, context);\n const contents: LimitExceededException = {\n name: \"LimitExceededException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1NotAuthorizedExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1NotAuthorizedException(body, context);\n const contents: NotAuthorizedException = {\n name: \"NotAuthorizedException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1ResourceConflictExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ResourceConflictException(body, context);\n const contents: ResourceConflictException = {\n name: \"ResourceConflictException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ResourceNotFoundException(body, context);\n const contents: ResourceNotFoundException = {\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1TooManyRequestsExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1TooManyRequestsException(body, context);\n const contents: TooManyRequestsException = {\n name: \"TooManyRequestsException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst serializeAws_json1_1CognitoIdentityProvider = (input: CognitoIdentityProvider, context: __SerdeContext): any => {\n return {\n ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }),\n ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }),\n ...(input.ServerSideTokenCheck !== undefined &&\n input.ServerSideTokenCheck !== null && { ServerSideTokenCheck: input.ServerSideTokenCheck }),\n };\n};\n\nconst serializeAws_json1_1CognitoIdentityProviderList = (\n input: CognitoIdentityProvider[],\n context: __SerdeContext\n): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return serializeAws_json1_1CognitoIdentityProvider(entry, context);\n });\n};\n\nconst serializeAws_json1_1CreateIdentityPoolInput = (input: CreateIdentityPoolInput, context: __SerdeContext): any => {\n return {\n ...(input.AllowClassicFlow !== undefined &&\n input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow }),\n ...(input.AllowUnauthenticatedIdentities !== undefined &&\n input.AllowUnauthenticatedIdentities !== null && {\n AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities,\n }),\n ...(input.CognitoIdentityProviders !== undefined &&\n input.CognitoIdentityProviders !== null && {\n CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(\n input.CognitoIdentityProviders,\n context\n ),\n }),\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.IdentityPoolName !== undefined &&\n input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName }),\n ...(input.IdentityPoolTags !== undefined &&\n input.IdentityPoolTags !== null && {\n IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context),\n }),\n ...(input.OpenIdConnectProviderARNs !== undefined &&\n input.OpenIdConnectProviderARNs !== null && {\n OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context),\n }),\n ...(input.SamlProviderARNs !== undefined &&\n input.SamlProviderARNs !== null && {\n SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context),\n }),\n ...(input.SupportedLoginProviders !== undefined &&\n input.SupportedLoginProviders !== null && {\n SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context),\n }),\n };\n};\n\nconst serializeAws_json1_1DeleteIdentitiesInput = (input: DeleteIdentitiesInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityIdsToDelete !== undefined &&\n input.IdentityIdsToDelete !== null && {\n IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context),\n }),\n };\n};\n\nconst serializeAws_json1_1DeleteIdentityPoolInput = (input: DeleteIdentityPoolInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1DescribeIdentityInput = (input: DescribeIdentityInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n };\n};\n\nconst serializeAws_json1_1DescribeIdentityPoolInput = (\n input: DescribeIdentityPoolInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1GetCredentialsForIdentityInput = (\n input: GetCredentialsForIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.CustomRoleArn !== undefined && input.CustomRoleArn !== null && { CustomRoleArn: input.CustomRoleArn }),\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n };\n};\n\nconst serializeAws_json1_1GetIdentityPoolRolesInput = (\n input: GetIdentityPoolRolesInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1GetIdInput = (input: GetIdInput, context: __SerdeContext): any => {\n return {\n ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n };\n};\n\nconst serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = (\n input: GetOpenIdTokenForDeveloperIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n ...(input.TokenDuration !== undefined && input.TokenDuration !== null && { TokenDuration: input.TokenDuration }),\n };\n};\n\nconst serializeAws_json1_1GetOpenIdTokenInput = (input: GetOpenIdTokenInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n };\n};\n\nconst serializeAws_json1_1IdentityIdList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1IdentityPool = (input: IdentityPool, context: __SerdeContext): any => {\n return {\n ...(input.AllowClassicFlow !== undefined &&\n input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow }),\n ...(input.AllowUnauthenticatedIdentities !== undefined &&\n input.AllowUnauthenticatedIdentities !== null && {\n AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities,\n }),\n ...(input.CognitoIdentityProviders !== undefined &&\n input.CognitoIdentityProviders !== null && {\n CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(\n input.CognitoIdentityProviders,\n context\n ),\n }),\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.IdentityPoolName !== undefined &&\n input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName }),\n ...(input.IdentityPoolTags !== undefined &&\n input.IdentityPoolTags !== null && {\n IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context),\n }),\n ...(input.OpenIdConnectProviderARNs !== undefined &&\n input.OpenIdConnectProviderARNs !== null && {\n OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context),\n }),\n ...(input.SamlProviderARNs !== undefined &&\n input.SamlProviderARNs !== null && {\n SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context),\n }),\n ...(input.SupportedLoginProviders !== undefined &&\n input.SupportedLoginProviders !== null && {\n SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context),\n }),\n };\n};\n\nconst serializeAws_json1_1IdentityPoolTagsListType = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1IdentityPoolTagsType = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1IdentityProviders = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1ListIdentitiesInput = (input: ListIdentitiesInput, context: __SerdeContext): any => {\n return {\n ...(input.HideDisabled !== undefined && input.HideDisabled !== null && { HideDisabled: input.HideDisabled }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),\n ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),\n };\n};\n\nconst serializeAws_json1_1ListIdentityPoolsInput = (input: ListIdentityPoolsInput, context: __SerdeContext): any => {\n return {\n ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),\n ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),\n };\n};\n\nconst serializeAws_json1_1ListTagsForResourceInput = (\n input: ListTagsForResourceInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),\n };\n};\n\nconst serializeAws_json1_1LoginsList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1LoginsMap = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1LookupDeveloperIdentityInput = (\n input: LookupDeveloperIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.DeveloperUserIdentifier !== undefined &&\n input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }),\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),\n ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),\n };\n};\n\nconst serializeAws_json1_1MappingRule = (input: MappingRule, context: __SerdeContext): any => {\n return {\n ...(input.Claim !== undefined && input.Claim !== null && { Claim: input.Claim }),\n ...(input.MatchType !== undefined && input.MatchType !== null && { MatchType: input.MatchType }),\n ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }),\n ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),\n };\n};\n\nconst serializeAws_json1_1MappingRulesList = (input: MappingRule[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return serializeAws_json1_1MappingRule(entry, context);\n });\n};\n\nconst serializeAws_json1_1MergeDeveloperIdentitiesInput = (\n input: MergeDeveloperIdentitiesInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.DestinationUserIdentifier !== undefined &&\n input.DestinationUserIdentifier !== null && { DestinationUserIdentifier: input.DestinationUserIdentifier }),\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.SourceUserIdentifier !== undefined &&\n input.SourceUserIdentifier !== null && { SourceUserIdentifier: input.SourceUserIdentifier }),\n };\n};\n\nconst serializeAws_json1_1OIDCProviderList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1RoleMapping = (input: RoleMapping, context: __SerdeContext): any => {\n return {\n ...(input.AmbiguousRoleResolution !== undefined &&\n input.AmbiguousRoleResolution !== null && { AmbiguousRoleResolution: input.AmbiguousRoleResolution }),\n ...(input.RulesConfiguration !== undefined &&\n input.RulesConfiguration !== null && {\n RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context),\n }),\n ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),\n };\n};\n\nconst serializeAws_json1_1RoleMappingMap = (input: { [key: string]: RoleMapping }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: serializeAws_json1_1RoleMapping(value, context),\n };\n }, {});\n};\n\nconst serializeAws_json1_1RolesMap = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1RulesConfigurationType = (input: RulesConfigurationType, context: __SerdeContext): any => {\n return {\n ...(input.Rules !== undefined &&\n input.Rules !== null && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }),\n };\n};\n\nconst serializeAws_json1_1SAMLProviderList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1SetIdentityPoolRolesInput = (\n input: SetIdentityPoolRolesInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.RoleMappings !== undefined &&\n input.RoleMappings !== null && { RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context) }),\n ...(input.Roles !== undefined &&\n input.Roles !== null && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }),\n };\n};\n\nconst serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => {\n return {\n ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),\n ...(input.Tags !== undefined &&\n input.Tags !== null && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }),\n };\n};\n\nconst serializeAws_json1_1UnlinkDeveloperIdentityInput = (\n input: UnlinkDeveloperIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.DeveloperUserIdentifier !== undefined &&\n input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }),\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1UnlinkIdentityInput = (input: UnlinkIdentityInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n ...(input.LoginsToRemove !== undefined &&\n input.LoginsToRemove !== null && {\n LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context),\n }),\n };\n};\n\nconst serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => {\n return {\n ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),\n ...(input.TagKeys !== undefined &&\n input.TagKeys !== null && { TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context) }),\n };\n};\n\nconst deserializeAws_json1_1CognitoIdentityProvider = (\n output: any,\n context: __SerdeContext\n): CognitoIdentityProvider => {\n return {\n ClientId: output.ClientId !== undefined && output.ClientId !== null ? output.ClientId : undefined,\n ProviderName: output.ProviderName !== undefined && output.ProviderName !== null ? output.ProviderName : undefined,\n ServerSideTokenCheck:\n output.ServerSideTokenCheck !== undefined && output.ServerSideTokenCheck !== null\n ? output.ServerSideTokenCheck\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1CognitoIdentityProviderList = (\n output: any,\n context: __SerdeContext\n): CognitoIdentityProvider[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1CognitoIdentityProvider(entry, context);\n });\n};\n\nconst deserializeAws_json1_1ConcurrentModificationException = (\n output: any,\n context: __SerdeContext\n): ConcurrentModificationException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1Credentials = (output: any, context: __SerdeContext): Credentials => {\n return {\n AccessKeyId: output.AccessKeyId !== undefined && output.AccessKeyId !== null ? output.AccessKeyId : undefined,\n Expiration:\n output.Expiration !== undefined && output.Expiration !== null\n ? new Date(Math.round(output.Expiration * 1000))\n : undefined,\n SecretKey: output.SecretKey !== undefined && output.SecretKey !== null ? output.SecretKey : undefined,\n SessionToken: output.SessionToken !== undefined && output.SessionToken !== null ? output.SessionToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1DeleteIdentitiesResponse = (\n output: any,\n context: __SerdeContext\n): DeleteIdentitiesResponse => {\n return {\n UnprocessedIdentityIds:\n output.UnprocessedIdentityIds !== undefined && output.UnprocessedIdentityIds !== null\n ? deserializeAws_json1_1UnprocessedIdentityIdList(output.UnprocessedIdentityIds, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1DeveloperUserAlreadyRegisteredException = (\n output: any,\n context: __SerdeContext\n): DeveloperUserAlreadyRegisteredException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1DeveloperUserIdentifierList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1ExternalServiceException = (\n output: any,\n context: __SerdeContext\n): ExternalServiceException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetCredentialsForIdentityResponse = (\n output: any,\n context: __SerdeContext\n): GetCredentialsForIdentityResponse => {\n return {\n Credentials:\n output.Credentials !== undefined && output.Credentials !== null\n ? deserializeAws_json1_1Credentials(output.Credentials, context)\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetIdentityPoolRolesResponse = (\n output: any,\n context: __SerdeContext\n): GetIdentityPoolRolesResponse => {\n return {\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n RoleMappings:\n output.RoleMappings !== undefined && output.RoleMappings !== null\n ? deserializeAws_json1_1RoleMappingMap(output.RoleMappings, context)\n : undefined,\n Roles:\n output.Roles !== undefined && output.Roles !== null\n ? deserializeAws_json1_1RolesMap(output.Roles, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetIdResponse = (output: any, context: __SerdeContext): GetIdResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse = (\n output: any,\n context: __SerdeContext\n): GetOpenIdTokenForDeveloperIdentityResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n Token: output.Token !== undefined && output.Token !== null ? output.Token : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenResponse = (output: any, context: __SerdeContext): GetOpenIdTokenResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n Token: output.Token !== undefined && output.Token !== null ? output.Token : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentitiesList = (output: any, context: __SerdeContext): IdentityDescription[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1IdentityDescription(entry, context);\n });\n};\n\nconst deserializeAws_json1_1IdentityDescription = (output: any, context: __SerdeContext): IdentityDescription => {\n return {\n CreationDate:\n output.CreationDate !== undefined && output.CreationDate !== null\n ? new Date(Math.round(output.CreationDate * 1000))\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n LastModifiedDate:\n output.LastModifiedDate !== undefined && output.LastModifiedDate !== null\n ? new Date(Math.round(output.LastModifiedDate * 1000))\n : undefined,\n Logins:\n output.Logins !== undefined && output.Logins !== null\n ? deserializeAws_json1_1LoginsList(output.Logins, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentityPool = (output: any, context: __SerdeContext): IdentityPool => {\n return {\n AllowClassicFlow:\n output.AllowClassicFlow !== undefined && output.AllowClassicFlow !== null ? output.AllowClassicFlow : undefined,\n AllowUnauthenticatedIdentities:\n output.AllowUnauthenticatedIdentities !== undefined && output.AllowUnauthenticatedIdentities !== null\n ? output.AllowUnauthenticatedIdentities\n : undefined,\n CognitoIdentityProviders:\n output.CognitoIdentityProviders !== undefined && output.CognitoIdentityProviders !== null\n ? deserializeAws_json1_1CognitoIdentityProviderList(output.CognitoIdentityProviders, context)\n : undefined,\n DeveloperProviderName:\n output.DeveloperProviderName !== undefined && output.DeveloperProviderName !== null\n ? output.DeveloperProviderName\n : undefined,\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n IdentityPoolName:\n output.IdentityPoolName !== undefined && output.IdentityPoolName !== null ? output.IdentityPoolName : undefined,\n IdentityPoolTags:\n output.IdentityPoolTags !== undefined && output.IdentityPoolTags !== null\n ? deserializeAws_json1_1IdentityPoolTagsType(output.IdentityPoolTags, context)\n : undefined,\n OpenIdConnectProviderARNs:\n output.OpenIdConnectProviderARNs !== undefined && output.OpenIdConnectProviderARNs !== null\n ? deserializeAws_json1_1OIDCProviderList(output.OpenIdConnectProviderARNs, context)\n : undefined,\n SamlProviderARNs:\n output.SamlProviderARNs !== undefined && output.SamlProviderARNs !== null\n ? deserializeAws_json1_1SAMLProviderList(output.SamlProviderARNs, context)\n : undefined,\n SupportedLoginProviders:\n output.SupportedLoginProviders !== undefined && output.SupportedLoginProviders !== null\n ? deserializeAws_json1_1IdentityProviders(output.SupportedLoginProviders, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentityPoolShortDescription = (\n output: any,\n context: __SerdeContext\n): IdentityPoolShortDescription => {\n return {\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n IdentityPoolName:\n output.IdentityPoolName !== undefined && output.IdentityPoolName !== null ? output.IdentityPoolName : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentityPoolsList = (\n output: any,\n context: __SerdeContext\n): IdentityPoolShortDescription[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1IdentityPoolShortDescription(entry, context);\n });\n};\n\nconst deserializeAws_json1_1IdentityPoolTagsType = (\n output: any,\n context: __SerdeContext\n): { [key: string]: string } => {\n return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst deserializeAws_json1_1IdentityProviders = (output: any, context: __SerdeContext): { [key: string]: string } => {\n return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst deserializeAws_json1_1InternalErrorException = (output: any, context: __SerdeContext): InternalErrorException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1InvalidIdentityPoolConfigurationException = (\n output: any,\n context: __SerdeContext\n): InvalidIdentityPoolConfigurationException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1InvalidParameterException = (\n output: any,\n context: __SerdeContext\n): InvalidParameterException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ListIdentitiesResponse = (output: any, context: __SerdeContext): ListIdentitiesResponse => {\n return {\n Identities:\n output.Identities !== undefined && output.Identities !== null\n ? deserializeAws_json1_1IdentitiesList(output.Identities, context)\n : undefined,\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ListIdentityPoolsResponse = (\n output: any,\n context: __SerdeContext\n): ListIdentityPoolsResponse => {\n return {\n IdentityPools:\n output.IdentityPools !== undefined && output.IdentityPools !== null\n ? deserializeAws_json1_1IdentityPoolsList(output.IdentityPools, context)\n : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ListTagsForResourceResponse = (\n output: any,\n context: __SerdeContext\n): ListTagsForResourceResponse => {\n return {\n Tags:\n output.Tags !== undefined && output.Tags !== null\n ? deserializeAws_json1_1IdentityPoolTagsType(output.Tags, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1LoginsList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1LookupDeveloperIdentityResponse = (\n output: any,\n context: __SerdeContext\n): LookupDeveloperIdentityResponse => {\n return {\n DeveloperUserIdentifierList:\n output.DeveloperUserIdentifierList !== undefined && output.DeveloperUserIdentifierList !== null\n ? deserializeAws_json1_1DeveloperUserIdentifierList(output.DeveloperUserIdentifierList, context)\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1MappingRule = (output: any, context: __SerdeContext): MappingRule => {\n return {\n Claim: output.Claim !== undefined && output.Claim !== null ? output.Claim : undefined,\n MatchType: output.MatchType !== undefined && output.MatchType !== null ? output.MatchType : undefined,\n RoleARN: output.RoleARN !== undefined && output.RoleARN !== null ? output.RoleARN : undefined,\n Value: output.Value !== undefined && output.Value !== null ? output.Value : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1MappingRulesList = (output: any, context: __SerdeContext): MappingRule[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1MappingRule(entry, context);\n });\n};\n\nconst deserializeAws_json1_1MergeDeveloperIdentitiesResponse = (\n output: any,\n context: __SerdeContext\n): MergeDeveloperIdentitiesResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1NotAuthorizedException = (output: any, context: __SerdeContext): NotAuthorizedException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1OIDCProviderList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1ResourceConflictException = (\n output: any,\n context: __SerdeContext\n): ResourceConflictException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ResourceNotFoundException = (\n output: any,\n context: __SerdeContext\n): ResourceNotFoundException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1RoleMapping = (output: any, context: __SerdeContext): RoleMapping => {\n return {\n AmbiguousRoleResolution:\n output.AmbiguousRoleResolution !== undefined && output.AmbiguousRoleResolution !== null\n ? output.AmbiguousRoleResolution\n : undefined,\n RulesConfiguration:\n output.RulesConfiguration !== undefined && output.RulesConfiguration !== null\n ? deserializeAws_json1_1RulesConfigurationType(output.RulesConfiguration, context)\n : undefined,\n Type: output.Type !== undefined && output.Type !== null ? output.Type : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1RoleMappingMap = (output: any, context: __SerdeContext): { [key: string]: RoleMapping } => {\n return Object.entries(output).reduce((acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: deserializeAws_json1_1RoleMapping(value, context),\n };\n }, {});\n};\n\nconst deserializeAws_json1_1RolesMap = (output: any, context: __SerdeContext): { [key: string]: string } => {\n return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst deserializeAws_json1_1RulesConfigurationType = (output: any, context: __SerdeContext): RulesConfigurationType => {\n return {\n Rules:\n output.Rules !== undefined && output.Rules !== null\n ? deserializeAws_json1_1MappingRulesList(output.Rules, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1SAMLProviderList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => {\n return {} as any;\n};\n\nconst deserializeAws_json1_1TooManyRequestsException = (\n output: any,\n context: __SerdeContext\n): TooManyRequestsException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1UnprocessedIdentityId = (output: any, context: __SerdeContext): UnprocessedIdentityId => {\n return {\n ErrorCode: output.ErrorCode !== undefined && output.ErrorCode !== null ? output.ErrorCode : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1UnprocessedIdentityIdList = (\n output: any,\n context: __SerdeContext\n): UnprocessedIdentityId[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1UnprocessedIdentityId(entry, context);\n });\n};\n\nconst deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => {\n return {} as any;\n};\n\nconst deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({\n httpStatusCode: output.statusCode,\n requestId: output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"],\n extendedRequestId: output.headers[\"x-amz-id-2\"],\n cfId: output.headers[\"x-amz-cf-id\"],\n});\n\n// Collect low-level response body stream to Uint8Array.\nconst collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => {\n if (streamBody instanceof Uint8Array) {\n return Promise.resolve(streamBody);\n }\n return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());\n};\n\n// Encode Uint8Array data into string with utf-8.\nconst collectBodyString = (streamBody: any, context: __SerdeContext): Promise =>\n collectBody(streamBody, context).then((body) => context.utf8Encoder(body));\n\nconst buildHttpRpcRequest = async (\n context: __SerdeContext,\n headers: __HeaderBag,\n path: string,\n resolvedHostname: string | undefined,\n body: any\n): Promise<__HttpRequest> => {\n const { hostname, protocol = \"https\", port } = await context.endpoint();\n const contents: any = {\n protocol,\n hostname,\n port,\n method: \"POST\",\n path,\n headers,\n };\n if (resolvedHostname !== undefined) {\n contents.hostname = resolvedHostname;\n }\n if (body !== undefined) {\n contents.body = body;\n }\n return new __HttpRequest(contents);\n};\n\nconst parseBody = (streamBody: any, context: __SerdeContext): any =>\n collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n return JSON.parse(encoded);\n }\n return {};\n });\n\n/**\n * Load an error code for the aws.rest-json-1.1 protocol.\n */\nconst loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {\n const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());\n\n const sanitizeErrorCode = (rawValue: string): string => {\n let cleanValue = rawValue;\n if (cleanValue.indexOf(\":\") >= 0) {\n cleanValue = cleanValue.split(\":\")[0];\n }\n if (cleanValue.indexOf(\"#\") >= 0) {\n cleanValue = cleanValue.split(\"#\")[1];\n }\n return cleanValue;\n };\n\n const headerKey = findKey(output.headers, \"x-amzn-errortype\");\n if (headerKey !== undefined) {\n return sanitizeErrorCode(output.headers[headerKey]);\n }\n\n if (data.code !== undefined) {\n return sanitizeErrorCode(data.code);\n }\n\n if (data[\"__type\"] !== undefined) {\n return sanitizeErrorCode(data[\"__type\"]);\n }\n\n return \"\";\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {\n DeserializeHandler,\n DeserializeHandlerArguments,\n DeserializeHandlerOutput,\n DeserializeMiddleware,\n HandlerExecutionContext,\n ResponseDeserializer,\n} from \"@aws-sdk/types\";\n\nexport const deserializerMiddleware = (\n options: RuntimeUtils,\n deserializer: ResponseDeserializer\n): DeserializeMiddleware => (\n next: DeserializeHandler,\n context: HandlerExecutionContext\n): DeserializeHandler => async (\n args: DeserializeHandlerArguments\n): Promise> => {\n const { response } = await next(args);\n const parsed = await deserializer(response, options);\n return {\n response,\n output: parsed as Output,\n };\n};\n","import {\n DeserializeHandlerOptions,\n EndpointBearer,\n MetadataBearer,\n MiddlewareStack,\n Pluggable,\n RequestSerializer,\n ResponseDeserializer,\n SerializeHandlerOptions,\n} from \"@aws-sdk/types\";\n\nimport { deserializerMiddleware } from \"./deserializerMiddleware\";\nimport { serializerMiddleware } from \"./serializerMiddleware\";\n\nexport const deserializerMiddlewareOption: DeserializeHandlerOptions = {\n name: \"deserializerMiddleware\",\n step: \"deserialize\",\n tags: [\"DESERIALIZER\"],\n override: true,\n};\n\nexport const serializerMiddlewareOption: SerializeHandlerOptions = {\n name: \"serializerMiddleware\",\n step: \"serialize\",\n tags: [\"SERIALIZER\"],\n override: true,\n};\n\nexport function getSerdePlugin<\n InputType extends object,\n SerDeContext extends EndpointBearer,\n OutputType extends MetadataBearer\n>(\n config: SerDeContext,\n serializer: RequestSerializer,\n deserializer: ResponseDeserializer\n): Pluggable {\n return {\n applyToStack: (commandStack: MiddlewareStack) => {\n commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);\n commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);\n },\n };\n}\n","import {\n EndpointBearer,\n HandlerExecutionContext,\n RequestSerializer,\n SerializeHandler,\n SerializeHandlerArguments,\n SerializeHandlerOutput,\n SerializeMiddleware,\n} from \"@aws-sdk/types\";\n\nexport const serializerMiddleware = (\n options: RuntimeUtils,\n serializer: RequestSerializer\n): SerializeMiddleware => (\n next: SerializeHandler,\n context: HandlerExecutionContext\n): SerializeHandler => async (\n args: SerializeHandlerArguments\n): Promise> => {\n const request = await serializer(args.input, options);\n return next({\n ...args,\n request,\n });\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {\n AbsoluteLocation,\n DeserializeHandler,\n Handler,\n HandlerExecutionContext,\n HandlerOptions,\n MiddlewareStack,\n MiddlewareType,\n Pluggable,\n Priority,\n RelativeLocation,\n Step,\n} from \"@aws-sdk/types\";\n\nimport { AbsoluteMiddlewareEntry, MiddlewareEntry, Normalized, RelativeMiddlewareEntry } from \"./types\";\n\nexport const constructStack = (): MiddlewareStack => {\n let absoluteEntries: AbsoluteMiddlewareEntry[] = [];\n let relativeEntries: RelativeMiddlewareEntry[] = [];\n const entriesNameSet: Set = new Set();\n\n const sort = >(entries: T[]): T[] =>\n entries.sort(\n (a, b) =>\n stepWeights[b.step] - stepWeights[a.step] ||\n priorityWeights[b.priority || \"normal\"] - priorityWeights[a.priority || \"normal\"]\n );\n\n const removeByName = (toRemove: string): boolean => {\n let isRemoved = false;\n const filterCb = (entry: MiddlewareEntry): boolean => {\n if (entry.name && entry.name === toRemove) {\n isRemoved = true;\n entriesNameSet.delete(toRemove);\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n };\n\n const removeByReference = (toRemove: MiddlewareType): boolean => {\n let isRemoved = false;\n const filterCb = (entry: MiddlewareEntry): boolean => {\n if (entry.middleware === toRemove) {\n isRemoved = true;\n if (entry.name) entriesNameSet.delete(entry.name);\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n };\n\n const cloneTo = (\n toStack: MiddlewareStack\n ): MiddlewareStack => {\n absoluteEntries.forEach((entry) => {\n //@ts-ignore\n toStack.add(entry.middleware, { ...entry });\n });\n relativeEntries.forEach((entry) => {\n //@ts-ignore\n toStack.addRelativeTo(entry.middleware, { ...entry });\n });\n return toStack;\n };\n\n const expandRelativeMiddlewareList = (\n from: Normalized, Input, Output>\n ): MiddlewareEntry[] => {\n const expandedMiddlewareList: MiddlewareEntry[] = [];\n from.before.forEach((entry) => {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n } else {\n expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n }\n });\n expandedMiddlewareList.push(from);\n from.after.reverse().forEach((entry) => {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n } else {\n expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n }\n });\n return expandedMiddlewareList;\n };\n\n /**\n * Get a final list of middleware in the order of being executed in the resolved handler.\n */\n const getMiddlewareList = (): Array> => {\n const normalizedAbsoluteEntries: Normalized, Input, Output>[] = [];\n const normalizedRelativeEntries: Normalized, Input, Output>[] = [];\n const normalizedEntriesNameMap: {\n [middlewareName: string]: Normalized, Input, Output>;\n } = {};\n\n absoluteEntries.forEach((entry) => {\n const normalizedEntry = {\n ...entry,\n before: [],\n after: [],\n };\n if (normalizedEntry.name) normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry;\n normalizedAbsoluteEntries.push(normalizedEntry);\n });\n\n relativeEntries.forEach((entry) => {\n const normalizedEntry = {\n ...entry,\n before: [],\n after: [],\n };\n if (normalizedEntry.name) normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry;\n normalizedRelativeEntries.push(normalizedEntry);\n });\n\n normalizedRelativeEntries.forEach((entry) => {\n if (entry.toMiddleware) {\n const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];\n if (toMiddleware === undefined) {\n throw new Error(\n `${entry.toMiddleware} is not found when adding ${entry.name || \"anonymous\"} middleware ${entry.relation} ${\n entry.toMiddleware\n }`\n );\n }\n if (entry.relation === \"after\") {\n toMiddleware.after.push(entry);\n }\n if (entry.relation === \"before\") {\n toMiddleware.before.push(entry);\n }\n }\n });\n\n const mainChain = sort(normalizedAbsoluteEntries)\n .map(expandRelativeMiddlewareList)\n .reduce((wholeList, expendedMiddlewareList) => {\n // TODO: Replace it with Array.flat();\n wholeList.push(...expendedMiddlewareList);\n return wholeList;\n }, [] as MiddlewareEntry[]);\n return mainChain.map((entry) => entry.middleware);\n };\n\n const stack = {\n add: (middleware: MiddlewareType, options: HandlerOptions & AbsoluteLocation = {}) => {\n const { name, override } = options;\n const entry: AbsoluteMiddlewareEntry = {\n step: \"initialize\",\n priority: \"normal\",\n middleware,\n ...options,\n };\n if (name) {\n if (entriesNameSet.has(name)) {\n if (!override) throw new Error(`Duplicate middleware name '${name}'`);\n const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === name);\n const toOverride = absoluteEntries[toOverrideIndex];\n if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) {\n throw new Error(\n `\"${name}\" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be ` +\n `overridden by same-name middleware with ${entry.priority} priority in ${entry.step} step.`\n );\n }\n absoluteEntries.splice(toOverrideIndex, 1);\n }\n entriesNameSet.add(name);\n }\n absoluteEntries.push(entry);\n },\n\n addRelativeTo: (middleware: MiddlewareType, options: HandlerOptions & RelativeLocation) => {\n const { name, override } = options;\n const entry: RelativeMiddlewareEntry = {\n middleware,\n ...options,\n };\n if (name) {\n if (entriesNameSet.has(name)) {\n if (!override) throw new Error(`Duplicate middleware name '${name}'`);\n const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === name);\n const toOverride = relativeEntries[toOverrideIndex];\n if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {\n throw new Error(\n `\"${name}\" middleware ${toOverride.relation} \"${toOverride.toMiddleware}\" middleware cannot be overridden ` +\n `by same-name middleware ${entry.relation} \"${entry.toMiddleware}\" middleware.`\n );\n }\n relativeEntries.splice(toOverrideIndex, 1);\n }\n entriesNameSet.add(name);\n }\n relativeEntries.push(entry);\n },\n\n clone: () => cloneTo(constructStack()),\n\n use: (plugin: Pluggable) => {\n plugin.applyToStack(stack);\n },\n\n remove: (toRemove: MiddlewareType | string): boolean => {\n if (typeof toRemove === \"string\") return removeByName(toRemove);\n else return removeByReference(toRemove);\n },\n\n removeByTag: (toRemove: string): boolean => {\n let isRemoved = false;\n const filterCb = (entry: MiddlewareEntry): boolean => {\n const { tags, name } = entry;\n if (tags && tags.includes(toRemove)) {\n if (name) entriesNameSet.delete(name);\n isRemoved = true;\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n },\n\n concat: (\n from: MiddlewareStack\n ): MiddlewareStack => {\n const cloned = cloneTo(constructStack());\n cloned.use(from);\n return cloned;\n },\n\n applyToStack: cloneTo,\n\n resolve: (\n handler: DeserializeHandler,\n context: HandlerExecutionContext\n ): Handler => {\n for (const middleware of getMiddlewareList().reverse()) {\n handler = middleware(handler as Handler, context) as any;\n }\n return handler as Handler;\n },\n };\n return stack;\n};\n\nconst stepWeights: { [key in Step]: number } = {\n initialize: 5,\n serialize: 4,\n build: 3,\n finalizeRequest: 2,\n deserialize: 1,\n};\n\nconst priorityWeights: { [key in Priority]: number } = {\n high: 3,\n normal: 2,\n low: 1,\n};\n","import { constructStack } from \"@aws-sdk/middleware-stack\";\nimport { Client as IClient, Command, MetadataBearer, RequestHandler } from \"@aws-sdk/types\";\n\nexport interface SmithyConfiguration {\n requestHandler: RequestHandler;\n /**\n * The API version set internally by the SDK, and is\n * not planned to be used by customer code.\n * @internal\n */\n readonly apiVersion: string;\n}\n\nexport type SmithyResolvedConfiguration = SmithyConfiguration;\n\nexport class Client<\n HandlerOptions,\n ClientInput extends object,\n ClientOutput extends MetadataBearer,\n ResolvedClientConfiguration extends SmithyResolvedConfiguration\n> implements IClient {\n public middlewareStack = constructStack();\n readonly config: ResolvedClientConfiguration;\n constructor(config: ResolvedClientConfiguration) {\n this.config = config;\n }\n send(\n command: Command>,\n options?: HandlerOptions\n ): Promise;\n send(\n command: Command>,\n cb: (err: any, data?: OutputType) => void\n ): void;\n send(\n command: Command>,\n options: HandlerOptions,\n cb: (err: any, data?: OutputType) => void\n ): void;\n send(\n command: Command>,\n optionsOrCb?: HandlerOptions | ((err: any, data?: OutputType) => void),\n cb?: (err: any, data?: OutputType) => void\n ): Promise | void {\n const options = typeof optionsOrCb !== \"function\" ? optionsOrCb : undefined;\n const callback = typeof optionsOrCb === \"function\" ? (optionsOrCb as (err: any, data?: OutputType) => void) : cb;\n const handler = command.resolveMiddleware(this.middlewareStack as any, this.config, options);\n if (callback) {\n handler(command)\n .then(\n (result) => callback(null, result.output),\n (err: any) => callback(err)\n )\n .catch(\n // prevent any errors thrown in the callback from triggering an\n // unhandled promise rejection\n () => {}\n );\n } else {\n return handler(command).then((result) => result.output);\n }\n }\n\n destroy() {\n if (this.config.requestHandler.destroy) this.config.requestHandler.destroy();\n }\n}\n","import { constructStack } from \"@aws-sdk/middleware-stack\";\nimport { Command as ICommand, Handler, MetadataBearer, MiddlewareStack as IMiddlewareStack } from \"@aws-sdk/types\";\n\nexport abstract class Command<\n Input extends ClientInput,\n Output extends ClientOutput,\n ResolvedClientConfiguration,\n ClientInput extends object = any,\n ClientOutput extends MetadataBearer = any\n> implements ICommand {\n abstract input: Input;\n readonly middlewareStack: IMiddlewareStack = constructStack();\n abstract resolveMiddleware(\n stack: IMiddlewareStack,\n configuration: ResolvedClientConfiguration,\n options: any\n ): Handler;\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * Lazy String holder for JSON typed contents.\n */\n\ninterface StringWrapper {\n new (arg: any): String;\n}\n\n/**\n * Because of https://github.com/microsoft/tslib/issues/95,\n * TS 'extends' shim doesn't support extending native types like String.\n * So here we create StringWrapper that duplicate everything from String\n * class including its prototype chain. So we can extend from here.\n */\n// @ts-ignore StringWrapper implementation is not a simple constructor\nexport const StringWrapper: StringWrapper = function () {\n //@ts-ignore 'this' cannot be assigned to any, but Object.getPrototypeOf accepts any\n const Class = Object.getPrototypeOf(this).constructor;\n const Constructor = Function.bind.apply(String, [null as any, ...arguments]);\n //@ts-ignore Call wrapped String constructor directly, don't bother typing it.\n const instance = new Constructor();\n Object.setPrototypeOf(instance, Class.prototype);\n return instance as String;\n};\nStringWrapper.prototype = Object.create(String.prototype, {\n constructor: {\n value: StringWrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\nObject.setPrototypeOf(StringWrapper, String);\n\nexport class LazyJsonString extends StringWrapper {\n deserializeJSON(): any {\n return JSON.parse(super.toString());\n }\n\n toJSON(): string {\n return super.toString();\n }\n\n static fromObject(object: any): LazyJsonString {\n if (object instanceof LazyJsonString) {\n return object;\n } else if (object instanceof String || typeof object === \"string\") {\n return new LazyJsonString(object);\n }\n return new LazyJsonString(JSON.stringify(object));\n }\n}\n","import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../CognitoIdentityClient\";\nimport { GetCredentialsForIdentityInput, GetCredentialsForIdentityResponse } from \"../models/models_0\";\nimport {\n deserializeAws_json1_1GetCredentialsForIdentityCommand,\n serializeAws_json1_1GetCredentialsForIdentityCommand,\n} from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\nimport {\n FinalizeHandlerArguments,\n Handler,\n HandlerExecutionContext,\n MiddlewareStack,\n HttpHandlerOptions as __HttpHandlerOptions,\n MetadataBearer as __MetadataBearer,\n SerdeContext as __SerdeContext,\n} from \"@aws-sdk/types\";\n\nexport type GetCredentialsForIdentityCommandInput = GetCredentialsForIdentityInput;\nexport type GetCredentialsForIdentityCommandOutput = GetCredentialsForIdentityResponse & __MetadataBearer;\n\n/**\n *

Returns credentials for the provided identity ID. Any provided logins will be\n * validated against supported login providers. If the token is for\n * cognito-identity.amazonaws.com, it will be passed through to AWS Security Token Service\n * with the appropriate role for the token.

\n *

This is a public API. You do not need any credentials to call this API.

\n */\nexport class GetCredentialsForIdentityCommand extends $Command<\n GetCredentialsForIdentityCommandInput,\n GetCredentialsForIdentityCommandOutput,\n CognitoIdentityClientResolvedConfig\n> {\n // Start section: command_properties\n // End section: command_properties\n\n constructor(readonly input: GetCredentialsForIdentityCommandInput) {\n // Start section: command_constructor\n super();\n // End section: command_constructor\n }\n\n /**\n * @internal\n */\n resolveMiddleware(\n clientStack: MiddlewareStack,\n configuration: CognitoIdentityClientResolvedConfig,\n options?: __HttpHandlerOptions\n ): Handler {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n\n const stack = clientStack.concat(this.middlewareStack);\n\n const { logger } = configuration;\n const clientName = \"CognitoIdentityClient\";\n const commandName = \"GetCredentialsForIdentityCommand\";\n const handlerExecutionContext: HandlerExecutionContext = {\n logger,\n clientName,\n commandName,\n inputFilterSensitiveLog: GetCredentialsForIdentityInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetCredentialsForIdentityResponse.filterSensitiveLog,\n };\n const { requestHandler } = configuration;\n return stack.resolve(\n (request: FinalizeHandlerArguments) =>\n requestHandler.handle(request.request as __HttpRequest, options || {}),\n handlerExecutionContext\n );\n }\n\n private serialize(input: GetCredentialsForIdentityCommandInput, context: __SerdeContext): Promise<__HttpRequest> {\n return serializeAws_json1_1GetCredentialsForIdentityCommand(input, context);\n }\n\n private deserialize(\n output: __HttpResponse,\n context: __SerdeContext\n ): Promise {\n return deserializeAws_json1_1GetCredentialsForIdentityCommand(output, context);\n }\n\n // Start section: command_body_extra\n // End section: command_body_extra\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * An error representing a failure of an individual credential provider.\n *\n * This error class has special meaning to the {@link chain} method. If a\n * provider in the chain is rejected with an error, the chain will only proceed\n * to the next provider if the value of the `tryNextLink` property on the error\n * is truthy. This allows individual providers to halt the chain and also\n * ensures the chain will stop if an entirely unexpected error is encountered.\n */\nexport class ProviderError extends Error {\n constructor(message: string, public readonly tryNextLink: boolean = true) {\n super(message);\n }\n}\n","import { Logins, ResolvedLogins } from \"./Logins\";\n\n/**\n * @internal\n */\nexport function resolveLogins(logins: Logins): Promise {\n return Promise.all(\n Object.keys(logins).reduce((arr: Array<[string, string] | Promise<[string, string]>>, name: string) => {\n const tokenOrProvider = logins[name];\n if (typeof tokenOrProvider === \"string\") {\n arr.push([name, tokenOrProvider] as [string, string]);\n } else {\n arr.push(tokenOrProvider().then((token) => [name, token] as [string, string]));\n }\n return arr;\n }, [] as Array>)\n ).then((resolvedPairs) =>\n resolvedPairs.reduce((logins: ResolvedLogins, [key, value]) => {\n logins[key] = value;\n return logins;\n }, {} as ResolvedLogins)\n );\n}\n","import { GetCredentialsForIdentityCommand } from \"@aws-sdk/client-cognito-identity\";\nimport { ProviderError } from \"@aws-sdk/property-provider\";\nimport { CredentialProvider, Credentials } from \"@aws-sdk/types\";\n\nimport { CognitoProviderParameters } from \"./CognitoProviderParameters\";\nimport { resolveLogins } from \"./resolveLogins\";\n\nexport interface CognitoIdentityCredentials extends Credentials {\n /**\n * The Cognito ID returned by the last call to AWS.CognitoIdentity.getOpenIdToken().\n */\n identityId: string;\n}\n\n/**\n * Retrieves temporary AWS credentials using Amazon Cognito's\n * `GetCredentialsForIdentity` operation.\n *\n * Results from this function call are not cached internally.\n */\nexport function fromCognitoIdentity(parameters: FromCognitoIdentityParameters): CredentialProvider {\n return async (): Promise => {\n const {\n Credentials: {\n AccessKeyId = throwOnMissingAccessKeyId(),\n Expiration,\n SecretKey = throwOnMissingSecretKey(),\n SessionToken,\n } = throwOnMissingCredentials(),\n } = await parameters.client.send(\n new GetCredentialsForIdentityCommand({\n CustomRoleArn: parameters.customRoleArn,\n IdentityId: parameters.identityId,\n Logins: parameters.logins ? await resolveLogins(parameters.logins) : undefined,\n })\n );\n\n return {\n identityId: parameters.identityId,\n accessKeyId: AccessKeyId,\n secretAccessKey: SecretKey,\n sessionToken: SessionToken,\n expiration: Expiration,\n };\n };\n}\n\nexport interface FromCognitoIdentityParameters extends CognitoProviderParameters {\n /**\n * The unique identifier for the identity against which credentials will be\n * issued.\n */\n identityId: string;\n}\n\nfunction throwOnMissingAccessKeyId(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no access key ID\");\n}\n\nfunction throwOnMissingCredentials(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no credentials\");\n}\n\nfunction throwOnMissingSecretKey(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no secret key\");\n}\n","import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../CognitoIdentityClient\";\nimport { GetIdInput, GetIdResponse } from \"../models/models_0\";\nimport { deserializeAws_json1_1GetIdCommand, serializeAws_json1_1GetIdCommand } from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\nimport {\n FinalizeHandlerArguments,\n Handler,\n HandlerExecutionContext,\n MiddlewareStack,\n HttpHandlerOptions as __HttpHandlerOptions,\n MetadataBearer as __MetadataBearer,\n SerdeContext as __SerdeContext,\n} from \"@aws-sdk/types\";\n\nexport type GetIdCommandInput = GetIdInput;\nexport type GetIdCommandOutput = GetIdResponse & __MetadataBearer;\n\n/**\n *

Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an\n * implicit linked account.

\n *

This is a public API. You do not need any credentials to call this API.

\n */\nexport class GetIdCommand extends $Command {\n // Start section: command_properties\n // End section: command_properties\n\n constructor(readonly input: GetIdCommandInput) {\n // Start section: command_constructor\n super();\n // End section: command_constructor\n }\n\n /**\n * @internal\n */\n resolveMiddleware(\n clientStack: MiddlewareStack,\n configuration: CognitoIdentityClientResolvedConfig,\n options?: __HttpHandlerOptions\n ): Handler {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n\n const stack = clientStack.concat(this.middlewareStack);\n\n const { logger } = configuration;\n const clientName = \"CognitoIdentityClient\";\n const commandName = \"GetIdCommand\";\n const handlerExecutionContext: HandlerExecutionContext = {\n logger,\n clientName,\n commandName,\n inputFilterSensitiveLog: GetIdInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetIdResponse.filterSensitiveLog,\n };\n const { requestHandler } = configuration;\n return stack.resolve(\n (request: FinalizeHandlerArguments) =>\n requestHandler.handle(request.request as __HttpRequest, options || {}),\n handlerExecutionContext\n );\n }\n\n private serialize(input: GetIdCommandInput, context: __SerdeContext): Promise<__HttpRequest> {\n return serializeAws_json1_1GetIdCommand(input, context);\n }\n\n private deserialize(output: __HttpResponse, context: __SerdeContext): Promise {\n return deserializeAws_json1_1GetIdCommand(output, context);\n }\n\n // Start section: command_body_extra\n // End section: command_body_extra\n}\n","import { Storage } from \"./Storage\";\n\nconst STORE_NAME = \"IdentityIds\";\n\nexport class IndexedDbStorage implements Storage {\n constructor(private readonly dbName: string = \"aws:cognito-identity-ids\") {}\n\n getItem(key: string): Promise {\n return this.withObjectStore(\"readonly\", (store) => {\n const req = store.get(key);\n\n return new Promise((resolve) => {\n req.onerror = () => resolve(null);\n\n req.onsuccess = () => resolve(req.result ? req.result.value : null);\n });\n }).catch(() => null);\n }\n\n removeItem(key: string): Promise {\n return this.withObjectStore(\"readwrite\", (store) => {\n const req = store.delete(key);\n\n return new Promise((resolve, reject) => {\n req.onerror = () => reject(req.error);\n\n req.onsuccess = () => resolve();\n });\n });\n }\n\n setItem(id: string, value: string): Promise {\n return this.withObjectStore(\"readwrite\", (store) => {\n const req = store.put({ id, value });\n\n return new Promise((resolve, reject) => {\n req.onerror = () => reject(req.error);\n\n req.onsuccess = () => resolve();\n });\n });\n }\n\n private getDb(): Promise {\n const openDbRequest = self.indexedDB.open(this.dbName, 1);\n return new Promise((resolve, reject) => {\n openDbRequest.onsuccess = () => {\n resolve(openDbRequest.result);\n };\n\n openDbRequest.onerror = () => {\n reject(openDbRequest.error);\n };\n\n openDbRequest.onblocked = () => {\n reject(new Error(\"Unable to access DB\"));\n };\n\n openDbRequest.onupgradeneeded = () => {\n const db = openDbRequest.result;\n db.onerror = () => {\n reject(new Error(\"Failed to create object store\"));\n };\n\n db.createObjectStore(STORE_NAME, { keyPath: \"id\" });\n };\n });\n }\n\n private withObjectStore(mode: IDBTransactionMode, action: (store: IDBObjectStore) => Promise): Promise {\n return this.getDb().then((db) => {\n const tx = db.transaction(STORE_NAME, mode);\n tx.oncomplete = () => db.close();\n\n return new Promise((resolve, reject) => {\n tx.onerror = () => reject(tx.error);\n\n resolve(action(tx.objectStore(STORE_NAME)));\n }).catch((err) => {\n db.close();\n throw err;\n });\n });\n }\n}\n","import { IndexedDbStorage } from \"./IndexedDbStorage\";\nimport { InMemoryStorage } from \"./InMemoryStorage\";\nimport { Storage } from \"./Storage\";\n\nconst inMemoryStorage = new InMemoryStorage();\n\nexport function localStorage(): Storage {\n if (typeof self === \"object\" && self.indexedDB) {\n return new IndexedDbStorage();\n }\n\n if (typeof window === \"object\" && window.localStorage) {\n return window.localStorage;\n }\n\n return inMemoryStorage;\n}\n","import { Storage } from \"./Storage\";\n\nexport class InMemoryStorage implements Storage {\n constructor(private store: { [key: string]: string } = {}) {}\n\n getItem(key: string): string | null {\n if (key in this.store) {\n return this.store[key];\n }\n\n return null;\n }\n\n removeItem(key: string): void {\n delete this.store[key];\n }\n\n setItem(key: string, value: string): void {\n this.store[key] = value;\n }\n}\n","import { GetIdCommand } from \"@aws-sdk/client-cognito-identity\";\nimport { ProviderError } from \"@aws-sdk/property-provider\";\nimport { CredentialProvider } from \"@aws-sdk/types\";\n\nimport { CognitoProviderParameters } from \"./CognitoProviderParameters\";\nimport { fromCognitoIdentity } from \"./fromCognitoIdentity\";\nimport { localStorage } from \"./localStorage\";\nimport { resolveLogins } from \"./resolveLogins\";\nimport { Storage } from \"./Storage\";\n\n/**\n * Retrieves or generates a unique identifier using Amazon Cognito's `GetId`\n * operation, then generates temporary AWS credentials using Amazon Cognito's\n * `GetCredentialsForIdentity` operation.\n *\n * Results from `GetId` are cached internally, but results from\n * `GetCredentialsForIdentity` are not.\n */\nexport function fromCognitoIdentityPool({\n accountId,\n cache = localStorage(),\n client,\n customRoleArn,\n identityPoolId,\n logins,\n userIdentifier = !logins || Object.keys(logins).length === 0 ? \"ANONYMOUS\" : undefined,\n}: FromCognitoIdentityPoolParameters): CredentialProvider {\n const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : undefined;\n\n let provider: CredentialProvider = async () => {\n let identityId = cacheKey && (await cache.getItem(cacheKey));\n if (!identityId) {\n const { IdentityId = throwOnMissingId() } = await client.send(\n new GetIdCommand({\n AccountId: accountId,\n IdentityPoolId: identityPoolId,\n Logins: logins ? await resolveLogins(logins) : undefined,\n })\n );\n identityId = IdentityId;\n if (cacheKey) {\n Promise.resolve(cache.setItem(cacheKey, identityId)).catch(() => {});\n }\n }\n\n provider = fromCognitoIdentity({\n client,\n customRoleArn,\n logins,\n identityId,\n });\n\n return provider();\n };\n\n return () =>\n provider().catch(async (err) => {\n if (cacheKey) {\n Promise.resolve(cache.removeItem(cacheKey)).catch(() => {});\n }\n\n throw err;\n });\n}\n\nexport interface FromCognitoIdentityPoolParameters extends CognitoProviderParameters {\n /**\n * A standard AWS account ID (9+ digits).\n */\n accountId?: string;\n\n /**\n * A cache in which to store resolved Cognito IdentityIds. If not supplied,\n * the credential provider will attempt to store IdentityIds in one of the\n * following (in order of preference):\n * 1. IndexedDB\n * 2. LocalStorage\n * 3. An in-memory cache object that will not persist between pages.\n *\n * IndexedDB is preferred to maximize data sharing between top-level\n * browsing contexts and web workers.\n *\n * The provider will not cache IdentityIds of authenticated users unless a\n * separate `userIdentitifer` parameter is supplied.\n */\n cache?: Storage;\n\n /**\n * The unique identifier for the identity pool from which an identity should\n * be retrieved or generated.\n */\n identityPoolId: string;\n\n /**\n * A unique identifier for the user. This is distinct from a Cognito\n * IdentityId and should instead be an identifier meaningful to your\n * application. Used to cache Cognito IdentityIds on a per-user basis.\n */\n userIdentifier?: string;\n}\n\nfunction throwOnMissingId(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no identity ID\");\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const escapeUri = (uri: string): string =>\n // AWS percent-encodes some extra non-standard characters in a URI\n encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);\n\nconst hexEncode = (c: string) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;\n","const alphabetByEncoding: { [key: string]: number } = {};\nconst alphabetByValue: Array = new Array(64);\n\nfor (let i = 0, start = \"A\".charCodeAt(0), limit = \"Z\".charCodeAt(0); i + start <= limit; i++) {\n const char = String.fromCharCode(i + start);\n alphabetByEncoding[char] = i;\n alphabetByValue[i] = char;\n}\n\nfor (let i = 0, start = \"a\".charCodeAt(0), limit = \"z\".charCodeAt(0); i + start <= limit; i++) {\n const char = String.fromCharCode(i + start);\n const index = i + 26;\n alphabetByEncoding[char] = index;\n alphabetByValue[index] = char;\n}\n\nfor (let i = 0; i < 10; i++) {\n alphabetByEncoding[i.toString(10)] = i + 52;\n const char = i.toString(10);\n const index = i + 52;\n alphabetByEncoding[char] = index;\n alphabetByValue[index] = char;\n}\n\nalphabetByEncoding[\"+\"] = 62;\nalphabetByValue[62] = \"+\";\nalphabetByEncoding[\"/\"] = 63;\nalphabetByValue[63] = \"/\";\n\nconst bitsPerLetter = 6;\nconst bitsPerByte = 8;\nconst maxLetterValue = 0b111111;\n\n/**\n * Converts a base-64 encoded string to a Uint8Array of bytes.\n *\n * @param input The base-64 encoded string\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function fromBase64(input: string): Uint8Array {\n let totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n } else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n const out = new ArrayBuffer(totalByteLength);\n const dataView = new DataView(out);\n for (let i = 0; i < input.length; i += 4) {\n let bits = 0;\n let bitLength = 0;\n for (let j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n } else {\n bits >>= bitsPerLetter;\n }\n }\n\n const chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n const byteLength = Math.floor(bitLength / bitsPerByte);\n for (let k = 0; k < byteLength; k++) {\n const offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n\n return new Uint8Array(out);\n}\n\n/**\n * Converts a Uint8Array of binary data to a base-64 encoded string.\n *\n * @param input The binary data to encode\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function toBase64(input: Uint8Array): string {\n let str = \"\";\n for (let i = 0; i < input.length; i += 3) {\n let bits = 0;\n let bitLength = 0;\n for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {\n bits |= input[j] << ((limit - j - 1) * bitsPerByte);\n bitLength += bitsPerByte;\n }\n\n const bitClusterCount = Math.ceil(bitLength / bitsPerLetter);\n bits <<= bitClusterCount * bitsPerLetter - bitLength;\n for (let k = 1; k <= bitClusterCount; k++) {\n const offset = (bitClusterCount - k) * bitsPerLetter;\n str += alphabetByValue[(bits & (maxLetterValue << offset)) >> offset];\n }\n\n str += \"==\".slice(0, 4 - bitClusterCount);\n }\n\n return str;\n}\n","import { HttpHandler, HttpRequest, HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { buildQueryString } from \"@aws-sdk/querystring-builder\";\nimport { HeaderBag, HttpHandlerOptions } from \"@aws-sdk/types\";\n\nimport { requestTimeout } from \"./request-timeout\";\n\ndeclare let AbortController: any;\n\n/**\n * Represents the http options that can be passed to a browser http client.\n */\nexport interface FetchHttpHandlerOptions {\n /**\n * The number of milliseconds a request can take before being automatically\n * terminated.\n */\n requestTimeout?: number;\n}\n\nexport class FetchHttpHandler implements HttpHandler {\n private readonly requestTimeout?: number;\n\n constructor({ requestTimeout }: FetchHttpHandlerOptions = {}) {\n this.requestTimeout = requestTimeout;\n }\n\n destroy(): void {\n // Do nothing. TLS and HTTP/2 connection pooling is handled by the browser.\n }\n\n handle(request: HttpRequest, { abortSignal }: HttpHandlerOptions = {}): Promise<{ response: HttpResponse }> {\n const requestTimeoutInMs = this.requestTimeout;\n\n // if the request was already aborted, prevent doing extra work\n if (abortSignal?.aborted) {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n return Promise.reject(abortError);\n }\n\n let path = request.path;\n if (request.query) {\n const queryString = buildQueryString(request.query);\n if (queryString) {\n path += `?${queryString}`;\n }\n }\n\n const { port, method } = request;\n const url = `${request.protocol}//${request.hostname}${port ? `:${port}` : \"\"}${path}`;\n // Request constructor doesn't allow GET/HEAD request with body\n // ref: https://github.com/whatwg/fetch/issues/551\n const body = method === \"GET\" || method === \"HEAD\" ? undefined : request.body;\n const requestOptions: RequestInit = {\n body,\n headers: new Headers(request.headers),\n method: method,\n };\n\n // some browsers support abort signal\n if (typeof AbortController !== \"undefined\") {\n (requestOptions as any)[\"signal\"] = abortSignal;\n }\n\n const fetchRequest = new Request(url, requestOptions);\n const raceOfPromises = [\n fetch(fetchRequest).then((response) => {\n const fetchHeaders: any = response.headers;\n const transformedHeaders: HeaderBag = {};\n\n for (const pair of >fetchHeaders.entries()) {\n transformedHeaders[pair[0]] = pair[1];\n }\n\n const hasReadableStream = response.body !== undefined;\n\n // Return the response with buffered body\n if (!hasReadableStream) {\n return response.blob().then((body) => ({\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body,\n }),\n }));\n }\n // Return the response with streaming body\n return {\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body: response.body,\n }),\n };\n }),\n requestTimeout(requestTimeoutInMs),\n ];\n if (abortSignal) {\n raceOfPromises.push(\n new Promise((resolve, reject) => {\n abortSignal.onabort = () => {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n };\n })\n );\n }\n return Promise.race(raceOfPromises);\n }\n}\n","import { QueryParameterBag } from \"@aws-sdk/types\";\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\n\nexport function buildQueryString(query: QueryParameterBag): string {\n const parts: string[] = [];\n for (let key of Object.keys(query).sort()) {\n const value = query[key];\n key = escapeUri(key);\n if (Array.isArray(value)) {\n for (let i = 0, iLen = value.length; i < iLen; i++) {\n parts.push(`${key}=${escapeUri(value[i])}`);\n }\n } else {\n let qsEntry = key;\n if (value || typeof value === \"string\") {\n qsEntry += `=${escapeUri(value)}`;\n }\n parts.push(qsEntry);\n }\n }\n\n return parts.join(\"&\");\n}\n","export function requestTimeout(timeoutInMs = 0): Promise {\n return new Promise((resolve, reject) => {\n if (timeoutInMs) {\n setTimeout(() => {\n const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);\n timeoutError.name = \"TimeoutError\";\n reject(timeoutError);\n }, timeoutInMs);\n }\n });\n}\n","import { StreamCollector } from \"@aws-sdk/types\";\nimport { fromBase64 } from \"@aws-sdk/util-base64-browser\";\n\n//reference: https://snack.expo.io/r1JCSWRGU\nexport const streamCollector: StreamCollector = (stream: Blob | ReadableStream): Promise => {\n if (typeof Blob === \"function\" && stream instanceof Blob) {\n return collectBlob(stream);\n }\n\n return collectStream(stream as ReadableStream);\n};\n\nasync function collectBlob(blob: Blob): Promise {\n const base64 = await readToBase64(blob);\n const arrayBuffer = fromBase64(base64);\n return new Uint8Array(arrayBuffer);\n}\n\nasync function collectStream(stream: ReadableStream): Promise {\n let res = new Uint8Array(0);\n const reader = stream.getReader();\n let isDone = false;\n while (!isDone) {\n const { done, value } = await reader.read();\n if (value) {\n const prior = res;\n res = new Uint8Array(prior.length + value.length);\n res.set(prior);\n res.set(value, prior.length);\n }\n isDone = done;\n }\n return res;\n}\n\nfunction readToBase64(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n if (reader.readyState !== 2) {\n return reject(new Error(\"Reader aborted too early\"));\n }\n const result = (reader.result ?? \"\") as string;\n // Response can include only 'data:' for empty blob, return empty string in this case.\n // Otherwise, return the string after ','\n const commaIndex = result.indexOf(\",\");\n const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n resolve(result.substring(dataOffset));\n };\n reader.onabort = () => reject(new Error(\"Read aborted\"));\n reader.onerror = () => reject(reader.error);\n // reader.readAsArrayBuffer is not always available\n reader.readAsDataURL(blob);\n });\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {\n AbsoluteLocation,\n FinalizeHandler,\n FinalizeHandlerArguments,\n FinalizeHandlerOutput,\n FinalizeRequestHandlerOptions,\n HandlerExecutionContext,\n MetadataBearer,\n Pluggable,\n} from \"@aws-sdk/types\";\n\nimport { RetryResolvedConfig } from \"./configurations\";\n\nexport const retryMiddleware = (options: RetryResolvedConfig) => (\n next: FinalizeHandler,\n context: HandlerExecutionContext\n): FinalizeHandler => async (\n args: FinalizeHandlerArguments\n): Promise> => {\n if (options?.retryStrategy?.mode)\n context.userAgent = [...(context.userAgent || []), [\"cfg/retry-mode\", options.retryStrategy.mode]];\n return options.retryStrategy.retry(next, args);\n};\n\nexport const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation = {\n name: \"retryMiddleware\",\n tags: [\"RETRY\"],\n step: \"finalizeRequest\",\n priority: \"high\",\n override: true,\n};\n\nexport const getRetryPlugin = (options: RetryResolvedConfig): Pluggable => ({\n applyToStack: (clientStack) => {\n clientStack.add(retryMiddleware(options), retryMiddlewareOptions);\n },\n});\n","/**\n * Errors encountered when the client clock and server clock cannot agree on the\n * current time.\n *\n * These errors are retryable, assuming the SDK has enabled clock skew\n * correction.\n */\nexport const CLOCK_SKEW_ERROR_CODES = [\n \"AuthFailure\",\n \"InvalidSignatureException\",\n \"RequestExpired\",\n \"RequestInTheFuture\",\n \"RequestTimeTooSkewed\",\n \"SignatureDoesNotMatch\",\n];\n\n/**\n * Errors that indicate the SDK is being throttled.\n *\n * These errors are always retryable.\n */\nexport const THROTTLING_ERROR_CODES = [\n \"BandwidthLimitExceeded\",\n \"EC2ThrottledException\",\n \"LimitExceededException\",\n \"PriorRequestNotComplete\",\n \"ProvisionedThroughputExceededException\",\n \"RequestLimitExceeded\",\n \"RequestThrottled\",\n \"RequestThrottledException\",\n \"SlowDown\",\n \"ThrottledException\",\n \"Throttling\",\n \"ThrottlingException\",\n \"TooManyRequestsException\",\n \"TransactionInProgressException\", // DynamoDB\n];\n\n/**\n * Error codes that indicate transient issues\n */\nexport const TRANSIENT_ERROR_CODES = [\"AbortError\", \"TimeoutError\", \"RequestTimeout\", \"RequestTimeoutException\"];\n\n/**\n * Error codes that indicate transient issues\n */\nexport const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];\n","import { SdkError } from \"@aws-sdk/smithy-client\";\n\nimport {\n CLOCK_SKEW_ERROR_CODES,\n THROTTLING_ERROR_CODES,\n TRANSIENT_ERROR_CODES,\n TRANSIENT_ERROR_STATUS_CODES,\n} from \"./constants\";\n\nexport const isRetryableByTrait = (error: SdkError) => error.$retryable !== undefined;\n\nexport const isClockSkewError = (error: SdkError) => CLOCK_SKEW_ERROR_CODES.includes(error.name);\n\nexport const isThrottlingError = (error: SdkError) =>\n error.$metadata?.httpStatusCode === 429 ||\n THROTTLING_ERROR_CODES.includes(error.name) ||\n error.$retryable?.throttling == true;\n\nexport const isTransientError = (error: SdkError) =>\n TRANSIENT_ERROR_CODES.includes(error.name) ||\n TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0);\n","import { MAXIMUM_RETRY_DELAY } from \"./constants\";\n\n/**\n * Calculate a capped, fully-jittered exponential backoff time.\n */\nexport const defaultDelayDecider = (delayBase: number, attempts: number) =>\n Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));\n","/**\n * The base number of milliseconds to use in calculating a suitable cool-down\n * time when a retryable error is encountered.\n */\nexport const DEFAULT_RETRY_DELAY_BASE = 100;\n\n/**\n * The maximum amount of time (in milliseconds) that will be used as a delay\n * between retry attempts.\n */\nexport const MAXIMUM_RETRY_DELAY = 20 * 1000;\n\n/**\n * The retry delay base (in milliseconds) to use when a throttling error is\n * encountered.\n */\nexport const THROTTLING_RETRY_DELAY_BASE = 500;\n\n/**\n * Initial number of retry tokens in Retry Quota\n */\nexport const INITIAL_RETRY_TOKENS = 500;\n\n/**\n * The total amount of retry tokens to be decremented from retry token balance.\n */\nexport const RETRY_COST = 5;\n\n/**\n * The total amount of retry tokens to be decremented from retry token balance\n * when a throttling error is encountered.\n */\nexport const TIMEOUT_RETRY_COST = 10;\n\n/**\n * The total amount of retry token to be incremented from retry token balance\n * if an SDK operation invocation succeeds without requiring a retry request.\n */\nexport const NO_RETRY_INCREMENT = 1;\n\n/**\n * Header name for SDK invocation ID\n */\nexport const INVOCATION_ID_HEADER = \"amz-sdk-invocation-id\";\n\n/**\n * Header name for request retry information.\n */\nexport const REQUEST_HEADER = \"amz-sdk-request\";\n","import {\n isClockSkewError,\n isRetryableByTrait,\n isThrottlingError,\n isTransientError,\n} from \"@aws-sdk/service-error-classification\";\nimport { SdkError } from \"@aws-sdk/smithy-client\";\n\nexport const defaultRetryDecider = (error: SdkError) => {\n if (!error) {\n return false;\n }\n\n return isRetryableByTrait(error) || isClockSkewError(error) || isThrottlingError(error) || isTransientError(error);\n};\n","import { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport { isThrottlingError } from \"@aws-sdk/service-error-classification\";\nimport { SdkError } from \"@aws-sdk/smithy-client\";\nimport { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider, RetryStrategy } from \"@aws-sdk/types\";\nimport { v4 } from \"uuid\";\n\nimport {\n DEFAULT_RETRY_DELAY_BASE,\n INITIAL_RETRY_TOKENS,\n INVOCATION_ID_HEADER,\n REQUEST_HEADER,\n THROTTLING_RETRY_DELAY_BASE,\n} from \"./constants\";\nimport { getDefaultRetryQuota } from \"./defaultRetryQuota\";\nimport { defaultDelayDecider } from \"./delayDecider\";\nimport { defaultRetryDecider } from \"./retryDecider\";\n\n/**\n * The default value for how many HTTP requests an SDK should make for a\n * single SDK operation invocation before giving up\n */\nexport const DEFAULT_MAX_ATTEMPTS = 3;\n\n/**\n * The default retry algorithm to use.\n */\nexport const DEFAULT_RETRY_MODE = \"standard\";\n\n/**\n * Determines whether an error is retryable based on the number of retries\n * already attempted, the HTTP status code, and the error received (if any).\n *\n * @param error The error encountered.\n */\nexport interface RetryDecider {\n (error: SdkError): boolean;\n}\n\n/**\n * Determines the number of milliseconds to wait before retrying an action.\n *\n * @param delayBase The base delay (in milliseconds).\n * @param attempts The number of times the action has already been tried.\n */\nexport interface DelayDecider {\n (delayBase: number, attempts: number): number;\n}\n\n/**\n * Interface that specifies the retry quota behavior.\n */\nexport interface RetryQuota {\n /**\n * returns true if retry tokens are available from the retry quota bucket.\n */\n hasRetryTokens: (error: SdkError) => boolean;\n\n /**\n * returns token amount from the retry quota bucket.\n * throws error is retry tokens are not available.\n */\n retrieveRetryTokens: (error: SdkError) => number;\n\n /**\n * releases tokens back to the retry quota.\n */\n releaseRetryTokens: (releaseCapacityAmount?: number) => void;\n}\n\n/**\n * Strategy options to be passed to StandardRetryStrategy\n */\nexport interface StandardRetryStrategyOptions {\n retryDecider?: RetryDecider;\n delayDecider?: DelayDecider;\n retryQuota?: RetryQuota;\n}\n\nexport class StandardRetryStrategy implements RetryStrategy {\n private retryDecider: RetryDecider;\n private delayDecider: DelayDecider;\n private retryQuota: RetryQuota;\n public readonly mode = DEFAULT_RETRY_MODE;\n\n constructor(private readonly maxAttemptsProvider: Provider, options?: StandardRetryStrategyOptions) {\n this.retryDecider = options?.retryDecider ?? defaultRetryDecider;\n this.delayDecider = options?.delayDecider ?? defaultDelayDecider;\n this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n }\n\n private shouldRetry(error: SdkError, attempts: number, maxAttempts: number) {\n return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);\n }\n\n private async getMaxAttempts() {\n let maxAttempts: number;\n try {\n maxAttempts = await this.maxAttemptsProvider();\n } catch (error) {\n maxAttempts = DEFAULT_MAX_ATTEMPTS;\n }\n return maxAttempts;\n }\n\n async retry(\n next: FinalizeHandler,\n args: FinalizeHandlerArguments\n ) {\n let retryTokenAmount;\n let attempts = 0;\n let totalDelay = 0;\n\n const maxAttempts = await this.getMaxAttempts();\n\n const { request } = args;\n if (HttpRequest.isInstance(request)) {\n request.headers[INVOCATION_ID_HEADER] = v4();\n }\n\n while (true) {\n try {\n if (HttpRequest.isInstance(request)) {\n request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;\n }\n const { response, output } = await next(args);\n\n this.retryQuota.releaseRetryTokens(retryTokenAmount);\n output.$metadata.attempts = attempts + 1;\n output.$metadata.totalRetryDelay = totalDelay;\n\n return { response, output };\n } catch (err) {\n attempts++;\n if (this.shouldRetry(err as SdkError, attempts, maxAttempts)) {\n retryTokenAmount = this.retryQuota.retrieveRetryTokens(err);\n const delay = this.delayDecider(\n isThrottlingError(err) ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE,\n attempts\n );\n totalDelay += delay;\n\n await new Promise((resolve) => setTimeout(resolve, delay));\n continue;\n }\n\n if (!err.$metadata) {\n err.$metadata = {};\n }\n\n err.$metadata.attempts = attempts;\n err.$metadata.totalRetryDelay = totalDelay;\n throw err;\n }\n }\n }\n}\n","import { SdkError } from \"@aws-sdk/smithy-client\";\n\nimport { NO_RETRY_INCREMENT, RETRY_COST, TIMEOUT_RETRY_COST } from \"./constants\";\nimport { RetryQuota } from \"./defaultStrategy\";\n\nexport const getDefaultRetryQuota = (initialRetryTokens: number): RetryQuota => {\n const MAX_CAPACITY = initialRetryTokens;\n let availableCapacity = initialRetryTokens;\n\n const getCapacityAmount = (error: SdkError) => (error.name === \"TimeoutError\" ? TIMEOUT_RETRY_COST : RETRY_COST);\n\n const hasRetryTokens = (error: SdkError) => getCapacityAmount(error) <= availableCapacity;\n\n const retrieveRetryTokens = (error: SdkError) => {\n if (!hasRetryTokens(error)) {\n // retryStrategy should stop retrying, and return last error\n throw new Error(\"No retry token available\");\n }\n const capacityAmount = getCapacityAmount(error);\n availableCapacity -= capacityAmount;\n return capacityAmount;\n };\n\n const releaseRetryTokens = (capacityReleaseAmount?: number) => {\n availableCapacity += capacityReleaseAmount ?? NO_RETRY_INCREMENT;\n availableCapacity = Math.min(availableCapacity, MAX_CAPACITY);\n };\n\n return Object.freeze({\n hasRetryTokens,\n retrieveRetryTokens,\n releaseRetryTokens,\n });\n};\n","import { LoadedConfigSelectors } from \"@aws-sdk/node-config-provider\";\nimport { Provider, RetryStrategy } from \"@aws-sdk/types\";\n\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, StandardRetryStrategy } from \"./defaultStrategy\";\n\nexport const ENV_MAX_ATTEMPTS = \"AWS_MAX_ATTEMPTS\";\nexport const CONFIG_MAX_ATTEMPTS = \"max_attempts\";\n\nexport const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors = {\n environmentVariableSelector: (env) => {\n const value = env[ENV_MAX_ATTEMPTS];\n if (!value) return undefined;\n const maxAttempt = parseInt(value);\n if (Number.isNaN(maxAttempt)) {\n throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got \"${value}\"`);\n }\n return maxAttempt;\n },\n configFileSelector: (profile) => {\n const value = profile[CONFIG_MAX_ATTEMPTS];\n if (!value) return undefined;\n const maxAttempt = parseInt(value);\n if (Number.isNaN(maxAttempt)) {\n throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got \"${value}\"`);\n }\n return maxAttempt;\n },\n default: DEFAULT_MAX_ATTEMPTS,\n};\n\nexport interface RetryInputConfig {\n /**\n * The maximum number of times requests that encounter retryable failures should be attempted.\n */\n maxAttempts?: number | Provider;\n /**\n * The strategy to retry the request. Using built-in exponential backoff strategy by default.\n */\n retryStrategy?: RetryStrategy;\n}\n\ninterface PreviouslyResolved {}\nexport interface RetryResolvedConfig {\n maxAttempts: Provider;\n retryStrategy: RetryStrategy;\n}\n\nexport const resolveRetryConfig = (input: T & PreviouslyResolved & RetryInputConfig): T & RetryResolvedConfig => {\n const maxAttempts = normalizeMaxAttempts(input.maxAttempts);\n return {\n ...input,\n maxAttempts,\n retryStrategy: input.retryStrategy || new StandardRetryStrategy(maxAttempts),\n };\n};\n\nconst normalizeMaxAttempts = (maxAttempts: number | Provider = DEFAULT_MAX_ATTEMPTS): Provider => {\n if (typeof maxAttempts === \"number\") {\n const promisified = Promise.resolve(maxAttempts);\n return () => promisified;\n }\n return maxAttempts;\n};\n\nexport const ENV_RETRY_MODE = \"AWS_RETRY_MODE\";\nexport const CONFIG_RETRY_MODE = \"retry_mode\";\n\nexport const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors = {\n environmentVariableSelector: (env) => env[ENV_RETRY_MODE],\n configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],\n default: DEFAULT_RETRY_MODE,\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { RegionInfo, RegionInfoProvider } from \"@aws-sdk/types\";\n\n// Partition default templates\nconst AWS_TEMPLATE = \"cognito-identity.{region}.amazonaws.com\";\nconst AWS_CN_TEMPLATE = \"cognito-identity.{region}.amazonaws.com.cn\";\nconst AWS_ISO_TEMPLATE = \"cognito-identity.{region}.c2s.ic.gov\";\nconst AWS_ISO_B_TEMPLATE = \"cognito-identity.{region}.sc2s.sgov.gov\";\nconst AWS_US_GOV_TEMPLATE = \"cognito-identity.{region}.amazonaws.com\";\n\n// Partition regions\nconst AWS_REGIONS = new Set([\n \"af-south-1\",\n \"ap-east-1\",\n \"ap-northeast-1\",\n \"ap-northeast-2\",\n \"ap-south-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"ca-central-1\",\n \"eu-central-1\",\n \"eu-north-1\",\n \"eu-south-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"eu-west-3\",\n \"me-south-1\",\n \"sa-east-1\",\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n]);\nconst AWS_CN_REGIONS = new Set([\"cn-north-1\", \"cn-northwest-1\"]);\nconst AWS_ISO_REGIONS = new Set([\"us-iso-east-1\"]);\nconst AWS_ISO_B_REGIONS = new Set([\"us-isob-east-1\"]);\nconst AWS_US_GOV_REGIONS = new Set([\"us-gov-east-1\", \"us-gov-west-1\"]);\n\nexport const defaultRegionInfoProvider: RegionInfoProvider = (region: string, options?: any) => {\n let regionInfo: RegionInfo | undefined = undefined;\n switch (region) {\n // First, try to match exact region names.\n case \"ap-northeast-1\":\n regionInfo = {\n hostname: \"cognito-identity.ap-northeast-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-northeast-2\":\n regionInfo = {\n hostname: \"cognito-identity.ap-northeast-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-south-1\":\n regionInfo = {\n hostname: \"cognito-identity.ap-south-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-southeast-1\":\n regionInfo = {\n hostname: \"cognito-identity.ap-southeast-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-southeast-2\":\n regionInfo = {\n hostname: \"cognito-identity.ap-southeast-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ca-central-1\":\n regionInfo = {\n hostname: \"cognito-identity.ca-central-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"cn-north-1\":\n regionInfo = {\n hostname: \"cognito-identity.cn-north-1.amazonaws.com.cn\",\n partition: \"aws-cn\",\n };\n break;\n case \"eu-central-1\":\n regionInfo = {\n hostname: \"cognito-identity.eu-central-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-north-1\":\n regionInfo = {\n hostname: \"cognito-identity.eu-north-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-west-1\":\n regionInfo = {\n hostname: \"cognito-identity.eu-west-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-west-2\":\n regionInfo = {\n hostname: \"cognito-identity.eu-west-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-west-3\":\n regionInfo = {\n hostname: \"cognito-identity.eu-west-3.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"fips-us-east-1\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-east-1.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-east-1\",\n };\n break;\n case \"fips-us-east-2\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-east-2.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-east-2\",\n };\n break;\n case \"fips-us-gov-west-1\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-gov-west-1.amazonaws.com\",\n partition: \"aws-us-gov\",\n signingRegion: \"us-gov-west-1\",\n };\n break;\n case \"fips-us-west-2\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-west-2.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-west-2\",\n };\n break;\n case \"sa-east-1\":\n regionInfo = {\n hostname: \"cognito-identity.sa-east-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-east-1\":\n regionInfo = {\n hostname: \"cognito-identity.us-east-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-east-2\":\n regionInfo = {\n hostname: \"cognito-identity.us-east-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-gov-west-1\":\n regionInfo = {\n hostname: \"cognito-identity.us-gov-west-1.amazonaws.com\",\n partition: \"aws-us-gov\",\n };\n break;\n case \"us-west-1\":\n regionInfo = {\n hostname: \"cognito-identity.us-west-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-west-2\":\n regionInfo = {\n hostname: \"cognito-identity.us-west-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n // Next, try to match partition endpoints.\n default:\n if (AWS_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws\",\n };\n }\n if (AWS_CN_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_CN_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-cn\",\n };\n }\n if (AWS_ISO_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_ISO_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-iso\",\n };\n }\n if (AWS_ISO_B_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_ISO_B_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-iso-b\",\n };\n }\n if (AWS_US_GOV_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_US_GOV_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-us-gov\",\n };\n }\n // Finally, assume it's an AWS partition endpoint.\n if (regionInfo === undefined) {\n regionInfo = {\n hostname: AWS_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws\",\n };\n }\n }\n return Promise.resolve({ signingService: \"cognito-identity\", ...regionInfo });\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { parseQueryString } from \"@aws-sdk/querystring-parser\";\nimport { Endpoint, QueryParameterBag, UrlParser } from \"@aws-sdk/types\";\n\nexport const parseUrl: UrlParser = (url: string): Endpoint => {\n const { hostname, pathname, port, protocol, search } = new URL(url);\n\n let query: QueryParameterBag | undefined;\n if (search) {\n query = parseQueryString(search);\n }\n\n return {\n hostname,\n port: port ? parseInt(port) : undefined,\n protocol,\n path: pathname,\n query,\n };\n};\n","import { Provider } from \"@aws-sdk/types\";\nexport const invalidProvider: (message: string) => Provider = (message: string) => () => Promise.reject(message);\n","import { defaultRegionInfoProvider } from \"./endpoints\";\nimport { Logger as __Logger } from \"@aws-sdk/types\";\nimport { parseUrl } from \"@aws-sdk/url-parser\";\n\n/**\n * @internal\n */\nexport const ClientSharedValues = {\n apiVersion: \"2014-06-30\",\n disableHostPrefix: false,\n logger: {} as __Logger,\n regionInfoProvider: defaultRegionInfoProvider,\n serviceId: \"Cognito Identity\",\n urlParser: parseUrl,\n};\n","import { QueryParameterBag } from \"@aws-sdk/types\";\n\nexport function parseQueryString(querystring: string): QueryParameterBag {\n const query: QueryParameterBag = {};\n querystring = querystring.replace(/^\\?/, \"\");\n\n if (querystring) {\n for (const pair of querystring.split(\"&\")) {\n let [key, value = null] = pair.split(\"=\");\n key = decodeURIComponent(key);\n if (value) {\n value = decodeURIComponent(value);\n }\n if (!(key in query)) {\n query[key] = value;\n } else if (Array.isArray(query[key])) {\n (query[key] as Array).push(value as string);\n } else {\n query[key] = [query[key] as string, value as string];\n }\n }\n }\n\n return query;\n}\n","import packageInfo from \"./package.json\";\n\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { FetchHttpHandler, streamCollector } from \"@aws-sdk/fetch-http-handler\";\nimport { invalidProvider } from \"@aws-sdk/invalid-dependency\";\nimport { DEFAULT_MAX_ATTEMPTS } from \"@aws-sdk/middleware-retry\";\nimport { fromBase64, toBase64 } from \"@aws-sdk/util-base64-browser\";\nimport { calculateBodyLength } from \"@aws-sdk/util-body-length-browser\";\nimport { defaultUserAgent } from \"@aws-sdk/util-user-agent-browser\";\nimport { fromUtf8, toUtf8 } from \"@aws-sdk/util-utf8-browser\";\nimport { ClientDefaults } from \"./CognitoIdentityClient\";\nimport { ClientSharedValues } from \"./runtimeConfig.shared\";\n\n/**\n * @internal\n */\nexport const ClientDefaultValues: Required = {\n ...ClientSharedValues,\n runtime: \"browser\",\n base64Decoder: fromBase64,\n base64Encoder: toBase64,\n bodyLengthChecker: calculateBodyLength,\n credentialDefaultProvider: (_: unknown) => () => Promise.reject(new Error(\"Credential is missing\")),\n defaultUserAgentProvider: defaultUserAgent({\n serviceId: ClientSharedValues.serviceId,\n clientVersion: packageInfo.version,\n }),\n maxAttempts: DEFAULT_MAX_ATTEMPTS,\n region: invalidProvider(\"Region is missing\"),\n requestHandler: new FetchHttpHandler(),\n sha256: Sha256,\n streamCollector,\n utf8Decoder: fromUtf8,\n utf8Encoder: toUtf8,\n};\n","export function calculateBodyLength(body: any): number | undefined {\n if (typeof body === \"string\") {\n let len = body.length;\n\n for (let i = len - 1; i >= 0; i--) {\n const code = body.charCodeAt(i);\n if (code > 0x7f && code <= 0x7ff) len++;\n else if (code > 0x7ff && code <= 0xffff) len += 2;\n }\n\n return len;\n } else if (typeof body.byteLength === \"number\") {\n // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n return body.byteLength;\n } else if (typeof body.size === \"number\") {\n // handles browser File object\n return body.size;\n }\n}\n","import { Provider, UserAgent } from \"@aws-sdk/types\";\nimport bowser from \"bowser\";\n\nimport { DefaultUserAgentOptions } from \"./configurations\";\n\n/**\n * Default provider to the user agent in browsers. It's a best effort to infer\n * the device information. It uses bowser library to detect the browser and virsion\n */\nexport const defaultUserAgent = ({\n serviceId,\n clientVersion,\n}: DefaultUserAgentOptions): Provider => async () => {\n const parsedUA = window?.navigator?.userAgent ? bowser.parse(window.navigator.userAgent) : undefined;\n const sections: UserAgent = [\n // sdk-metadata\n [\"aws-sdk-js\", clientVersion],\n // os-metadata\n [`os/${parsedUA?.os?.name || \"other\"}`, parsedUA?.os?.version],\n // language-metadata\n // ECMAScript edition doesn't matter in JS.\n [\"lang/js\"],\n // browser vendor and version.\n [\"md/browser\", `${parsedUA?.browser?.name ?? \"unknown\"}_${parsedUA?.browser?.version ?? \"unknown\"}`],\n ];\n\n if (serviceId) {\n // api-metadata\n // service Id may not appear in non-AWS clients\n sections.push([`api/${serviceId}`, clientVersion]);\n }\n\n return sections;\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { Endpoint, Provider, RegionInfoProvider, UrlParser } from \"@aws-sdk/types\";\n\nexport interface EndpointsInputConfig {\n /**\n * The fully qualified endpoint of the webservice. This is only required when using a custom endpoint (for example, when using a local version of S3).\n */\n endpoint?: string | Endpoint | Provider;\n\n /**\n * Whether TLS is enabled for requests.\n */\n tls?: boolean;\n}\n\ninterface PreviouslyResolved {\n regionInfoProvider: RegionInfoProvider;\n urlParser: UrlParser;\n region: Provider;\n}\n\nexport interface EndpointsResolvedConfig extends Required {\n endpoint: Provider;\n isCustomEndpoint: boolean;\n}\n\nexport const resolveEndpointsConfig = (\n input: T & EndpointsInputConfig & PreviouslyResolved\n): T & EndpointsResolvedConfig => ({\n ...input,\n tls: input.tls ?? true,\n endpoint: input.endpoint ? normalizeEndpoint(input) : () => getEndPointFromRegion(input),\n isCustomEndpoint: input.endpoint ? true : false,\n});\n\nconst normalizeEndpoint = (input: EndpointsInputConfig & PreviouslyResolved): Provider => {\n const { endpoint, urlParser } = input;\n if (typeof endpoint === \"string\") {\n const promisified = Promise.resolve(urlParser(endpoint));\n return () => promisified;\n } else if (typeof endpoint === \"object\") {\n const promisified = Promise.resolve(endpoint);\n return () => promisified;\n }\n return endpoint!;\n};\n\nconst getEndPointFromRegion = async (input: EndpointsInputConfig & PreviouslyResolved) => {\n const { tls = true } = input;\n const region = await input.region();\n\n const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!dnsHostRegex.test(region)) {\n throw new Error(\"Invalid region in client config\");\n }\n\n const { hostname } = (await input.regionInfoProvider(region)) ?? {};\n if (!hostname) {\n throw new Error(\"Cannot resolve hostname from client config\");\n }\n\n return input.urlParser(`${tls ? \"https:\" : \"http:\"}//${hostname}`);\n};\n","import { LoadedConfigSelectors, LocalConfigOptions } from \"@aws-sdk/node-config-provider\";\nimport { Provider } from \"@aws-sdk/types\";\n\nexport const REGION_ENV_NAME = \"AWS_REGION\";\nexport const REGION_INI_NAME = \"region\";\n\nexport const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors = {\n environmentVariableSelector: (env) => env[REGION_ENV_NAME],\n configFileSelector: (profile) => profile[REGION_INI_NAME],\n default: () => {\n throw new Error(\"Region is missing\");\n },\n};\n\nexport const NODE_REGION_CONFIG_FILE_OPTIONS: LocalConfigOptions = {\n preferredFile: \"credentials\",\n};\n\nexport interface RegionInputConfig {\n /**\n * The AWS region to which this client will send requests\n */\n region?: string | Provider;\n}\n\ninterface PreviouslyResolved {}\n\nexport interface RegionResolvedConfig {\n region: Provider;\n}\n\nexport const resolveRegionConfig = (input: T & RegionInputConfig & PreviouslyResolved): T & RegionResolvedConfig => {\n if (!input.region) {\n throw new Error(\"Region is missing\");\n }\n return {\n ...input,\n region: normalizeRegion(input.region!),\n };\n};\n\nconst normalizeRegion = (region: string | Provider): Provider => {\n if (typeof region === \"string\") {\n const promisified = Promise.resolve(region);\n return () => promisified;\n }\n return region as Provider;\n};\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport {\n BodyLengthCalculator,\n BuildHandler,\n BuildHandlerArguments,\n BuildHandlerOptions,\n BuildHandlerOutput,\n BuildMiddleware,\n MetadataBearer,\n Pluggable,\n} from \"@aws-sdk/types\";\n\nconst CONTENT_LENGTH_HEADER = \"content-length\";\n\nexport function contentLengthMiddleware(bodyLengthChecker: BodyLengthCalculator): BuildMiddleware {\n return (next: BuildHandler): BuildHandler => async (\n args: BuildHandlerArguments\n ): Promise> => {\n const request = args.request;\n if (HttpRequest.isInstance(request)) {\n const { body, headers } = request;\n if (\n body &&\n Object.keys(headers)\n .map((str) => str.toLowerCase())\n .indexOf(CONTENT_LENGTH_HEADER) === -1\n ) {\n const length = bodyLengthChecker(body);\n if (length !== undefined) {\n request.headers = {\n ...request.headers,\n [CONTENT_LENGTH_HEADER]: String(length),\n };\n }\n }\n }\n\n return next({\n ...args,\n request,\n });\n };\n}\n\nexport const contentLengthMiddlewareOptions: BuildHandlerOptions = {\n step: \"build\",\n tags: [\"SET_CONTENT_LENGTH\", \"CONTENT_LENGTH\"],\n name: \"contentLengthMiddleware\",\n override: true,\n};\n\nexport const getContentLengthPlugin = (options: { bodyLengthChecker: BodyLengthCalculator }): Pluggable => ({\n applyToStack: (clientStack) => {\n clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);\n },\n});\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport { AbsoluteLocation, BuildHandlerOptions, BuildMiddleware, Pluggable, RequestHandler } from \"@aws-sdk/types\";\n\nexport interface HostHeaderInputConfig {}\ninterface PreviouslyResolved {\n requestHandler: RequestHandler;\n}\nexport interface HostHeaderResolvedConfig {\n requestHandler: RequestHandler;\n}\nexport function resolveHostHeaderConfig(\n input: T & PreviouslyResolved & HostHeaderInputConfig\n): T & HostHeaderResolvedConfig {\n return input;\n}\n\nexport const hostHeaderMiddleware = (\n options: HostHeaderResolvedConfig\n): BuildMiddleware => (next) => async (args) => {\n if (!HttpRequest.isInstance(args.request)) return next(args);\n const { request } = args;\n const { handlerProtocol = \"\" } = options.requestHandler.metadata || {};\n //For H2 request, remove 'host' header and use ':authority' header instead\n //reference: https://nodejs.org/dist/latest-v13.x/docs/api/errors.html#ERR_HTTP2_INVALID_CONNECTION_HEADERS\n if (handlerProtocol.indexOf(\"h2\") >= 0 && !request.headers[\":authority\"]) {\n delete request.headers[\"host\"];\n request.headers[\":authority\"] = \"\";\n //non-H2 request and 'host' header is not set, set the 'host' header to request's hostname.\n } else if (!request.headers[\"host\"]) {\n request.headers[\"host\"] = request.hostname;\n }\n return next(args);\n};\n\nexport const hostHeaderMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation = {\n name: \"hostHeaderMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"HOST\"],\n override: true,\n};\n\nexport const getHostHeaderPlugin = (options: HostHeaderResolvedConfig): Pluggable => ({\n applyToStack: (clientStack) => {\n clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);\n },\n});\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { HttpResponse } from \"@aws-sdk/protocol-http\";\nimport {\n AbsoluteLocation,\n HandlerExecutionContext,\n InitializeHandler,\n InitializeHandlerArguments,\n InitializeHandlerOptions,\n InitializeHandlerOutput,\n MetadataBearer,\n Pluggable,\n} from \"@aws-sdk/types\";\n\nexport const loggerMiddleware = () => (\n next: InitializeHandler,\n context: HandlerExecutionContext\n): InitializeHandler => async (\n args: InitializeHandlerArguments\n): Promise> => {\n const { clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog } = context;\n\n const response = await next(args);\n\n if (!logger) {\n return response;\n }\n\n if (typeof logger.info === \"function\") {\n const { $metadata, ...outputWithoutMetadata } = response.output;\n logger.info({\n clientName,\n commandName,\n input: inputFilterSensitiveLog(args.input),\n output: outputFilterSensitiveLog(outputWithoutMetadata),\n metadata: $metadata,\n });\n }\n\n return response;\n};\n\nexport const loggerMiddlewareOptions: InitializeHandlerOptions & AbsoluteLocation = {\n name: \"loggerMiddleware\",\n tags: [\"LOGGER\"],\n step: \"initialize\",\n override: true,\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getLoggerPlugin = (options: any): Pluggable => ({\n applyToStack: (clientStack) => {\n clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);\n },\n});\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","const SHORT_TO_HEX: { [key: number]: string } = {};\nconst HEX_TO_SHORT: { [key: string]: number } = {};\n\nfor (let i = 0; i < 256; i++) {\n let encodedByte = i.toString(16).toLowerCase();\n if (encodedByte.length === 1) {\n encodedByte = `0${encodedByte}`;\n }\n\n SHORT_TO_HEX[i] = encodedByte;\n HEX_TO_SHORT[encodedByte] = i;\n}\n\n/**\n * Converts a hexadecimal encoded string to a Uint8Array of bytes.\n *\n * @param encoded The hexadecimal encoded string\n */\nexport function fromHex(encoded: string): Uint8Array {\n if (encoded.length % 2 !== 0) {\n throw new Error(\"Hex encoded strings must have an even number length\");\n }\n\n const out = new Uint8Array(encoded.length / 2);\n for (let i = 0; i < encoded.length; i += 2) {\n const encodedByte = encoded.substr(i, 2).toLowerCase();\n if (encodedByte in HEX_TO_SHORT) {\n out[i / 2] = HEX_TO_SHORT[encodedByte];\n } else {\n throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);\n }\n }\n\n return out;\n}\n\n/**\n * Converts a Uint8Array of binary data to a hexadecimal encoded string.\n *\n * @param bytes The binary data to encode\n */\nexport function toHex(bytes: Uint8Array): string {\n let out = \"\";\n for (let i = 0; i < bytes.byteLength; i++) {\n out += SHORT_TO_HEX[bytes[i]];\n }\n\n return out;\n}\n","export const ALGORITHM_QUERY_PARAM = \"X-Amz-Algorithm\";\nexport const CREDENTIAL_QUERY_PARAM = \"X-Amz-Credential\";\nexport const AMZ_DATE_QUERY_PARAM = \"X-Amz-Date\";\nexport const SIGNED_HEADERS_QUERY_PARAM = \"X-Amz-SignedHeaders\";\nexport const EXPIRES_QUERY_PARAM = \"X-Amz-Expires\";\nexport const SIGNATURE_QUERY_PARAM = \"X-Amz-Signature\";\nexport const TOKEN_QUERY_PARAM = \"X-Amz-Security-Token\";\n\nexport const AUTH_HEADER = \"authorization\";\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();\nexport const DATE_HEADER = \"date\";\nexport const GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];\nexport const SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();\nexport const SHA256_HEADER = \"x-amz-content-sha256\";\nexport const TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();\nexport const HOST_HEADER = \"host\";\n\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n \"cache-control\": true,\n connection: true,\n expect: true,\n from: true,\n \"keep-alive\": true,\n \"max-forwards\": true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n \"transfer-encoding\": true,\n upgrade: true,\n \"user-agent\": true,\n \"x-amzn-trace-id\": true,\n};\n\nexport const PROXY_HEADER_PATTERN = /^proxy-/;\n\nexport const SEC_HEADER_PATTERN = /^sec-/;\n\nexport const UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i];\n\nexport const ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256\";\n\nexport const EVENT_ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256-PAYLOAD\";\n\nexport const UNSIGNED_PAYLOAD = \"UNSIGNED-PAYLOAD\";\n\nexport const MAX_CACHE_SIZE = 50;\nexport const KEY_TYPE_IDENTIFIER = \"aws4_request\";\n\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;\n","import { Credentials, HashConstructor, SourceData } from \"@aws-sdk/types\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\n\nimport { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from \"./constants\";\n\nconst signingKeyCache: { [key: string]: Uint8Array } = {};\nconst cacheQueue: Array = [];\n\n/**\n * Create a string describing the scope of credentials used to sign a request.\n *\n * @param shortDate The current calendar date in the form YYYYMMDD.\n * @param region The AWS region in which the service resides.\n * @param service The service to which the signed request is being sent.\n */\nexport function createScope(shortDate: string, region: string, service: string): string {\n return `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;\n}\n\n/**\n * Derive a signing key from its composite parts\n *\n * @param sha256Constructor A constructor function that can instantiate SHA-256\n * hash objects.\n * @param credentials The credentials with which the request will be\n * signed.\n * @param shortDate The current calendar date in the form YYYYMMDD.\n * @param region The AWS region in which the service resides.\n * @param service The service to which the signed request is being\n * sent.\n */\nexport const getSigningKey = async (\n sha256Constructor: HashConstructor,\n credentials: Credentials,\n shortDate: string,\n region: string,\n service: string\n): Promise => {\n const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);\n const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;\n if (cacheKey in signingKeyCache) {\n return signingKeyCache[cacheKey];\n }\n\n cacheQueue.push(cacheKey);\n while (cacheQueue.length > MAX_CACHE_SIZE) {\n delete signingKeyCache[cacheQueue.shift() as string];\n }\n\n let key: SourceData = `AWS4${credentials.secretAccessKey}`;\n for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {\n key = await hmac(sha256Constructor, key, signable);\n }\n return (signingKeyCache[cacheKey] = key as Uint8Array);\n};\n\n/**\n * @internal\n */\nexport function clearCredentialCache(): void {\n cacheQueue.length = 0;\n Object.keys(signingKeyCache).forEach((cacheKey) => {\n delete signingKeyCache[cacheKey];\n });\n}\n\nfunction hmac(ctor: HashConstructor, secret: SourceData, data: SourceData): Promise {\n const hash = new ctor(secret);\n hash.update(data);\n return hash.digest();\n}\n","import { HeaderBag, HttpRequest } from \"@aws-sdk/types\";\n\nimport { ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN } from \"./constants\";\n\n/**\n * @internal\n */\nexport function getCanonicalHeaders(\n { headers }: HttpRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n): HeaderBag {\n const canonical: HeaderBag = {};\n for (const headerName of Object.keys(headers).sort()) {\n const canonicalHeaderName = headerName.toLowerCase();\n if (\n canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName) ||\n PROXY_HEADER_PATTERN.test(canonicalHeaderName) ||\n SEC_HEADER_PATTERN.test(canonicalHeaderName)\n ) {\n if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) {\n continue;\n }\n }\n\n canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, \" \");\n }\n\n return canonical;\n}\n","import { isArrayBuffer } from \"@aws-sdk/is-array-buffer\";\nimport { HashConstructor, HttpRequest } from \"@aws-sdk/types\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\n\nimport { SHA256_HEADER, UNSIGNED_PAYLOAD } from \"./constants\";\n\n/**\n * @internal\n */\nexport async function getPayloadHash(\n { headers, body }: HttpRequest,\n hashConstructor: HashConstructor\n): Promise {\n for (const headerName of Object.keys(headers)) {\n if (headerName.toLowerCase() === SHA256_HEADER) {\n return headers[headerName];\n }\n }\n\n if (body == undefined) {\n return \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\";\n } else if (typeof body === \"string\" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {\n const hashCtor = new hashConstructor();\n hashCtor.update(body);\n return toHex(await hashCtor.digest());\n }\n\n // As any defined body that is not a string or binary data is a stream, this\n // body is unsignable. Attempt to send the request with an unsigned payload,\n // which may or may not be accepted by the service.\n return UNSIGNED_PAYLOAD;\n}\n","export const isArrayBuffer = (arg: any): arg is ArrayBuffer =>\n (typeof ArrayBuffer === \"function\" && arg instanceof ArrayBuffer) ||\n Object.prototype.toString.call(arg) === \"[object ArrayBuffer]\";\n","import { HttpRequest, QueryParameterBag } from \"@aws-sdk/types\";\n\n/**\n * @internal\n */\nexport function cloneRequest({ headers, query, ...rest }: HttpRequest): HttpRequest {\n return {\n ...rest,\n headers: { ...headers },\n query: query ? cloneQuery(query) : undefined,\n };\n}\n\nfunction cloneQuery(query: QueryParameterBag): QueryParameterBag {\n return Object.keys(query).reduce((carry: QueryParameterBag, paramName: string) => {\n const param = query[paramName];\n return {\n ...carry,\n [paramName]: Array.isArray(param) ? [...param] : param,\n };\n }, {});\n}\n","import { HttpRequest } from \"@aws-sdk/types\";\n\nimport { cloneRequest } from \"./cloneRequest\";\nimport { GENERATED_HEADERS } from \"./constants\";\n\n/**\n * @internal\n */\nexport function prepareRequest(request: HttpRequest): HttpRequest {\n // Create a clone of the request object that does not clone the body\n request = typeof (request as any).clone === \"function\" ? (request as any).clone() : cloneRequest(request);\n\n for (const headerName of Object.keys(request.headers)) {\n if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName];\n }\n }\n\n return request;\n}\n","export function iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, \"Z\");\n}\n\nexport function toDate(time: number | string | Date): Date {\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n\n if (typeof time === \"string\") {\n if (Number(time)) {\n return new Date(Number(time) * 1000);\n }\n return new Date(time);\n }\n\n return time;\n}\n","import {\n Credentials,\n DateInput,\n EventSigner,\n EventSigningArguments,\n FormattedEvent,\n HashConstructor,\n HeaderBag,\n HttpRequest,\n Provider,\n RequestPresigner,\n RequestPresigningArguments,\n RequestSigner,\n RequestSigningArguments,\n SigningArguments,\n StringSigner,\n} from \"@aws-sdk/types\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\n\nimport {\n ALGORITHM_IDENTIFIER,\n ALGORITHM_QUERY_PARAM,\n AMZ_DATE_HEADER,\n AMZ_DATE_QUERY_PARAM,\n AUTH_HEADER,\n CREDENTIAL_QUERY_PARAM,\n EVENT_ALGORITHM_IDENTIFIER,\n EXPIRES_QUERY_PARAM,\n MAX_PRESIGNED_TTL,\n SHA256_HEADER,\n SIGNATURE_QUERY_PARAM,\n SIGNED_HEADERS_QUERY_PARAM,\n TOKEN_HEADER,\n TOKEN_QUERY_PARAM,\n} from \"./constants\";\nimport { createScope, getSigningKey } from \"./credentialDerivation\";\nimport { getCanonicalHeaders } from \"./getCanonicalHeaders\";\nimport { getCanonicalQuery } from \"./getCanonicalQuery\";\nimport { getPayloadHash } from \"./getPayloadHash\";\nimport { hasHeader } from \"./hasHeader\";\nimport { moveHeadersToQuery } from \"./moveHeadersToQuery\";\nimport { prepareRequest } from \"./prepareRequest\";\nimport { iso8601 } from \"./utilDate\";\n\nexport interface SignatureV4Init {\n /**\n * The service signing name.\n */\n service: string;\n\n /**\n * The region name or a function that returns a promise that will be\n * resolved with the region name.\n */\n region: string | Provider;\n\n /**\n * The credentials with which the request should be signed or a function\n * that returns a promise that will be resolved with credentials.\n */\n credentials: Credentials | Provider;\n\n /**\n * A constructor function for a hash object that will calculate SHA-256 HMAC\n * checksums.\n */\n sha256?: HashConstructor;\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean;\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean;\n}\n\nexport interface SignatureV4CryptoInit {\n sha256: HashConstructor;\n}\n\nexport class SignatureV4 implements RequestPresigner, RequestSigner, StringSigner, EventSigner {\n private readonly service: string;\n private readonly regionProvider: Provider;\n private readonly credentialProvider: Provider;\n private readonly sha256: HashConstructor;\n private readonly uriEscapePath: boolean;\n private readonly applyChecksum: boolean;\n\n constructor({\n applyChecksum,\n credentials,\n region,\n service,\n sha256,\n uriEscapePath = true,\n }: SignatureV4Init & SignatureV4CryptoInit) {\n this.service = service;\n this.sha256 = sha256;\n this.uriEscapePath = uriEscapePath;\n // default to true if applyChecksum isn't set\n this.applyChecksum = typeof applyChecksum === \"boolean\" ? applyChecksum : true;\n this.regionProvider = normalizeRegionProvider(region);\n this.credentialProvider = normalizeCredentialsProvider(credentials);\n }\n\n public async presign(originalRequest: HttpRequest, options: RequestPresigningArguments = {}): Promise {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options;\n const credentials = await this.credentialProvider();\n const region = signingRegion ?? (await this.regionProvider());\n\n const { longDate, shortDate } = formatDate(signingDate);\n if (expiresIn > MAX_PRESIGNED_TTL) {\n return Promise.reject(\n \"Signature version 4 presigned URLs\" + \" must have an expiration date less than one week in\" + \" the future\"\n );\n }\n\n const scope = createScope(shortDate, region, signingService ?? this.service);\n const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders });\n\n if (credentials.sessionToken) {\n request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;\n }\n request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;\n request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;\n request.query[AMZ_DATE_QUERY_PARAM] = longDate;\n request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);\n\n const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders);\n\n request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(\n longDate,\n scope,\n this.getSigningKey(credentials, region, shortDate, signingService),\n this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))\n );\n\n return request;\n }\n\n public async sign(stringToSign: string, options?: SigningArguments): Promise;\n public async sign(event: FormattedEvent, options: EventSigningArguments): Promise;\n public async sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise;\n public async sign(toSign: any, options: any): Promise {\n if (typeof toSign === \"string\") {\n return this.signString(toSign, options);\n } else if (toSign.headers && toSign.payload) {\n return this.signEvent(toSign, options);\n } else {\n return this.signRequest(toSign, options);\n }\n }\n\n private async signEvent(\n { headers, payload }: FormattedEvent,\n { signingDate = new Date(), priorSignature, signingRegion, signingService }: EventSigningArguments\n ): Promise {\n const region = signingRegion ?? (await this.regionProvider());\n const { shortDate, longDate } = formatDate(signingDate);\n const scope = createScope(shortDate, region, signingService ?? this.service);\n const hashedPayload = await getPayloadHash({ headers: {}, body: payload } as any, this.sha256);\n const hash = new this.sha256();\n hash.update(headers);\n const hashedHeaders = toHex(await hash.digest());\n const stringToSign = [\n EVENT_ALGORITHM_IDENTIFIER,\n longDate,\n scope,\n priorSignature,\n hashedHeaders,\n hashedPayload,\n ].join(\"\\n\");\n return this.signString(stringToSign, { signingDate, signingRegion: region, signingService });\n }\n\n private async signString(\n stringToSign: string,\n { signingDate = new Date(), signingRegion, signingService }: SigningArguments = {}\n ): Promise {\n const credentials = await this.credentialProvider();\n const region = signingRegion ?? (await this.regionProvider());\n const { shortDate } = formatDate(signingDate);\n\n const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));\n hash.update(stringToSign);\n return toHex(await hash.digest());\n }\n\n private async signRequest(\n requestToSign: HttpRequest,\n {\n signingDate = new Date(),\n signableHeaders,\n unsignableHeaders,\n signingRegion,\n signingService,\n }: RequestSigningArguments = {}\n ): Promise {\n const credentials = await this.credentialProvider();\n const region = signingRegion ?? (await this.regionProvider());\n const request = prepareRequest(requestToSign);\n const { longDate, shortDate } = formatDate(signingDate);\n const scope = createScope(shortDate, region, signingService ?? this.service);\n\n request.headers[AMZ_DATE_HEADER] = longDate;\n if (credentials.sessionToken) {\n request.headers[TOKEN_HEADER] = credentials.sessionToken;\n }\n\n const payloadHash = await getPayloadHash(request, this.sha256);\n if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {\n request.headers[SHA256_HEADER] = payloadHash;\n }\n\n const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n const signature = await this.getSignature(\n longDate,\n scope,\n this.getSigningKey(credentials, region, shortDate, signingService),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n );\n\n request.headers[AUTH_HEADER] =\n `${ALGORITHM_IDENTIFIER} ` +\n `Credential=${credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` +\n `Signature=${signature}`;\n\n return request;\n }\n\n private createCanonicalRequest(request: HttpRequest, canonicalHeaders: HeaderBag, payloadHash: string): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort();\n return `${request.method}\n${this.getCanonicalPath(request)}\n${getCanonicalQuery(request)}\n${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join(\"\\n\")}\n\n${sortedHeaders.join(\";\")}\n${payloadHash}`;\n }\n\n private async createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): Promise {\n const hash = new this.sha256();\n hash.update(canonicalRequest);\n const hashedRequest = await hash.digest();\n\n return `${ALGORITHM_IDENTIFIER}\n${longDate}\n${credentialScope}\n${toHex(hashedRequest)}`;\n }\n\n private getCanonicalPath({ path }: HttpRequest): string {\n if (this.uriEscapePath) {\n const doubleEncoded = encodeURIComponent(path.replace(/^\\//, \"\"));\n return `/${doubleEncoded.replace(/%2F/g, \"/\")}`;\n }\n\n return path;\n }\n\n private async getSignature(\n longDate: string,\n credentialScope: string,\n keyPromise: Promise,\n canonicalRequest: string\n ): Promise {\n const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest);\n\n const hash = new this.sha256(await keyPromise);\n hash.update(stringToSign);\n return toHex(await hash.digest());\n }\n\n private getSigningKey(\n credentials: Credentials,\n region: string,\n shortDate: string,\n service?: string\n ): Promise {\n return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);\n }\n}\n\nconst formatDate = (now: DateInput): { longDate: string; shortDate: string } => {\n const longDate = iso8601(now).replace(/[\\-:]/g, \"\");\n return {\n longDate,\n shortDate: longDate.substr(0, 8),\n };\n};\n\nconst getCanonicalHeaderList = (headers: object): string => Object.keys(headers).sort().join(\";\");\n\nconst normalizeRegionProvider = (region: string | Provider): Provider => {\n if (typeof region === \"string\") {\n const promisified = Promise.resolve(region);\n return () => promisified;\n } else {\n return region;\n }\n};\n\nconst normalizeCredentialsProvider = (credentials: Credentials | Provider): Provider => {\n if (typeof credentials === \"object\") {\n const promisified = Promise.resolve(credentials);\n return () => promisified;\n } else {\n return credentials;\n }\n};\n","import { HttpRequest, QueryParameterBag } from \"@aws-sdk/types\";\n\nimport { cloneRequest } from \"./cloneRequest\";\n\n/**\n * @internal\n */\nexport function moveHeadersToQuery(\n request: HttpRequest,\n options: { unhoistableHeaders?: Set } = {}\n): HttpRequest & { query: QueryParameterBag } {\n const { headers, query = {} as QueryParameterBag } =\n typeof (request as any).clone === \"function\" ? (request as any).clone() : cloneRequest(request);\n for (const name of Object.keys(headers)) {\n const lname = name.toLowerCase();\n if (lname.substr(0, 6) === \"x-amz-\" && !options.unhoistableHeaders?.has(lname)) {\n query[name] = headers[name];\n delete headers[name];\n }\n }\n\n return {\n ...request,\n headers,\n query,\n };\n}\n","import { HeaderBag } from \"@aws-sdk/types\";\n\nexport function hasHeader(soughtHeader: string, headers: HeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase();\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true;\n }\n }\n\n return false;\n}\n","import { HttpRequest } from \"@aws-sdk/types\";\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\n\nimport { SIGNATURE_HEADER } from \"./constants\";\n\n/**\n * @internal\n */\nexport function getCanonicalQuery({ query = {} }: HttpRequest): string {\n const keys: Array = [];\n const serialized: { [key: string]: string } = {};\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === SIGNATURE_HEADER) {\n continue;\n }\n\n keys.push(key);\n const value = query[key];\n if (typeof value === \"string\") {\n serialized[key] = `${escapeUri(key)}=${escapeUri(value)}`;\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) => encoded.concat([`${escapeUri(key)}=${escapeUri(value)}`]),\n []\n )\n .join(\"&\");\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized) // omit any falsy values\n .join(\"&\");\n}\n","import { SignatureV4 } from \"@aws-sdk/signature-v4\";\nimport { Credentials, HashConstructor, Provider, RegionInfo, RegionInfoProvider, RequestSigner } from \"@aws-sdk/types\";\n\nexport interface AwsAuthInputConfig {\n /**\n * The credentials used to sign requests.\n */\n credentials?: Credentials | Provider;\n\n /**\n * The signer to use when signing requests.\n */\n signer?: RequestSigner | Provider;\n\n /**\n * Whether to escape request path when signing the request.\n */\n signingEscapePath?: boolean;\n\n /**\n * An offset value in milliseconds to apply to all signing times.\n */\n systemClockOffset?: number;\n\n /**\n * The region where you want to sign your request against. This\n * can be different to the region in the endpoint.\n */\n signingRegion?: string;\n}\ninterface PreviouslyResolved {\n credentialDefaultProvider: (input: any) => Provider;\n region: string | Provider;\n regionInfoProvider: RegionInfoProvider;\n signingName?: string;\n serviceId: string;\n sha256: HashConstructor;\n}\nexport interface AwsAuthResolvedConfig {\n credentials: Provider;\n signer: Provider;\n signingEscapePath: boolean;\n systemClockOffset: number;\n}\nexport function resolveAwsAuthConfig(input: T & AwsAuthInputConfig & PreviouslyResolved): T & AwsAuthResolvedConfig {\n const credentials = input.credentials || input.credentialDefaultProvider(input as any);\n const normalizedCreds = normalizeProvider(credentials);\n const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;\n let signer: Provider;\n if (input.signer) {\n //if signer is supplied by user, normalize it to a function returning a promise for signer.\n signer = normalizeProvider(input.signer);\n } else {\n //construct a provider inferring signing from region.\n signer = () =>\n normalizeProvider(input.region)()\n .then(async (region) => [(await input.regionInfoProvider(region)) || {}, region] as [RegionInfo, string])\n .then(([regionInfo, region]) => {\n const { signingRegion, signingService } = regionInfo;\n //update client's singing region and signing service config if they are resolved.\n //signing region resolving order: user supplied signingRegion -> endpoints.json inferred region -> client region\n input.signingRegion = input.signingRegion || signingRegion || region;\n //signing name resolving order:\n //user supplied signingName -> endpoints.json inferred (credential scope -> model arnNamespace) -> model service id\n input.signingName = input.signingName || signingService || input.serviceId;\n\n return new SignatureV4({\n credentials: normalizedCreds,\n region: input.signingRegion,\n service: input.signingName,\n sha256,\n uriEscapePath: signingEscapePath,\n });\n });\n }\n\n return {\n ...input,\n systemClockOffset,\n signingEscapePath,\n credentials: normalizedCreds,\n signer,\n };\n}\n\nfunction normalizeProvider(input: T | Provider): Provider {\n if (typeof input === \"object\") {\n const promisified = Promise.resolve(input);\n return () => promisified;\n }\n return input as Provider;\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const USER_AGENT = \"user-agent\";\n\nexport const X_AMZ_USER_AGENT = \"x-amz-user-agent\";\n\nexport const SPACE = \" \";\n\nexport const UA_ESCAPE_REGEX = /[^\\!\\#\\$\\%\\&\\'\\*\\+\\-\\.\\^\\_\\`\\|\\~\\d\\w]/g;\n","import { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport {\n AbsoluteLocation,\n BuildHandler,\n BuildHandlerArguments,\n BuildHandlerOptions,\n BuildHandlerOutput,\n HandlerExecutionContext,\n MetadataBearer,\n Pluggable,\n UserAgentPair,\n} from \"@aws-sdk/types\";\n\nimport { UserAgentResolvedConfig } from \"./configurations\";\nimport { SPACE, UA_ESCAPE_REGEX, USER_AGENT, X_AMZ_USER_AGENT } from \"./constants\";\n\n/**\n * Build user agent header sections from:\n * 1. runtime-specific default user agent provider;\n * 2. custom user agent from `customUserAgent` client config;\n * 3. handler execution context set by internal SDK components;\n * The built user agent will be set to `x-amz-user-agent` header for ALL the\n * runtimes.\n * Please note that any override to the `user-agent` or `x-amz-user-agent` header\n * in the HTTP request is discouraged. Please use `customUserAgent` client\n * config or middleware setting the `userAgent` context to generate desired user\n * agent.\n */\nexport const userAgentMiddleware = (options: UserAgentResolvedConfig) => (\n next: BuildHandler,\n context: HandlerExecutionContext\n): BuildHandler => async (args: BuildHandlerArguments): Promise> => {\n const { request } = args;\n if (!HttpRequest.isInstance(request)) return next(args);\n const { headers } = request;\n const userAgent = context?.userAgent?.map(escapeUserAgent) || [];\n const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);\n const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];\n // Set value to AWS-specific user agent header\n headers[X_AMZ_USER_AGENT] = [...defaultUserAgent, ...userAgent, ...customUserAgent].join(SPACE);\n // Get value to be sent with non-AWS-specific user agent header.\n const normalUAValue = [\n ...defaultUserAgent.filter((section) => section.startsWith(\"aws-sdk-\")),\n ...customUserAgent,\n ].join(SPACE);\n if (options.runtime !== \"browser\" && normalUAValue) {\n headers[USER_AGENT] = headers[USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;\n }\n\n return next({\n ...args,\n request,\n });\n};\n\n/**\n * Escape the each pair according to https://tools.ietf.org/html/rfc5234 and join the pair with pattern `name/version`.\n * User agent name may include prefix like `md/`, `api/`, `os/` etc., we should not escape the `/` after the prefix.\n * @private\n */\nconst escapeUserAgent = ([name, version]: UserAgentPair): string => {\n const prefixSeparatorIndex = name.indexOf(\"/\");\n const prefix = name.substring(0, prefixSeparatorIndex); // If no prefix, prefix is just \"\"\n let uaName = name.substring(prefixSeparatorIndex + 1);\n if (prefix === \"api\") {\n uaName = uaName.toLowerCase();\n }\n return [prefix, uaName, version]\n .filter((item) => item && item.length > 0)\n .map((item) => item?.replace(UA_ESCAPE_REGEX, \"_\"))\n .join(\"/\");\n};\n\nexport const getUserAgentMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation = {\n name: \"getUserAgentMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"SET_USER_AGENT\", \"USER_AGENT\"],\n override: true,\n};\n\nexport const getUserAgentPlugin = (config: UserAgentResolvedConfig): Pluggable => ({\n applyToStack: (clientStack) => {\n clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);\n },\n});\n","import { CreateIdentityPoolCommandInput, CreateIdentityPoolCommandOutput } from \"./commands/CreateIdentityPoolCommand\";\nimport { DeleteIdentitiesCommandInput, DeleteIdentitiesCommandOutput } from \"./commands/DeleteIdentitiesCommand\";\nimport { DeleteIdentityPoolCommandInput, DeleteIdentityPoolCommandOutput } from \"./commands/DeleteIdentityPoolCommand\";\nimport { DescribeIdentityCommandInput, DescribeIdentityCommandOutput } from \"./commands/DescribeIdentityCommand\";\nimport {\n DescribeIdentityPoolCommandInput,\n DescribeIdentityPoolCommandOutput,\n} from \"./commands/DescribeIdentityPoolCommand\";\nimport {\n GetCredentialsForIdentityCommandInput,\n GetCredentialsForIdentityCommandOutput,\n} from \"./commands/GetCredentialsForIdentityCommand\";\nimport { GetIdCommandInput, GetIdCommandOutput } from \"./commands/GetIdCommand\";\nimport {\n GetIdentityPoolRolesCommandInput,\n GetIdentityPoolRolesCommandOutput,\n} from \"./commands/GetIdentityPoolRolesCommand\";\nimport { GetOpenIdTokenCommandInput, GetOpenIdTokenCommandOutput } from \"./commands/GetOpenIdTokenCommand\";\nimport {\n GetOpenIdTokenForDeveloperIdentityCommandInput,\n GetOpenIdTokenForDeveloperIdentityCommandOutput,\n} from \"./commands/GetOpenIdTokenForDeveloperIdentityCommand\";\nimport { ListIdentitiesCommandInput, ListIdentitiesCommandOutput } from \"./commands/ListIdentitiesCommand\";\nimport { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from \"./commands/ListIdentityPoolsCommand\";\nimport {\n ListTagsForResourceCommandInput,\n ListTagsForResourceCommandOutput,\n} from \"./commands/ListTagsForResourceCommand\";\nimport {\n LookupDeveloperIdentityCommandInput,\n LookupDeveloperIdentityCommandOutput,\n} from \"./commands/LookupDeveloperIdentityCommand\";\nimport {\n MergeDeveloperIdentitiesCommandInput,\n MergeDeveloperIdentitiesCommandOutput,\n} from \"./commands/MergeDeveloperIdentitiesCommand\";\nimport {\n SetIdentityPoolRolesCommandInput,\n SetIdentityPoolRolesCommandOutput,\n} from \"./commands/SetIdentityPoolRolesCommand\";\nimport { TagResourceCommandInput, TagResourceCommandOutput } from \"./commands/TagResourceCommand\";\nimport {\n UnlinkDeveloperIdentityCommandInput,\n UnlinkDeveloperIdentityCommandOutput,\n} from \"./commands/UnlinkDeveloperIdentityCommand\";\nimport { UnlinkIdentityCommandInput, UnlinkIdentityCommandOutput } from \"./commands/UnlinkIdentityCommand\";\nimport { UntagResourceCommandInput, UntagResourceCommandOutput } from \"./commands/UntagResourceCommand\";\nimport { UpdateIdentityPoolCommandInput, UpdateIdentityPoolCommandOutput } from \"./commands/UpdateIdentityPoolCommand\";\nimport { ClientDefaultValues as __ClientDefaultValues } from \"./runtimeConfig\";\nimport {\n EndpointsInputConfig,\n EndpointsResolvedConfig,\n RegionInputConfig,\n RegionResolvedConfig,\n resolveEndpointsConfig,\n resolveRegionConfig,\n} from \"@aws-sdk/config-resolver\";\nimport { getContentLengthPlugin } from \"@aws-sdk/middleware-content-length\";\nimport {\n HostHeaderInputConfig,\n HostHeaderResolvedConfig,\n getHostHeaderPlugin,\n resolveHostHeaderConfig,\n} from \"@aws-sdk/middleware-host-header\";\nimport { getLoggerPlugin } from \"@aws-sdk/middleware-logger\";\nimport { RetryInputConfig, RetryResolvedConfig, getRetryPlugin, resolveRetryConfig } from \"@aws-sdk/middleware-retry\";\nimport { AwsAuthInputConfig, AwsAuthResolvedConfig, resolveAwsAuthConfig } from \"@aws-sdk/middleware-signing\";\nimport {\n UserAgentInputConfig,\n UserAgentResolvedConfig,\n getUserAgentPlugin,\n resolveUserAgentConfig,\n} from \"@aws-sdk/middleware-user-agent\";\nimport { HttpHandler as __HttpHandler } from \"@aws-sdk/protocol-http\";\nimport {\n Client as __Client,\n SmithyConfiguration as __SmithyConfiguration,\n SmithyResolvedConfiguration as __SmithyResolvedConfiguration,\n} from \"@aws-sdk/smithy-client\";\nimport {\n Provider,\n RegionInfoProvider,\n Credentials as __Credentials,\n Decoder as __Decoder,\n Encoder as __Encoder,\n HashConstructor as __HashConstructor,\n HttpHandlerOptions as __HttpHandlerOptions,\n Logger as __Logger,\n Provider as __Provider,\n StreamCollector as __StreamCollector,\n UrlParser as __UrlParser,\n UserAgent as __UserAgent,\n} from \"@aws-sdk/types\";\n\nexport type ServiceInputTypes =\n | CreateIdentityPoolCommandInput\n | DeleteIdentitiesCommandInput\n | DeleteIdentityPoolCommandInput\n | DescribeIdentityCommandInput\n | DescribeIdentityPoolCommandInput\n | GetCredentialsForIdentityCommandInput\n | GetIdCommandInput\n | GetIdentityPoolRolesCommandInput\n | GetOpenIdTokenCommandInput\n | GetOpenIdTokenForDeveloperIdentityCommandInput\n | ListIdentitiesCommandInput\n | ListIdentityPoolsCommandInput\n | ListTagsForResourceCommandInput\n | LookupDeveloperIdentityCommandInput\n | MergeDeveloperIdentitiesCommandInput\n | SetIdentityPoolRolesCommandInput\n | TagResourceCommandInput\n | UnlinkDeveloperIdentityCommandInput\n | UnlinkIdentityCommandInput\n | UntagResourceCommandInput\n | UpdateIdentityPoolCommandInput;\n\nexport type ServiceOutputTypes =\n | CreateIdentityPoolCommandOutput\n | DeleteIdentitiesCommandOutput\n | DeleteIdentityPoolCommandOutput\n | DescribeIdentityCommandOutput\n | DescribeIdentityPoolCommandOutput\n | GetCredentialsForIdentityCommandOutput\n | GetIdCommandOutput\n | GetIdentityPoolRolesCommandOutput\n | GetOpenIdTokenCommandOutput\n | GetOpenIdTokenForDeveloperIdentityCommandOutput\n | ListIdentitiesCommandOutput\n | ListIdentityPoolsCommandOutput\n | ListTagsForResourceCommandOutput\n | LookupDeveloperIdentityCommandOutput\n | MergeDeveloperIdentitiesCommandOutput\n | SetIdentityPoolRolesCommandOutput\n | TagResourceCommandOutput\n | UnlinkDeveloperIdentityCommandOutput\n | UnlinkIdentityCommandOutput\n | UntagResourceCommandOutput\n | UpdateIdentityPoolCommandOutput;\n\nexport interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {\n /**\n * The HTTP handler to use. Fetch in browser and Https in Nodejs.\n */\n requestHandler?: __HttpHandler;\n\n /**\n * A constructor for a class implementing the @aws-sdk/types.Hash interface\n * that computes the SHA-256 HMAC or checksum of a string or binary buffer.\n */\n sha256?: __HashConstructor;\n\n /**\n * The function that will be used to convert strings into HTTP endpoints.\n */\n urlParser?: __UrlParser;\n\n /**\n * A function that can calculate the length of a request body.\n */\n bodyLengthChecker?: (body: any) => number | undefined;\n\n /**\n * A function that converts a stream into an array of bytes.\n */\n streamCollector?: __StreamCollector;\n\n /**\n * The function that will be used to convert a base64-encoded string to a byte array\n */\n base64Decoder?: __Decoder;\n\n /**\n * The function that will be used to convert binary data to a base64-encoded string\n */\n base64Encoder?: __Encoder;\n\n /**\n * The function that will be used to convert a UTF8-encoded string to a byte array\n */\n utf8Decoder?: __Decoder;\n\n /**\n * The function that will be used to convert binary data to a UTF-8 encoded string\n */\n utf8Encoder?: __Encoder;\n\n /**\n * The runtime environment\n */\n runtime?: string;\n\n /**\n * Disable dyanamically changing the endpoint of the client based on the hostPrefix\n * trait of an operation.\n */\n disableHostPrefix?: boolean;\n\n /**\n * Unique service identifier.\n * @internal\n */\n serviceId?: string;\n\n /**\n * Default credentials provider; Not available in browser runtime\n */\n credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;\n\n /**\n * The AWS region to which this client will send requests\n */\n region?: string | __Provider;\n\n /**\n * Value for how many times a request will be made at most in case of retry.\n */\n maxAttempts?: number | __Provider;\n\n /**\n * Optional logger for logging debug/info/warn/error.\n */\n logger?: __Logger;\n\n /**\n * Fetch related hostname, signing name or signing region with given region.\n */\n regionInfoProvider?: RegionInfoProvider;\n\n /**\n * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header\n * @internal\n */\n defaultUserAgentProvider?: Provider<__UserAgent>;\n}\n\nexport type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &\n ClientDefaults &\n RegionInputConfig &\n EndpointsInputConfig &\n AwsAuthInputConfig &\n RetryInputConfig &\n HostHeaderInputConfig &\n UserAgentInputConfig;\n\nexport type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> &\n Required &\n RegionResolvedConfig &\n EndpointsResolvedConfig &\n AwsAuthResolvedConfig &\n RetryResolvedConfig &\n HostHeaderResolvedConfig &\n UserAgentResolvedConfig;\n\n/**\n * Amazon Cognito Federated Identities\n *

Amazon Cognito Federated Identities is a web service that delivers scoped temporary\n * credentials to mobile devices and other untrusted environments. It uniquely identifies a\n * device and supplies the user with a consistent identity over the lifetime of an\n * application.

\n *

Using Amazon Cognito Federated Identities, you can enable authentication with one or\n * more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon\n * Cognito user pool, and you can also choose to support unauthenticated access from your app.\n * Cognito delivers a unique identifier for each user and acts as an OpenID token provider\n * trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS\n * credentials.

\n *

For a description of the authentication flow from the Amazon Cognito Developer Guide\n * see Authentication Flow.

\n *

For more information see Amazon Cognito Federated Identities.

\n */\nexport class CognitoIdentityClient extends __Client<\n __HttpHandlerOptions,\n ServiceInputTypes,\n ServiceOutputTypes,\n CognitoIdentityClientResolvedConfig\n> {\n readonly config: CognitoIdentityClientResolvedConfig;\n\n constructor(configuration: CognitoIdentityClientConfig) {\n let _config_0 = {\n ...__ClientDefaultValues,\n ...configuration,\n };\n let _config_1 = resolveRegionConfig(_config_0);\n let _config_2 = resolveEndpointsConfig(_config_1);\n let _config_3 = resolveAwsAuthConfig(_config_2);\n let _config_4 = resolveRetryConfig(_config_3);\n let _config_5 = resolveHostHeaderConfig(_config_4);\n let _config_6 = resolveUserAgentConfig(_config_5);\n super(_config_6);\n this.config = _config_6;\n this.middlewareStack.use(getRetryPlugin(this.config));\n this.middlewareStack.use(getContentLengthPlugin(this.config));\n this.middlewareStack.use(getHostHeaderPlugin(this.config));\n this.middlewareStack.use(getLoggerPlugin(this.config));\n this.middlewareStack.use(getUserAgentPlugin(this.config));\n }\n\n destroy(): void {\n super.destroy();\n }\n}\n","import { Provider, UserAgent } from \"@aws-sdk/types\";\nexport interface UserAgentInputConfig {\n /**\n * The custom user agent header that would be appended to default one\n */\n customUserAgent?: string | UserAgent;\n}\ninterface PreviouslyResolved {\n defaultUserAgentProvider: Provider;\n runtime: string;\n}\nexport interface UserAgentResolvedConfig {\n defaultUserAgentProvider: Provider;\n customUserAgent?: UserAgent;\n runtime: string;\n}\nexport function resolveUserAgentConfig(\n input: T & PreviouslyResolved & UserAgentInputConfig\n): T & UserAgentResolvedConfig {\n return {\n ...input,\n customUserAgent: typeof input.customUserAgent === \"string\" ? [[input.customUserAgent]] : input.customUserAgent,\n };\n}\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { version } from './version';\n\nconst BASE_USER_AGENT = `aws-amplify/${version}`;\n\nexport const Platform = {\n\tuserAgent: `${BASE_USER_AGENT} js`,\n\tproduct: '',\n\tnavigator: null,\n\tisReactNative: false,\n};\nif (typeof navigator !== 'undefined' && navigator.product) {\n\tPlatform.product = navigator.product || '';\n\tPlatform.navigator = navigator || null;\n\tswitch (navigator.product) {\n\t\tcase 'ReactNative':\n\t\t\tPlatform.userAgent = `${BASE_USER_AGENT} react-native`;\n\t\t\tPlatform.isReactNative = true;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tPlatform.userAgent = `${BASE_USER_AGENT} js`;\n\t\t\tPlatform.isReactNative = false;\n\t\t\tbreak;\n\t}\n}\n\nexport const getAmplifyUserAgent = (content?: string) => {\n\treturn `${Platform.userAgent}${content ? content : ''}`;\n};\n\n/**\n * @deprecated use named import\n */\nexport default Platform;\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n\tCognitoIdentityClient,\n\tCognitoIdentityClientConfig,\n} from '@aws-sdk/client-cognito-identity';\nimport { Provider } from '@aws-sdk/types';\nimport { getAmplifyUserAgent } from '../Platform';\n\n/**\n * Returns a CognitoIdentityClient with middleware\n * @param {CognitoIdentityClientConfig} config\n * @return {CognitoIdentityClient}\n */\nexport function createCognitoIdentityClient(\n\tconfig: CognitoIdentityClientConfig\n): CognitoIdentityClient {\n\tconst client = new CognitoIdentityClient({\n\t\tregion: config.region,\n\t\tcustomUserAgent: getAmplifyUserAgent(),\n\t});\n\n\tclient.middlewareStack.add(\n\t\t(next, _) => (args: any) => {\n\t\t\treturn next(middlewareArgs(args));\n\t\t},\n\t\t{\n\t\t\tstep: 'build',\n\t\t\tname: 'cacheControlMiddleWare',\n\t\t}\n\t);\n\n\treturn client;\n}\n\nexport function middlewareArgs(args: { request: any; input: any }) {\n\treturn {\n\t\t...args,\n\t\trequest: {\n\t\t\t...args.request,\n\t\t\theaders: {\n\t\t\t\t...args.request.headers,\n\t\t\t\t'cache-control': 'no-store',\n\t\t\t},\n\t\t},\n\t};\n}\n","import { ConsoleLogger as Logger } from './Logger';\nimport { StorageHelper } from './StorageHelper';\nimport { makeQuerablePromise } from './JS';\nimport { FacebookOAuth, GoogleOAuth } from './OAuthHelper';\nimport { jitteredExponentialRetry } from './Util';\nimport { ICredentials } from './types';\nimport { Amplify } from './Amplify';\nimport {\n\tfromCognitoIdentity,\n\tFromCognitoIdentityParameters,\n\tfromCognitoIdentityPool,\n\tFromCognitoIdentityPoolParameters,\n} from '@aws-sdk/credential-provider-cognito-identity';\nimport {\n\tGetIdCommand,\n\tGetCredentialsForIdentityCommand,\n} from '@aws-sdk/client-cognito-identity';\nimport { CredentialProvider } from '@aws-sdk/types';\nimport { createCognitoIdentityClient } from './Util/CognitoIdentityClient';\n\nconst logger = new Logger('Credentials');\n\nconst CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if required in the future\n\nconst COGNITO_IDENTITY_KEY_PREFIX = 'CognitoIdentityId-';\n\nexport class CredentialsClass {\n\tprivate _config;\n\tprivate _credentials;\n\tprivate _credentials_source;\n\tprivate _gettingCredPromise = null;\n\tprivate _refreshHandlers = {};\n\tprivate _storage;\n\tprivate _storageSync;\n\tprivate _identityId;\n\tprivate _nextCredentialsRefresh: Number;\n\n\t// Allow `Auth` to be injected for SSR, but Auth isn't a required dependency for Credentials\n\tAuth = undefined;\n\n\tconstructor(config) {\n\t\tthis.configure(config);\n\t\tthis._refreshHandlers['google'] = GoogleOAuth.refreshGoogleToken;\n\t\tthis._refreshHandlers['facebook'] = FacebookOAuth.refreshFacebookToken;\n\t}\n\n\tpublic getModuleName() {\n\t\treturn 'Credentials';\n\t}\n\n\tpublic getCredSource() {\n\t\treturn this._credentials_source;\n\t}\n\n\tpublic configure(config) {\n\t\tif (!config) return this._config || {};\n\n\t\tthis._config = Object.assign({}, this._config, config);\n\t\tconst { refreshHandlers } = this._config;\n\t\t// If the developer has provided an object of refresh handlers,\n\t\t// then we can merge the provided handlers with the current handlers.\n\t\tif (refreshHandlers) {\n\t\t\tthis._refreshHandlers = {\n\t\t\t\t...this._refreshHandlers,\n\t\t\t\t...refreshHandlers,\n\t\t\t};\n\t\t}\n\n\t\tthis._storage = this._config.storage;\n\n\t\tif (!this._storage) {\n\t\t\tthis._storage = new StorageHelper().getStorage();\n\t\t}\n\n\t\tthis._storageSync = Promise.resolve();\n\t\tif (typeof this._storage['sync'] === 'function') {\n\t\t\tthis._storageSync = this._storage['sync']();\n\t\t}\n\n\t\treturn this._config;\n\t}\n\n\tpublic get() {\n\t\tlogger.debug('getting credentials');\n\t\treturn this._pickupCredentials();\n\t}\n\n\t// currently we only store the guest identity in local storage\n\tprivate _getCognitoIdentityIdStorageKey(identityPoolId: string) {\n\t\treturn `${COGNITO_IDENTITY_KEY_PREFIX}${identityPoolId}`;\n\t}\n\n\tprivate _pickupCredentials() {\n\t\tlogger.debug('picking up credentials');\n\t\tif (!this._gettingCredPromise || !this._gettingCredPromise.isPending()) {\n\t\t\tlogger.debug('getting new cred promise');\n\t\t\tthis._gettingCredPromise = makeQuerablePromise(this._keepAlive());\n\t\t} else {\n\t\t\tlogger.debug('getting old cred promise');\n\t\t}\n\t\treturn this._gettingCredPromise;\n\t}\n\n\tprivate async _keepAlive() {\n\t\tlogger.debug('checking if credentials exists and not expired');\n\t\tconst cred = this._credentials;\n\t\tif (cred && !this._isExpired(cred) && !this._isPastTTL()) {\n\t\t\tlogger.debug('credentials not changed and not expired, directly return');\n\t\t\treturn Promise.resolve(cred);\n\t\t}\n\n\t\tlogger.debug('need to get a new credential or refresh the existing one');\n\n\t\t// Some use-cases don't require Auth for signing in, but use Credentials for guest users (e.g. Analytics)\n\t\t// Prefer locally scoped `Auth`, but fallback to registered `Amplify.Auth` global otherwise.\n\t\tconst { Auth = Amplify.Auth } = this;\n\n\t\tif (!Auth || typeof Auth.currentUserCredentials !== 'function') {\n\t\t\treturn Promise.reject('No Auth module registered in Amplify');\n\t\t}\n\n\t\tif (!this._isExpired(cred) && this._isPastTTL()) {\n\t\t\tlogger.debug('ttl has passed but token is not yet expired');\n\t\t\ttry {\n\t\t\t\tconst user = await Auth.currentUserPoolUser();\n\t\t\t\tconst session = await Auth.currentSession();\n\t\t\t\tconst refreshToken = session.refreshToken;\n\t\t\t\tconst refreshRequest = new Promise((res, rej) => {\n\t\t\t\t\tuser.refreshSession(refreshToken, (err, data) => {\n\t\t\t\t\t\treturn err ? rej(err) : res(data);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tawait refreshRequest; // note that rejections will be caught and handled in the catch block.\n\t\t\t} catch (err) {\n\t\t\t\t// should not throw because user might just be on guest access or is authenticated through federation\n\t\t\t\tlogger.debug('Error attempting to refreshing the session', err);\n\t\t\t}\n\t\t}\n\t\treturn Auth.currentUserCredentials();\n\t}\n\n\tpublic refreshFederatedToken(federatedInfo) {\n\t\tlogger.debug('Getting federated credentials');\n\t\tconst { provider, user, token, identity_id } = federatedInfo;\n\t\tlet { expires_at } = federatedInfo;\n\n\t\t// Make sure expires_at is in millis\n\t\texpires_at =\n\t\t\tnew Date(expires_at).getFullYear() === 1970\n\t\t\t\t? expires_at * 1000\n\t\t\t\t: expires_at;\n\n\t\tconst that = this;\n\t\tlogger.debug('checking if federated jwt token expired');\n\t\tif (expires_at > new Date().getTime()) {\n\t\t\t// if not expired\n\t\t\tlogger.debug('token not expired');\n\t\t\treturn this._setCredentialsFromFederation({\n\t\t\t\tprovider,\n\t\t\t\ttoken,\n\t\t\t\tuser,\n\t\t\t\tidentity_id,\n\t\t\t\texpires_at,\n\t\t\t});\n\t\t} else {\n\t\t\t// if refresh handler exists\n\t\t\tif (\n\t\t\t\tthat._refreshHandlers[provider] &&\n\t\t\t\ttypeof that._refreshHandlers[provider] === 'function'\n\t\t\t) {\n\t\t\t\tlogger.debug('getting refreshed jwt token from federation provider');\n\t\t\t\treturn this._providerRefreshWithRetry({\n\t\t\t\t\trefreshHandler: that._refreshHandlers[provider],\n\t\t\t\t\tprovider,\n\t\t\t\t\tuser,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlogger.debug('no refresh handler for provider:', provider);\n\t\t\t\tthis.clear();\n\t\t\t\treturn Promise.reject('no refresh handler for provider');\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _providerRefreshWithRetry({ refreshHandler, provider, user }) {\n\t\tconst MAX_DELAY_MS = 10 * 1000;\n\t\t// refreshHandler will retry network errors, otherwise it will\n\t\t// return NonRetryableError to break out of jitteredExponentialRetry\n\t\treturn jitteredExponentialRetry(refreshHandler, [], MAX_DELAY_MS)\n\t\t\t.then(data => {\n\t\t\t\tlogger.debug('refresh federated token sucessfully', data);\n\t\t\t\treturn this._setCredentialsFromFederation({\n\t\t\t\t\tprovider,\n\t\t\t\t\ttoken: data.token,\n\t\t\t\t\tuser,\n\t\t\t\t\tidentity_id: data.identity_id,\n\t\t\t\t\texpires_at: data.expires_at,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(e => {\n\t\t\t\tconst isNetworkError =\n\t\t\t\t\ttypeof e === 'string' &&\n\t\t\t\t\te.toLowerCase().lastIndexOf('network error', e.length) === 0;\n\n\t\t\t\tif (!isNetworkError) {\n\t\t\t\t\tthis.clear();\n\t\t\t\t}\n\n\t\t\t\tlogger.debug('refresh federated token failed', e);\n\t\t\t\treturn Promise.reject('refreshing federation token failed: ' + e);\n\t\t\t});\n\t}\n\n\tprivate _isExpired(credentials): boolean {\n\t\tif (!credentials) {\n\t\t\tlogger.debug('no credentials for expiration check');\n\t\t\treturn true;\n\t\t}\n\t\tlogger.debug('are these credentials expired?', credentials);\n\t\tconst ts = Date.now();\n\n\t\t/* returns date object.\n\t\t\thttps://github.com/aws/aws-sdk-js-v3/blob/v1.0.0-beta.1/packages/types/src/credentials.ts#L26\n\t\t*/\n\t\tconst { expiration } = credentials;\n\t\treturn expiration.getTime() <= ts;\n\t}\n\n\tprivate _isPastTTL(): boolean {\n\t\treturn this._nextCredentialsRefresh <= Date.now();\n\t}\n\n\tprivate async _setCredentialsForGuest() {\n\t\tlogger.debug('setting credentials for guest');\n\t\tconst { identityPoolId, region, mandatorySignIn } = this._config;\n\t\tif (mandatorySignIn) {\n\t\t\treturn Promise.reject(\n\t\t\t\t'cannot get guest credentials when mandatory signin enabled'\n\t\t\t);\n\t\t}\n\n\t\tif (!identityPoolId) {\n\t\t\tlogger.debug(\n\t\t\t\t'No Cognito Identity pool provided for unauthenticated access'\n\t\t\t);\n\t\t\treturn Promise.reject(\n\t\t\t\t'No Cognito Identity pool provided for unauthenticated access'\n\t\t\t);\n\t\t}\n\n\t\tif (!region) {\n\t\t\tlogger.debug('region is not configured for getting the credentials');\n\t\t\treturn Promise.reject(\n\t\t\t\t'region is not configured for getting the credentials'\n\t\t\t);\n\t\t}\n\n\t\tconst identityId = (this._identityId = await this._getGuestIdentityId());\n\n\t\tconst cognitoClient = createCognitoIdentityClient({\n\t\t\tregion,\n\t\t});\n\n\t\tlet credentials = undefined;\n\t\tif (identityId) {\n\t\t\tconst cognitoIdentityParams: FromCognitoIdentityParameters = {\n\t\t\t\tidentityId,\n\t\t\t\tclient: cognitoClient,\n\t\t\t};\n\t\t\tcredentials = fromCognitoIdentity(cognitoIdentityParams)();\n\t\t} else {\n\t\t\t/*\n\t\t\tRetreiving identityId with GetIdCommand to mimic the behavior in the following code in aws-sdk-v3:\n\t\t\thttps://git.io/JeDxU\n\n\t\t\tNote: Retreive identityId from CredentialsProvider once aws-sdk-js v3 supports this.\n\t\t\t*/\n\t\t\tconst credentialsProvider: CredentialProvider = async () => {\n\t\t\t\tconst { IdentityId } = await cognitoClient.send(\n\t\t\t\t\tnew GetIdCommand({\n\t\t\t\t\t\tIdentityPoolId: identityPoolId,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\tthis._identityId = IdentityId;\n\t\t\t\tconst cognitoIdentityParams: FromCognitoIdentityParameters = {\n\t\t\t\t\tclient: cognitoClient,\n\t\t\t\t\tidentityId: IdentityId,\n\t\t\t\t};\n\n\t\t\t\tconst credentialsFromCognitoIdentity = fromCognitoIdentity(\n\t\t\t\t\tcognitoIdentityParams\n\t\t\t\t);\n\n\t\t\t\treturn credentialsFromCognitoIdentity();\n\t\t\t};\n\n\t\t\tcredentials = credentialsProvider().catch(async err => {\n\t\t\t\tthrow err;\n\t\t\t});\n\t\t}\n\n\t\treturn this._loadCredentials(credentials, 'guest', false, null)\n\t\t\t.then(res => {\n\t\t\t\treturn res;\n\t\t\t})\n\t\t\t.catch(async e => {\n\t\t\t\t// If identity id is deleted in the console, we make one attempt to recreate it\n\t\t\t\t// and remove existing id from cache.\n\t\t\t\tif (\n\t\t\t\t\te.name === 'ResourceNotFoundException' &&\n\t\t\t\t\te.message === `Identity '${identityId}' not found.`\n\t\t\t\t) {\n\t\t\t\t\tlogger.debug('Failed to load guest credentials');\n\t\t\t\t\tawait this._removeGuestIdentityId();\n\n\t\t\t\t\tconst credentialsProvider: CredentialProvider = async () => {\n\t\t\t\t\t\tconst { IdentityId } = await cognitoClient.send(\n\t\t\t\t\t\t\tnew GetIdCommand({\n\t\t\t\t\t\t\t\tIdentityPoolId: identityPoolId,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis._identityId = IdentityId;\n\t\t\t\t\t\tconst cognitoIdentityParams: FromCognitoIdentityParameters = {\n\t\t\t\t\t\t\tclient: cognitoClient,\n\t\t\t\t\t\t\tidentityId: IdentityId,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tconst credentialsFromCognitoIdentity = fromCognitoIdentity(\n\t\t\t\t\t\t\tcognitoIdentityParams\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn credentialsFromCognitoIdentity();\n\t\t\t\t\t};\n\n\t\t\t\t\tcredentials = credentialsProvider().catch(async err => {\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t});\n\n\t\t\t\t\treturn this._loadCredentials(credentials, 'guest', false, null);\n\t\t\t\t} else {\n\t\t\t\t\treturn e;\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tprivate _setCredentialsFromFederation(params) {\n\t\tconst { provider, token, identity_id } = params;\n\t\tconst domains = {\n\t\t\tgoogle: 'accounts.google.com',\n\t\t\tfacebook: 'graph.facebook.com',\n\t\t\tamazon: 'www.amazon.com',\n\t\t\tdeveloper: 'cognito-identity.amazonaws.com',\n\t\t};\n\n\t\t// Use custom provider url instead of the predefined ones\n\t\tconst domain = domains[provider] || provider;\n\t\tif (!domain) {\n\t\t\treturn Promise.reject('You must specify a federated provider');\n\t\t}\n\n\t\tconst logins = {};\n\t\tlogins[domain] = token;\n\n\t\tconst { identityPoolId, region } = this._config;\n\t\tif (!identityPoolId) {\n\t\t\tlogger.debug('No Cognito Federated Identity pool provided');\n\t\t\treturn Promise.reject('No Cognito Federated Identity pool provided');\n\t\t}\n\t\tif (!region) {\n\t\t\tlogger.debug('region is not configured for getting the credentials');\n\t\t\treturn Promise.reject(\n\t\t\t\t'region is not configured for getting the credentials'\n\t\t\t);\n\t\t}\n\n\t\tconst cognitoClient = createCognitoIdentityClient({\n\t\t\tregion,\n\t\t});\n\n\t\tlet credentials = undefined;\n\t\tif (identity_id) {\n\t\t\tconst cognitoIdentityParams: FromCognitoIdentityParameters = {\n\t\t\t\tidentityId: identity_id,\n\t\t\t\tlogins,\n\t\t\t\tclient: cognitoClient,\n\t\t\t};\n\t\t\tcredentials = fromCognitoIdentity(cognitoIdentityParams)();\n\t\t} else {\n\t\t\tconst cognitoIdentityParams: FromCognitoIdentityPoolParameters = {\n\t\t\t\tlogins,\n\t\t\t\tidentityPoolId,\n\t\t\t\tclient: cognitoClient,\n\t\t\t};\n\t\t\tcredentials = fromCognitoIdentityPool(cognitoIdentityParams)();\n\t\t}\n\t\treturn this._loadCredentials(credentials, 'federated', true, params);\n\t}\n\n\tprivate _setCredentialsFromSession(session): Promise {\n\t\tlogger.debug('set credentials from session');\n\t\tconst idToken = session.getIdToken().getJwtToken();\n\t\tconst { region, userPoolId, identityPoolId } = this._config;\n\t\tif (!identityPoolId) {\n\t\t\tlogger.debug('No Cognito Federated Identity pool provided');\n\t\t\treturn Promise.reject('No Cognito Federated Identity pool provided');\n\t\t}\n\t\tif (!region) {\n\t\t\tlogger.debug('region is not configured for getting the credentials');\n\t\t\treturn Promise.reject(\n\t\t\t\t'region is not configured for getting the credentials'\n\t\t\t);\n\t\t}\n\t\tconst key = 'cognito-idp.' + region + '.amazonaws.com/' + userPoolId;\n\t\tconst logins = {};\n\t\tlogins[key] = idToken;\n\n\t\tconst cognitoClient = createCognitoIdentityClient({\n\t\t\tregion,\n\t\t});\n\n\t\t/* \n\t\t\tRetreiving identityId with GetIdCommand to mimic the behavior in the following code in aws-sdk-v3:\n\t\t\thttps://git.io/JeDxU\n\n\t\t\tNote: Retreive identityId from CredentialsProvider once aws-sdk-js v3 supports this.\n\t\t*/\n\t\tconst credentialsProvider: CredentialProvider = async () => {\n\t\t\t// try to fetch the local stored guest identity, if found, we will associate it with the logins\n\t\t\tconst guestIdentityId = await this._getGuestIdentityId();\n\n\t\t\tlet generatedOrRetrievedIdentityId;\n\t\t\tif (!guestIdentityId) {\n\t\t\t\t// for a first-time user, this will return a brand new identity\n\t\t\t\t// for a returning user, this will retrieve the previous identity assocaited with the logins\n\t\t\t\tconst { IdentityId } = await cognitoClient.send(\n\t\t\t\t\tnew GetIdCommand({\n\t\t\t\t\t\tIdentityPoolId: identityPoolId,\n\t\t\t\t\t\tLogins: logins,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\tgeneratedOrRetrievedIdentityId = IdentityId;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tCredentials: { AccessKeyId, Expiration, SecretKey, SessionToken },\n\t\t\t\t// single source of truth for the primary identity associated with the logins\n\t\t\t\t// only if a guest identity is used for a first-time user, that guest identity will become its primary identity\n\t\t\t\tIdentityId: primaryIdentityId,\n\t\t\t} = await cognitoClient.send(\n\t\t\t\tnew GetCredentialsForIdentityCommand({\n\t\t\t\t\tIdentityId: guestIdentityId || generatedOrRetrievedIdentityId,\n\t\t\t\t\tLogins: logins,\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tthis._identityId = primaryIdentityId;\n\t\t\tif (guestIdentityId) {\n\t\t\t\t// if guestIdentity is found and used by GetCredentialsForIdentity\n\t\t\t\t// it will be linked to the logins provided, and disqualified as an unauth identity\n\t\t\t\tlogger.debug(\n\t\t\t\t\t`The guest identity ${guestIdentityId} has been successfully linked to the logins`\n\t\t\t\t);\n\t\t\t\tif (guestIdentityId === primaryIdentityId) {\n\t\t\t\t\tlogger.debug(\n\t\t\t\t\t\t`The guest identity ${guestIdentityId} has become the primary identity`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// remove it from local storage to avoid being used as a guest Identity by _setCredentialsForGuest\n\t\t\t\tawait this._removeGuestIdentityId();\n\t\t\t}\n\n\t\t\t// https://github.com/aws/aws-sdk-js-v3/blob/main/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts#L40\n\t\t\treturn {\n\t\t\t\taccessKeyId: AccessKeyId,\n\t\t\t\tsecretAccessKey: SecretKey,\n\t\t\t\tsessionToken: SessionToken,\n\t\t\t\texpiration: Expiration,\n\t\t\t\tidentityId: primaryIdentityId,\n\t\t\t};\n\t\t};\n\n\t\tconst credentials = credentialsProvider().catch(async err => {\n\t\t\tthrow err;\n\t\t});\n\n\t\treturn this._loadCredentials(credentials, 'userPool', true, null);\n\t}\n\n\tprivate _loadCredentials(\n\t\tcredentials,\n\t\tsource,\n\t\tauthenticated,\n\t\tinfo\n\t): Promise {\n\t\tconst that = this;\n\t\treturn new Promise((res, rej) => {\n\t\t\tcredentials\n\t\t\t\t.then(async credentials => {\n\t\t\t\t\tlogger.debug('Load credentials successfully', credentials);\n\t\t\t\t\tif (this._identityId && !credentials.identityId) {\n\t\t\t\t\t\tcredentials['identityId'] = this._identityId;\n\t\t\t\t\t}\n\n\t\t\t\t\tthat._credentials = credentials;\n\t\t\t\t\tthat._credentials.authenticated = authenticated;\n\t\t\t\t\tthat._credentials_source = source;\n\t\t\t\t\tthat._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n\t\t\t\t\tif (source === 'federated') {\n\t\t\t\t\t\tconst user = Object.assign(\n\t\t\t\t\t\t\t{ id: this._credentials.identityId },\n\t\t\t\t\t\t\tinfo.user\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst { provider, token, expires_at, identity_id } = info;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthis._storage.setItem(\n\t\t\t\t\t\t\t\t'aws-amplify-federatedInfo',\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tprovider,\n\t\t\t\t\t\t\t\t\ttoken,\n\t\t\t\t\t\t\t\t\tuser,\n\t\t\t\t\t\t\t\t\texpires_at,\n\t\t\t\t\t\t\t\t\tidentity_id,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tlogger.debug('Failed to put federated info into auth storage', e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (source === 'guest') {\n\t\t\t\t\t\tawait this._setGuestIdentityId(credentials.identityId);\n\t\t\t\t\t}\n\t\t\t\t\tres(that._credentials);\n\t\t\t\t\treturn;\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tlogger.debug('Failed to load credentials', credentials);\n\t\t\t\t\t\tlogger.debug('Error loading credentials', err);\n\t\t\t\t\t\trej(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t}\n\n\tpublic set(params, source): Promise {\n\t\tif (source === 'session') {\n\t\t\treturn this._setCredentialsFromSession(params);\n\t\t} else if (source === 'federation') {\n\t\t\treturn this._setCredentialsFromFederation(params);\n\t\t} else if (source === 'guest') {\n\t\t\treturn this._setCredentialsForGuest();\n\t\t} else {\n\t\t\tlogger.debug('no source specified for setting credentials');\n\t\t\treturn Promise.reject('invalid source');\n\t\t}\n\t}\n\n\tpublic async clear() {\n\t\tthis._credentials = null;\n\t\tthis._credentials_source = null;\n\t\tlogger.debug('removing aws-amplify-federatedInfo from storage');\n\t\tthis._storage.removeItem('aws-amplify-federatedInfo');\n\t}\n\n\t/* operations on local stored guest identity */\n\tprivate async _getGuestIdentityId(): Promise {\n\t\tconst { identityPoolId } = this._config;\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t\treturn this._storage.getItem(\n\t\t\t\tthis._getCognitoIdentityIdStorageKey(identityPoolId)\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to get the cached guest identityId', e);\n\t\t}\n\t}\n\n\tprivate async _setGuestIdentityId(identityId: string) {\n\t\tconst { identityPoolId } = this._config;\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t\tthis._storage.setItem(\n\t\t\t\tthis._getCognitoIdentityIdStorageKey(identityPoolId),\n\t\t\t\tidentityId\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to cache guest identityId', e);\n\t\t}\n\t}\n\n\tprivate async _removeGuestIdentityId() {\n\t\tconst { identityPoolId } = this._config;\n\t\tlogger.debug(\n\t\t\t`removing ${this._getCognitoIdentityIdStorageKey(\n\t\t\t\tidentityPoolId\n\t\t\t)} from storage`\n\t\t);\n\t\tthis._storage.removeItem(\n\t\t\tthis._getCognitoIdentityIdStorageKey(identityPoolId)\n\t\t);\n\t}\n\n\t/**\n\t * Compact version of credentials\n\t * @param {Object} credentials\n\t * @return {Object} - Credentials\n\t */\n\tpublic shear(credentials) {\n\t\treturn {\n\t\t\taccessKeyId: credentials.accessKeyId,\n\t\t\tsessionToken: credentials.sessionToken,\n\t\t\tsecretAccessKey: credentials.secretAccessKey,\n\t\t\tidentityId: credentials.identityId,\n\t\t\tauthenticated: credentials.authenticated,\n\t\t};\n\t}\n}\n\nexport const Credentials = new CredentialsClass(null);\n\nAmplify.register(Credentials);\n\n/**\n * @deprecated use named import\n */\nexport default Credentials;\n","import { AmplifyConfig } from './types';\nimport { ConsoleLogger as Logger } from './Logger';\n\nconst logger = new Logger('Parser');\n\nexport const parseMobileHubConfig = (config): AmplifyConfig => {\n\tconst amplifyConfig: AmplifyConfig = {};\n\t// Analytics\n\tif (config['aws_mobile_analytics_app_id']) {\n\t\tconst Analytics = {\n\t\t\tAWSPinpoint: {\n\t\t\t\tappId: config['aws_mobile_analytics_app_id'],\n\t\t\t\tregion: config['aws_mobile_analytics_app_region'],\n\t\t\t},\n\t\t};\n\t\tamplifyConfig.Analytics = Analytics;\n\t}\n\n\t// Auth\n\tif (config['aws_cognito_identity_pool_id'] || config['aws_user_pools_id']) {\n\t\tamplifyConfig.Auth = {\n\t\t\tuserPoolId: config['aws_user_pools_id'],\n\t\t\tuserPoolWebClientId: config['aws_user_pools_web_client_id'],\n\t\t\tregion: config['aws_cognito_region'],\n\t\t\tidentityPoolId: config['aws_cognito_identity_pool_id'],\n\t\t\tidentityPoolRegion: config['aws_cognito_region'],\n\t\t\tmandatorySignIn: config['aws_mandatory_sign_in'] === 'enable',\n\t\t\tsignUpVerificationMethod:\n\t\t\t\tconfig['aws_cognito_sign_up_verification_method'] || 'code',\n\t\t};\n\t}\n\n\t// Storage\n\tlet storageConfig;\n\tif (config['aws_user_files_s3_bucket']) {\n\t\tstorageConfig = {\n\t\t\tAWSS3: {\n\t\t\t\tbucket: config['aws_user_files_s3_bucket'],\n\t\t\t\tregion: config['aws_user_files_s3_bucket_region'],\n\t\t\t\tdangerouslyConnectToHttpEndpointForTesting:\n\t\t\t\t\tconfig[\n\t\t\t\t\t\t'aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing'\n\t\t\t\t\t],\n\t\t\t},\n\t\t};\n\t} else {\n\t\tstorageConfig = config ? config.Storage || config : {};\n\t}\n\n\t// Logging\n\tif (config['Logging']) {\n\t\tamplifyConfig.Logging = {\n\t\t\t...config['Logging'],\n\t\t\tregion: config['aws_project_region'],\n\t\t};\n\t}\n\n\t// Geo\n\tif (config['geo']) {\n\t\tamplifyConfig.Geo = Object.assign({}, config.geo);\n\t\tif (config.geo['amazon_location_service']) {\n\t\t\tamplifyConfig.Geo = {\n\t\t\t\tAmazonLocationService: config.geo['amazon_location_service'],\n\t\t\t};\n\t\t}\n\t}\n\n\tamplifyConfig.Analytics = Object.assign(\n\t\t{},\n\t\tamplifyConfig.Analytics,\n\t\tconfig.Analytics\n\t);\n\tamplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);\n\tamplifyConfig.Storage = Object.assign({}, storageConfig);\n\tamplifyConfig.Logging = Object.assign(\n\t\t{},\n\t\tamplifyConfig.Logging,\n\t\tconfig.Logging\n\t);\n\tlogger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);\n\treturn amplifyConfig;\n};\n\n/**\n * @deprecated use per-function export\n */\nexport class Parser {\n\tstatic parseMobilehubConfig = parseMobileHubConfig;\n}\n\n/**\n * @deprecated use per-function export\n */\nexport default Parser;\n","import * as cookie from 'cookie';\r\nexport function hasDocumentCookie() {\r\n // Can we get/set cookies on document.cookie?\r\n return typeof document === 'object' && typeof document.cookie === 'string';\r\n}\r\nexport function cleanCookies() {\r\n document.cookie.split(';').forEach(function (c) {\r\n document.cookie = c\r\n .replace(/^ +/, '')\r\n .replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/');\r\n });\r\n}\r\nexport function parseCookies(cookies, options) {\r\n if (typeof cookies === 'string') {\r\n return cookie.parse(cookies, options);\r\n }\r\n else if (typeof cookies === 'object' && cookies !== null) {\r\n return cookies;\r\n }\r\n else {\r\n return {};\r\n }\r\n}\r\nexport function isParsingCookie(value, doNotParse) {\r\n if (typeof doNotParse === 'undefined') {\r\n // We guess if the cookie start with { or [, it has been serialized\r\n doNotParse =\r\n !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '\"');\r\n }\r\n return !doNotParse;\r\n}\r\nexport function readCookie(value, options) {\r\n if (options === void 0) { options = {}; }\r\n var cleanValue = cleanupCookieValue(value);\r\n if (isParsingCookie(cleanValue, options.doNotParse)) {\r\n try {\r\n return JSON.parse(cleanValue);\r\n }\r\n catch (e) {\r\n // At least we tried\r\n }\r\n }\r\n // Ignore clean value if we failed the deserialization\r\n // It is not relevant anymore to trim those values\r\n return value;\r\n}\r\nfunction cleanupCookieValue(value) {\r\n // express prepend j: before serializing a cookie\r\n if (value && value[0] === 'j' && value[1] === ':') {\r\n return value.substr(2);\r\n }\r\n return value;\r\n}\r\n","var __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nimport * as cookie from 'cookie';\r\nimport { hasDocumentCookie, parseCookies, readCookie } from './utils';\r\nvar Cookies = /** @class */ (function () {\r\n function Cookies(cookies, options) {\r\n var _this = this;\r\n this.changeListeners = [];\r\n this.HAS_DOCUMENT_COOKIE = false;\r\n this.cookies = parseCookies(cookies, options);\r\n new Promise(function () {\r\n _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\r\n }).catch(function () { });\r\n }\r\n Cookies.prototype._updateBrowserValues = function (parseOptions) {\r\n if (!this.HAS_DOCUMENT_COOKIE) {\r\n return;\r\n }\r\n this.cookies = cookie.parse(document.cookie, parseOptions);\r\n };\r\n Cookies.prototype._emitChange = function (params) {\r\n for (var i = 0; i < this.changeListeners.length; ++i) {\r\n this.changeListeners[i](params);\r\n }\r\n };\r\n Cookies.prototype.get = function (name, options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n return readCookie(this.cookies[name], options);\r\n };\r\n Cookies.prototype.getAll = function (options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n var result = {};\r\n for (var name_1 in this.cookies) {\r\n result[name_1] = readCookie(this.cookies[name_1], options);\r\n }\r\n return result;\r\n };\r\n Cookies.prototype.set = function (name, value, options) {\r\n var _a;\r\n if (typeof value === 'object') {\r\n value = JSON.stringify(value);\r\n }\r\n this.cookies = __assign(__assign({}, this.cookies), (_a = {}, _a[name] = value, _a));\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, value, options);\r\n }\r\n this._emitChange({ name: name, value: value, options: options });\r\n };\r\n Cookies.prototype.remove = function (name, options) {\r\n var finalOptions = (options = __assign(__assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\r\n this.cookies = __assign({}, this.cookies);\r\n delete this.cookies[name];\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, '', finalOptions);\r\n }\r\n this._emitChange({ name: name, value: undefined, options: options });\r\n };\r\n Cookies.prototype.addChangeListener = function (callback) {\r\n this.changeListeners.push(callback);\r\n };\r\n Cookies.prototype.removeChangeListener = function (callback) {\r\n var idx = this.changeListeners.indexOf(callback);\r\n if (idx >= 0) {\r\n this.changeListeners.splice(idx, 1);\r\n }\r\n };\r\n return Cookies;\r\n}());\r\nexport default Cookies;\r\n","import Cookies from './Cookies';\r\nexport default Cookies;\r\n","import Cookies from 'universal-cookie';\nimport { browserOrNode } from '../JS';\n\ntype Store = Record;\n\nconst { isBrowser } = browserOrNode();\n\n// Avoid using @types/next because @aws-amplify/ui-angular's version of TypeScript is too old to support it\ntype Context = { req?: any };\n\nexport class UniversalStorage implements Storage {\n\tcookies = new Cookies();\n\tstore: Store = isBrowser ? window.localStorage : Object.create(null);\n\n\tconstructor(context: Context = {}) {\n\t\tthis.cookies = context.req\n\t\t\t? new Cookies(context.req.headers.cookie)\n\t\t\t: new Cookies();\n\n\t\tObject.assign(this.store, this.cookies.getAll());\n\t}\n\n\tget length() {\n\t\treturn Object.entries(this.store).length;\n\t}\n\n\tclear() {\n\t\tArray.from(new Array(this.length))\n\t\t\t.map((_, i) => this.key(i))\n\t\t\t.forEach(key => this.removeItem(key));\n\t}\n\n\tgetItem(key: keyof Store) {\n\t\treturn this.getLocalItem(key);\n\t}\n\n\tprotected getLocalItem(key: keyof Store) {\n\t\treturn Object.prototype.hasOwnProperty.call(this.store, key)\n\t\t\t? this.store[key]\n\t\t\t: null;\n\t}\n\n\tprotected getUniversalItem(key: keyof Store) {\n\t\treturn this.cookies.get(key);\n\t}\n\n\tkey(index: number) {\n\t\treturn Object.keys(this.store)[index];\n\t}\n\n\tremoveItem(key: string) {\n\t\tthis.removeLocalItem(key);\n\t\tthis.removeUniversalItem(key);\n\t}\n\n\tprotected removeLocalItem(key: keyof Store) {\n\t\tdelete this.store[key];\n\t}\n\n\tprotected removeUniversalItem(key: keyof Store) {\n\t\tthis.cookies.remove(key, {\n\t\t\tpath: '/',\n\t\t});\n\t}\n\n\tsetItem(key: keyof Store, value: string) {\n\t\tthis.setLocalItem(key, value);\n\n\t\t// keys take the shape:\n\t\t// 1. `${ProviderPrefix}.${userPoolClientId}.${username}.${tokenType}\n\t\t// 2. `${ProviderPrefix}.${userPoolClientId}.LastAuthUser\n\t\tconst tokenType = key.split('.').pop();\n\n\t\tswitch (tokenType) {\n\t\t\t// LastAuthUser is needed for computing other key names\n\t\t\tcase 'LastAuthUser':\n\n\t\t\t// accessToken is required for CognitoUserSession\n\t\t\tcase 'accessToken':\n\n\t\t\t// refreshToken originates on the client, but SSR pages won't fail when this expires\n\t\t\t// Note: the new `accessToken` will also be refreshed on the client (since Amplify doesn't set server-side cookies)\n\t\t\tcase 'refreshToken':\n\n\t\t\t// Required for CognitoUserSession\n\t\t\tcase 'idToken':\n\t\t\t\tisBrowser\n\t\t\t\t\t? this.setUniversalItem(key, value)\n\t\t\t\t\t: this.setLocalItem(key, value);\n\n\t\t\t// userData is used when `Auth.currentAuthenticatedUser({ bypassCache: false })`.\n\t\t\t// Can be persisted to speed up calls to `Auth.currentAuthenticatedUser()`\n\t\t\t// case 'userData':\n\n\t\t\t// Ignoring clockDrift on the server for now, but needs testing\n\t\t\t// case 'clockDrift':\n\t\t}\n\t}\n\n\tprotected setLocalItem(key: keyof Store, value: string) {\n\t\tthis.store[key] = value;\n\t}\n\n\tprotected setUniversalItem(key: keyof Store, value: string) {\n\t\tthis.cookies.set(key, value, {\n\t\t\tpath: '/',\n\t\t\t// `httpOnly` cannot be set via JavaScript: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#JavaScript_access_using_Document.cookie\n\t\t\tsameSite: true,\n\t\t\t// Allow unsecure requests to http://localhost:3000/ when in development.\n\t\t\tsecure: window.location.hostname === 'localhost' ? false : true,\n\t\t});\n\t}\n}\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nconst SELF = '_self';\n\nexport const launchUri = (url: string) => {\n\tconst windowProxy = window.open(url, SELF);\n\tif (windowProxy) {\n\t\treturn Promise.resolve(windowProxy);\n\t} else {\n\t\treturn Promise.reject();\n\t}\n};\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nimport { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI\nimport { launchUri } from './urlOpener';\nimport * as oAuthStorage from './oauthStorage';\n\nimport {\n\tOAuthOpts,\n\tisCognitoHostedOpts,\n\tCognitoHostedUIIdentityProvider,\n} from '../types/Auth';\n\nimport { ConsoleLogger as Logger, Hub, urlSafeEncode } from '@aws-amplify/core';\n\nimport sha256 from 'crypto-js/sha256';\nimport Base64 from 'crypto-js/enc-base64';\n\nconst AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' &&\ntypeof Symbol.for === 'function'\n\t? Symbol.for('amplify_default')\n\t: '@@amplify_default') as Symbol;\n\nconst dispatchAuthEvent = (event: string, data: any, message: string) => {\n\tHub.dispatch('auth', { event, data, message }, 'Auth', AMPLIFY_SYMBOL);\n};\n\nconst logger = new Logger('OAuth');\n\nexport default class OAuth {\n\tprivate _urlOpener;\n\tprivate _config;\n\tprivate _cognitoClientId;\n\tprivate _scopes;\n\n\tconstructor({\n\t\tconfig,\n\t\tcognitoClientId,\n\t\tscopes = [],\n\t}: {\n\t\tscopes: string[];\n\t\tconfig: OAuthOpts;\n\t\tcognitoClientId: string;\n\t}) {\n\t\tthis._urlOpener = config.urlOpener || launchUri;\n\t\tthis._config = config;\n\t\tthis._cognitoClientId = cognitoClientId;\n\n\t\tif (!this.isValidScopes(scopes))\n\t\t\tthrow Error('scopes must be a String Array');\n\t\tthis._scopes = scopes;\n\t}\n\n\tprivate isValidScopes(scopes: string[]) {\n\t\treturn (\n\t\t\tArray.isArray(scopes) && scopes.every(scope => typeof scope === 'string')\n\t\t);\n\t}\n\n\tpublic oauthSignIn(\n\t\tresponseType = 'code',\n\t\tdomain: string,\n\t\tredirectSignIn: string,\n\t\tclientId: string,\n\t\tprovider:\n\t\t\t| CognitoHostedUIIdentityProvider\n\t\t\t| string = CognitoHostedUIIdentityProvider.Cognito,\n\t\tcustomState?: string\n\t) {\n\t\tconst generatedState = this._generateState(32);\n\n\t\t/* encodeURIComponent is not URL safe, use urlSafeEncode instead. Cognito \n\t\tsingle-encodes/decodes url on first sign in and double-encodes/decodes url\n\t\twhen user already signed in. Using encodeURIComponent, Base32, Base64 add \n\t\tcharacters % or = which on further encoding becomes unsafe. '=' create issue \n\t\tfor parsing query params. \n\t\tRefer: https://github.com/aws-amplify/amplify-js/issues/5218 */\n\t\tconst state = customState\n\t\t\t? `${generatedState}-${urlSafeEncode(customState)}`\n\t\t\t: generatedState;\n\n\t\toAuthStorage.setState(state);\n\n\t\tconst pkce_key = this._generateRandom(128);\n\t\toAuthStorage.setPKCE(pkce_key);\n\n\t\tconst code_challenge = this._generateChallenge(pkce_key);\n\t\tconst code_challenge_method = 'S256';\n\n\t\tconst scopesString = this._scopes.join(' ');\n\n\t\tconst queryString = Object.entries({\n\t\t\tredirect_uri: redirectSignIn,\n\t\t\tresponse_type: responseType,\n\t\t\tclient_id: clientId,\n\t\t\tidentity_provider: provider,\n\t\t\tscope: scopesString,\n\t\t\tstate,\n\t\t\t...(responseType === 'code' ? { code_challenge } : {}),\n\t\t\t...(responseType === 'code' ? { code_challenge_method } : {}),\n\t\t})\n\t\t\t.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n\t\t\t.join('&');\n\n\t\tconst URL = `https://${domain}/oauth2/authorize?${queryString}`;\n\t\tlogger.debug(`Redirecting to ${URL}`);\n\t\tthis._urlOpener(URL, redirectSignIn);\n\t}\n\n\tprivate async _handleCodeFlow(currentUrl: string) {\n\t\t/* Convert URL into an object with parameters as keys\n { redirect_uri: 'http://localhost:3000/', response_type: 'code', ...} */\n\t\tconst { code } = (parse(currentUrl).query || '')\n\t\t\t.split('&')\n\t\t\t.map(pairings => pairings.split('='))\n\t\t\t.reduce((accum, [k, v]) => ({ ...accum, [k]: v }), { code: undefined });\n\n\t\tconst currentUrlPathname = parse(currentUrl).pathname || '/';\n\t\tconst redirectSignInPathname =\n\t\t\tparse(this._config.redirectSignIn).pathname || '/';\n\n\t\tif (!code || currentUrlPathname !== redirectSignInPathname) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst oAuthTokenEndpoint =\n\t\t\t'https://' + this._config.domain + '/oauth2/token';\n\n\t\tdispatchAuthEvent(\n\t\t\t'codeFlow',\n\t\t\t{},\n\t\t\t`Retrieving tokens from ${oAuthTokenEndpoint}`\n\t\t);\n\n\t\tconst client_id = isCognitoHostedOpts(this._config)\n\t\t\t? this._cognitoClientId\n\t\t\t: this._config.clientID;\n\n\t\tconst redirect_uri = isCognitoHostedOpts(this._config)\n\t\t\t? this._config.redirectSignIn\n\t\t\t: this._config.redirectUri;\n\n\t\tconst code_verifier = oAuthStorage.getPKCE();\n\n\t\tconst oAuthTokenBody = {\n\t\t\tgrant_type: 'authorization_code',\n\t\t\tcode,\n\t\t\tclient_id,\n\t\t\tredirect_uri,\n\t\t\t...(code_verifier ? { code_verifier } : {}),\n\t\t};\n\n\t\tlogger.debug(\n\t\t\t`Calling token endpoint: ${oAuthTokenEndpoint} with`,\n\t\t\toAuthTokenBody\n\t\t);\n\n\t\tconst body = Object.entries(oAuthTokenBody)\n\t\t\t.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n\t\t\t.join('&');\n\n\t\tconst {\n\t\t\taccess_token,\n\t\t\trefresh_token,\n\t\t\tid_token,\n\t\t\terror,\n\t\t} = await ((await fetch(oAuthTokenEndpoint, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t},\n\t\t\tbody,\n\t\t})) as any).json();\n\n\t\tif (error) {\n\t\t\tthrow new Error(error);\n\t\t}\n\n\t\treturn {\n\t\t\taccessToken: access_token,\n\t\t\trefreshToken: refresh_token,\n\t\t\tidToken: id_token,\n\t\t};\n\t}\n\n\tprivate async _handleImplicitFlow(currentUrl: string) {\n\t\t// hash is `null` if `#` doesn't exist on URL\n\t\tconst { id_token, access_token } = (parse(currentUrl).hash || '#')\n\t\t\t.substr(1) // Remove # from returned code\n\t\t\t.split('&')\n\t\t\t.map(pairings => pairings.split('='))\n\t\t\t.reduce((accum, [k, v]) => ({ ...accum, [k]: v }), {\n\t\t\t\tid_token: undefined,\n\t\t\t\taccess_token: undefined,\n\t\t\t});\n\n\t\tdispatchAuthEvent('implicitFlow', {}, `Got tokens from ${currentUrl}`);\n\t\tlogger.debug(`Retrieving implicit tokens from ${currentUrl} with`);\n\n\t\treturn {\n\t\t\taccessToken: access_token,\n\t\t\tidToken: id_token,\n\t\t\trefreshToken: null,\n\t\t};\n\t}\n\n\tpublic async handleAuthResponse(currentUrl?: string) {\n\t\ttry {\n\t\t\tconst urlParams = currentUrl\n\t\t\t\t? ({\n\t\t\t\t\t\t...(parse(currentUrl).hash || '#')\n\t\t\t\t\t\t\t.substr(1)\n\t\t\t\t\t\t\t.split('&')\n\t\t\t\t\t\t\t.map(entry => entry.split('='))\n\t\t\t\t\t\t\t.reduce((acc, [k, v]) => ((acc[k] = v), acc), {}),\n\t\t\t\t\t\t...(parse(currentUrl).query || '')\n\t\t\t\t\t\t\t.split('&')\n\t\t\t\t\t\t\t.map(entry => entry.split('='))\n\t\t\t\t\t\t\t.reduce((acc, [k, v]) => ((acc[k] = v), acc), {}),\n\t\t\t\t } as any)\n\t\t\t\t: {};\n\t\t\tconst { error, error_description } = urlParams;\n\n\t\t\tif (error) {\n\t\t\t\tthrow new Error(error_description);\n\t\t\t}\n\n\t\t\tconst state: string = this._validateState(urlParams);\n\n\t\t\tlogger.debug(\n\t\t\t\t`Starting ${this._config.responseType} flow with ${currentUrl}`\n\t\t\t);\n\t\t\tif (this._config.responseType === 'code') {\n\t\t\t\treturn { ...(await this._handleCodeFlow(currentUrl)), state };\n\t\t\t} else {\n\t\t\t\treturn { ...(await this._handleImplicitFlow(currentUrl)), state };\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tlogger.error(`Error handling auth response.`, e);\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tprivate _validateState(urlParams: any): string {\n\t\tif (!urlParams) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst savedState = oAuthStorage.getState();\n\t\tconst { state: returnedState } = urlParams;\n\n\t\t// This is because savedState only exists if the flow was initiated by Amplify\n\t\tif (savedState && savedState !== returnedState) {\n\t\t\tthrow new Error('Invalid state in OAuth flow');\n\t\t}\n\t\treturn returnedState;\n\t}\n\n\tpublic async signOut() {\n\t\tlet oAuthLogoutEndpoint = 'https://' + this._config.domain + '/logout?';\n\n\t\tconst client_id = isCognitoHostedOpts(this._config)\n\t\t\t? this._cognitoClientId\n\t\t\t: this._config.oauth.clientID;\n\n\t\tconst signout_uri = isCognitoHostedOpts(this._config)\n\t\t\t? this._config.redirectSignOut\n\t\t\t: this._config.returnTo;\n\n\t\toAuthLogoutEndpoint += Object.entries({\n\t\t\tclient_id,\n\t\t\tlogout_uri: encodeURIComponent(signout_uri),\n\t\t})\n\t\t\t.map(([k, v]) => `${k}=${v}`)\n\t\t\t.join('&');\n\n\t\tdispatchAuthEvent(\n\t\t\t'oAuthSignOut',\n\t\t\t{ oAuth: 'signOut' },\n\t\t\t`Signing out from ${oAuthLogoutEndpoint}`\n\t\t);\n\t\tlogger.debug(`Signing out from ${oAuthLogoutEndpoint}`);\n\n\t\treturn this._urlOpener(oAuthLogoutEndpoint, signout_uri);\n\t}\n\n\tprivate _generateState(length: number) {\n\t\tlet result = '';\n\t\tlet i = length;\n\t\tconst chars =\n\t\t\t'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\tfor (; i > 0; --i)\n\t\t\tresult += chars[Math.round(Math.random() * (chars.length - 1))];\n\t\treturn result;\n\t}\n\n\tprivate _generateChallenge(code: string) {\n\t\treturn this._base64URL(sha256(code));\n\t}\n\n\tprivate _base64URL(string) {\n\t\treturn string\n\t\t\t.toString(Base64)\n\t\t\t.replace(/=/g, '')\n\t\t\t.replace(/\\+/g, '-')\n\t\t\t.replace(/\\//g, '_');\n\t}\n\n\tprivate _generateRandom(size: number) {\n\t\tconst CHARSET =\n\t\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n\t\tconst buffer = new Uint8Array(size);\n\t\tif (typeof window !== 'undefined' && !!window.crypto) {\n\t\t\twindow.crypto.getRandomValues(buffer);\n\t\t} else {\n\t\t\tfor (let i = 0; i < size; i += 1) {\n\t\t\t\tbuffer[i] = (Math.random() * CHARSET.length) | 0;\n\t\t\t}\n\t\t}\n\t\treturn this._bufferToString(buffer);\n\t}\n\n\tprivate _bufferToString(buffer: Uint8Array) {\n\t\tconst CHARSET =\n\t\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\tconst state = [];\n\t\tfor (let i = 0; i < buffer.byteLength; i += 1) {\n\t\t\tconst index = buffer[i] % CHARSET.length;\n\t\t\tstate.push(CHARSET[index]);\n\t\t}\n\t\treturn state.join('');\n\t}\n}\n","export function urlSafeEncode(str: string) {\n\treturn str\n\t\t.split('')\n\t\t.map(char =>\n\t\t\tchar\n\t\t\t\t.charCodeAt(0)\n\t\t\t\t.toString(16)\n\t\t\t\t.padStart(2, '0')\n\t\t)\n\t\t.join('');\n}\n\nexport function urlSafeDecode(hex: string) {\n\treturn hex\n\t\t.match(/.{2}/g)\n\t\t.map(char => String.fromCharCode(parseInt(char, 16)))\n\t\t.join('');\n}\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nexport const setState = (state: string) => {\n\twindow.sessionStorage.setItem('oauth_state', state);\n};\n\nexport const getState = () => {\n\tconst oauth_state = window.sessionStorage.getItem('oauth_state');\n\twindow.sessionStorage.removeItem('oauth_state');\n\treturn oauth_state;\n};\n\nexport const setPKCE = (private_key: string) => {\n\twindow.sessionStorage.setItem('ouath_pkce_key', private_key);\n};\n\nexport const getPKCE = () => {\n\tconst ouath_pkce_key = window.sessionStorage.getItem('ouath_pkce_key');\n\twindow.sessionStorage.removeItem('ouath_pkce_key');\n\treturn ouath_pkce_key;\n};\n\nexport const clearAll = () => {\n\twindow.sessionStorage.removeItem('ouath_pkce_key');\n\twindow.sessionStorage.removeItem('oauth_state');\n};\n","export enum AuthErrorStrings {\n\tDEFAULT_MSG = 'Authentication Error',\n\tEMPTY_EMAIL = 'Email cannot be empty',\n\tEMPTY_PHONE = 'Phone number cannot be empty',\n\tEMPTY_USERNAME = 'Username cannot be empty',\n\tINVALID_USERNAME = 'The username should either be a string or one of the sign in types',\n\tEMPTY_PASSWORD = 'Password cannot be empty',\n\tEMPTY_CODE = 'Confirmation code cannot be empty',\n\tSIGN_UP_ERROR = 'Error creating account',\n\tNO_MFA = 'No valid MFA method provided',\n\tINVALID_MFA = 'Invalid MFA type',\n\tEMPTY_CHALLENGE = 'Challenge response cannot be empty',\n\tNO_USER_SESSION = 'Failed to get the session because the user is empty',\n\tNETWORK_ERROR = 'Network Error',\n\tDEVICE_CONFIG = 'Device tracking has not been configured in this User Pool',\n\tAUTOSIGNIN_ERROR = 'Please use your credentials to sign in',\n}\n","/*\n * Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nimport { AuthErrorMessages, AuthErrorTypes } from './types';\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\nimport { AuthErrorStrings } from './common/AuthErrorStrings';\n\nconst logger = new Logger('AuthError');\n\nexport class AuthError extends Error {\n\tpublic log: string;\n\tconstructor(type: AuthErrorTypes) {\n\t\tconst { message, log } = authErrorMessages[type];\n\t\tsuper(message);\n\n\t\t// Hack for making the custom error class work when transpiled to es5\n\t\t// TODO: Delete the following 2 lines after we change the build target to >= es2015\n\t\tthis.constructor = AuthError;\n\t\tObject.setPrototypeOf(this, AuthError.prototype);\n\n\t\tthis.name = 'AuthError';\n\t\tthis.log = log || message;\n\n\t\tlogger.error(this.log);\n\t}\n}\n\nexport class NoUserPoolError extends AuthError {\n\tconstructor(type: AuthErrorTypes) {\n\t\tsuper(type);\n\n\t\t// Hack for making the custom error class work when transpiled to es5\n\t\t// TODO: Delete the following 2 lines after we change the build target to >= es2015\n\t\tthis.constructor = NoUserPoolError;\n\t\tObject.setPrototypeOf(this, NoUserPoolError.prototype);\n\n\t\tthis.name = 'NoUserPoolError';\n\t}\n}\n\nexport const authErrorMessages: AuthErrorMessages = {\n\tnoConfig: {\n\t\tmessage: AuthErrorStrings.DEFAULT_MSG,\n\t\tlog: `\n Error: Amplify has not been configured correctly.\n This error is typically caused by one of the following scenarios:\n\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n \n 2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n `,\n\t},\n\tmissingAuthConfig: {\n\t\tmessage: AuthErrorStrings.DEFAULT_MSG,\n\t\tlog: `\n Error: Amplify has not been configured correctly. \n The configuration object is missing required auth properties.\n This error is typically caused by one of the following scenarios:\n\n 1. Did you run \\`amplify push\\` after adding auth via \\`amplify add auth\\`?\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\n `,\n\t},\n\temptyUsername: {\n\t\tmessage: AuthErrorStrings.EMPTY_USERNAME,\n\t},\n\t// TODO: should include a list of valid sign-in types\n\tinvalidUsername: {\n\t\tmessage: AuthErrorStrings.INVALID_USERNAME,\n\t},\n\temptyPassword: {\n\t\tmessage: AuthErrorStrings.EMPTY_PASSWORD,\n\t},\n\temptyCode: {\n\t\tmessage: AuthErrorStrings.EMPTY_CODE,\n\t},\n\tsignUpError: {\n\t\tmessage: AuthErrorStrings.SIGN_UP_ERROR,\n\t\tlog: 'The first parameter should either be non-null string or object',\n\t},\n\tnoMFA: {\n\t\tmessage: AuthErrorStrings.NO_MFA,\n\t},\n\tinvalidMFA: {\n\t\tmessage: AuthErrorStrings.INVALID_MFA,\n\t},\n\temptyChallengeResponse: {\n\t\tmessage: AuthErrorStrings.EMPTY_CHALLENGE,\n\t},\n\tnoUserSession: {\n\t\tmessage: AuthErrorStrings.NO_USER_SESSION,\n\t},\n\tdeviceConfig: {\n\t\tmessage: AuthErrorStrings.DEVICE_CONFIG,\n\t},\n\tnetworkError: {\n\t\tmessage: AuthErrorStrings.NETWORK_ERROR,\n\t},\n\tautoSignInError: {\n\t\tmessage: AuthErrorStrings.AUTOSIGNIN_ERROR,\n\t},\n\tdefault: {\n\t\tmessage: AuthErrorStrings.DEFAULT_MSG,\n\t},\n};\n","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n *\t http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nimport {\n\tAuthOptions,\n\tFederatedResponse,\n\tSignUpParams,\n\tFederatedUser,\n\tConfirmSignUpOptions,\n\tSignOutOpts,\n\tCurrentUserOpts,\n\tGetPreferredMFAOpts,\n\tSignInOpts,\n\tisUsernamePasswordOpts,\n\tisCognitoHostedOpts,\n\tisFederatedSignInOptions,\n\tisFederatedSignInOptionsCustom,\n\thasCustomState,\n\tFederatedSignInOptionsCustom,\n\tLegacyProvider,\n\tFederatedSignInOptions,\n\tAwsCognitoOAuthOpts,\n\tClientMetaData,\n} from './types';\n\nimport {\n\tAmplify,\n\tConsoleLogger as Logger,\n\tCredentials,\n\tHub,\n\tStorageHelper,\n\tICredentials,\n\tParser,\n\tbrowserOrNode,\n\tUniversalStorage,\n\turlSafeDecode,\n\tHubCallback,\n} from '@aws-amplify/core';\nimport {\n\tCookieStorage,\n\tCognitoUserPool,\n\tAuthenticationDetails,\n\tICognitoUserPoolData,\n\tICognitoUserData,\n\tISignUpResult,\n\tCognitoUser,\n\tMFAOption,\n\tCognitoUserSession,\n\tIAuthenticationCallback,\n\tICognitoUserAttributeData,\n\tCognitoUserAttribute,\n\tCognitoIdToken,\n\tCognitoRefreshToken,\n\tCognitoAccessToken,\n\tNodeCallback,\n} from 'amazon-cognito-identity-js';\n\nimport { parse } from 'url';\nimport OAuth from './OAuth/OAuth';\nimport { default as urlListener } from './urlListener';\nimport { AuthError, NoUserPoolError } from './Errors';\nimport {\n\tAuthErrorTypes,\n\tAutoSignInOptions,\n\tCognitoHostedUIIdentityProvider,\n\tIAuthDevice,\n} from './types/Auth';\n\nconst logger = new Logger('AuthClass');\nconst USER_ADMIN_SCOPE = 'aws.cognito.signin.user.admin';\n\n// 10 sec, following this guide https://www.nngroup.com/articles/response-times-3-important-limits/\nconst OAUTH_FLOW_MS_TIMEOUT = 10 * 1000;\n\nconst AMPLIFY_SYMBOL = (\n\ttypeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n\t\t? Symbol.for('amplify_default')\n\t\t: '@@amplify_default'\n) as Symbol;\n\nconst dispatchAuthEvent = (event: string, data: any, message: string) => {\n\tHub.dispatch('auth', { event, data, message }, 'Auth', AMPLIFY_SYMBOL);\n};\n\n// Cognito Documentation for max device\n// tslint:disable-next-line:max-line-length\n// https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListDevices.html#API_ListDevices_RequestSyntax\nconst MAX_DEVICES = 60;\n\nconst MAX_AUTOSIGNIN_POLLING_MS = 3 * 60 * 1000;\n\n/**\n * Provide authentication steps\n */\nexport class AuthClass {\n\tprivate _config: AuthOptions;\n\tprivate userPool: CognitoUserPool = null;\n\tprivate user: any = null;\n\tprivate _oAuthHandler: OAuth;\n\tprivate _storage;\n\tprivate _storageSync;\n\tprivate oAuthFlowInProgress: boolean = false;\n\tprivate pendingSignIn: ReturnType | null;\n\tprivate autoSignInInitiated: boolean = false;\n\n\tCredentials = Credentials;\n\n\t/**\n\t * Initialize Auth with AWS configurations\n\t * @param {Object} config - Configuration of the Auth\n\t */\n\tconstructor(config: AuthOptions) {\n\t\tthis.configure(config);\n\t\tthis.currentCredentials = this.currentCredentials.bind(this);\n\t\tthis.currentUserCredentials = this.currentUserCredentials.bind(this);\n\n\t\tHub.listen('auth', ({ payload }) => {\n\t\t\tconst { event } = payload;\n\t\t\tswitch (event) {\n\t\t\t\tcase 'signIn':\n\t\t\t\t\tthis._storage.setItem('amplify-signin-with-hostedUI', 'false');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'signOut':\n\t\t\t\t\tthis._storage.removeItem('amplify-signin-with-hostedUI');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cognitoHostedUI':\n\t\t\t\t\tthis._storage.setItem('amplify-signin-with-hostedUI', 'true');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic getModuleName() {\n\t\treturn 'Auth';\n\t}\n\n\tconfigure(config?) {\n\t\tif (!config) return this._config || {};\n\t\tlogger.debug('configure Auth');\n\t\tconst conf = Object.assign(\n\t\t\t{},\n\t\t\tthis._config,\n\t\t\tParser.parseMobilehubConfig(config).Auth,\n\t\t\tconfig\n\t\t);\n\t\tthis._config = conf;\n\t\tconst {\n\t\t\tuserPoolId,\n\t\t\tuserPoolWebClientId,\n\t\t\tcookieStorage,\n\t\t\toauth,\n\t\t\tregion,\n\t\t\tidentityPoolId,\n\t\t\tmandatorySignIn,\n\t\t\trefreshHandlers,\n\t\t\tidentityPoolRegion,\n\t\t\tclientMetadata,\n\t\t\tendpoint,\n\t\t} = this._config;\n\n\t\tif (!this._config.storage) {\n\t\t\t// backward compatability\n\t\t\tif (cookieStorage) this._storage = new CookieStorage(cookieStorage);\n\t\t\telse {\n\t\t\t\tthis._storage = config.ssr\n\t\t\t\t\t? new UniversalStorage()\n\t\t\t\t\t: new StorageHelper().getStorage();\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this._isValidAuthStorage(this._config.storage)) {\n\t\t\t\tlogger.error('The storage in the Auth config is not valid!');\n\t\t\t\tthrow new Error('Empty storage object');\n\t\t\t}\n\t\t\tthis._storage = this._config.storage;\n\t\t}\n\n\t\tthis._storageSync = Promise.resolve();\n\t\tif (typeof this._storage['sync'] === 'function') {\n\t\t\tthis._storageSync = this._storage['sync']();\n\t\t}\n\n\t\tif (userPoolId) {\n\t\t\tconst userPoolData: ICognitoUserPoolData = {\n\t\t\t\tUserPoolId: userPoolId,\n\t\t\t\tClientId: userPoolWebClientId,\n\t\t\t\tendpoint,\n\t\t\t};\n\t\t\tuserPoolData.Storage = this._storage;\n\n\t\t\tthis.userPool = new CognitoUserPool(\n\t\t\t\tuserPoolData,\n\t\t\t\tthis.wrapRefreshSessionCallback\n\t\t\t);\n\t\t}\n\n\t\tthis.Credentials.configure({\n\t\t\tmandatorySignIn,\n\t\t\tregion: identityPoolRegion || region,\n\t\t\tuserPoolId,\n\t\t\tidentityPoolId,\n\t\t\trefreshHandlers,\n\t\t\tstorage: this._storage,\n\t\t});\n\n\t\t// initialize cognitoauth client if hosted ui options provided\n\t\t// to keep backward compatibility:\n\t\tconst cognitoHostedUIConfig = oauth\n\t\t\t? isCognitoHostedOpts(this._config.oauth)\n\t\t\t\t? oauth\n\t\t\t\t: (oauth).awsCognito\n\t\t\t: undefined;\n\n\t\tif (cognitoHostedUIConfig) {\n\t\t\tconst cognitoAuthParams = Object.assign(\n\t\t\t\t{\n\t\t\t\t\tcognitoClientId: userPoolWebClientId,\n\t\t\t\t\tUserPoolId: userPoolId,\n\t\t\t\t\tdomain: cognitoHostedUIConfig['domain'],\n\t\t\t\t\tscopes: cognitoHostedUIConfig['scope'],\n\t\t\t\t\tredirectSignIn: cognitoHostedUIConfig['redirectSignIn'],\n\t\t\t\t\tredirectSignOut: cognitoHostedUIConfig['redirectSignOut'],\n\t\t\t\t\tresponseType: cognitoHostedUIConfig['responseType'],\n\t\t\t\t\tStorage: this._storage,\n\t\t\t\t\turlOpener: cognitoHostedUIConfig['urlOpener'],\n\t\t\t\t\tclientMetadata,\n\t\t\t\t},\n\t\t\t\tcognitoHostedUIConfig['options']\n\t\t\t);\n\n\t\t\tthis._oAuthHandler = new OAuth({\n\t\t\t\tscopes: cognitoAuthParams.scopes,\n\t\t\t\tconfig: cognitoAuthParams,\n\t\t\t\tcognitoClientId: cognitoAuthParams.cognitoClientId,\n\t\t\t});\n\n\t\t\t// **NOTE** - Remove this in a future major release as it is a breaking change\n\t\t\t// Prevents _handleAuthResponse from being called multiple times in Expo\n\t\t\t// See https://github.com/aws-amplify/amplify-js/issues/4388\n\t\t\tconst usedResponseUrls = {};\n\t\t\turlListener(({ url }) => {\n\t\t\t\tif (usedResponseUrls[url]) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tusedResponseUrls[url] = true;\n\t\t\t\tthis._handleAuthResponse(url);\n\t\t\t});\n\t\t}\n\n\t\tdispatchAuthEvent(\n\t\t\t'configured',\n\t\t\tnull,\n\t\t\t`The Auth category has been configured successfully`\n\t\t);\n\n\t\tif (\n\t\t\t!this.autoSignInInitiated &&\n\t\t\ttypeof this._storage['getItem'] === 'function'\n\t\t) {\n\t\t\tconst pollingInitiated = this.isTrueStorageValue(\n\t\t\t\t'amplify-polling-started'\n\t\t\t);\n\t\t\tif (pollingInitiated) {\n\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t'autoSignIn_failure',\n\t\t\t\t\tnull,\n\t\t\t\t\tAuthErrorTypes.AutoSignInError\n\t\t\t\t);\n\t\t\t\tthis._storage.removeItem('amplify-auto-sign-in');\n\t\t\t}\n\t\t\tthis._storage.removeItem('amplify-polling-started');\n\t\t}\n\t\treturn this._config;\n\t}\n\n\twrapRefreshSessionCallback = (callback: NodeCallback.Any) => {\n\t\tconst wrapped: NodeCallback.Any = (error, data) => {\n\t\t\tif (data) {\n\t\t\t\tdispatchAuthEvent('tokenRefresh', undefined, `New token retrieved`);\n\t\t\t} else {\n\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t'tokenRefresh_failure',\n\t\t\t\t\terror,\n\t\t\t\t\t`Failed to retrieve new token`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn callback(error, data);\n\t\t};\n\t\treturn wrapped;\n\t} // prettier-ignore\n\n\t/**\n\t * Sign up with username, password and other attributes like phone, email\n\t * @param {String | object} params - The user attributes used for signin\n\t * @param {String[]} restOfAttrs - for the backward compatability\n\t * @return - A promise resolves callback data if success\n\t */\n\tpublic signUp(\n\t\tparams: string | SignUpParams,\n\t\t...restOfAttrs: string[]\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\n\t\tlet username: string = null;\n\t\tlet password: string = null;\n\t\tconst attributes: CognitoUserAttribute[] = [];\n\t\tlet validationData: CognitoUserAttribute[] = null;\n\t\tlet clientMetadata;\n\t\tlet autoSignIn: AutoSignInOptions = { enabled: false };\n\t\tlet autoSignInValidationData = {};\n\t\tlet autoSignInClientMetaData: ClientMetaData = {};\n\n\t\tif (params && typeof params === 'string') {\n\t\t\tusername = params;\n\t\t\tpassword = restOfAttrs ? restOfAttrs[0] : null;\n\t\t\tconst email: string = restOfAttrs ? restOfAttrs[1] : null;\n\t\t\tconst phone_number: string = restOfAttrs ? restOfAttrs[2] : null;\n\n\t\t\tif (email)\n\t\t\t\tattributes.push(\n\t\t\t\t\tnew CognitoUserAttribute({ Name: 'email', Value: email })\n\t\t\t\t);\n\n\t\t\tif (phone_number)\n\t\t\t\tattributes.push(\n\t\t\t\t\tnew CognitoUserAttribute({\n\t\t\t\t\t\tName: 'phone_number',\n\t\t\t\t\t\tValue: phone_number,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t} else if (params && typeof params === 'object') {\n\t\t\tusername = params['username'];\n\t\t\tpassword = params['password'];\n\n\t\t\tif (params && params.clientMetadata) {\n\t\t\t\tclientMetadata = params.clientMetadata;\n\t\t\t} else if (this._config.clientMetadata) {\n\t\t\t\tclientMetadata = this._config.clientMetadata;\n\t\t\t}\n\n\t\t\tconst attrs = params['attributes'];\n\t\t\tif (attrs) {\n\t\t\t\tObject.keys(attrs).map(key => {\n\t\t\t\t\tattributes.push(\n\t\t\t\t\t\tnew CognitoUserAttribute({ Name: key, Value: attrs[key] })\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst validationDataObject = params['validationData'];\n\t\t\tif (validationDataObject) {\n\t\t\t\tvalidationData = [];\n\t\t\t\tObject.keys(validationDataObject).map(key => {\n\t\t\t\t\tvalidationData.push(\n\t\t\t\t\t\tnew CognitoUserAttribute({\n\t\t\t\t\t\t\tName: key,\n\t\t\t\t\t\t\tValue: validationDataObject[key],\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tautoSignIn = params.autoSignIn ?? { enabled: false };\n\t\t\tif (autoSignIn.enabled) {\n\t\t\t\tthis._storage.setItem('amplify-auto-sign-in', 'true');\n\t\t\t\tautoSignInValidationData = autoSignIn.validationData ?? {};\n\t\t\t\tautoSignInClientMetaData = autoSignIn.clientMetaData ?? {};\n\t\t\t}\n\t\t} else {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.SignUpError);\n\t\t}\n\n\t\tif (!username) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n\t\t}\n\t\tif (!password) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n\t\t}\n\n\t\tlogger.debug('signUp attrs:', attributes);\n\t\tlogger.debug('signUp validation data:', validationData);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.userPool.signUp(\n\t\t\t\tusername,\n\t\t\t\tpassword,\n\t\t\t\tattributes,\n\t\t\t\tvalidationData,\n\t\t\t\t(err, data) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'signUp_failure',\n\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\t`${username} failed to signup`\n\t\t\t\t\t\t);\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'signUp',\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t`${username} has signed up successfully`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (autoSignIn.enabled) {\n\t\t\t\t\t\t\tthis.handleAutoSignIn(\n\t\t\t\t\t\t\t\tusername,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tautoSignInValidationData,\n\t\t\t\t\t\t\t\tautoSignInClientMetaData,\n\t\t\t\t\t\t\t\tdata\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate handleAutoSignIn(\n\t\tusername: string,\n\t\tpassword: string,\n\t\tvalidationData: {},\n\t\tclientMetadata: any,\n\t\tdata: any\n\t) {\n\t\tthis.autoSignInInitiated = true;\n\t\tconst authDetails = new AuthenticationDetails({\n\t\t\tUsername: username,\n\t\t\tPassword: password,\n\t\t\tValidationData: validationData,\n\t\t\tClientMetadata: clientMetadata,\n\t\t});\n\t\tif (data.userConfirmed) {\n\t\t\tthis.signInAfterUserConfirmed(authDetails);\n\t\t} else if (this._config.signUpVerificationMethod === 'link') {\n\t\t\tthis.handleLinkAutoSignIn(authDetails);\n\t\t} else {\n\t\t\tthis.handleCodeAutoSignIn(authDetails);\n\t\t}\n\t}\n\n\tprivate handleCodeAutoSignIn(authDetails: AuthenticationDetails) {\n\t\tconst listenEvent = ({ payload }) => {\n\t\t\tif (payload.event === 'confirmSignUp') {\n\t\t\t\tthis.signInAfterUserConfirmed(authDetails, listenEvent);\n\t\t\t}\n\t\t};\n\t\tHub.listen('auth', listenEvent);\n\t}\n\n\tprivate handleLinkAutoSignIn(authDetails: AuthenticationDetails) {\n\t\tthis._storage.setItem('amplify-polling-started', 'true');\n\t\tconst start = Date.now();\n\t\tconst autoSignInPollingIntervalId = setInterval(() => {\n\t\t\tif (Date.now() - start > MAX_AUTOSIGNIN_POLLING_MS) {\n\t\t\t\tclearInterval(autoSignInPollingIntervalId);\n\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t'autoSignIn_failure',\n\t\t\t\t\tnull,\n\t\t\t\t\t'Please confirm your account and use your credentials to sign in.'\n\t\t\t\t);\n\t\t\t\tthis._storage.removeItem('amplify-auto-sign-in');\n\t\t\t} else {\n\t\t\t\tthis.signInAfterUserConfirmed(\n\t\t\t\t\tauthDetails,\n\t\t\t\t\tnull,\n\t\t\t\t\tautoSignInPollingIntervalId\n\t\t\t\t);\n\t\t\t}\n\t\t}, 5000);\n\t}\n\n\tprivate async signInAfterUserConfirmed(\n\t\tauthDetails: AuthenticationDetails,\n\t\tlistenEvent?: HubCallback,\n\t\tautoSignInPollingIntervalId?: ReturnType\n\t) {\n\t\tconst user = this.createCognitoUser(authDetails.getUsername());\n\t\ttry {\n\t\t\tawait user.authenticateUser(\n\t\t\t\tauthDetails,\n\t\t\t\tthis.authCallbacks(\n\t\t\t\t\tuser,\n\t\t\t\t\tvalue => {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'autoSignIn',\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t`${authDetails.getUsername()} has signed in successfully`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (listenEvent) {\n\t\t\t\t\t\t\tHub.remove('auth', listenEvent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (autoSignInPollingIntervalId) {\n\t\t\t\t\t\t\tclearInterval(autoSignInPollingIntervalId);\n\t\t\t\t\t\t\tthis._storage.removeItem('amplify-polling-started');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._storage.removeItem('amplify-auto-sign-in');\n\t\t\t\t\t},\n\t\t\t\t\terror => {\n\t\t\t\t\t\tlogger.error(error);\n\t\t\t\t\t\tthis._storage.removeItem('amplify-auto-sign-in');\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tlogger.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Send the verification code to confirm sign up\n\t * @param {String} username - The username to be confirmed\n\t * @param {String} code - The verification code\n\t * @param {ConfirmSignUpOptions} options - other options for confirm signup\n\t * @return - A promise resolves callback data if success\n\t */\n\tpublic confirmSignUp(\n\t\tusername: string,\n\t\tcode: string,\n\t\toptions?: ConfirmSignUpOptions\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\t\tif (!username) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n\t\t}\n\t\tif (!code) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyCode);\n\t\t}\n\n\t\tconst user = this.createCognitoUser(username);\n\t\tconst forceAliasCreation =\n\t\t\toptions && typeof options.forceAliasCreation === 'boolean'\n\t\t\t\t? options.forceAliasCreation\n\t\t\t\t: true;\n\n\t\tlet clientMetadata;\n\t\tif (options && options.clientMetadata) {\n\t\t\tclientMetadata = options.clientMetadata;\n\t\t} else if (this._config.clientMetadata) {\n\t\t\tclientMetadata = this._config.clientMetadata;\n\t\t}\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.confirmRegistration(\n\t\t\t\tcode,\n\t\t\t\tforceAliasCreation,\n\t\t\t\t(err, data) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'confirmSignUp',\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t`${username} has been confirmed successfully`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst autoSignIn = this.isTrueStorageValue('amplify-auto-sign-in');\n\t\t\t\t\t\tif (autoSignIn && !this.autoSignInInitiated) {\n\t\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t\t'autoSignIn_failure',\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tAuthErrorTypes.AutoSignInError\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tthis._storage.removeItem('amplify-auto-sign-in');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate isTrueStorageValue(value: string) {\n\t\tconst item = this._storage.getItem(value);\n\t\treturn item ? item === 'true' : false;\n\t}\n\n\t/**\n\t * Resend the verification code\n\t * @param {String} username - The username to be confirmed\n\t * @param {ClientMetadata} clientMetadata - Metadata to be passed to Cognito Lambda triggers\n\t * @return - A promise resolves code delivery details if successful\n\t */\n\tpublic resendSignUp(\n\t\tusername: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\t\tif (!username) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n\t\t}\n\n\t\tconst user = this.createCognitoUser(username);\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.resendConfirmationCode((err, data) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(data);\n\t\t\t\t}\n\t\t\t}, clientMetadata);\n\t\t});\n\t}\n\n\t/**\n\t * Sign in\n\t * @param {String | SignInOpts} usernameOrSignInOpts - The username to be signed in or the sign in options\n\t * @param {String} pw - The password of the username\n\t * @param {ClientMetaData} clientMetadata - Client metadata for custom workflows\n\t * @return - A promise resolves the CognitoUser\n\t */\n\tpublic signIn(\n\t\tusernameOrSignInOpts: string | SignInOpts,\n\t\tpw?: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\n\t\tlet username = null;\n\t\tlet password = null;\n\t\tlet validationData = {};\n\n\t\t// for backward compatibility\n\t\tif (typeof usernameOrSignInOpts === 'string') {\n\t\t\tusername = usernameOrSignInOpts;\n\t\t\tpassword = pw;\n\t\t} else if (isUsernamePasswordOpts(usernameOrSignInOpts)) {\n\t\t\tif (typeof pw !== 'undefined') {\n\t\t\t\tlogger.warn(\n\t\t\t\t\t'The password should be defined under the first parameter object!'\n\t\t\t\t);\n\t\t\t}\n\t\t\tusername = usernameOrSignInOpts.username;\n\t\t\tpassword = usernameOrSignInOpts.password;\n\t\t\tvalidationData = usernameOrSignInOpts.validationData;\n\t\t} else {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.InvalidUsername);\n\t\t}\n\t\tif (!username) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n\t\t}\n\t\tconst authDetails = new AuthenticationDetails({\n\t\t\tUsername: username,\n\t\t\tPassword: password,\n\t\t\tValidationData: validationData,\n\t\t\tClientMetadata: clientMetadata,\n\t\t});\n\t\tif (password) {\n\t\t\treturn this.signInWithPassword(authDetails);\n\t\t} else {\n\t\t\treturn this.signInWithoutPassword(authDetails);\n\t\t}\n\t}\n\n\t/**\n\t * Return an object with the authentication callbacks\n\t * @param {CognitoUser} user - the cognito user object\n\t * @param {} resolve - function called when resolving the current step\n\t * @param {} reject - function called when rejecting the current step\n\t * @return - an object with the callback methods for user authentication\n\t */\n\tprivate authCallbacks(\n\t\tuser: CognitoUser,\n\t\tresolve: (value?: CognitoUser | any) => void,\n\t\treject: (value?: any) => void\n\t): IAuthenticationCallback {\n\t\tconst that = this;\n\t\treturn {\n\t\t\tonSuccess: async session => {\n\t\t\t\tlogger.debug(session);\n\t\t\t\tdelete user['challengeName'];\n\t\t\t\tdelete user['challengeParam'];\n\t\t\t\ttry {\n\t\t\t\t\tawait this.Credentials.clear();\n\t\t\t\t\tconst cred = await this.Credentials.set(session, 'session');\n\t\t\t\t\tlogger.debug('succeed to get cognito credentials', cred);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tlogger.debug('cannot get cognito credentials', e);\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// In order to get user attributes and MFA methods\n\t\t\t\t\t\t// We need to trigger currentUserPoolUser again\n\t\t\t\t\t\tconst currentUser = await this.currentUserPoolUser();\n\t\t\t\t\t\tthat.user = currentUser;\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'signIn',\n\t\t\t\t\t\t\tcurrentUser,\n\t\t\t\t\t\t\t`A user ${user.getUsername()} has been signed in`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresolve(currentUser);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlogger.error('Failed to get the signed in user', e);\n\t\t\t\t\t\treject(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonFailure: err => {\n\t\t\t\tlogger.debug('signIn failure', err);\n\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t'signIn_failure',\n\t\t\t\t\terr,\n\t\t\t\t\t`${user.getUsername()} failed to signin`\n\t\t\t\t);\n\t\t\t\treject(err);\n\t\t\t},\n\t\t\tcustomChallenge: challengeParam => {\n\t\t\t\tlogger.debug('signIn custom challenge answer required');\n\t\t\t\tuser['challengeName'] = 'CUSTOM_CHALLENGE';\n\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\tresolve(user);\n\t\t\t},\n\t\t\tmfaRequired: (challengeName, challengeParam) => {\n\t\t\t\tlogger.debug('signIn MFA required');\n\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\tresolve(user);\n\t\t\t},\n\t\t\tmfaSetup: (challengeName, challengeParam) => {\n\t\t\t\tlogger.debug('signIn mfa setup', challengeName);\n\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\tresolve(user);\n\t\t\t},\n\t\t\tnewPasswordRequired: (userAttributes, requiredAttributes) => {\n\t\t\t\tlogger.debug('signIn new password');\n\t\t\t\tuser['challengeName'] = 'NEW_PASSWORD_REQUIRED';\n\t\t\t\tuser['challengeParam'] = {\n\t\t\t\t\tuserAttributes,\n\t\t\t\t\trequiredAttributes,\n\t\t\t\t};\n\t\t\t\tresolve(user);\n\t\t\t},\n\t\t\ttotpRequired: (challengeName, challengeParam) => {\n\t\t\t\tlogger.debug('signIn totpRequired');\n\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\tresolve(user);\n\t\t\t},\n\t\t\tselectMFAType: (challengeName, challengeParam) => {\n\t\t\t\tlogger.debug('signIn selectMFAType', challengeName);\n\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\tresolve(user);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Sign in with a password\n\t * @private\n\t * @param {AuthenticationDetails} authDetails - the user sign in data\n\t * @return - A promise resolves the CognitoUser object if success or mfa required\n\t */\n\tprivate signInWithPassword(\n\t\tauthDetails: AuthenticationDetails\n\t): Promise {\n\t\tif (this.pendingSignIn) {\n\t\t\tthrow new Error('Pending sign-in attempt already in progress');\n\t\t}\n\n\t\tconst user = this.createCognitoUser(authDetails.getUsername());\n\n\t\tthis.pendingSignIn = new Promise((resolve, reject) => {\n\t\t\tuser.authenticateUser(\n\t\t\t\tauthDetails,\n\t\t\t\tthis.authCallbacks(\n\t\t\t\t\tuser,\n\t\t\t\t\tvalue => {\n\t\t\t\t\t\tthis.pendingSignIn = null;\n\t\t\t\t\t\tresolve(value);\n\t\t\t\t\t},\n\t\t\t\t\terror => {\n\t\t\t\t\t\tthis.pendingSignIn = null;\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\n\t\treturn this.pendingSignIn;\n\t}\n\n\t/**\n\t * Sign in without a password\n\t * @private\n\t * @param {AuthenticationDetails} authDetails - the user sign in data\n\t * @return - A promise resolves the CognitoUser object if success or mfa required\n\t */\n\tprivate signInWithoutPassword(\n\t\tauthDetails: AuthenticationDetails\n\t): Promise {\n\t\tconst user = this.createCognitoUser(authDetails.getUsername());\n\t\tuser.setAuthenticationFlowType('CUSTOM_AUTH');\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.initiateAuth(authDetails, this.authCallbacks(user, resolve, reject));\n\t\t});\n\t}\n\n\t/**\n\t * This was previously used by an authenticated user to get MFAOptions,\n\t * but no longer returns a meaningful response. Refer to the documentation for\n\t * how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js\n\t * @deprecated\n\t * @param {CognitoUser} user - the current user\n\t * @return - A promise resolves the current preferred mfa option if success\n\t */\n\tpublic getMFAOptions(user: CognitoUser | any): Promise {\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.getMFAOptions((err, mfaOptions) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tlogger.debug('get MFA Options failed', err);\n\t\t\t\t\trej(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlogger.debug('get MFA options success', mfaOptions);\n\t\t\t\tres(mfaOptions);\n\t\t\t\treturn;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * get preferred mfa method\n\t * @param {CognitoUser} user - the current cognito user\n\t * @param {GetPreferredMFAOpts} params - options for getting the current user preferred MFA\n\t */\n\tpublic getPreferredMFA(\n\t\tuser: CognitoUser | any,\n\t\tparams?: GetPreferredMFAOpts\n\t): Promise {\n\t\tconst that = this;\n\t\treturn new Promise((res, rej) => {\n\t\t\tconst clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n\n\t\t\tconst bypassCache = params ? params.bypassCache : false;\n\t\t\tuser.getUserData(\n\t\t\t\tasync (err, data) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tlogger.debug('getting preferred mfa failed', err);\n\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trej(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst mfaType = that._getMfaTypeFromUserData(data);\n\t\t\t\t\tif (!mfaType) {\n\t\t\t\t\t\trej('invalid MFA Type');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tres(mfaType);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ bypassCache, clientMetadata }\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate _getMfaTypeFromUserData(data) {\n\t\tlet ret = null;\n\t\tconst preferredMFA = data.PreferredMfaSetting;\n\t\t// if the user has used Auth.setPreferredMFA() to setup the mfa type\n\t\t// then the \"PreferredMfaSetting\" would exist in the response\n\t\tif (preferredMFA) {\n\t\t\tret = preferredMFA;\n\t\t} else {\n\t\t\t// if mfaList exists but empty, then its noMFA\n\t\t\tconst mfaList = data.UserMFASettingList;\n\t\t\tif (!mfaList) {\n\t\t\t\t// if SMS was enabled by using Auth.enableSMS(),\n\t\t\t\t// the response would contain MFAOptions\n\t\t\t\t// as for now Cognito only supports for SMS, so we will say it is 'SMS_MFA'\n\t\t\t\t// if it does not exist, then it should be NOMFA\n\t\t\t\tconst MFAOptions = data.MFAOptions;\n\t\t\t\tif (MFAOptions) {\n\t\t\t\t\tret = 'SMS_MFA';\n\t\t\t\t} else {\n\t\t\t\t\tret = 'NOMFA';\n\t\t\t\t}\n\t\t\t} else if (mfaList.length === 0) {\n\t\t\t\tret = 'NOMFA';\n\t\t\t} else {\n\t\t\t\tlogger.debug('invalid case for getPreferredMFA', data);\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprivate _getUserData(user, params) {\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.getUserData(async (err, data) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tlogger.debug('getting user data failed', err);\n\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trej(err);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tres(data);\n\t\t\t\t}\n\t\t\t}, params);\n\t\t});\n\t}\n\n\t/**\n\t * set preferred MFA method\n\t * @param {CognitoUser} user - the current Cognito user\n\t * @param {string} mfaMethod - preferred mfa method\n\t * @return - A promise resolve if success\n\t */\n\tpublic async setPreferredMFA(\n\t\tuser: CognitoUser | any,\n\t\tmfaMethod: 'TOTP' | 'SMS' | 'NOMFA' | 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA'\n\t): Promise {\n\t\tconst clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n\n\t\tconst userData = await this._getUserData(user, {\n\t\t\tbypassCache: true,\n\t\t\tclientMetadata,\n\t\t});\n\t\tlet smsMfaSettings = null;\n\t\tlet totpMfaSettings = null;\n\n\t\tswitch (mfaMethod) {\n\t\t\tcase 'TOTP':\n\t\t\tcase 'SOFTWARE_TOKEN_MFA':\n\t\t\t\ttotpMfaSettings = {\n\t\t\t\t\tPreferredMfa: true,\n\t\t\t\t\tEnabled: true,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 'SMS':\n\t\t\tcase 'SMS_MFA':\n\t\t\t\tsmsMfaSettings = {\n\t\t\t\t\tPreferredMfa: true,\n\t\t\t\t\tEnabled: true,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 'NOMFA':\n\t\t\t\tconst mfaList = userData['UserMFASettingList'];\n\t\t\t\tconst currentMFAType = await this._getMfaTypeFromUserData(userData);\n\t\t\t\tif (currentMFAType === 'NOMFA') {\n\t\t\t\t\treturn Promise.resolve('No change for mfa type');\n\t\t\t\t} else if (currentMFAType === 'SMS_MFA') {\n\t\t\t\t\tsmsMfaSettings = {\n\t\t\t\t\t\tPreferredMfa: false,\n\t\t\t\t\t\tEnabled: false,\n\t\t\t\t\t};\n\t\t\t\t} else if (currentMFAType === 'SOFTWARE_TOKEN_MFA') {\n\t\t\t\t\ttotpMfaSettings = {\n\t\t\t\t\t\tPreferredMfa: false,\n\t\t\t\t\t\tEnabled: false,\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn this.rejectAuthError(AuthErrorTypes.InvalidMFA);\n\t\t\t\t}\n\t\t\t\t// if there is a UserMFASettingList in the response\n\t\t\t\t// we need to disable every mfa type in that list\n\t\t\t\tif (mfaList && mfaList.length !== 0) {\n\t\t\t\t\t// to disable SMS or TOTP if exists in that list\n\t\t\t\t\tmfaList.forEach(mfaType => {\n\t\t\t\t\t\tif (mfaType === 'SMS_MFA') {\n\t\t\t\t\t\t\tsmsMfaSettings = {\n\t\t\t\t\t\t\t\tPreferredMfa: false,\n\t\t\t\t\t\t\t\tEnabled: false,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if (mfaType === 'SOFTWARE_TOKEN_MFA') {\n\t\t\t\t\t\t\ttotpMfaSettings = {\n\t\t\t\t\t\t\t\tPreferredMfa: false,\n\t\t\t\t\t\t\t\tEnabled: false,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlogger.debug('no validmfa method provided');\n\t\t\t\treturn this.rejectAuthError(AuthErrorTypes.NoMFA);\n\t\t}\n\n\t\tconst that = this;\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.setUserMfaPreference(\n\t\t\t\tsmsMfaSettings,\n\t\t\t\ttotpMfaSettings,\n\t\t\t\t(err, result) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tlogger.debug('Set user mfa preference error', err);\n\t\t\t\t\t\treturn rej(err);\n\t\t\t\t\t}\n\t\t\t\t\tlogger.debug('Set user mfa success', result);\n\t\t\t\t\tlogger.debug('Caching the latest user data into local');\n\t\t\t\t\t// cache the latest result into user data\n\t\t\t\t\tuser.getUserData(\n\t\t\t\t\t\tasync (err, data) => {\n\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\tlogger.debug('getting user data failed', err);\n\t\t\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn rej(err);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn res(result);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbypassCache: true,\n\t\t\t\t\t\t\tclientMetadata,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * disable SMS\n\t * @deprecated\n\t * @param {CognitoUser} user - the current user\n\t * @return - A promise resolves is success\n\t */\n\tpublic disableSMS(user: CognitoUser): Promise {\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.disableMFA((err, data) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tlogger.debug('disable mfa failed', err);\n\t\t\t\t\trej(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlogger.debug('disable mfa succeed', data);\n\t\t\t\tres(data);\n\t\t\t\treturn;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * enable SMS\n\t * @deprecated\n\t * @param {CognitoUser} user - the current user\n\t * @return - A promise resolves is success\n\t */\n\tpublic enableSMS(user: CognitoUser): Promise {\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.enableMFA((err, data) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tlogger.debug('enable mfa failed', err);\n\t\t\t\t\trej(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlogger.debug('enable mfa succeed', data);\n\t\t\t\tres(data);\n\t\t\t\treturn;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Setup TOTP\n\t * @param {CognitoUser} user - the current user\n\t * @return - A promise resolves with the secret code if success\n\t */\n\tpublic setupTOTP(user: CognitoUser | any): Promise {\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.associateSoftwareToken({\n\t\t\t\tonFailure: err => {\n\t\t\t\t\tlogger.debug('associateSoftwareToken failed', err);\n\t\t\t\t\trej(err);\n\t\t\t\t\treturn;\n\t\t\t\t},\n\t\t\t\tassociateSecretCode: secretCode => {\n\t\t\t\t\tlogger.debug('associateSoftwareToken sucess', secretCode);\n\t\t\t\t\tres(secretCode);\n\t\t\t\t\treturn;\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * verify TOTP setup\n\t * @param {CognitoUser} user - the current user\n\t * @param {string} challengeAnswer - challenge answer\n\t * @return - A promise resolves is success\n\t */\n\tpublic verifyTotpToken(\n\t\tuser: CognitoUser | any,\n\t\tchallengeAnswer: string\n\t): Promise {\n\t\tlogger.debug('verification totp token', user, challengeAnswer);\n\t\treturn new Promise((res, rej) => {\n\t\t\tuser.verifySoftwareToken(challengeAnswer, 'My TOTP device', {\n\t\t\t\tonFailure: err => {\n\t\t\t\t\tlogger.debug('verifyTotpToken failed', err);\n\t\t\t\t\trej(err);\n\t\t\t\t\treturn;\n\t\t\t\t},\n\t\t\t\tonSuccess: data => {\n\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t'signIn',\n\t\t\t\t\t\tuser,\n\t\t\t\t\t\t`A user ${user.getUsername()} has been signed in`\n\t\t\t\t\t);\n\t\t\t\t\tlogger.debug('verifyTotpToken success', data);\n\t\t\t\t\tres(data);\n\t\t\t\t\treturn;\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Send MFA code to confirm sign in\n\t * @param {Object} user - The CognitoUser object\n\t * @param {String} code - The confirmation code\n\t */\n\tpublic confirmSignIn(\n\t\tuser: CognitoUser | any,\n\t\tcode: string,\n\t\tmfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | null,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!code) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyCode);\n\t\t}\n\n\t\tconst that = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.sendMFACode(\n\t\t\t\tcode,\n\t\t\t\t{\n\t\t\t\t\tonSuccess: async session => {\n\t\t\t\t\t\tlogger.debug(session);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait this.Credentials.clear();\n\t\t\t\t\t\t\tconst cred = await this.Credentials.set(session, 'session');\n\t\t\t\t\t\t\tlogger.debug('succeed to get cognito credentials', cred);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tlogger.debug('cannot get cognito credentials', e);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tthat.user = user;\n\n\t\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t\t'signIn',\n\t\t\t\t\t\t\t\tuser,\n\t\t\t\t\t\t\t\t`A user ${user.getUsername()} has been signed in`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tresolve(user);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonFailure: err => {\n\t\t\t\t\t\tlogger.debug('confirm signIn failure', err);\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tmfaType,\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\tpublic completeNewPassword(\n\t\tuser: CognitoUser | any,\n\t\tpassword: string,\n\t\trequiredAttributes: any = {},\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!password) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n\t\t}\n\n\t\tconst that = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.completeNewPasswordChallenge(\n\t\t\t\tpassword,\n\t\t\t\trequiredAttributes,\n\t\t\t\t{\n\t\t\t\t\tonSuccess: async session => {\n\t\t\t\t\t\tlogger.debug(session);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait this.Credentials.clear();\n\t\t\t\t\t\t\tconst cred = await this.Credentials.set(session, 'session');\n\t\t\t\t\t\t\tlogger.debug('succeed to get cognito credentials', cred);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tlogger.debug('cannot get cognito credentials', e);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tthat.user = user;\n\t\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t\t'signIn',\n\t\t\t\t\t\t\t\tuser,\n\t\t\t\t\t\t\t\t`A user ${user.getUsername()} has been signed in`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tresolve(user);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonFailure: err => {\n\t\t\t\t\t\tlogger.debug('completeNewPassword failure', err);\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'completeNewPassword_failure',\n\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\t`${this.user} failed to complete the new password flow`\n\t\t\t\t\t\t);\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t},\n\t\t\t\t\tmfaRequired: (challengeName, challengeParam) => {\n\t\t\t\t\t\tlogger.debug('signIn MFA required');\n\t\t\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\t\t\tresolve(user);\n\t\t\t\t\t},\n\t\t\t\t\tmfaSetup: (challengeName, challengeParam) => {\n\t\t\t\t\t\tlogger.debug('signIn mfa setup', challengeName);\n\t\t\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\t\t\tresolve(user);\n\t\t\t\t\t},\n\t\t\t\t\ttotpRequired: (challengeName, challengeParam) => {\n\t\t\t\t\t\tlogger.debug('signIn mfa setup', challengeName);\n\t\t\t\t\t\tuser['challengeName'] = challengeName;\n\t\t\t\t\t\tuser['challengeParam'] = challengeParam;\n\t\t\t\t\t\tresolve(user);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Send the answer to a custom challenge\n\t * @param {CognitoUser} user - The CognitoUser object\n\t * @param {String} challengeResponses - The confirmation code\n\t */\n\tpublic sendCustomChallengeAnswer(\n\t\tuser: CognitoUser | any,\n\t\tchallengeResponses: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\t\tif (!challengeResponses) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyChallengeResponse);\n\t\t}\n\n\t\tconst that = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.sendCustomChallengeAnswer(\n\t\t\t\tchallengeResponses,\n\t\t\t\tthis.authCallbacks(user, resolve, reject),\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Delete an authenticated users' attributes\n\t * @param {CognitoUser} - The currently logged in user object\n\t * @return {Promise}\n\t **/\n\tpublic deleteUserAttributes(\n\t\tuser: CognitoUser | any,\n\t\tattributeNames: string[]\n\t) {\n\t\tconst that = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthat.userSession(user).then(session => {\n\t\t\t\tuser.deleteAttributes(attributeNames, (err, result) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\treturn reject(err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn resolve(result);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Delete the current authenticated user\n\t * @return {Promise}\n\t **/\n\t// TODO: Check return type void\n\tpublic async deleteUser(): Promise {\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to sync cache info into memory', e);\n\t\t\tthrow new Error(e);\n\t\t}\n\n\t\tconst isSignedInHostedUI =\n\t\t\tthis._oAuthHandler &&\n\t\t\tthis._storage.getItem('amplify-signin-with-hostedUI') === 'true';\n\n\t\treturn new Promise(async (res, rej) => {\n\t\t\tif (this.userPool) {\n\t\t\t\tconst user = this.userPool.getCurrentUser();\n\n\t\t\t\tif (!user) {\n\t\t\t\t\tlogger.debug('Failed to get user from user pool');\n\t\t\t\t\treturn rej(new Error('No current user.'));\n\t\t\t\t} else {\n\t\t\t\t\tuser.getSession(async (err, session) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tlogger.debug('Failed to get the user session', err);\n\t\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn rej(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuser.deleteUser((err, result: string) => {\n\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\trej(err);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t\t\t\t'userDeleted',\n\t\t\t\t\t\t\t\t\t\tresult,\n\t\t\t\t\t\t\t\t\t\t'The authenticated user has been deleted.'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tuser.signOut();\n\t\t\t\t\t\t\t\t\tthis.user = null;\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tthis.cleanCachedItems(); // clean aws credentials\n\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\t// TODO: change to rejects in refactor\n\t\t\t\t\t\t\t\t\t\tlogger.debug('failed to clear cached items');\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (isSignedInHostedUI) {\n\t\t\t\t\t\t\t\t\t\tthis.oAuthSignOutRedirect(res, rej);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t\t\t\t\t'signOut',\n\t\t\t\t\t\t\t\t\t\t\tthis.user,\n\t\t\t\t\t\t\t\t\t\t\t`A user has been signed out`\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tres(result);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.debug('no Congito User pool');\n\t\t\t\trej(new Error('Cognito User pool does not exist'));\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Update an authenticated users' attributes\n\t * @param {CognitoUser} - The currently logged in user object\n\t * @return {Promise}\n\t **/\n\tpublic updateUserAttributes(\n\t\tuser: CognitoUser | any,\n\t\tattributes: object,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tconst attributeList: ICognitoUserAttributeData[] = [];\n\t\tconst that = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthat.userSession(user).then(session => {\n\t\t\t\tfor (const key in attributes) {\n\t\t\t\t\tif (key !== 'sub' && key.indexOf('_verified') < 0) {\n\t\t\t\t\t\tconst attr: ICognitoUserAttributeData = {\n\t\t\t\t\t\t\tName: key,\n\t\t\t\t\t\t\tValue: attributes[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tattributeList.push(attr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuser.updateAttributes(\n\t\t\t\t\tattributeList,\n\t\t\t\t\t(err, result) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\treturn reject(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn resolve(result);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tclientMetadata\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t * Return user attributes\n\t * @param {Object} user - The CognitoUser object\n\t * @return - A promise resolves to user attributes if success\n\t */\n\tpublic userAttributes(\n\t\tuser: CognitoUser | any\n\t): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.userSession(user).then(session => {\n\t\t\t\tuser.getUserAttributes((err, attributes) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve(attributes);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic verifiedContact(user: CognitoUser | any) {\n\t\tconst that = this;\n\t\treturn this.userAttributes(user).then(attributes => {\n\t\t\tconst attrs = that.attributesToObject(attributes);\n\t\t\tconst unverified = {};\n\t\t\tconst verified = {};\n\t\t\tif (attrs['email']) {\n\t\t\t\tif (attrs['email_verified']) {\n\t\t\t\t\tverified['email'] = attrs['email'];\n\t\t\t\t} else {\n\t\t\t\t\tunverified['email'] = attrs['email'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (attrs['phone_number']) {\n\t\t\t\tif (attrs['phone_number_verified']) {\n\t\t\t\t\tverified['phone_number'] = attrs['phone_number'];\n\t\t\t\t} else {\n\t\t\t\t\tunverified['phone_number'] = attrs['phone_number'];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tverified,\n\t\t\t\tunverified,\n\t\t\t};\n\t\t});\n\t}\n\n\tprivate isErrorWithMessage(err: any): err is { message: string } {\n\t\treturn (\n\t\t\ttypeof err === 'object' &&\n\t\t\tObject.prototype.hasOwnProperty.call(err, 'message')\n\t\t);\n\t}\n\n\t// Session revoked by another app\n\tprivate isTokenRevokedError(\n\t\terr: any\n\t): err is { message: 'Access Token has been revoked' } {\n\t\treturn (\n\t\t\tthis.isErrorWithMessage(err) &&\n\t\t\terr.message === 'Access Token has been revoked'\n\t\t);\n\t}\n\n\tprivate isRefreshTokenRevokedError(\n\t\terr: any\n\t): err is { message: 'Refresh Token has been revoked' } {\n\t\treturn (\n\t\t\tthis.isErrorWithMessage(err) &&\n\t\t\terr.message === 'Refresh Token has been revoked'\n\t\t);\n\t}\n\n\tprivate isUserDisabledError(\n\t\terr: any\n\t): err is { message: 'User is disabled.' } {\n\t\treturn this.isErrorWithMessage(err) && err.message === 'User is disabled.';\n\t}\n\n\tprivate isUserDoesNotExistError(\n\t\terr: any\n\t): err is { message: 'User does not exist.' } {\n\t\treturn (\n\t\t\tthis.isErrorWithMessage(err) && err.message === 'User does not exist.'\n\t\t);\n\t}\n\n\tprivate isRefreshTokenExpiredError(\n\t\terr: any\n\t): err is { message: 'Refresh Token has expired' } {\n\t\treturn (\n\t\t\tthis.isErrorWithMessage(err) &&\n\t\t\terr.message === 'Refresh Token has expired'\n\t\t);\n\t}\n\n\tprivate isSignedInHostedUI() {\n\t\treturn (\n\t\t\tthis._oAuthHandler &&\n\t\t\tthis._storage.getItem('amplify-signin-with-hostedUI') === 'true'\n\t\t);\n\t}\n\n\tprivate isSessionInvalid(err: any) {\n\t\treturn (\n\t\t\tthis.isUserDisabledError(err) ||\n\t\t\tthis.isUserDoesNotExistError(err) ||\n\t\t\tthis.isTokenRevokedError(err) ||\n\t\t\tthis.isRefreshTokenRevokedError(err) ||\n\t\t\tthis.isRefreshTokenExpiredError(err)\n\t\t);\n\t}\n\n\tprivate async cleanUpInvalidSession(user: CognitoUser) {\n\t\tuser.signOut();\n\t\tthis.user = null;\n\t\ttry {\n\t\t\tawait this.cleanCachedItems(); // clean aws credentials\n\t\t} catch (e) {\n\t\t\tlogger.debug('failed to clear cached items');\n\t\t}\n\t\tif (this.isSignedInHostedUI()) {\n\t\t\treturn new Promise((res, rej) => {\n\t\t\t\tthis.oAuthSignOutRedirect(res, rej);\n\t\t\t});\n\t\t} else {\n\t\t\tdispatchAuthEvent('signOut', this.user, `A user has been signed out`);\n\t\t}\n\t}\n\n\t/**\n\t * Get current authenticated user\n\t * @return - A promise resolves to current authenticated CognitoUser if success\n\t */\n\tpublic currentUserPoolUser(\n\t\tparams?: CurrentUserOpts\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tthis._storageSync\n\t\t\t\t.then(async () => {\n\t\t\t\t\tif (this.isOAuthInProgress()) {\n\t\t\t\t\t\tlogger.debug('OAuth signIn in progress, waiting for resolution...');\n\n\t\t\t\t\t\tawait new Promise(res => {\n\t\t\t\t\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\t\t\t\t\tlogger.debug('OAuth signIn in progress timeout');\n\n\t\t\t\t\t\t\t\tHub.remove('auth', hostedUISignCallback);\n\n\t\t\t\t\t\t\t\tres();\n\t\t\t\t\t\t\t}, OAUTH_FLOW_MS_TIMEOUT);\n\n\t\t\t\t\t\t\tHub.listen('auth', hostedUISignCallback);\n\n\t\t\t\t\t\t\tfunction hostedUISignCallback({ payload }) {\n\t\t\t\t\t\t\t\tconst { event } = payload;\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent === 'cognitoHostedUI' ||\n\t\t\t\t\t\t\t\t\tevent === 'cognitoHostedUI_failure'\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tlogger.debug(`OAuth signIn resolved: ${event}`);\n\t\t\t\t\t\t\t\t\tclearTimeout(timeoutId);\n\n\t\t\t\t\t\t\t\t\tHub.remove('auth', hostedUISignCallback);\n\n\t\t\t\t\t\t\t\t\tres();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst user = this.userPool.getCurrentUser();\n\n\t\t\t\t\tif (!user) {\n\t\t\t\t\t\tlogger.debug('Failed to get user from user pool');\n\t\t\t\t\t\trej('No current user');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n\n\t\t\t\t\t// refresh the session if the session expired.\n\t\t\t\t\tuser.getSession(\n\t\t\t\t\t\tasync (err, session) => {\n\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\tlogger.debug('Failed to get the user session', err);\n\t\t\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\trej(err);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// get user data from Cognito\n\t\t\t\t\t\t\tconst bypassCache = params ? params.bypassCache : false;\n\n\t\t\t\t\t\t\tif (bypassCache) {\n\t\t\t\t\t\t\t\tawait this.Credentials.clear();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n\n\t\t\t\t\t\t\t// validate the token's scope first before calling this function\n\t\t\t\t\t\t\tconst { scope = '' } = session.getAccessToken().decodePayload();\n\t\t\t\t\t\t\tif (scope.split(' ').includes(USER_ADMIN_SCOPE)) {\n\t\t\t\t\t\t\t\tuser.getUserData(\n\t\t\t\t\t\t\t\t\tasync (err, data) => {\n\t\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\t\tlogger.debug('getting user data failed', err);\n\t\t\t\t\t\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\trej(err);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tres(user);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tconst preferredMFA = data.PreferredMfaSetting || 'NOMFA';\n\t\t\t\t\t\t\t\t\t\tconst attributeList = [];\n\n\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < data.UserAttributes.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tconst attribute = {\n\t\t\t\t\t\t\t\t\t\t\t\tName: data.UserAttributes[i].Name,\n\t\t\t\t\t\t\t\t\t\t\t\tValue: data.UserAttributes[i].Value,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tconst userAttribute = new CognitoUserAttribute(attribute);\n\t\t\t\t\t\t\t\t\t\t\tattributeList.push(userAttribute);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconst attributes = this.attributesToObject(attributeList);\n\t\t\t\t\t\t\t\t\t\tObject.assign(user, { attributes, preferredMFA });\n\t\t\t\t\t\t\t\t\t\treturn res(user);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{ bypassCache, clientMetadata }\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlogger.debug(\n\t\t\t\t\t\t\t\t\t`Unable to get the user data because the ${USER_ADMIN_SCOPE} ` +\n\t\t\t\t\t\t\t\t\t\t`is not in the scopes of the access token`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn res(user);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ clientMetadata }\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.catch(e => {\n\t\t\t\t\tlogger.debug('Failed to sync cache info into memory', e);\n\t\t\t\t\treturn rej(e);\n\t\t\t\t});\n\t\t});\n\t}\n\n\tprivate isOAuthInProgress(): boolean {\n\t\treturn this.oAuthFlowInProgress;\n\t}\n\n\t/**\n\t * Get current authenticated user\n\t * @param {CurrentUserOpts} - options for getting the current user\n\t * @return - A promise resolves to current authenticated CognitoUser if success\n\t */\n\tpublic async currentAuthenticatedUser(\n\t\tparams?: CurrentUserOpts\n\t): Promise {\n\t\tlogger.debug('getting current authenticated user');\n\t\tlet federatedUser = null;\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to sync cache info into memory', e);\n\t\t\tthrow e;\n\t\t}\n\n\t\ttry {\n\t\t\tconst federatedInfo = JSON.parse(\n\t\t\t\tthis._storage.getItem('aws-amplify-federatedInfo')\n\t\t\t);\n\t\t\tif (federatedInfo) {\n\t\t\t\tfederatedUser = {\n\t\t\t\t\t...federatedInfo.user,\n\t\t\t\t\ttoken: federatedInfo.token,\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tlogger.debug('cannot load federated user from auth storage');\n\t\t}\n\n\t\tif (federatedUser) {\n\t\t\tthis.user = federatedUser;\n\t\t\tlogger.debug('get current authenticated federated user', this.user);\n\t\t\treturn this.user;\n\t\t} else {\n\t\t\tlogger.debug('get current authenticated userpool user');\n\t\t\tlet user = null;\n\t\t\ttry {\n\t\t\t\tuser = await this.currentUserPoolUser(params);\n\t\t\t} catch (e) {\n\t\t\t\tif (e === 'No userPool') {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t'Cannot get the current user because the user pool is missing. ' +\n\t\t\t\t\t\t\t'Please make sure the Auth module is configured with a valid Cognito User Pool ID'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlogger.debug('The user is not authenticated by the error', e);\n\t\t\t\treturn Promise.reject('The user is not authenticated');\n\t\t\t}\n\t\t\tthis.user = user;\n\t\t\treturn this.user;\n\t\t}\n\t}\n\n\t/**\n\t * Get current user's session\n\t * @return - A promise resolves to session object if success\n\t */\n\tpublic currentSession(): Promise {\n\t\tconst that = this;\n\t\tlogger.debug('Getting current session');\n\t\t// Purposely not calling the reject method here because we don't need a console error\n\t\tif (!this.userPool) {\n\t\t\treturn Promise.reject(new Error('No User Pool in the configuration.'));\n\t\t}\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tthat\n\t\t\t\t.currentUserPoolUser()\n\t\t\t\t.then(user => {\n\t\t\t\t\tthat\n\t\t\t\t\t\t.userSession(user)\n\t\t\t\t\t\t.then(session => {\n\t\t\t\t\t\t\tres(session);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch(e => {\n\t\t\t\t\t\t\tlogger.debug('Failed to get the current session', e);\n\t\t\t\t\t\t\trej(e);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch(e => {\n\t\t\t\t\tlogger.debug('Failed to get the current user', e);\n\t\t\t\t\trej(e);\n\t\t\t\t\treturn;\n\t\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Get the corresponding user session\n\t * @param {Object} user - The CognitoUser object\n\t * @return - A promise resolves to the session\n\t */\n\tpublic userSession(user): Promise {\n\t\tif (!user) {\n\t\t\tlogger.debug('the user is null');\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.NoUserSession);\n\t\t}\n\t\tconst clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tlogger.debug('Getting the session from this user:', user);\n\t\t\tuser.getSession(\n\t\t\t\tasync (err, session) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tlogger.debug('Failed to get the session from user', user);\n\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trej(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.debug('Succeed to get the user session', session);\n\t\t\t\t\t\tres(session);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ clientMetadata }\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Get authenticated credentials of current user.\n\t * @return - A promise resolves to be current user's credentials\n\t */\n\tpublic async currentUserCredentials(): Promise {\n\t\tlogger.debug('Getting current user credentials');\n\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to sync cache info into memory', e);\n\t\t\tthrow e;\n\t\t}\n\n\t\t// first to check whether there is federation info in the auth storage\n\t\tlet federatedInfo = null;\n\t\ttry {\n\t\t\tfederatedInfo = JSON.parse(\n\t\t\t\tthis._storage.getItem('aws-amplify-federatedInfo')\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tlogger.debug('failed to get or parse item aws-amplify-federatedInfo', e);\n\t\t}\n\n\t\tif (federatedInfo) {\n\t\t\t// refresh the jwt token here if necessary\n\t\t\treturn this.Credentials.refreshFederatedToken(federatedInfo);\n\t\t} else {\n\t\t\treturn this.currentSession()\n\t\t\t\t.then(session => {\n\t\t\t\t\tlogger.debug('getting session success', session);\n\t\t\t\t\treturn this.Credentials.set(session, 'session');\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tlogger.debug('getting guest credentials');\n\t\t\t\t\treturn this.Credentials.set(null, 'guest');\n\t\t\t\t});\n\t\t}\n\t}\n\n\tpublic currentCredentials(): Promise {\n\t\tlogger.debug('getting current credentials');\n\t\treturn this.Credentials.get();\n\t}\n\n\t/**\n\t * Initiate an attribute confirmation request\n\t * @param {Object} user - The CognitoUser\n\t * @param {Object} attr - The attributes to be verified\n\t * @return - A promise resolves to callback data if success\n\t */\n\tpublic verifyUserAttribute(\n\t\tuser: CognitoUser | any,\n\t\tattr: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.getAttributeVerificationCode(\n\t\t\t\tattr,\n\t\t\t\t{\n\t\t\t\t\tonSuccess(success) {\n\t\t\t\t\t\treturn resolve(success);\n\t\t\t\t\t},\n\t\t\t\t\tonFailure(err) {\n\t\t\t\t\t\treturn reject(err);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Confirm an attribute using a confirmation code\n\t * @param {Object} user - The CognitoUser\n\t * @param {Object} attr - The attribute to be verified\n\t * @param {String} code - The confirmation code\n\t * @return - A promise resolves to callback data if success\n\t */\n\tpublic verifyUserAttributeSubmit(\n\t\tuser: CognitoUser | any,\n\t\tattr: string,\n\t\tcode: string\n\t): Promise {\n\t\tif (!code) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyCode);\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.verifyAttribute(attr, code, {\n\t\t\t\tonSuccess(data) {\n\t\t\t\t\tresolve(data);\n\t\t\t\t\treturn;\n\t\t\t\t},\n\t\t\t\tonFailure(err) {\n\t\t\t\t\treject(err);\n\t\t\t\t\treturn;\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic verifyCurrentUserAttribute(attr: string): Promise {\n\t\tconst that = this;\n\t\treturn that\n\t\t\t.currentUserPoolUser()\n\t\t\t.then(user => that.verifyUserAttribute(user, attr));\n\t}\n\n\t/**\n\t * Confirm current user's attribute using a confirmation code\n\t * @param {Object} attr - The attribute to be verified\n\t * @param {String} code - The confirmation code\n\t * @return - A promise resolves to callback data if success\n\t */\n\tverifyCurrentUserAttributeSubmit(\n\t\tattr: string,\n\t\tcode: string\n\t): Promise {\n\t\tconst that = this;\n\t\treturn that\n\t\t\t.currentUserPoolUser()\n\t\t\t.then(user => that.verifyUserAttributeSubmit(user, attr, code));\n\t}\n\n\tprivate async cognitoIdentitySignOut(\n\t\topts: SignOutOpts,\n\t\tuser: CognitoUser | any\n\t) {\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to sync cache info into memory', e);\n\t\t\tthrow e;\n\t\t}\n\n\t\tconst isSignedInHostedUI =\n\t\t\tthis._oAuthHandler &&\n\t\t\tthis._storage.getItem('amplify-signin-with-hostedUI') === 'true';\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tif (opts && opts.global) {\n\t\t\t\tlogger.debug('user global sign out', user);\n\t\t\t\t// in order to use global signout\n\t\t\t\t// we must validate the user as an authenticated user by using getSession\n\t\t\t\tconst clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n\n\t\t\t\tuser.getSession(\n\t\t\t\t\tasync (err, result) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tlogger.debug('failed to get the user session', err);\n\t\t\t\t\t\t\tif (this.isSessionInvalid(err)) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait this.cleanUpInvalidSession(user);\n\t\t\t\t\t\t\t\t} catch (cleanUpError) {\n\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\t\t\t\t`Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn rej(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tuser.globalSignOut({\n\t\t\t\t\t\t\tonSuccess: data => {\n\t\t\t\t\t\t\t\tlogger.debug('global sign out success');\n\t\t\t\t\t\t\t\tif (isSignedInHostedUI) {\n\t\t\t\t\t\t\t\t\tthis.oAuthSignOutRedirect(res, rej);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn res();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonFailure: err => {\n\t\t\t\t\t\t\t\tlogger.debug('global sign out failed', err);\n\t\t\t\t\t\t\t\treturn rej(err);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\t{ clientMetadata }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tlogger.debug('user sign out', user);\n\t\t\t\tuser.signOut(() => {\n\t\t\t\t\tif (isSignedInHostedUI) {\n\t\t\t\t\t\tthis.oAuthSignOutRedirect(res, rej);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn res();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate oAuthSignOutRedirect(\n\t\tresolve: () => void,\n\t\treject: (reason?: any) => void\n\t) {\n\t\tconst { isBrowser } = browserOrNode();\n\n\t\tif (isBrowser) {\n\t\t\tthis.oAuthSignOutRedirectOrReject(reject);\n\t\t} else {\n\t\t\tthis.oAuthSignOutAndResolve(resolve);\n\t\t}\n\t}\n\n\tprivate oAuthSignOutAndResolve(resolve: () => void) {\n\t\tthis._oAuthHandler.signOut();\n\t\tresolve();\n\t}\n\n\tprivate oAuthSignOutRedirectOrReject(reject: (reason?: any) => void) {\n\t\tthis._oAuthHandler.signOut(); // this method redirects url\n\n\t\t// App should be redirected to another url otherwise it will reject\n\t\tsetTimeout(() => reject(Error('Signout timeout fail')), 3000);\n\t}\n\n\t/**\n\t * Sign out method\n\t * @\n\t * @return - A promise resolved if success\n\t */\n\tpublic async signOut(opts?: SignOutOpts): Promise {\n\t\ttry {\n\t\t\tawait this.cleanCachedItems();\n\t\t} catch (e) {\n\t\t\tlogger.debug('failed to clear cached items');\n\t\t}\n\n\t\tif (this.userPool) {\n\t\t\tconst user = this.userPool.getCurrentUser();\n\t\t\tif (user) {\n\t\t\t\tawait this.cognitoIdentitySignOut(opts, user);\n\t\t\t} else {\n\t\t\t\tlogger.debug('no current Cognito user');\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.debug('no Cognito User pool');\n\t\t}\n\n\t\t/**\n\t\t * Note for future refactor - no reliable way to get username with\n\t\t * Cognito User Pools vs Identity when federating with Social Providers\n\t\t * This is why we need a well structured session object that can be inspected\n\t\t * and information passed back in the message below for Hub dispatch\n\t\t */\n\t\tdispatchAuthEvent('signOut', this.user, `A user has been signed out`);\n\t\tthis.user = null;\n\t}\n\n\tprivate async cleanCachedItems() {\n\t\t// clear cognito cached item\n\t\tawait this.Credentials.clear();\n\t}\n\n\t/**\n\t * Change a password for an authenticated user\n\t * @param {Object} user - The CognitoUser object\n\t * @param {String} oldPassword - the current password\n\t * @param {String} newPassword - the requested new password\n\t * @return - A promise resolves if success\n\t */\n\tpublic changePassword(\n\t\tuser: CognitoUser | any,\n\t\toldPassword: string,\n\t\tnewPassword: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise<'SUCCESS'> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.userSession(user).then(session => {\n\t\t\t\tuser.changePassword(\n\t\t\t\t\toldPassword,\n\t\t\t\t\tnewPassword,\n\t\t\t\t\t(err, data) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tlogger.debug('change password failure', err);\n\t\t\t\t\t\t\treturn reject(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn resolve(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tclientMetadata\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Initiate a forgot password request\n\t * @param {String} username - the username to change password\n\t * @return - A promise resolves if success\n\t */\n\tpublic forgotPassword(\n\t\tusername: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\t\tif (!username) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n\t\t}\n\n\t\tconst user = this.createCognitoUser(username);\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.forgotPassword(\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t},\n\t\t\t\t\tonFailure: err => {\n\t\t\t\t\t\tlogger.debug('forgot password failure', err);\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'forgotPassword_failure',\n\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\t`${username} forgotPassword failed`\n\t\t\t\t\t\t);\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t},\n\t\t\t\t\tinputVerificationCode: data => {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'forgotPassword',\n\t\t\t\t\t\t\tuser,\n\t\t\t\t\t\t\t`${username} has initiated forgot password flow`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Confirm a new password using a confirmation Code\n\t * @param {String} username - The username\n\t * @param {String} code - The confirmation code\n\t * @param {String} password - The new password\n\t * @return - A promise that resolves if success\n\t */\n\tpublic forgotPasswordSubmit(\n\t\tusername: string,\n\t\tcode: string,\n\t\tpassword: string,\n\t\tclientMetadata: ClientMetaData = this._config.clientMetadata\n\t): Promise {\n\t\tif (!this.userPool) {\n\t\t\treturn this.rejectNoUserPool();\n\t\t}\n\t\tif (!username) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n\t\t}\n\t\tif (!code) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyCode);\n\t\t}\n\t\tif (!password) {\n\t\t\treturn this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n\t\t}\n\n\t\tconst user = this.createCognitoUser(username);\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuser.confirmPassword(\n\t\t\t\tcode,\n\t\t\t\tpassword,\n\t\t\t\t{\n\t\t\t\t\tonSuccess: success => {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'forgotPasswordSubmit',\n\t\t\t\t\t\t\tuser,\n\t\t\t\t\t\t\t`${username} forgotPasswordSubmit successful`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresolve(success);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t},\n\t\t\t\t\tonFailure: err => {\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'forgotPasswordSubmit_failure',\n\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\t`${username} forgotPasswordSubmit failed`\n\t\t\t\t\t\t);\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tclientMetadata\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Get user information\n\t * @async\n\t * @return {Object }- current User's information\n\t */\n\tpublic async currentUserInfo() {\n\t\tconst source = this.Credentials.getCredSource();\n\n\t\tif (!source || source === 'aws' || source === 'userPool') {\n\t\t\tconst user = await this.currentUserPoolUser().catch(err =>\n\t\t\t\tlogger.error(err)\n\t\t\t);\n\t\t\tif (!user) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst attributes = await this.userAttributes(user);\n\t\t\t\tconst userAttrs: object = this.attributesToObject(attributes);\n\t\t\t\tlet credentials = null;\n\t\t\t\ttry {\n\t\t\t\t\tcredentials = await this.currentCredentials();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tlogger.debug(\n\t\t\t\t\t\t'Failed to retrieve credentials while getting current user info',\n\t\t\t\t\t\te\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst info = {\n\t\t\t\t\tid: credentials ? credentials.identityId : undefined,\n\t\t\t\t\tusername: user.getUsername(),\n\t\t\t\t\tattributes: userAttrs,\n\t\t\t\t};\n\t\t\t\treturn info;\n\t\t\t} catch (err) {\n\t\t\t\tlogger.error('currentUserInfo error', err);\n\t\t\t\treturn {};\n\t\t\t}\n\t\t}\n\n\t\tif (source === 'federated') {\n\t\t\tconst user = this.user;\n\t\t\treturn user ? user : {};\n\t\t}\n\t}\n\n\tpublic async federatedSignIn(\n\t\toptions?: FederatedSignInOptions\n\t): Promise;\n\tpublic async federatedSignIn(\n\t\tprovider: LegacyProvider,\n\t\tresponse: FederatedResponse,\n\t\tuser: FederatedUser\n\t): Promise;\n\tpublic async federatedSignIn(\n\t\toptions?: FederatedSignInOptionsCustom\n\t): Promise;\n\tpublic async federatedSignIn(\n\t\tproviderOrOptions:\n\t\t\t| LegacyProvider\n\t\t\t| FederatedSignInOptions\n\t\t\t| FederatedSignInOptionsCustom,\n\t\tresponse?: FederatedResponse,\n\t\tuser?: FederatedUser\n\t): Promise {\n\t\tif (!this._config.identityPoolId && !this._config.userPoolId) {\n\t\t\tthrow new Error(\n\t\t\t\t`Federation requires either a User Pool or Identity Pool in config`\n\t\t\t);\n\t\t}\n\n\t\t// Ensure backwards compatability\n\t\tif (typeof providerOrOptions === 'undefined') {\n\t\t\tif (this._config.identityPoolId && !this._config.userPoolId) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Federation with Identity Pools requires tokens passed as arguments`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tisFederatedSignInOptions(providerOrOptions) ||\n\t\t\tisFederatedSignInOptionsCustom(providerOrOptions) ||\n\t\t\thasCustomState(providerOrOptions) ||\n\t\t\ttypeof providerOrOptions === 'undefined'\n\t\t) {\n\t\t\tconst options = providerOrOptions || {\n\t\t\t\tprovider: CognitoHostedUIIdentityProvider.Cognito,\n\t\t\t};\n\t\t\tconst provider = isFederatedSignInOptions(options)\n\t\t\t\t? options.provider\n\t\t\t\t: (options as FederatedSignInOptionsCustom).customProvider;\n\n\t\t\tconst customState = isFederatedSignInOptions(options)\n\t\t\t\t? options.customState\n\t\t\t\t: (options as FederatedSignInOptionsCustom).customState;\n\n\t\t\tif (this._config.userPoolId) {\n\t\t\t\tconst client_id = isCognitoHostedOpts(this._config.oauth)\n\t\t\t\t\t? this._config.userPoolWebClientId\n\t\t\t\t\t: this._config.oauth.clientID;\n\t\t\t\t/*Note: Invenstigate automatically adding trailing slash */\n\t\t\t\tconst redirect_uri = isCognitoHostedOpts(this._config.oauth)\n\t\t\t\t\t? this._config.oauth.redirectSignIn\n\t\t\t\t\t: this._config.oauth.redirectUri;\n\n\t\t\t\tthis._oAuthHandler.oauthSignIn(\n\t\t\t\t\tthis._config.oauth.responseType,\n\t\t\t\t\tthis._config.oauth.domain,\n\t\t\t\t\tredirect_uri,\n\t\t\t\t\tclient_id,\n\t\t\t\t\tprovider,\n\t\t\t\t\tcustomState\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst provider = providerOrOptions;\n\t\t\t// To check if the user is already logged in\n\t\t\ttry {\n\t\t\t\tconst loggedInUser = JSON.stringify(\n\t\t\t\t\tJSON.parse(this._storage.getItem('aws-amplify-federatedInfo')).user\n\t\t\t\t);\n\t\t\t\tif (loggedInUser) {\n\t\t\t\t\tlogger.warn(`There is already a signed in user: ${loggedInUser} in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.`);\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tconst { token, identity_id, expires_at } = response;\n\t\t\t// Because this.Credentials.set would update the user info with identity id\n\t\t\t// So we need to retrieve the user again.\n\t\t\tconst credentials = await this.Credentials.set(\n\t\t\t\t{ provider, token, identity_id, user, expires_at },\n\t\t\t\t'federation'\n\t\t\t);\n\t\t\tconst currentUser = await this.currentAuthenticatedUser();\n\t\t\tdispatchAuthEvent(\n\t\t\t\t'signIn',\n\t\t\t\tcurrentUser,\n\t\t\t\t`A user ${currentUser.username} has been signed in`\n\t\t\t);\n\t\t\tlogger.debug('federated sign in credentials', credentials);\n\t\t\treturn credentials;\n\t\t}\n\t}\n\n\t/**\n\t * Used to complete the OAuth flow with or without the Cognito Hosted UI\n\t * @param {String} URL - optional parameter for customers to pass in the response URL\n\t */\n\tprivate async _handleAuthResponse(URL?: string) {\n\t\tif (this.oAuthFlowInProgress) {\n\t\t\tlogger.debug(`Skipping URL ${URL} current flow in progress`);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.oAuthFlowInProgress = true;\n\t\t\tif (!this._config.userPoolId) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`OAuth responses require a User Pool defined in config`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdispatchAuthEvent(\n\t\t\t\t'parsingCallbackUrl',\n\t\t\t\t{ url: URL },\n\t\t\t\t`The callback url is being parsed`\n\t\t\t);\n\n\t\t\tconst currentUrl =\n\t\t\t\tURL || (browserOrNode().isBrowser ? window.location.href : '');\n\n\t\t\tconst hasCodeOrError = !!(parse(currentUrl).query || '')\n\t\t\t\t.split('&')\n\t\t\t\t.map(entry => entry.split('='))\n\t\t\t\t.find(([k]) => k === 'code' || k === 'error');\n\n\t\t\tconst hasTokenOrError = !!(parse(currentUrl).hash || '#')\n\t\t\t\t.substr(1)\n\t\t\t\t.split('&')\n\t\t\t\t.map(entry => entry.split('='))\n\t\t\t\t.find(([k]) => k === 'access_token' || k === 'error');\n\n\t\t\tif (hasCodeOrError || hasTokenOrError) {\n\t\t\t\tthis._storage.setItem('amplify-redirected-from-hosted-ui', 'true');\n\t\t\t\ttry {\n\t\t\t\t\tconst { accessToken, idToken, refreshToken, state } =\n\t\t\t\t\t\tawait this._oAuthHandler.handleAuthResponse(currentUrl);\n\t\t\t\t\tconst session = new CognitoUserSession({\n\t\t\t\t\t\tIdToken: new CognitoIdToken({ IdToken: idToken }),\n\t\t\t\t\t\tRefreshToken: new CognitoRefreshToken({\n\t\t\t\t\t\t\tRefreshToken: refreshToken,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tAccessToken: new CognitoAccessToken({\n\t\t\t\t\t\t\tAccessToken: accessToken,\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\n\t\t\t\t\tlet credentials;\n\t\t\t\t\t// Get AWS Credentials & store if Identity Pool is defined\n\t\t\t\t\tif (this._config.identityPoolId) {\n\t\t\t\t\t\tcredentials = await this.Credentials.set(session, 'session');\n\t\t\t\t\t\tlogger.debug('AWS credentials', credentials);\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\tPrior to the request we do sign the custom state along with the state we set. This check will verify\n\t\t\t\tif there is a dash indicated when setting custom state from the request. If a dash is contained\n\t\t\t\tthen there is custom state present on the state string.\n\t\t\t\t*/\n\t\t\t\t\tconst isCustomStateIncluded = /-/.test(state);\n\n\t\t\t\t\t/*\n\t\t\t\tThe following is to create a user for the Cognito Identity SDK to store the tokens\n\t\t\t\tWhen we remove this SDK later that logic will have to be centralized in our new version\n\t\t\t\t*/\n\t\t\t\t\t//#region\n\t\t\t\t\tconst currentUser = this.createCognitoUser(\n\t\t\t\t\t\tsession.getIdToken().decodePayload()['cognito:username']\n\t\t\t\t\t);\n\n\t\t\t\t\t// This calls cacheTokens() in Cognito SDK\n\t\t\t\t\tcurrentUser.setSignInUserSession(session);\n\n\t\t\t\t\tif (window && typeof window.history !== 'undefined') {\n\t\t\t\t\t\twindow.history.replaceState(\n\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t(this._config.oauth as AwsCognitoOAuthOpts).redirectSignIn\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t'signIn',\n\t\t\t\t\t\tcurrentUser,\n\t\t\t\t\t\t`A user ${currentUser.getUsername()} has been signed in`\n\t\t\t\t\t);\n\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t'cognitoHostedUI',\n\t\t\t\t\t\tcurrentUser,\n\t\t\t\t\t\t`A user ${currentUser.getUsername()} has been signed in via Cognito Hosted UI`\n\t\t\t\t\t);\n\n\t\t\t\t\tif (isCustomStateIncluded) {\n\t\t\t\t\t\tconst customState = state.split('-').splice(1).join('-');\n\n\t\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t\t'customOAuthState',\n\t\t\t\t\t\t\turlSafeDecode(customState),\n\t\t\t\t\t\t\t`State for user ${currentUser.getUsername()}`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t//#endregion\n\n\t\t\t\t\treturn credentials;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlogger.debug('Error in cognito hosted auth response', err);\n\n\t\t\t\t\t// Just like a successful handling of `?code`, replace the window history to \"dispose\" of the `code`.\n\t\t\t\t\t// Otherwise, reloading the page will throw errors as the `code` has already been spent.\n\t\t\t\t\tif (window && typeof window.history !== 'undefined') {\n\t\t\t\t\t\twindow.history.replaceState(\n\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t(this._config.oauth as AwsCognitoOAuthOpts).redirectSignIn\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t'signIn_failure',\n\t\t\t\t\t\terr,\n\t\t\t\t\t\t`The OAuth response flow failed`\n\t\t\t\t\t);\n\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t'cognitoHostedUI_failure',\n\t\t\t\t\t\terr,\n\t\t\t\t\t\t`A failure occurred when returning to the Cognito Hosted UI`\n\t\t\t\t\t);\n\t\t\t\t\tdispatchAuthEvent(\n\t\t\t\t\t\t'customState_failure',\n\t\t\t\t\t\terr,\n\t\t\t\t\t\t`A failure occurred when returning state`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.oAuthFlowInProgress = false;\n\t\t}\n\t}\n\n\t/**\n\t * Compact version of credentials\n\t * @param {Object} credentials\n\t * @return {Object} - Credentials\n\t */\n\tpublic essentialCredentials(credentials): ICredentials {\n\t\treturn {\n\t\t\taccessKeyId: credentials.accessKeyId,\n\t\t\tsessionToken: credentials.sessionToken,\n\t\t\tsecretAccessKey: credentials.secretAccessKey,\n\t\t\tidentityId: credentials.identityId,\n\t\t\tauthenticated: credentials.authenticated,\n\t\t};\n\t}\n\n\tprivate attributesToObject(attributes) {\n\t\tconst obj = {};\n\t\tif (attributes) {\n\t\t\tattributes.map(attribute => {\n\t\t\t\tif (\n\t\t\t\t\tattribute.Name === 'email_verified' ||\n\t\t\t\t\tattribute.Name === 'phone_number_verified'\n\t\t\t\t) {\n\t\t\t\t\tobj[attribute.Name] =\n\t\t\t\t\t\tthis.isTruthyString(attribute.Value) || attribute.Value === true;\n\t\t\t\t} else {\n\t\t\t\t\tobj[attribute.Name] = attribute.Value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn obj;\n\t}\n\n\tprivate isTruthyString(value: any): boolean {\n\t\treturn (\n\t\t\ttypeof value.toLowerCase === 'function' && value.toLowerCase() === 'true'\n\t\t);\n\t}\n\n\tprivate createCognitoUser(username: string): CognitoUser {\n\t\tconst userData: ICognitoUserData = {\n\t\t\tUsername: username,\n\t\t\tPool: this.userPool,\n\t\t};\n\t\tuserData.Storage = this._storage;\n\n\t\tconst { authenticationFlowType } = this._config;\n\n\t\tconst user = new CognitoUser(userData);\n\t\tif (authenticationFlowType) {\n\t\t\tuser.setAuthenticationFlowType(authenticationFlowType);\n\t\t}\n\t\treturn user;\n\t}\n\n\tprivate _isValidAuthStorage(obj) {\n\t\t// We need to check if the obj has the functions of Storage\n\t\treturn (\n\t\t\t!!obj &&\n\t\t\ttypeof obj.getItem === 'function' &&\n\t\t\ttypeof obj.setItem === 'function' &&\n\t\t\ttypeof obj.removeItem === 'function' &&\n\t\t\ttypeof obj.clear === 'function'\n\t\t);\n\t}\n\n\tprivate noUserPoolErrorHandler(config: AuthOptions): AuthErrorTypes {\n\t\tif (config) {\n\t\t\tif (!config.userPoolId || !config.identityPoolId) {\n\t\t\t\treturn AuthErrorTypes.MissingAuthConfig;\n\t\t\t}\n\t\t}\n\t\treturn AuthErrorTypes.NoConfig;\n\t}\n\n\tprivate rejectAuthError(type: AuthErrorTypes): Promise {\n\t\treturn Promise.reject(new AuthError(type));\n\t}\n\n\tprivate rejectNoUserPool(): Promise {\n\t\tconst type = this.noUserPoolErrorHandler(this._config);\n\t\treturn Promise.reject(new NoUserPoolError(type));\n\t}\n\n\tpublic async rememberDevice(): Promise {\n\t\tlet currUser;\n\n\t\ttry {\n\t\t\tcurrUser = await this.currentUserPoolUser();\n\t\t} catch (error) {\n\t\t\tlogger.debug('The user is not authenticated by the error', error);\n\t\t\treturn Promise.reject('The user is not authenticated');\n\t\t}\n\n\t\tcurrUser.getCachedDeviceKeyAndPassword();\n\t\treturn new Promise((res, rej) => {\n\t\t\tcurrUser.setDeviceStatusRemembered({\n\t\t\t\tonSuccess: data => {\n\t\t\t\t\tres(data);\n\t\t\t\t},\n\t\t\t\tonFailure: err => {\n\t\t\t\t\tif (err.code === 'InvalidParameterException') {\n\t\t\t\t\t\trej(new AuthError(AuthErrorTypes.DeviceConfig));\n\t\t\t\t\t} else if (err.code === 'NetworkError') {\n\t\t\t\t\t\trej(new AuthError(AuthErrorTypes.NetworkError));\n\t\t\t\t\t} else {\n\t\t\t\t\t\trej(err);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic async forgetDevice(): Promise {\n\t\tlet currUser;\n\n\t\ttry {\n\t\t\tcurrUser = await this.currentUserPoolUser();\n\t\t} catch (error) {\n\t\t\tlogger.debug('The user is not authenticated by the error', error);\n\t\t\treturn Promise.reject('The user is not authenticated');\n\t\t}\n\n\t\tcurrUser.getCachedDeviceKeyAndPassword();\n\t\treturn new Promise((res, rej) => {\n\t\t\tcurrUser.forgetDevice({\n\t\t\t\tonSuccess: data => {\n\t\t\t\t\tres(data);\n\t\t\t\t},\n\t\t\t\tonFailure: err => {\n\t\t\t\t\tif (err.code === 'InvalidParameterException') {\n\t\t\t\t\t\trej(new AuthError(AuthErrorTypes.DeviceConfig));\n\t\t\t\t\t} else if (err.code === 'NetworkError') {\n\t\t\t\t\t\trej(new AuthError(AuthErrorTypes.NetworkError));\n\t\t\t\t\t} else {\n\t\t\t\t\t\trej(err);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic async fetchDevices(): Promise {\n\t\tlet currUser;\n\n\t\ttry {\n\t\t\tcurrUser = await this.currentUserPoolUser();\n\t\t} catch (error) {\n\t\t\tlogger.debug('The user is not authenticated by the error', error);\n\t\t\tthrow new Error('The user is not authenticated');\n\t\t}\n\n\t\tcurrUser.getCachedDeviceKeyAndPassword();\n\t\treturn new Promise((res, rej) => {\n\t\t\tconst cb = {\n\t\t\t\tonSuccess(data) {\n\t\t\t\t\tconst deviceList: IAuthDevice[] = data.Devices.map(device => {\n\t\t\t\t\t\tconst deviceName =\n\t\t\t\t\t\t\tdevice.DeviceAttributes.find(\n\t\t\t\t\t\t\t\t({ Name }) => Name === 'device_name'\n\t\t\t\t\t\t\t) || {};\n\n\t\t\t\t\t\tconst deviceInfo: IAuthDevice = {\n\t\t\t\t\t\t\tid: device.DeviceKey,\n\t\t\t\t\t\t\tname: deviceName.Value,\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn deviceInfo;\n\t\t\t\t\t});\n\t\t\t\t\tres(deviceList);\n\t\t\t\t},\n\t\t\t\tonFailure: err => {\n\t\t\t\t\tif (err.code === 'InvalidParameterException') {\n\t\t\t\t\t\trej(new AuthError(AuthErrorTypes.DeviceConfig));\n\t\t\t\t\t} else if (err.code === 'NetworkError') {\n\t\t\t\t\t\trej(new AuthError(AuthErrorTypes.NetworkError));\n\t\t\t\t\t} else {\n\t\t\t\t\t\trej(err);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t\tcurrUser.listDevices(MAX_DEVICES, null, cb);\n\t\t});\n\t}\n}\n\nexport const Auth = new AuthClass(null);\n\nAmplify.register(Auth);\n","/*\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { browserOrNode } from '@aws-amplify/core';\n\nexport default callback => {\n\tif (browserOrNode().isBrowser && window.location) {\n\t\tconst url = window.location.href;\n\n\t\tcallback({ url });\n\t} else if (browserOrNode().isNode) {\n\t\t// continue building on ssr\n\t\t() => {}; // noop\n\t} else {\n\t\tthrow new Error('Not supported');\n\t}\n};\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var pairs = str.split(';')\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('=')\n\n // skip things that don't look like key=value\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim()\n\n // only assign once\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim()\n\n // quoted values\n if (val[0] === '\"') {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","import { MsSubtleCrypto } from \"./MsSubtleCrypto\";\n\ntype SubtleCryptoMethod =\n | \"decrypt\"\n | \"digest\"\n | \"encrypt\"\n | \"exportKey\"\n | \"generateKey\"\n | \"importKey\"\n | \"sign\"\n | \"verify\";\n\nconst msSubtleCryptoMethods: Array = [\n \"decrypt\",\n \"digest\",\n \"encrypt\",\n \"exportKey\",\n \"generateKey\",\n \"importKey\",\n \"sign\",\n \"verify\"\n];\n\n/**\n * The value accessible as `window.msCrypto` in Internet Explorer 11.\n */\nexport interface MsCrypto {\n getRandomValues: (toFill: Uint8Array) => void;\n subtle: MsSubtleCrypto;\n}\n\n/**\n * The `window` object in Internet Explorer 11. This interface does not\n * exhaustively document the prefixed features of `window` in IE11.\n */\nexport interface MsWindow extends Window {\n MSInputMethodContext: any;\n msCrypto: MsCrypto;\n}\n\nfunction quacksLikeAnMsWindow(window: Window): window is MsWindow {\n return \"MSInputMethodContext\" in window && \"msCrypto\" in window;\n}\n\n/**\n * Determines if the provided window is (or is like) the window object one would\n * expect to encounter in Internet Explorer 11.\n */\nexport function isMsWindow(window: Window): window is MsWindow {\n if (quacksLikeAnMsWindow(window) && window.msCrypto.subtle !== undefined) {\n const { getRandomValues, subtle } = window.msCrypto;\n return msSubtleCryptoMethods\n .map(methodName => subtle[methodName])\n .concat(getRandomValues)\n .every(method => typeof method === \"function\");\n }\n\n return false;\n}\n","export * from \"./CryptoOperation\";\nexport * from \"./Key\";\nexport * from \"./KeyOperation\";\nexport * from \"./MsSubtleCrypto\";\nexport * from \"./MsWindow\";\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const SHA_256_HASH: { name: \"SHA-256\" } = { name: \"SHA-256\" };\n\nexport const SHA_256_HMAC_ALGO: { name: \"HMAC\"; hash: { name: \"SHA-256\" } } = {\n name: \"HMAC\",\n hash: SHA_256_HASH\n};\n\nexport const EMPTY_DATA_SHA_256 = new Uint8Array([\n 227,\n 176,\n 196,\n 66,\n 152,\n 252,\n 28,\n 20,\n 154,\n 251,\n 244,\n 200,\n 153,\n 111,\n 185,\n 36,\n 39,\n 174,\n 65,\n 228,\n 100,\n 155,\n 147,\n 76,\n 164,\n 149,\n 153,\n 27,\n 120,\n 82,\n 184,\n 85\n]);\n","import { Sha256 as Ie11Sha256 } from \"./ie11Sha256\";\nimport { Sha256 as WebCryptoSha256 } from \"./webCryptoSha256\";\nimport { Sha256 as JsSha256 } from \"@aws-crypto/sha256-js\";\nimport { Hash, SourceData } from \"@aws-sdk/types\";\nimport { supportsWebCrypto } from \"@aws-crypto/supports-web-crypto\";\nimport { isMsWindow } from \"@aws-crypto/ie11-detection\";\nimport { locateWindow } from \"@aws-sdk/util-locate-window\";\n\nexport class Sha256 implements Hash {\n private readonly hash: Hash;\n\n constructor(secret?: SourceData) {\n if (supportsWebCrypto(locateWindow())) {\n this.hash = new WebCryptoSha256(secret);\n } else if (isMsWindow(locateWindow())) {\n this.hash = new Ie11Sha256(secret);\n } else {\n this.hash = new JsSha256(secret);\n }\n }\n\n update(data: SourceData, encoding?: \"utf8\" | \"ascii\" | \"latin1\"): void {\n this.hash.update(data, encoding);\n }\n\n digest(): Promise {\n return this.hash.digest();\n }\n}\n","import { isEmptyData } from \"./isEmptyData\";\nimport { SHA_256_HMAC_ALGO } from \"./constants\";\nimport { Hash, SourceData } from \"@aws-sdk/types\";\nimport { fromUtf8 } from \"@aws-sdk/util-utf8-browser\";\nimport { CryptoOperation, Key, MsWindow } from \"@aws-crypto/ie11-detection\";\nimport { locateWindow } from \"@aws-sdk/util-locate-window\";\n\nexport class Sha256 implements Hash {\n private operation: Promise;\n\n constructor(secret?: SourceData) {\n if (secret) {\n this.operation = getKeyPromise(secret).then(keyData =>\n (locateWindow() as MsWindow).msCrypto.subtle.sign(\n SHA_256_HMAC_ALGO,\n keyData\n )\n );\n this.operation.catch(() => {});\n } else {\n this.operation = Promise.resolve(\n (locateWindow() as MsWindow).msCrypto.subtle.digest(\"SHA-256\")\n );\n }\n }\n\n update(toHash: SourceData): void {\n if (isEmptyData(toHash)) {\n return;\n }\n\n this.operation = this.operation.then(operation => {\n operation.onerror = () => {\n this.operation = Promise.reject(\n new Error(\"Error encountered updating hash\")\n );\n };\n operation.process(toArrayBufferView(toHash));\n\n return operation;\n });\n this.operation.catch(() => {});\n }\n\n digest(): Promise {\n return this.operation.then(\n operation =>\n new Promise((resolve, reject) => {\n operation.onerror = () => {\n reject(new Error(\"Error encountered finalizing hash\"));\n };\n operation.oncomplete = () => {\n if (operation.result) {\n resolve(new Uint8Array(operation.result));\n }\n reject(new Error(\"Error encountered finalizing hash\"));\n };\n\n operation.finish();\n })\n );\n }\n}\n\nfunction getKeyPromise(secret: SourceData): Promise {\n return new Promise((resolve, reject) => {\n const keyOperation = (locateWindow() as MsWindow).msCrypto.subtle.importKey(\n \"raw\",\n toArrayBufferView(secret),\n SHA_256_HMAC_ALGO,\n false,\n [\"sign\"]\n );\n\n keyOperation.oncomplete = () => {\n if (keyOperation.result) {\n resolve(keyOperation.result);\n }\n\n reject(new Error(\"ImportKey completed without importing key.\"));\n };\n keyOperation.onerror = () => {\n reject(new Error(\"ImportKey failed to import key.\"));\n };\n });\n}\n\nfunction toArrayBufferView(data: SourceData): Uint8Array {\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(\n data.buffer,\n data.byteOffset,\n data.byteLength / Uint8Array.BYTES_PER_ELEMENT\n );\n }\n\n return new Uint8Array(data);\n}\n","export * from \"./crossPlatformSha256\";\nexport { Sha256 as Ie11Sha256 } from \"./ie11Sha256\";\nexport { Sha256 as WebCryptoSha256 } from \"./webCryptoSha256\";\n","import { SourceData } from \"@aws-sdk/types\";\n\nexport function isEmptyData(data: SourceData): boolean {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n\n return data.byteLength === 0;\n}\n","import { Hash, SourceData } from \"@aws-sdk/types\";\nimport { isEmptyData, convertToBuffer } from \"@aws-crypto/util\";\nimport {\n EMPTY_DATA_SHA_256,\n SHA_256_HASH,\n SHA_256_HMAC_ALGO,\n} from \"./constants\";\nimport { locateWindow } from \"@aws-sdk/util-locate-window\";\n\nexport class Sha256 implements Hash {\n private readonly key: Promise | undefined;\n private toHash: Uint8Array = new Uint8Array(0);\n\n constructor(secret?: SourceData) {\n if (secret !== void 0) {\n this.key = new Promise((resolve, reject) => {\n locateWindow()\n .crypto.subtle.importKey(\n \"raw\",\n convertToBuffer(secret),\n SHA_256_HMAC_ALGO,\n false,\n [\"sign\"]\n )\n .then(resolve, reject);\n });\n this.key.catch(() => {});\n }\n }\n\n update(data: SourceData): void {\n if (isEmptyData(data)) {\n return;\n }\n\n const update = convertToBuffer(data);\n const typedArray = new Uint8Array(\n this.toHash.byteLength + update.byteLength\n );\n typedArray.set(this.toHash, 0);\n typedArray.set(update, this.toHash.byteLength);\n this.toHash = typedArray;\n }\n\n digest(): Promise {\n if (this.key) {\n return this.key.then((key) =>\n locateWindow()\n .crypto.subtle.sign(SHA_256_HMAC_ALGO, key, this.toHash)\n .then((data) => new Uint8Array(data))\n );\n }\n\n if (isEmptyData(this.toHash)) {\n return Promise.resolve(EMPTY_DATA_SHA_256);\n }\n\n return Promise.resolve()\n .then(() =>\n locateWindow().crypto.subtle.digest(SHA_256_HASH, this.toHash)\n )\n .then((data) => Promise.resolve(new Uint8Array(data)));\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {\n BLOCK_SIZE,\n DIGEST_LENGTH,\n INIT,\n KEY,\n MAX_HASHABLE_LENGTH\n} from \"./constants\";\n\n/**\n * @internal\n */\nexport class RawSha256 {\n private state: Int32Array = Int32Array.from(INIT);\n private temp: Int32Array = new Int32Array(64);\n private buffer: Uint8Array = new Uint8Array(64);\n private bufferLength: number = 0;\n private bytesHashed: number = 0;\n\n /**\n * @internal\n */\n finished: boolean = false;\n\n update(data: Uint8Array): void {\n if (this.finished) {\n throw new Error(\"Attempted to update an already finished hash.\");\n }\n\n let position = 0;\n let { byteLength } = data;\n this.bytesHashed += byteLength;\n\n if (this.bytesHashed * 8 > MAX_HASHABLE_LENGTH) {\n throw new Error(\"Cannot hash more than 2^53 - 1 bits\");\n }\n\n while (byteLength > 0) {\n this.buffer[this.bufferLength++] = data[position++];\n byteLength--;\n\n if (this.bufferLength === BLOCK_SIZE) {\n this.hashBuffer();\n this.bufferLength = 0;\n }\n }\n }\n\n digest(): Uint8Array {\n if (!this.finished) {\n const bitsHashed = this.bytesHashed * 8;\n const bufferView = new DataView(\n this.buffer.buffer,\n this.buffer.byteOffset,\n this.buffer.byteLength\n );\n\n const undecoratedLength = this.bufferLength;\n bufferView.setUint8(this.bufferLength++, 0x80);\n\n // Ensure the final block has enough room for the hashed length\n if (undecoratedLength % BLOCK_SIZE >= BLOCK_SIZE - 8) {\n for (let i = this.bufferLength; i < BLOCK_SIZE; i++) {\n bufferView.setUint8(i, 0);\n }\n this.hashBuffer();\n this.bufferLength = 0;\n }\n\n for (let i = this.bufferLength; i < BLOCK_SIZE - 8; i++) {\n bufferView.setUint8(i, 0);\n }\n bufferView.setUint32(\n BLOCK_SIZE - 8,\n Math.floor(bitsHashed / 0x100000000),\n true\n );\n bufferView.setUint32(BLOCK_SIZE - 4, bitsHashed);\n\n this.hashBuffer();\n\n this.finished = true;\n }\n\n // The value in state is little-endian rather than big-endian, so flip\n // each word into a new Uint8Array\n const out = new Uint8Array(DIGEST_LENGTH);\n for (let i = 0; i < 8; i++) {\n out[i * 4] = (this.state[i] >>> 24) & 0xff;\n out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;\n out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;\n out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;\n }\n\n return out;\n }\n\n private hashBuffer(): void {\n const { buffer, state } = this;\n\n let state0 = state[0],\n state1 = state[1],\n state2 = state[2],\n state3 = state[3],\n state4 = state[4],\n state5 = state[5],\n state6 = state[6],\n state7 = state[7];\n\n for (let i = 0; i < BLOCK_SIZE; i++) {\n if (i < 16) {\n this.temp[i] =\n ((buffer[i * 4] & 0xff) << 24) |\n ((buffer[i * 4 + 1] & 0xff) << 16) |\n ((buffer[i * 4 + 2] & 0xff) << 8) |\n (buffer[i * 4 + 3] & 0xff);\n } else {\n let u = this.temp[i - 2];\n const t1 =\n ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);\n\n u = this.temp[i - 15];\n const t2 =\n ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);\n\n this.temp[i] =\n ((t1 + this.temp[i - 7]) | 0) + ((t2 + this.temp[i - 16]) | 0);\n }\n\n const t1 =\n ((((((state4 >>> 6) | (state4 << 26)) ^\n ((state4 >>> 11) | (state4 << 21)) ^\n ((state4 >>> 25) | (state4 << 7))) +\n ((state4 & state5) ^ (~state4 & state6))) |\n 0) +\n ((state7 + ((KEY[i] + this.temp[i]) | 0)) | 0)) |\n 0;\n\n const t2 =\n ((((state0 >>> 2) | (state0 << 30)) ^\n ((state0 >>> 13) | (state0 << 19)) ^\n ((state0 >>> 22) | (state0 << 10))) +\n ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) |\n 0;\n\n state7 = state6;\n state6 = state5;\n state5 = state4;\n state4 = (state3 + t1) | 0;\n state3 = state2;\n state2 = state1;\n state1 = state0;\n state0 = (t1 + t2) | 0;\n }\n\n state[0] += state0;\n state[1] += state1;\n state[2] += state2;\n state[3] += state3;\n state[4] += state4;\n state[5] += state5;\n state[6] += state6;\n state[7] += state7;\n }\n}\n","/**\n * @internal\n */\nexport const BLOCK_SIZE: number = 64;\n\n/**\n * @internal\n */\nexport const DIGEST_LENGTH: number = 32;\n\n/**\n * @internal\n */\nexport const KEY = new Uint32Array([\n 0x428a2f98,\n 0x71374491,\n 0xb5c0fbcf,\n 0xe9b5dba5,\n 0x3956c25b,\n 0x59f111f1,\n 0x923f82a4,\n 0xab1c5ed5,\n 0xd807aa98,\n 0x12835b01,\n 0x243185be,\n 0x550c7dc3,\n 0x72be5d74,\n 0x80deb1fe,\n 0x9bdc06a7,\n 0xc19bf174,\n 0xe49b69c1,\n 0xefbe4786,\n 0x0fc19dc6,\n 0x240ca1cc,\n 0x2de92c6f,\n 0x4a7484aa,\n 0x5cb0a9dc,\n 0x76f988da,\n 0x983e5152,\n 0xa831c66d,\n 0xb00327c8,\n 0xbf597fc7,\n 0xc6e00bf3,\n 0xd5a79147,\n 0x06ca6351,\n 0x14292967,\n 0x27b70a85,\n 0x2e1b2138,\n 0x4d2c6dfc,\n 0x53380d13,\n 0x650a7354,\n 0x766a0abb,\n 0x81c2c92e,\n 0x92722c85,\n 0xa2bfe8a1,\n 0xa81a664b,\n 0xc24b8b70,\n 0xc76c51a3,\n 0xd192e819,\n 0xd6990624,\n 0xf40e3585,\n 0x106aa070,\n 0x19a4c116,\n 0x1e376c08,\n 0x2748774c,\n 0x34b0bcb5,\n 0x391c0cb3,\n 0x4ed8aa4a,\n 0x5b9cca4f,\n 0x682e6ff3,\n 0x748f82ee,\n 0x78a5636f,\n 0x84c87814,\n 0x8cc70208,\n 0x90befffa,\n 0xa4506ceb,\n 0xbef9a3f7,\n 0xc67178f2\n]);\n\n/**\n * @internal\n */\nexport const INIT = [\n 0x6a09e667,\n 0xbb67ae85,\n 0x3c6ef372,\n 0xa54ff53a,\n 0x510e527f,\n 0x9b05688c,\n 0x1f83d9ab,\n 0x5be0cd19\n];\n\n/**\n * @internal\n */\nexport const MAX_HASHABLE_LENGTH = 2 ** 53 - 1;\n","export * from \"./jsSha256\";\n","import { BLOCK_SIZE } from \"./constants\";\nimport { RawSha256 } from \"./RawSha256\";\nimport { Hash, SourceData } from \"@aws-sdk/types\";\nimport { isEmptyData, convertToBuffer } from \"@aws-crypto/util\";\n\nexport class Sha256 implements Hash {\n private readonly hash = new RawSha256();\n private readonly outer?: RawSha256;\n private error: any;\n\n constructor(secret?: SourceData) {\n if (secret) {\n this.outer = new RawSha256();\n const inner = bufferFromSecret(secret);\n const outer = new Uint8Array(BLOCK_SIZE);\n outer.set(inner);\n\n for (let i = 0; i < BLOCK_SIZE; i++) {\n inner[i] ^= 0x36;\n outer[i] ^= 0x5c;\n }\n\n this.hash.update(inner);\n this.outer.update(outer);\n\n // overwrite the copied key in memory\n for (let i = 0; i < inner.byteLength; i++) {\n inner[i] = 0;\n }\n }\n }\n\n update(toHash: SourceData): void {\n if (isEmptyData(toHash) || this.error) {\n return;\n }\n\n try {\n this.hash.update(convertToBuffer(toHash));\n } catch (e) {\n this.error = e;\n }\n }\n\n /* This synchronous method keeps compatibility\n * with the v2 aws-sdk.\n */\n digestSync(): Uint8Array {\n if (this.error) {\n throw this.error;\n }\n\n if (this.outer) {\n if (!this.outer.finished) {\n this.outer.update(this.hash.digest());\n }\n\n return this.outer.digest();\n }\n\n return this.hash.digest();\n }\n\n /* The underlying digest method here is synchronous.\n * To keep the same interface with the other hash functions\n * the default is to expose this as an async method.\n * However, it can sometimes be useful to have a sync method.\n */\n async digest(): Promise {\n return this.digestSync();\n }\n}\n\nfunction bufferFromSecret(secret: SourceData): Uint8Array {\n let input = convertToBuffer(secret);\n\n if (input.byteLength > BLOCK_SIZE) {\n const bufferHash = new RawSha256();\n bufferHash.update(input);\n input = bufferHash.digest();\n }\n\n const buffer = new Uint8Array(BLOCK_SIZE);\n buffer.set(input);\n return buffer;\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export * from \"./supportsWebCrypto\";\n","type SubtleCryptoMethod =\n | \"decrypt\"\n | \"digest\"\n | \"encrypt\"\n | \"exportKey\"\n | \"generateKey\"\n | \"importKey\"\n | \"sign\"\n | \"verify\";\n\nconst subtleCryptoMethods: Array = [\n \"decrypt\",\n \"digest\",\n \"encrypt\",\n \"exportKey\",\n \"generateKey\",\n \"importKey\",\n \"sign\",\n \"verify\"\n];\n\nexport function supportsWebCrypto(window: Window): boolean {\n if (\n supportsSecureRandom(window) &&\n typeof window.crypto.subtle === \"object\"\n ) {\n const { subtle } = window.crypto;\n\n return supportsSubtleCrypto(subtle);\n }\n\n return false;\n}\n\nexport function supportsSecureRandom(window: Window): boolean {\n if (typeof window === \"object\" && typeof window.crypto === \"object\") {\n const { getRandomValues } = window.crypto;\n\n return typeof getRandomValues === \"function\";\n }\n\n return false;\n}\n\nexport function supportsSubtleCrypto(subtle: SubtleCrypto) {\n return (\n subtle &&\n subtleCryptoMethods.every(\n methodName => typeof subtle[methodName] === \"function\"\n )\n );\n}\n\nexport async function supportsZeroByteGCM(subtle: SubtleCrypto) {\n if (!supportsSubtleCrypto(subtle)) return false;\n try {\n const key = await subtle.generateKey(\n { name: \"AES-GCM\", length: 128 },\n false,\n [\"encrypt\"]\n );\n const zeroByteAuthTag = await subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: new Uint8Array(Array(12)),\n additionalData: new Uint8Array(Array(16)),\n tagLength: 128\n },\n key,\n new Uint8Array(0)\n );\n return zeroByteAuthTag.byteLength === 16;\n } catch {\n return false;\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { SourceData } from \"@aws-sdk/types\";\nimport { fromUtf8 as fromUtf8Browser } from \"@aws-sdk/util-utf8-browser\";\n\n// Quick polyfill\nconst fromUtf8 =\n typeof Buffer !== \"undefined\" && Buffer.from\n ? (input: string) => Buffer.from(input, \"utf8\")\n : fromUtf8Browser;\n\nexport function convertToBuffer(data: SourceData): Uint8Array {\n // Already a Uint8, do nothing\n if (data instanceof Uint8Array) return data;\n\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(\n data.buffer,\n data.byteOffset,\n data.byteLength / Uint8Array.BYTES_PER_ELEMENT\n );\n }\n\n return new Uint8Array(data);\n}\n","// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport { convertToBuffer } from \"./convertToBuffer\";\nexport { isEmptyData } from \"./isEmptyData\";\nexport { numToUint8 } from \"./numToUint8\";\nexport {uint32ArrayFrom} from './uint32ArrayFrom';\n","// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { SourceData } from \"@aws-sdk/types\";\n\nexport function isEmptyData(data: SourceData): boolean {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n\n return data.byteLength === 0;\n}\n","// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function numToUint8(num: number) {\n return new Uint8Array([\n (num & 0xff000000) >> 24,\n (num & 0x00ff0000) >> 16,\n (num & 0x0000ff00) >> 8,\n num & 0x000000ff,\n ]);\n}\n","// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// IE 11 does not support Array.from, so we do it manually\nexport function uint32ArrayFrom(a_lookUpTable: Array): Uint32Array {\n if (!Array.from) {\n const return_array = new Uint32Array(a_lookUpTable.length)\n let a_index = 0\n while (a_index < a_lookUpTable.length) {\n return_array[a_index] = a_lookUpTable[a_index]\n }\n return return_array\n }\n return Uint32Array.from(a_lookUpTable)\n}\n","import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from \"./pureJs\";\nimport { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from \"./whatwgEncodingApi\";\nexport const fromUtf8 = (input) => typeof TextEncoder === \"function\" ? textEncoderFromUtf8(input) : jsFromUtf8(input);\nexport const toUtf8 = (input) => typeof TextDecoder === \"function\" ? textEncoderToUtf8(input) : jsToUtf8(input);\n","export function fromUtf8(input) {\n return new TextEncoder().encode(input);\n}\nexport function toUtf8(input) {\n return new TextDecoder(\"utf-8\").decode(input);\n}\n","export const fromUtf8 = (input) => {\n const bytes = [];\n for (let i = 0, len = input.length; i < len; i++) {\n const value = input.charCodeAt(i);\n if (value < 0x80) {\n bytes.push(value);\n }\n else if (value < 0x800) {\n bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);\n }\n else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);\n bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);\n }\n else {\n bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);\n }\n }\n return Uint8Array.from(bytes);\n};\nexport const toUtf8 = (input) => {\n let decoded = \"\";\n for (let i = 0, len = input.length; i < len; i++) {\n const byte = input[i];\n if (byte < 0x80) {\n decoded += String.fromCharCode(byte);\n }\n else if (0b11000000 <= byte && byte < 0b11100000) {\n const nextByte = input[++i];\n decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));\n }\n else if (0b11110000 <= byte && byte < 0b101101101) {\n const surrogatePair = [byte, input[++i], input[++i], input[++i]];\n const encoded = \"%\" + surrogatePair.map((byteValue) => byteValue.toString(16)).join(\"%\");\n decoded += decodeURIComponent(encoded);\n }\n else {\n decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));\n }\n }\n return decoded;\n};\n","import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from \"./pureJs\";\nimport { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from \"./whatwgEncodingApi\";\n\ndeclare const TextDecoder: Function | undefined;\ndeclare const TextEncoder: Function | undefined;\n\nexport const fromUtf8 = (input: string): Uint8Array =>\n typeof TextEncoder === \"function\" ? textEncoderFromUtf8(input) : jsFromUtf8(input);\n\nexport const toUtf8 = (input: Uint8Array): string =>\n typeof TextDecoder === \"function\" ? textEncoderToUtf8(input) : jsToUtf8(input);\n","/**\n * A declaration of the global TextEncoder and TextDecoder constructors.\n *\n * @see https://encoding.spec.whatwg.org/\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nnamespace Encoding {\n interface TextDecoderOptions {\n fatal?: boolean;\n ignoreBOM?: boolean;\n }\n\n interface TextDecodeOptions {\n stream?: boolean;\n }\n\n interface TextDecoder {\n readonly encoding: string;\n readonly fatal: boolean;\n readonly ignoreBOM: boolean;\n decode(input?: ArrayBuffer | ArrayBufferView, options?: TextDecodeOptions): string;\n }\n\n export interface TextDecoderConstructor {\n new (label?: string, options?: TextDecoderOptions): TextDecoder;\n }\n\n interface TextEncoder {\n readonly encoding: \"utf-8\";\n encode(input?: string): Uint8Array;\n }\n\n export interface TextEncoderConstructor {\n new (): TextEncoder;\n }\n}\n\ndeclare const TextDecoder: Encoding.TextDecoderConstructor;\n\ndeclare const TextEncoder: Encoding.TextEncoderConstructor;\n\nexport function fromUtf8(input: string): Uint8Array {\n return new TextEncoder().encode(input);\n}\n\nexport function toUtf8(input: Uint8Array): string {\n return new TextDecoder(\"utf-8\").decode(input);\n}\n","/**\n * Converts a JS string from its native UCS-2/UTF-16 representation into a\n * Uint8Array of the bytes used to represent the equivalent characters in UTF-8.\n *\n * Cribbed from the `goog.crypt.stringToUtf8ByteArray` function in the Google\n * Closure library, though updated to use typed arrays.\n */\nexport const fromUtf8 = (input: string): Uint8Array => {\n const bytes: Array = [];\n for (let i = 0, len = input.length; i < len; i++) {\n const value = input.charCodeAt(i);\n if (value < 0x80) {\n bytes.push(value);\n } else if (value < 0x800) {\n bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);\n } else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);\n bytes.push(\n (surrogatePair >> 18) | 0b11110000,\n ((surrogatePair >> 12) & 0b111111) | 0b10000000,\n ((surrogatePair >> 6) & 0b111111) | 0b10000000,\n (surrogatePair & 0b111111) | 0b10000000\n );\n } else {\n bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);\n }\n }\n\n return Uint8Array.from(bytes);\n};\n\n/**\n * Converts a typed array of bytes containing UTF-8 data into a native JS\n * string.\n *\n * Partly cribbed from the `goog.crypt.utf8ByteArrayToString` function in the\n * Google Closure library, though updated to use typed arrays and to better\n * handle astral plane code points.\n */\nexport const toUtf8 = (input: Uint8Array): string => {\n let decoded = \"\";\n for (let i = 0, len = input.length; i < len; i++) {\n const byte = input[i];\n if (byte < 0x80) {\n decoded += String.fromCharCode(byte);\n } else if (0b11000000 <= byte && byte < 0b11100000) {\n const nextByte = input[++i];\n decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));\n } else if (0b11110000 <= byte && byte < 0b101101101) {\n const surrogatePair = [byte, input[++i], input[++i], input[++i]];\n const encoded = \"%\" + surrogatePair.map((byteValue) => byteValue.toString(16)).join(\"%\");\n decoded += decodeURIComponent(encoded);\n } else {\n decoded += String.fromCharCode(\n ((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)\n );\n }\n }\n\n return decoded;\n};\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","const fallbackWindow = {};\nexport function locateWindow() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n else if (typeof self !== \"undefined\") {\n return self;\n }\n return fallbackWindow;\n}\n","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isBrowser = \"object\" !== 'undefined';\nvar hasOwn = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nif (!isBrowser) {\n withEmotionCache = function withEmotionCache(func) {\n return function (props) {\n var cache = useContext(EmotionCacheContext);\n\n if (cache === null) {\n // yes, we're potentially creating this on every render\n // it doesn't actually matter though since it's only on the server\n // so there will only every be a single render\n // that could change in the future because of suspense and etc. but for now,\n // this works and i don't want to optimise for a future thing that we aren't sure about\n cache = createCache({\n key: 'css'\n });\n return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {\n value: cache\n }, func(props, cache));\n } else {\n return func(props, cache);\n }\n };\n };\n}\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isBrowser as i, useTheme as u, withEmotionCache as w };\n","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser$1 } from './emotion-element-43c6fea0.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-43c6fea0.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.11.4\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/emotion-react.cjs.mjs\",\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs\",\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": {\n\t\t\ttypes: {\n\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t},\n\t\t\t\"default\": \"./macro.js\"\n\t\t}\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.*\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.11.0\",\n\t\t\"@emotion/cache\": \"^11.11.0\",\n\t\t\"@emotion/serialize\": \"^1.1.3\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.1\",\n\t\t\"@emotion/utils\": \"^1.2.1\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.1\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.11.2\",\n\t\t\"@emotion/css-prettifier\": \"1.1.3\",\n\t\t\"@emotion/server\": \"11.11.0\",\n\t\t\"@emotion/styled\": \"11.11.0\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": {\n\t\t\t\t\ttypes: {\n\t\t\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t\t\t},\n\t\t\t\t\t\"default\": \"./macro.js\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n // $FlowFixMe\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n\n if (!isBrowser$1) {\n var _ref;\n\n var serializedNames = serialized.name;\n var serializedStyles = serialized.styles;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n serializedStyles += next.styles;\n next = next.next;\n }\n\n var shouldCache = cache.compat === true;\n var rules = cache.insert(\"\", {\n name: serializedNames,\n styles: serializedStyles\n }, cache.sheet, shouldCache);\n\n if (shouldCache) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref = {}, _ref[\"data-emotion\"] = cache.key + \"-global \" + serializedNames, _ref.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref.nonce = cache.sheet.nonce, _ref));\n } // yes, i know these hooks are used conditionally\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","//\n// Main\n//\nexport default function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"AX\": [\n \"H\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"JP\": [\n \"H\",\n \"h\",\n \"K\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ]\n};\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith;\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \" \\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n return _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \" \\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \" \\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \" \\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage ? 'default message' : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { UnsupportedFormatterError } from './error';\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback } from '@mui/utils';\n\n// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase : never` once generatePropTypes runs with TS 4.1\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mapEventPropToEvent(eventProp) {\n return eventProp.substring(2).toLowerCase();\n}\nfunction clickedRootScrollbar(event, doc) {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\n}\n/**\n * Listen for click events that occur somewhere in the document, outside of the element itself.\n * For instance, if you need to hide a menu when people click anywhere else on your page.\n *\n * Demos:\n *\n * - [Click-Away Listener](https://mui.com/base-ui/react-click-away-listener/)\n *\n * API:\n *\n * - [ClickAwayListener API](https://mui.com/base-ui/react-click-away-listener/components-api/#click-away-listener)\n */\nfunction ClickAwayListener(props) {\n const {\n children,\n disableReactTree = false,\n mouseEvent = 'onClick',\n onClickAway,\n touchEvent = 'onTouchEnd'\n } = props;\n const movedRef = React.useRef(false);\n const nodeRef = React.useRef(null);\n const activatedRef = React.useRef(false);\n const syntheticEventRef = React.useRef(false);\n React.useEffect(() => {\n // Ensure that this component is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n setTimeout(() => {\n activatedRef.current = true;\n }, 0);\n return () => {\n activatedRef.current = false;\n };\n }, []);\n const handleRef = useForkRef(\n // @ts-expect-error TODO upstream fix\n children.ref, nodeRef);\n\n // The handler doesn't take event.defaultPrevented into account:\n //\n // event.preventDefault() is meant to stop default behaviors like\n // clicking a checkbox to check it, hitting a button to submit a form,\n // and hitting left arrow to move the cursor in a text input etc.\n // Only special HTML elements have these default behaviors.\n const handleClickAway = useEventCallback(event => {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = syntheticEventRef.current;\n syntheticEventRef.current = false;\n const doc = ownerDocument(nodeRef.current);\n\n // 1. IE11 support, which trigger the handleClickAway even after the unbind\n // 2. The child might render null.\n // 3. Behave like a blur listener.\n if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {\n return;\n }\n\n // Do not act if user performed touchmove\n if (movedRef.current) {\n movedRef.current = false;\n return;\n }\n let insideDOM;\n\n // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;\n } else {\n insideDOM = !doc.documentElement.contains(\n // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target) || nodeRef.current.contains(\n // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target);\n }\n if (!insideDOM && (disableReactTree || !insideReactTree)) {\n onClickAway(event);\n }\n });\n\n // Keep track of mouse/touch events that bubbled up through the portal.\n const createHandleSynthetic = handlerName => event => {\n syntheticEventRef.current = true;\n const childrenPropsHandler = children.props[handlerName];\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n const childrenProps = {\n ref: handleRef\n };\n if (touchEvent !== false) {\n childrenProps[touchEvent] = createHandleSynthetic(touchEvent);\n }\n React.useEffect(() => {\n if (touchEvent !== false) {\n const mappedTouchEvent = mapEventPropToEvent(touchEvent);\n const doc = ownerDocument(nodeRef.current);\n const handleTouchMove = () => {\n movedRef.current = true;\n };\n doc.addEventListener(mappedTouchEvent, handleClickAway);\n doc.addEventListener('touchmove', handleTouchMove);\n return () => {\n doc.removeEventListener(mappedTouchEvent, handleClickAway);\n doc.removeEventListener('touchmove', handleTouchMove);\n };\n }\n return undefined;\n }, [handleClickAway, touchEvent]);\n if (mouseEvent !== false) {\n childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);\n }\n React.useEffect(() => {\n if (mouseEvent !== false) {\n const mappedMouseEvent = mapEventPropToEvent(mouseEvent);\n const doc = ownerDocument(nodeRef.current);\n doc.addEventListener(mappedMouseEvent, handleClickAway);\n return () => {\n doc.removeEventListener(mappedMouseEvent, handleClickAway);\n };\n }\n return undefined;\n }, [handleClickAway, mouseEvent]);\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: /*#__PURE__*/React.cloneElement(children, childrenProps)\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ClickAwayListener.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The wrapped element.\n */\n children: elementAcceptingRef.isRequired,\n /**\n * If `true`, the React tree is ignored and only the DOM tree is considered.\n * This prop changes how portaled elements are handled.\n * @default false\n */\n disableReactTree: PropTypes.bool,\n /**\n * The mouse event to listen to. You can disable the listener by providing `false`.\n * @default 'onClick'\n */\n mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),\n /**\n * Callback fired when a \"click away\" event is detected.\n */\n onClickAway: PropTypes.func.isRequired,\n /**\n * The touch event to listen to. You can disable the listener by providing `false`.\n * @default 'onTouchEnd'\n */\n touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n ClickAwayListener['propTypes' + ''] = exactProp(ClickAwayListener.propTypes);\n}\nexport { ClickAwayListener };","'use client';\n\n/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n// Inspired by https://github.com/focus-trap/tabbable\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n // in Chrome,
,