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BU,GAM5B,OALkB,WAEdD,EAAmB,aACnB,YAAW,EAAiBC","sources":["webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Amplify.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/OAuthHelper/GoogleOAuth.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/OAuthHelper/FacebookOAuth.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/OAuthHelper/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Credentials.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Hub.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/JS.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Logger/ConsoleLogger.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Parser.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Platform/version.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Platform/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Signer.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/StorageHelper/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/UniversalStorage/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Util/DateUtils.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Util/Retry.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/Util/StringUtils.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/constants.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/I18n/I18n.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/I18n/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-crypto/sha256-js/src/RawSha256.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-crypto/sha256-js/src/constants.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-crypto/sha256-js/src/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-crypto/sha256-js/src/jsSha256.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-sdk/util-utf8-browser/src/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-sdk/util-utf8-browser/src/whatwgEncodingApi.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/node_modules/@aws-sdk/util-utf8-browser/src/pureJs.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/node_modules/zen-observable-ts/src/zenObservable.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/src/Providers/PubSubProvider.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/src/Providers/MqttOverWSProvider.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/src/Providers/AWSAppSyncProvider.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/node_modules/graphql/language/location.mjs","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/node_modules/graphql/error/printError.mjs","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/node_modules/graphql/error/GraphQLError.mjs","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/src/Providers/AWSAppSyncRealTimeProvider.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/src/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/pubsub/src/PubSub.ts","webpack://leadsbridge/../../../../../webpack/universalModuleDefinition","webpack://leadsbridge/../../../../../webpack/bootstrap","webpack://leadsbridge/../../../../../src/index.ts","webpack://leadsbridge/aws_amplify_ui/./src/Anchor.css","webpack://leadsbridge/aws_amplify_ui/./src/Button.css","webpack://leadsbridge/aws_amplify_ui/./src/Form.css","webpack://leadsbridge/aws_amplify_ui/./src/Hint.css","webpack://leadsbridge/aws_amplify_ui/./src/Input.css","webpack://leadsbridge/aws_amplify_ui/./src/Nav.css","webpack://leadsbridge/aws_amplify_ui/./src/PhotoPicker.css","webpack://leadsbridge/aws_amplify_ui/./src/Section.css","webpack://leadsbridge/aws_amplify_ui/./src/SelectInput.css","webpack://leadsbridge/aws_amplify_ui/./src/Strike.css","webpack://leadsbridge/aws_amplify_ui/./src/Toast.css","webpack://leadsbridge/aws_amplify_ui/./src/Totp.css","webpack://leadsbridge/aws_amplify_ui/./src/XR.css","webpack://leadsbridge/./node_modules/@aws-crypto/crc32/src/index.ts","webpack://leadsbridge/./node_modules/@aws-crypto/ie11-detection/src/MsWindow.ts","webpack://leadsbridge/./node_modules/@aws-crypto/ie11-detection/src/index.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-browser/src/constants.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-browser/src/crossPlatformSha256.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-browser/src/ie11Sha256.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-browser/src/index.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-browser/src/isEmptyData.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-browser/src/webCryptoSha256.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-js/src/RawSha256.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-js/src/constants.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-js/src/index.ts","webpack://leadsbridge/./node_modules/@aws-crypto/sha256-js/src/jsSha256.ts","webpack://leadsbridge/./node_modules/@aws-crypto/supports-web-crypto/src/index.ts","webpack://leadsbridge/./node_modules/@aws-crypto/supports-web-crypto/src/supportsWebCrypto.ts","webpack://leadsbridge/./node_modules/@aws-amplify/core/src/ServiceWorker/ServiceWorker.ts","webpack://leadsbridge/./node_modules/@aws-amplify/storage/src/providers/axios-http-handler.ts","webpack://leadsbridge/./node_modules/@aws-amplify/storage/src/providers/AWSS3ProviderManagedUpload.ts","webpack://leadsbridge/./node_modules/@aws-amplify/storage/src/providers/AWSS3Provider.ts","webpack://leadsbridge/./node_modules/@aws-amplify/storage/src/Storage.ts","webpack://leadsbridge/./node_modules/@aws-amplify/storage/src/index.ts","webpack://leadsbridge/./node_modules/aws-amplify/src/index.ts","webpack://leadsbridge/./node_modules/@aws-amplify/ui-components/dist/esm-es5/auth-types-78df304e.js","webpack://leadsbridge/./node_modules/@aws-amplify/ui-components/dist/esm-es5/storage-types-f257c0f2.js","webpack://leadsbridge/./node_modules/@aws-amplify/ui-components/dist/esm-es5/Translations-108d469f.js","webpack://leadsbridge/./node_modules/@aws-amplify/ui-components/dist/esm-es5/constants-c8ecaa24.js","webpack://leadsbridge/./node_modules/@aws-amplify/ui-components/dist/esm-es5/helpers-14fcb50c.js"],"sourcesContent":["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\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","/*\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 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 { getAmplifyUserAgent } from './Platform';\nimport { Amplify } from './Amplify';\nimport {\n\tfromCognitoIdentity,\n\tFromCognitoIdentityParameters,\n\tfromCognitoIdentityPool,\n\tFromCognitoIdentityPoolParameters,\n} from '@aws-sdk/credential-provider-cognito-identity';\nimport {\n\tCognitoIdentityClient,\n\tGetIdCommand,\n} from '@aws-sdk/client-cognito-identity';\nimport { CredentialProvider } from '@aws-sdk/types';\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\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\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\tlet identityId = undefined;\n\t\ttry {\n\t\t\tawait this._storageSync;\n\t\t\tidentityId = this._storage.getItem('CognitoIdentityId-' + identityPoolId);\n\t\t\tthis._identityId = identityId;\n\t\t} catch (e) {\n\t\t\tlogger.debug('Failed to get the cached identityId', e);\n\t\t}\n\n\t\tconst cognitoClient = new CognitoIdentityClient({\n\t\t\tregion,\n\t\t\tcustomUserAgent: getAmplifyUserAgent(),\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\tthis._storage.removeItem('CognitoIdentityId-' + identityPoolId);\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 = new CognitoIdentityClient({\n\t\t\tregion,\n\t\t\tcustomUserAgent: getAmplifyUserAgent(),\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 = new CognitoIdentityClient({\n\t\t\tregion,\n\t\t\tcustomUserAgent: getAmplifyUserAgent(),\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\tconst { IdentityId } = await cognitoClient.send(\n\t\t\t\tnew GetIdCommand({\n\t\t\t\t\tIdentityPoolId: identityPoolId,\n\t\t\t\t\tLogins: logins,\n\t\t\t\t})\n\t\t\t);\n\t\t\tthis._identityId = IdentityId;\n\n\t\t\tconst cognitoIdentityParams: FromCognitoIdentityParameters = {\n\t\t\t\tclient: cognitoClient,\n\t\t\t\tlogins,\n\t\t\t\tidentityId: IdentityId,\n\t\t\t};\n\n\t\t\tconst credentialsFromCognitoIdentity = fromCognitoIdentity(\n\t\t\t\tcognitoIdentityParams\n\t\t\t);\n\n\t\t\treturn credentialsFromCognitoIdentity();\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\tconst { identityPoolId } = this._config;\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\ttry {\n\t\t\t\t\t\t\tawait this._storageSync;\n\t\t\t\t\t\t\tthis._storage.setItem(\n\t\t\t\t\t\t\t\t'CognitoIdentityId-' + identityPoolId,\n\t\t\t\t\t\t\t\tcredentials.identityId // TODO: IdentityId is currently not returned by fromCognitoIdentityPool()\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 cache identityId', e);\n\t\t\t\t\t\t}\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/**\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","/*\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'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 \npsuedo 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\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","/*\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 { 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\n/**\n * Write logs\n * @class Logger\n */\nexport class ConsoleLogger implements Logger {\n\tname: string;\n\tlevel: string;\n\n\t/**\n\t * @constructor\n\t * @param {string} name - Name of the logger\n\t */\n\tconstructor(name, level = 'WARN') {\n\t\tthis.name = name;\n\t\tthis.level = level;\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\t/**\n\t * Write log\n\t * @method\n\t * @memeberof Logger\n\t * @param {string} type - log type, default INFO\n\t * @param {string|object} msg - Logging message or object\n\t */\n\t_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 === 'ERROR' && console.error) {\n\t\t\tlog = console.error.bind(console);\n\t\t}\n\t\tif (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\n\t\tif (msg.length === 1 && typeof msg[0] === 'string') {\n\t\t\tlog(`${prefix} - ${msg[0]}`);\n\t\t} else if (msg.length === 1) {\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\tlog(`${prefix} - ${msg[0]}`, obj);\n\t\t} else {\n\t\t\tlog(prefix, msg);\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('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('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('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('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('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('VERBOSE', ...msg);\n\t}\n}\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};\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\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\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","// generated by genversion\nexport const version = '3.8.14';\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 = () => {\n\treturn Platform.userAgent;\n};\n\n/**\n * @deprecated use named import\n */\nexport default Platform;\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';\nimport { Sha256 as jsSha256 } from '@aws-crypto/sha256-js';\nimport { toHex } from '@aws-sdk/util-hex-encoding';\nimport { parse, format } from 'url';\nimport { DateUtils } from './Util';\n\nconst logger = new Logger('Signer');\n\nconst DEFAULT_ALGORITHM = 'AWS4-HMAC-SHA256';\nconst IOT_SERVICE_NAME = 'iotdevicegateway';\n\nconst encrypt = function(key, src) {\n\tconst hash = new jsSha256(key);\n\thash.update(src);\n\treturn hash.digestSync();\n};\n\nconst hash = function(src) {\n\tconst arg = src || '';\n\tconst hash = new jsSha256();\n\thash.update(arg);\n\treturn toHex(hash.digestSync());\n};\n\n/**\n * @private\n * RFC 3986 compliant version of encodeURIComponent\n */\nconst escape_RFC3986 = function(component) {\n\treturn component.replace(/[!'()*]/g, function(c) {\n\t\treturn (\n\t\t\t'%' +\n\t\t\tc\n\t\t\t\t.charCodeAt(0)\n\t\t\t\t.toString(16)\n\t\t\t\t.toUpperCase()\n\t\t);\n\t});\n};\n\n/**\n * @private\n * Create canonical query string\n *\n */\nconst canonical_query = function(query) {\n\tif (!query || query.length === 0) {\n\t\treturn '';\n\t}\n\n\treturn query\n\t\t.split('&')\n\t\t.map(e => {\n\t\t\tconst key_val = e.split('=');\n\n\t\t\tif (key_val.length === 1) {\n\t\t\t\treturn e;\n\t\t\t} else {\n\t\t\t\tconst reencoded_val = escape_RFC3986(key_val[1]);\n\t\t\t\treturn key_val[0] + '=' + reencoded_val;\n\t\t\t}\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\tconst key_a = a.split('=')[0];\n\t\t\tconst key_b = b.split('=')[0];\n\t\t\tif (key_a === key_b) {\n\t\t\t\treturn a < b ? -1 : 1;\n\t\t\t} else {\n\t\t\t\treturn key_a < key_b ? -1 : 1;\n\t\t\t}\n\t\t})\n\t\t.join('&');\n};\n\n/**\n* @private\n* Create canonical headers\n*\n
\nCanonicalHeaders =\n    CanonicalHeadersEntry0 + CanonicalHeadersEntry1 + ... + CanonicalHeadersEntryN\nCanonicalHeadersEntry =\n    Lowercase(HeaderName) + ':' + Trimall(HeaderValue) + '\\n'\n
\n*/\nconst canonical_headers = function(headers) {\n\tif (!headers || Object.keys(headers).length === 0) {\n\t\treturn '';\n\t}\n\n\treturn (\n\t\tObject.keys(headers)\n\t\t\t.map(function(key) {\n\t\t\t\treturn {\n\t\t\t\t\tkey: key.toLowerCase(),\n\t\t\t\t\tvalue: headers[key] ? headers[key].trim().replace(/\\s+/g, ' ') : '',\n\t\t\t\t};\n\t\t\t})\n\t\t\t.sort(function(a, b) {\n\t\t\t\treturn a.key < b.key ? -1 : 1;\n\t\t\t})\n\t\t\t.map(function(item) {\n\t\t\t\treturn item.key + ':' + item.value;\n\t\t\t})\n\t\t\t.join('\\n') + '\\n'\n\t);\n};\n\n/**\n * List of header keys included in the canonical headers.\n * @access private\n */\nconst signed_headers = function(headers) {\n\treturn Object.keys(headers)\n\t\t.map(function(key) {\n\t\t\treturn key.toLowerCase();\n\t\t})\n\t\t.sort()\n\t\t.join(';');\n};\n\n/**\n* @private\n* Create canonical request\n* Refer to\n* {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html|Create a Canonical Request}\n*\n
\nCanonicalRequest =\n    HTTPRequestMethod + '\\n' +\n    CanonicalURI + '\\n' +\n    CanonicalQueryString + '\\n' +\n    CanonicalHeaders + '\\n' +\n    SignedHeaders + '\\n' +\n    HexEncode(Hash(RequestPayload))\n
\n*/\nconst canonical_request = function(request) {\n\tconst url_info = parse(request.url);\n\n\treturn [\n\t\trequest.method || '/',\n\t\tencodeURIComponent(url_info.pathname).replace(/%2F/gi, '/'),\n\t\tcanonical_query(url_info.query),\n\t\tcanonical_headers(request.headers),\n\t\tsigned_headers(request.headers),\n\t\thash(request.data),\n\t].join('\\n');\n};\n\nconst parse_service_info = function(request) {\n\tconst url_info = parse(request.url),\n\t\thost = url_info.host;\n\n\tconst matched = host.match(/([^\\.]+)\\.(?:([^\\.]*)\\.)?amazonaws\\.com$/);\n\tlet parsed = (matched || []).slice(1, 3);\n\n\tif (parsed[1] === 'es') {\n\t\t// Elastic Search\n\t\tparsed = parsed.reverse();\n\t}\n\n\treturn {\n\t\tservice: request.service || parsed[0],\n\t\tregion: request.region || parsed[1],\n\t};\n};\n\nconst credential_scope = function(d_str, region, service) {\n\treturn [d_str, region, service, 'aws4_request'].join('/');\n};\n\n/**\n* @private\n* Create a string to sign\n* Refer to\n* {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html|Create String to Sign}\n*\n
\nStringToSign =\n    Algorithm + \\n +\n    RequestDateTime + \\n +\n    CredentialScope + \\n +\n    HashedCanonicalRequest\n
\n*/\nconst string_to_sign = function(algorithm, canonical_request, dt_str, scope) {\n\treturn [algorithm, dt_str, scope, hash(canonical_request)].join('\\n');\n};\n\n/**\n* @private\n* Create signing key\n* Refer to\n* {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html|Calculate Signature}\n*\n
\nkSecret = your secret access key\nkDate = HMAC(\"AWS4\" + kSecret, Date)\nkRegion = HMAC(kDate, Region)\nkService = HMAC(kRegion, Service)\nkSigning = HMAC(kService, \"aws4_request\")\n
\n*/\nconst get_signing_key = function(secret_key, d_str, service_info) {\n\tlogger.debug(service_info);\n\tconst k = 'AWS4' + secret_key,\n\t\tk_date = encrypt(k, d_str),\n\t\tk_region = encrypt(k_date, service_info.region),\n\t\tk_service = encrypt(k_region, service_info.service),\n\t\tk_signing = encrypt(k_service, 'aws4_request');\n\n\treturn k_signing;\n};\n\nconst get_signature = function(signing_key, str_to_sign) {\n\treturn toHex(encrypt(signing_key, str_to_sign));\n};\n\n/**\n * @private\n * Create authorization header\n * Refer to\n * {@link http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html|Add the Signing Information}\n */\nconst get_authorization_header = function(\n\talgorithm,\n\taccess_key,\n\tscope,\n\tsigned_headers,\n\tsignature\n) {\n\treturn [\n\t\talgorithm + ' ' + 'Credential=' + access_key + '/' + scope,\n\t\t'SignedHeaders=' + signed_headers,\n\t\t'Signature=' + signature,\n\t].join(', ');\n};\n\nexport class Signer {\n\t/**\n * Sign a HTTP request, add 'Authorization' header to request param\n * @method sign\n * @memberof Signer\n * @static\n *\n * @param {object} request - HTTP request object\n
\n    request: {\n        method: GET | POST | PUT ...\n        url: ...,\n        headers: {\n            header1: ...\n        },\n        data: data\n    }\n    
\n * @param {object} access_info - AWS access credential info\n
\n    access_info: {\n        access_key: ...,\n        secret_key: ...,\n        session_token: ...\n    }\n    
\n * @param {object} [service_info] - AWS service type and region, optional,\n * if not provided then parse out from url\n
\n    service_info: {\n        service: ...,\n        region: ...\n    }\n    
\n *\n * @returns {object} Signed HTTP request\n */\n\tstatic sign(request, access_info, service_info = null) {\n\t\trequest.headers = request.headers || {};\n\n\t\t// datetime string and date string\n\t\tconst dt = DateUtils.getDateWithClockOffset(),\n\t\t\tdt_str = dt.toISOString().replace(/[:\\-]|\\.\\d{3}/g, ''),\n\t\t\td_str = dt_str.substr(0, 8);\n\n\t\tconst url_info = parse(request.url);\n\t\trequest.headers['host'] = url_info.host;\n\t\trequest.headers['x-amz-date'] = dt_str;\n\t\tif (access_info.session_token) {\n\t\t\trequest.headers['X-Amz-Security-Token'] = access_info.session_token;\n\t\t}\n\n\t\t// Task 1: Create a Canonical Request\n\t\tconst request_str = canonical_request(request);\n\t\tlogger.debug(request_str);\n\n\t\t// Task 2: Create a String to Sign\n\t\tconst serviceInfo = service_info || parse_service_info(request),\n\t\t\tscope = credential_scope(d_str, serviceInfo.region, serviceInfo.service),\n\t\t\tstr_to_sign = string_to_sign(\n\t\t\t\tDEFAULT_ALGORITHM,\n\t\t\t\trequest_str,\n\t\t\t\tdt_str,\n\t\t\t\tscope\n\t\t\t);\n\n\t\t// Task 3: Calculate the Signature\n\t\tconst signing_key = get_signing_key(\n\t\t\t\taccess_info.secret_key,\n\t\t\t\td_str,\n\t\t\t\tserviceInfo\n\t\t\t),\n\t\t\tsignature = get_signature(signing_key, str_to_sign);\n\n\t\t// Task 4: Adding the Signing information to the Request\n\t\tconst authorization_header = get_authorization_header(\n\t\t\tDEFAULT_ALGORITHM,\n\t\t\taccess_info.access_key,\n\t\t\tscope,\n\t\t\tsigned_headers(request.headers),\n\t\t\tsignature\n\t\t);\n\t\trequest.headers['Authorization'] = authorization_header;\n\n\t\treturn request;\n\t}\n\n\tstatic signUrl(\n\t\turlToSign: string,\n\t\taccessInfo: any,\n\t\tserviceInfo?: any,\n\t\texpiration?: number\n\t): string;\n\tstatic signUrl(\n\t\trequest: any,\n\t\taccessInfo: any,\n\t\tserviceInfo?: any,\n\t\texpiration?: number\n\t): string;\n\tstatic signUrl(\n\t\turlOrRequest: string | any,\n\t\taccessInfo: any,\n\t\tserviceInfo?: any,\n\t\texpiration?: number\n\t): string {\n\t\tconst urlToSign: string =\n\t\t\ttypeof urlOrRequest === 'object' ? urlOrRequest.url : urlOrRequest;\n\t\tconst method: string =\n\t\t\ttypeof urlOrRequest === 'object' ? urlOrRequest.method : 'GET';\n\t\tconst body: any =\n\t\t\ttypeof urlOrRequest === 'object' ? urlOrRequest.body : undefined;\n\n\t\tconst now = DateUtils.getDateWithClockOffset()\n\t\t\t.toISOString()\n\t\t\t.replace(/[:\\-]|\\.\\d{3}/g, '');\n\t\tconst today = now.substr(0, 8);\n\t\t// Intentionally discarding search\n\t\tconst { search, ...parsedUrl } = parse(urlToSign, true, true);\n\t\tconst { host } = parsedUrl;\n\t\tconst signedHeaders = { host };\n\n\t\tconst { region, service } =\n\t\t\tserviceInfo || parse_service_info({ url: format(parsedUrl) });\n\t\tconst credentialScope = credential_scope(today, region, service);\n\n\t\t// IoT service does not allow the session token in the canonical request\n\t\t// https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n\t\tconst sessionTokenRequired =\n\t\t\taccessInfo.session_token && service !== IOT_SERVICE_NAME;\n\t\tconst queryParams = {\n\t\t\t'X-Amz-Algorithm': DEFAULT_ALGORITHM,\n\t\t\t'X-Amz-Credential': [accessInfo.access_key, credentialScope].join('/'),\n\t\t\t'X-Amz-Date': now.substr(0, 16),\n\t\t\t...(sessionTokenRequired\n\t\t\t\t? { 'X-Amz-Security-Token': `${accessInfo.session_token}` }\n\t\t\t\t: {}),\n\t\t\t...(expiration ? { 'X-Amz-Expires': `${expiration}` } : {}),\n\t\t\t'X-Amz-SignedHeaders': Object.keys(signedHeaders).join(','),\n\t\t};\n\n\t\tconst canonicalRequest = canonical_request({\n\t\t\tmethod,\n\t\t\turl: format({\n\t\t\t\t...parsedUrl,\n\t\t\t\tquery: {\n\t\t\t\t\t...parsedUrl.query,\n\t\t\t\t\t...queryParams,\n\t\t\t\t},\n\t\t\t}),\n\t\t\theaders: signedHeaders,\n\t\t\tdata: body,\n\t\t});\n\n\t\tconst stringToSign = string_to_sign(\n\t\t\tDEFAULT_ALGORITHM,\n\t\t\tcanonicalRequest,\n\t\t\tnow,\n\t\t\tcredentialScope\n\t\t);\n\n\t\tconst signing_key = get_signing_key(accessInfo.secret_key, today, {\n\t\t\tregion,\n\t\t\tservice,\n\t\t});\n\t\tconst signature = get_signature(signing_key, stringToSign);\n\n\t\tconst additionalQueryParams = {\n\t\t\t'X-Amz-Signature': signature,\n\t\t\t...(accessInfo.session_token && {\n\t\t\t\t'X-Amz-Security-Token': accessInfo.session_token,\n\t\t\t}),\n\t\t};\n\n\t\tconst result = format({\n\t\t\tprotocol: parsedUrl.protocol,\n\t\t\tslashes: true,\n\t\t\thostname: parsedUrl.hostname,\n\t\t\tport: parsedUrl.port,\n\t\t\tpathname: parsedUrl.pathname,\n\t\t\tquery: {\n\t\t\t\t...parsedUrl.query,\n\t\t\t\t...queryParams,\n\t\t\t\t...additionalQueryParams,\n\t\t\t},\n\t\t});\n\n\t\treturn result;\n\t}\n}\n\n/**\n * @deprecated use per-function import\n */\nexport default Signer;\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","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// Required for CognitoUserSession\n\t\t\tcase 'idToken':\n\t\t\t\tthis.setUniversalItem(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// refreshToken isn't shared with the server so that the client handles refreshing\n\t\t\t// case 'refreshToken':\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 * Date & time utility functions to abstract the `aws-sdk` away from users.\n * (v2 => v3 modularization is a breaking change)\n *\n * @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262\n */\n\nconst FIVE_MINUTES_IN_MS = 1000 * 60 * 5;\n\nexport const DateUtils = {\n\t/**\n\t * Milliseconds to offset the date to compensate for clock skew between device & services\n\t */\n\tclockOffset: 0,\n\n\tgetDateWithClockOffset() {\n\t\tif (DateUtils.clockOffset) {\n\t\t\treturn new Date(new Date().getTime() + DateUtils.clockOffset);\n\t\t} else {\n\t\t\treturn new Date();\n\t\t}\n\t},\n\n\t/**\n\t * @returns {number} Clock offset in milliseconds\n\t */\n\tgetClockOffset() {\n\t\treturn DateUtils.clockOffset;\n\t},\n\n\tgetHeaderStringFromDate(date: Date = DateUtils.getDateWithClockOffset()) {\n\t\treturn date.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '');\n\t},\n\n\tgetDateFromHeaderString(header: string) {\n\t\tconst [, year, month, day, hour, minute, second] = header.match(\n\t\t\t/^(\\d{4})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})(\\d{2}).+/\n\t\t);\n\n\t\treturn new Date(\n\t\t\tDate.UTC(\n\t\t\t\tNumber(year),\n\t\t\t\tNumber(month) - 1,\n\t\t\t\tNumber(day),\n\t\t\t\tNumber(hour),\n\t\t\t\tNumber(minute),\n\t\t\t\tNumber(second)\n\t\t\t)\n\t\t);\n\t},\n\n\tisClockSkewed(serverDate: Date) {\n\t\t// API gateway permits client calls that are off by no more than ±5 minutes\n\t\treturn (\n\t\t\tMath.abs(\n\t\t\t\tserverDate.getTime() - DateUtils.getDateWithClockOffset().getTime()\n\t\t\t) >= FIVE_MINUTES_IN_MS\n\t\t);\n\t},\n\n\tisClockSkewError(error: any) {\n\t\tif (!error.response || !error.response.headers) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst { headers } = error.response;\n\n\t\treturn Boolean(\n\t\t\theaders['x-amzn-errortype'] === 'BadRequestException' &&\n\t\t\t\t(headers.date || headers.Date)\n\t\t);\n\t},\n\n\t/**\n\t * @param {number} offset Clock offset in milliseconds\n\t */\n\tsetClockOffset(offset: number) {\n\t\tDateUtils.clockOffset = offset;\n\t},\n};\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: Function,\n\targs: any[],\n\tdelayFn: DelayFunction,\n\tattempt: number = 1\n) {\n\tif (typeof functionToRetry !== 'function') {\n\t\tthrow Error('functionToRetry must be a function');\n\t}\n\tlogger.debug(\n\t\t`${\n\t\t\tfunctionToRetry.name\n\t\t} attempt #${attempt} with this vars: ${JSON.stringify(args)}`\n\t);\n\n\ttry {\n\t\treturn await functionToRetry(...args);\n\t} catch (err) {\n\t\tlogger.debug(`error on ${functionToRetry.name}`, err);\n\n\t\tif (isNonRetryableError(err)) {\n\t\t\tlogger.debug(`${functionToRetry.name} non retryable error`, err);\n\t\t\tthrow err;\n\t\t}\n\n\t\tconst retryIn = delayFn(attempt, args, err);\n\t\tlogger.debug(`${functionToRetry.name} retrying in ${retryIn} ms`);\n\n\t\tif (retryIn !== false) {\n\t\t\tawait new Promise(res => setTimeout(res, retryIn));\n\t\t\treturn await retry(functionToRetry, args, delayFn, attempt + 1);\n\t\t} else {\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nconst MAX_DELAY_MS = 5 * 60 * 1000;\n\nfunction jitteredBackoff(maxDelayMs: number): 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: Function,\n\targs: any[],\n\tmaxDelayMs: number = MAX_DELAY_MS\n) => retry(functionToRetry, args, jitteredBackoff(maxDelayMs));\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 2018-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/**\n * This Symbol is used to reference an internal-only PubSub provider that\n * is used for AppSync/GraphQL subscriptions in the API category.\n */\nconst hasSymbol =\n\ttypeof Symbol !== 'undefined' && typeof Symbol.for === 'function';\n\nexport const INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER = hasSymbol\n\t? Symbol.for('INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER')\n\t: '@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER';\n\nexport const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol\n\t? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')\n\t: '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';\n\nexport const USER_AGENT_HEADER = 'x-amz-user-agent';\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 { I18nOptions } from './types';\nimport { ConsoleLogger as Logger } from '../Logger';\n\nconst logger = new Logger('I18n');\n\n/**\n * Language transition class\n */\nexport class I18n {\n\t/**\n\t * @private\n\t */\n\t_options: I18nOptions = null;\n\n\t/**\n\t * @private\n\t */\n\t_lang = null;\n\n\t/**\n\t * @private\n\t */\n\t_dict = {};\n\n\t/**\n\t * @constructor\n\t * Initialize with configurations\n\t * @param {Object} options\n\t */\n\tconstructor(options: I18nOptions) {\n\t\tthis._options = Object.assign({}, options);\n\t\tthis._lang = this._options.language;\n\n\t\tif (\n\t\t\t!this._lang &&\n\t\t\ttypeof window !== 'undefined' &&\n\t\t\twindow &&\n\t\t\twindow.navigator\n\t\t) {\n\t\t\tthis._lang = window.navigator.language;\n\t\t}\n\n\t\tlogger.debug(this._lang);\n\t}\n\n\t/**\n\t * @method\n\t * Explicitly setting language\n\t * @param {String} lang\n\t */\n\tsetLanguage(lang: string) {\n\t\tthis._lang = lang;\n\t}\n\n\t/**\n\t * @method\n\t * Get value\n\t * @param {String} key\n\t * @param {String} defVal - Default value\n\t */\n\tget(key, defVal = undefined) {\n\t\tif (!this._lang) {\n\t\t\treturn typeof defVal !== 'undefined' ? defVal : key;\n\t\t}\n\n\t\tconst lang = this._lang;\n\t\tlet val = this.getByLanguage(key, lang);\n\t\tif (val) {\n\t\t\treturn val;\n\t\t}\n\n\t\tif (lang.indexOf('-') > 0) {\n\t\t\tval = this.getByLanguage(key, lang.split('-')[0]);\n\t\t}\n\t\tif (val) {\n\t\t\treturn val;\n\t\t}\n\n\t\treturn typeof defVal !== 'undefined' ? defVal : key;\n\t}\n\n\t/**\n\t * @method\n\t * Get value according to specified language\n\t * @param {String} key\n\t * @param {String} language - Specified langurage to be used\n\t * @param {String} defVal - Default value\n\t */\n\tgetByLanguage(key, language, defVal = null) {\n\t\tif (!language) {\n\t\t\treturn defVal;\n\t\t}\n\n\t\tconst lang_dict = this._dict[language];\n\t\tif (!lang_dict) {\n\t\t\treturn defVal;\n\t\t}\n\n\t\treturn lang_dict[key];\n\t}\n\n\t/**\n\t * @method\n\t * Add vocabularies for one language\n\t * @param {String} language - Language of the dictionary\n\t * @param {Object} vocabularies - Object that has key-value as dictionary entry\n\t */\n\tputVocabulariesForLanguage(language, vocabularies) {\n\t\tlet lang_dict = this._dict[language];\n\t\tif (!lang_dict) {\n\t\t\tlang_dict = this._dict[language] = {};\n\t\t}\n\t\tObject.assign(lang_dict, vocabularies);\n\t}\n\n\t/**\n\t * @method\n\t * Add vocabularies for one language\n\t * @param {Object} vocabularies - Object that has language as key,\n\t * vocabularies of each language as value\n\t */\n\tputVocabularies(vocabularies) {\n\t\tObject.keys(vocabularies).map(key => {\n\t\t\tthis.putVocabulariesForLanguage(key, vocabularies[key]);\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\nimport { I18n as I18nClass } from './I18n';\n\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { Amplify } from '../Amplify';\n\nconst logger = new Logger('I18n');\n\nlet _config = null;\nlet _i18n = null;\n\n/**\n * Export I18n APIs\n */\nexport class I18n {\n\t/**\n\t * @static\n\t * @method\n\t * Configure I18n part\n\t * @param {Object} config - Configuration of the I18n\n\t */\n\tstatic configure(config) {\n\t\tlogger.debug('configure I18n');\n\t\tif (!config) {\n\t\t\treturn _config;\n\t\t}\n\n\t\t_config = Object.assign({}, _config, config.I18n || config);\n\n\t\tI18n.createInstance();\n\n\t\treturn _config;\n\t}\n\n\tstatic getModuleName() {\n\t\treturn 'I18n';\n\t}\n\n\t/**\n\t * @static\n\t * @method\n\t * Create an instance of I18n for the library\n\t */\n\tstatic createInstance() {\n\t\tlogger.debug('create I18n instance');\n\t\tif (_i18n) {\n\t\t\treturn;\n\t\t}\n\t\t_i18n = new I18nClass(_config);\n\t}\n\n\t/**\n\t * @static @method\n\t * Explicitly setting language\n\t * @param {String} lang\n\t */\n\tstatic setLanguage(lang) {\n\t\tI18n.checkConfig();\n\n\t\treturn _i18n.setLanguage(lang);\n\t}\n\n\t/**\n\t * @static @method\n\t * Get value\n\t * @param {String} key\n\t * @param {String} defVal - Default value\n\t */\n\tstatic get(key, defVal?) {\n\t\tif (!I18n.checkConfig()) {\n\t\t\treturn typeof defVal === 'undefined' ? key : defVal;\n\t\t}\n\n\t\treturn _i18n.get(key, defVal);\n\t}\n\n\t/**\n\t * @static\n\t * @method\n\t * Add vocabularies for one language\n\t * @param {String} langurage - Language of the dictionary\n\t * @param {Object} vocabularies - Object that has key-value as dictionary entry\n\t */\n\tstatic putVocabulariesForLanguage(language, vocabularies) {\n\t\tI18n.checkConfig();\n\n\t\treturn _i18n.putVocabulariesForLanguage(language, vocabularies);\n\t}\n\n\t/**\n\t * @static\n\t * @method\n\t * Add vocabularies for one language\n\t * @param {Object} vocabularies - Object that has language as key,\n\t * vocabularies of each language as value\n\t */\n\tstatic putVocabularies(vocabularies) {\n\t\tI18n.checkConfig();\n\n\t\treturn _i18n.putVocabularies(vocabularies);\n\t}\n\n\tpublic static checkConfig() {\n\t\tif (!_i18n) {\n\t\t\t_i18n = new I18nClass(_config);\n\t\t}\n\n\t\treturn true;\n\t}\n}\n\nAmplify.register(I18n);\n\n/**\n * @deprecated use named import\n */\nexport default I18n;\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 { Amplify } from './Amplify';\nimport { Platform } from './Platform';\n\nexport { AmplifyClass } from './Amplify';\nexport { ClientDevice } from './ClientDevice';\nexport { ConsoleLogger, ConsoleLogger as Logger } from './Logger';\nexport * from './Errors';\nexport { Hub, HubCapsule, HubCallback, HubPayload } from './Hub';\nexport { I18n } from './I18n';\nexport * from './JS';\nexport { Signer } from './Signer';\nexport * from './Parser';\nexport { FacebookOAuth, GoogleOAuth } from './OAuthHelper';\nexport * from './RNComponents';\nexport { Credentials, CredentialsClass } from './Credentials';\nexport { ServiceWorker } from './ServiceWorker';\nexport { ICredentials } from './types';\nexport { StorageHelper, MemoryStorage } from './StorageHelper';\nexport { UniversalStorage } from './UniversalStorage';\nexport { Platform, getAmplifyUserAgent } from './Platform';\nexport * from './constants';\n\nexport const Constants = {\n\tuserAgent: Platform.userAgent,\n};\n\nexport * from './constants';\nexport * from './Util';\n\nexport { Amplify };\n/**\n * @deprecated use named import\n */\nexport default Amplify;\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 { fromUtf8 } from \"@aws-sdk/util-utf8-browser\";\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\nfunction isEmptyData(data: SourceData): boolean {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n\n return data.byteLength === 0;\n}\n\nfunction convertToBuffer(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","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","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n","/*\n * Copyright 2017-2018 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 Observable from 'zen-observable-ts';\nimport { PubSubProvider, ProvidertOptions } from '../types';\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\n\nconst logger = new Logger('AbstractPubSubProvider');\n\nexport abstract class AbstractPubSubProvider implements PubSubProvider {\n\tprivate _config: ProvidertOptions;\n\n\tconstructor(options: ProvidertOptions = {}) {\n\t\tthis._config = options;\n\t}\n\n\tconfigure(config: ProvidertOptions = {}): ProvidertOptions {\n\t\tthis._config = { ...config, ...this._config };\n\n\t\tlogger.debug(`configure ${this.getProviderName()}`, this._config);\n\n\t\treturn this.options;\n\t}\n\n\tgetCategory() {\n\t\treturn 'PubSub';\n\t}\n\n\tabstract getProviderName(): string;\n\n\tprotected get options(): ProvidertOptions {\n\t\treturn { ...this._config };\n\t}\n\n\tpublic abstract newClient(clientOptions: ProvidertOptions): Promise;\n\n\tpublic abstract publish(\n\t\ttopics: string[] | string,\n\t\tmsg: any,\n\t\toptions?: ProvidertOptions\n\t): void;\n\n\tpublic abstract subscribe(\n\t\ttopics: string[] | string,\n\t\toptions?: ProvidertOptions\n\t): Observable;\n}\n","/*\n * Copyright 2017-2018 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 * as Paho from 'paho-mqtt';\nimport { v4 as uuid } from 'uuid';\nimport Observable from 'zen-observable-ts';\n\nimport { AbstractPubSubProvider } from './PubSubProvider';\nimport { ProvidertOptions, SubscriptionObserver } from '../types';\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\n\nconst logger = new Logger('MqttOverWSProvider');\n\nexport function mqttTopicMatch(filter: string, topic: string) {\n\tconst filterArray = filter.split('/');\n\tconst length = filterArray.length;\n\tconst topicArray = topic.split('/');\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tconst left = filterArray[i];\n\t\tconst right = topicArray[i];\n\t\tif (left === '#') return topicArray.length >= length;\n\t\tif (left !== '+' && left !== right) return false;\n\t}\n\treturn length === topicArray.length;\n}\n\nexport interface MqttProvidertOptions extends ProvidertOptions {\n\tclientId?: string;\n\turl?: string;\n}\n\nclass ClientsQueue {\n\tprivate promises: Map> = new Map();\n\n\tasync get(clientId: string, clientFactory: (string) => Promise) {\n\t\tlet promise = this.promises.get(clientId);\n\t\tif (promise) {\n\t\t\treturn promise;\n\t\t}\n\n\t\tpromise = clientFactory(clientId);\n\n\t\tthis.promises.set(clientId, promise);\n\n\t\treturn promise;\n\t}\n\n\tget allClients() {\n\t\treturn Array.from(this.promises.keys());\n\t}\n\n\tremove(clientId) {\n\t\tthis.promises.delete(clientId);\n\t}\n}\n\nconst topicSymbol = typeof Symbol !== 'undefined' ? Symbol('topic') : '@@topic';\n\nexport class MqttOverWSProvider extends AbstractPubSubProvider {\n\tprivate _clientsQueue = new ClientsQueue();\n\n\tconstructor(options: MqttProvidertOptions = {}) {\n\t\tsuper({ ...options, clientId: options.clientId || uuid() });\n\t}\n\n\tprotected get clientId() {\n\t\treturn this.options.clientId;\n\t}\n\n\tprotected get endpoint() {\n\t\treturn this.options.aws_pubsub_endpoint;\n\t}\n\n\tprotected get clientsQueue() {\n\t\treturn this._clientsQueue;\n\t}\n\n\tprotected get isSSLEnabled() {\n\t\treturn !this.options\n\t\t\t.aws_appsync_dangerously_connect_to_http_endpoint_for_testing;\n\t}\n\n\tprotected getTopicForValue(value) {\n\t\treturn typeof value === 'object' && value[topicSymbol];\n\t}\n\n\tgetProviderName() {\n\t\treturn 'MqttOverWSProvider';\n\t}\n\n\tpublic onDisconnect({ clientId, errorCode, ...args }) {\n\t\tif (errorCode !== 0) {\n\t\t\tlogger.warn(clientId, JSON.stringify({ errorCode, ...args }, null, 2));\n\n\t\t\tconst topicsToDelete = [];\n\t\t\tconst clientIdObservers = this._clientIdObservers.get(clientId);\n\t\t\tif (!clientIdObservers) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclientIdObservers.forEach(observer => {\n\t\t\t\tobserver.error('Disconnected, error code: ' + errorCode);\n\t\t\t\t// removing observers for disconnected clientId\n\t\t\t\tthis._topicObservers.forEach((observerForTopic, observerTopic) => {\n\t\t\t\t\tobserverForTopic.delete(observer);\n\t\t\t\t\tif (observerForTopic.size === 0) {\n\t\t\t\t\t\ttopicsToDelete.push(observerTopic);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// forgiving any trace of clientId\n\t\t\tthis._clientIdObservers.delete(clientId);\n\n\t\t\t// Removing topics that are not listen by an observer\n\t\t\ttopicsToDelete.forEach(topic => {\n\t\t\t\tthis._topicObservers.delete(topic);\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async newClient({\n\t\turl,\n\t\tclientId,\n\t}: MqttProvidertOptions): Promise {\n\t\tlogger.debug('Creating new MQTT client', clientId);\n\n\t\t// @ts-ignore\n\t\tconst client = new Paho.Client(url, clientId);\n\t\t// client.trace = (args) => logger.debug(clientId, JSON.stringify(args, null, 2));\n\t\tclient.onMessageArrived = ({\n\t\t\tdestinationName: topic,\n\t\t\tpayloadString: msg,\n\t\t}) => {\n\t\t\tthis._onMessage(topic, msg);\n\t\t};\n\t\tclient.onConnectionLost = ({ errorCode, ...args }) => {\n\t\t\tthis.onDisconnect({ clientId, errorCode, ...args });\n\t\t};\n\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tclient.connect({\n\t\t\t\tuseSSL: this.isSSLEnabled,\n\t\t\t\tmqttVersion: 3,\n\t\t\t\tonSuccess: () => resolve(client),\n\t\t\t\tonFailure: reject,\n\t\t\t});\n\t\t});\n\n\t\treturn client;\n\t}\n\n\tprotected async connect(\n\t\tclientId: string,\n\t\toptions: MqttProvidertOptions = {}\n\t): Promise {\n\t\treturn await this.clientsQueue.get(clientId, clientId =>\n\t\t\tthis.newClient({ ...options, clientId })\n\t\t);\n\t}\n\n\tprotected async disconnect(clientId: string): Promise {\n\t\tconst client = await this.clientsQueue.get(clientId, () => null);\n\n\t\tif (client && client.isConnected()) {\n\t\t\tclient.disconnect();\n\t\t}\n\t\tthis.clientsQueue.remove(clientId);\n\t}\n\n\tasync publish(topics: string[] | string, msg: any) {\n\t\tconst targetTopics = ([] as string[]).concat(topics);\n\t\tconst message = JSON.stringify(msg);\n\n\t\tconst url = await this.endpoint;\n\n\t\tconst client = await this.connect(this.clientId, { url });\n\n\t\tlogger.debug('Publishing to topic(s)', targetTopics.join(','), message);\n\t\ttargetTopics.forEach(topic => client.send(topic, message));\n\t}\n\n\tprotected _topicObservers: Map<\n\t\tstring,\n\t\tSet>\n\t> = new Map();\n\n\tprotected _clientIdObservers: Map<\n\t\tstring,\n\t\tSet>\n\t> = new Map();\n\n\tprivate _onMessage(topic: string, msg: any) {\n\t\ttry {\n\t\t\tconst matchedTopicObservers = [];\n\t\t\tthis._topicObservers.forEach((observerForTopic, observerTopic) => {\n\t\t\t\tif (mqttTopicMatch(observerTopic, topic)) {\n\t\t\t\t\tmatchedTopicObservers.push(observerForTopic);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst parsedMessage = JSON.parse(msg);\n\n\t\t\tif (typeof parsedMessage === 'object') {\n\t\t\t\tparsedMessage[topicSymbol] = topic;\n\t\t\t}\n\n\t\t\tmatchedTopicObservers.forEach(observersForTopic => {\n\t\t\t\tobserversForTopic.forEach(observer => observer.next(parsedMessage));\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlogger.warn('Error handling message', error, msg);\n\t\t}\n\t}\n\n\tsubscribe(\n\t\ttopics: string[] | string,\n\t\toptions: MqttProvidertOptions = {}\n\t): Observable {\n\t\tconst targetTopics = ([] as string[]).concat(topics);\n\t\tlogger.debug('Subscribing to topic(s)', targetTopics.join(','));\n\n\t\treturn new Observable(observer => {\n\t\t\ttargetTopics.forEach(topic => {\n\t\t\t\t// this._topicObservers is used to notify the observers according to the topic received on the message\n\t\t\t\tlet observersForTopic = this._topicObservers.get(topic);\n\n\t\t\t\tif (!observersForTopic) {\n\t\t\t\t\tobserversForTopic = new Set();\n\n\t\t\t\t\tthis._topicObservers.set(topic, observersForTopic);\n\t\t\t\t}\n\n\t\t\t\tobserversForTopic.add(observer);\n\t\t\t});\n\n\t\t\t// @ts-ignore\n\t\t\tlet client: Paho.Client;\n\t\t\tconst { clientId = this.clientId } = options;\n\n\t\t\t// this._clientIdObservers is used to close observers when client gets disconnected\n\t\t\tlet observersForClientId = this._clientIdObservers.get(clientId);\n\t\t\tif (!observersForClientId) {\n\t\t\t\tobserversForClientId = new Set();\n\t\t\t}\n\t\t\tobserversForClientId.add(observer);\n\t\t\tthis._clientIdObservers.set(clientId, observersForClientId);\n\n\t\t\t(async () => {\n\t\t\t\tconst { url = await this.endpoint } = options;\n\n\t\t\t\ttry {\n\t\t\t\t\tclient = await this.connect(clientId, { url });\n\t\t\t\t\ttargetTopics.forEach(topic => {\n\t\t\t\t\t\tclient.subscribe(topic);\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {\n\t\t\t\t\tobserver.error(e);\n\t\t\t\t}\n\t\t\t})();\n\n\t\t\treturn () => {\n\t\t\t\tlogger.debug('Unsubscribing from topic(s)', targetTopics.join(','));\n\n\t\t\t\tif (client) {\n\t\t\t\t\tthis._clientIdObservers.get(clientId).delete(observer);\n\t\t\t\t\t// No more observers per client => client not needed anymore\n\t\t\t\t\tif (this._clientIdObservers.get(clientId).size === 0) {\n\t\t\t\t\t\tthis.disconnect(clientId);\n\t\t\t\t\t\tthis._clientIdObservers.delete(clientId);\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetTopics.forEach(topic => {\n\t\t\t\t\t\tconst observersForTopic =\n\t\t\t\t\t\t\tthis._topicObservers.get(topic) ||\n\t\t\t\t\t\t\t(new Set() as Set>);\n\n\t\t\t\t\t\tobserversForTopic.delete(observer);\n\n\t\t\t\t\t\t// if no observers exists for the topic, topic should be removed\n\t\t\t\t\t\tif (observersForTopic.size === 0) {\n\t\t\t\t\t\t\tthis._topicObservers.delete(topic);\n\t\t\t\t\t\t\tif (client.isConnected()) {\n\t\t\t\t\t\t\t\tclient.unsubscribe(topic);\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\n\t\t\t\treturn null;\n\t\t\t};\n\t\t});\n\t}\n}\n","/*\n * Copyright 2017-2018 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 { Client } from 'paho-mqtt';\nimport Observable from 'zen-observable-ts';\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\n\nimport { MqttOverWSProvider } from './MqttOverWSProvider';\n\nconst logger = new Logger('AWSAppSyncProvider');\n\nexport class AWSAppSyncProvider extends MqttOverWSProvider {\n\tprotected get endpoint() {\n\t\tthrow new Error('Not supported');\n\t}\n\n\tgetProviderName() {\n\t\treturn 'AWSAppSyncProvider';\n\t}\n\n\tpublic async publish(topics: string[] | string, msg: any, options?: any) {\n\t\tthrow new Error('Operation not supported');\n\t}\n\n\tprivate _cleanUp(clientId: string) {\n\t\tconst topicsForClient = Array.from(this._topicClient.entries())\n\t\t\t.filter(([, c]) => c.clientId === clientId)\n\t\t\t.map(([t]) => t);\n\n\t\ttopicsForClient.forEach(t => this._cleanUpForTopic(t));\n\t}\n\n\tprivate _cleanUpForTopic(topic) {\n\t\tthis._topicClient.delete(topic);\n\t\tthis._topicAlias.delete(topic);\n\t}\n\n\tpublic onDisconnect({ clientId, errorCode, ...args }) {\n\t\tif (errorCode !== 0) {\n\t\t\tconst topicsForClient = Array.from(this._topicClient.entries())\n\t\t\t\t.filter(([, c]) => c.clientId === clientId)\n\t\t\t\t.map(([t]) => t);\n\n\t\t\ttopicsForClient.forEach(topic => {\n\t\t\t\tif (this._topicObservers.has(topic)) {\n\t\t\t\t\tthis._topicObservers.get(topic).forEach(obs => {\n\t\t\t\t\t\tif (!obs.closed) {\n\t\t\t\t\t\t\tobs.error(args);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tthis._topicObservers.delete(topic);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._cleanUp(clientId);\n\t\t}\n\t}\n\n\tprivate _topicClient: Map = new Map();\n\n\tprivate _topicAlias: Map = new Map();\n\n\tprotected async disconnect(clientId: string): Promise {\n\t\tconst client = await this.clientsQueue.get(clientId, () => null);\n\n\t\tawait super.disconnect(clientId);\n\n\t\tthis._cleanUp(clientId);\n\t}\n\n\tsubscribe(topics: string[] | string, options: any = {}): Observable {\n\t\tconst result = new Observable(observer => {\n\t\t\tconst targetTopics = ([] as string[]).concat(topics);\n\t\t\tlogger.debug('Subscribing to topic(s)', targetTopics.join(','));\n\n\t\t\t(async () => {\n\t\t\t\t// Add these topics to map\n\t\t\t\ttargetTopics.forEach(t => {\n\t\t\t\t\tif (!this._topicObservers.has(t)) {\n\t\t\t\t\t\tthis._topicObservers.set(t, new Set());\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._topicObservers.get(t).add(observer);\n\t\t\t\t});\n\n\t\t\t\tconst { mqttConnections = [], newSubscriptions } = options;\n\n\t\t\t\t// creates a map of {\"topic\": \"alias\"}\n\t\t\t\tconst newAliases = Object.entries(\n\t\t\t\t\tnewSubscriptions\n\t\t\t\t).map(([alias, v]: [string, { topic: string }]) => [v.topic, alias]);\n\n\t\t\t\t// Merge new aliases with old ones\n\t\t\t\tthis._topicAlias = new Map([\n\t\t\t\t\t...Array.from(this._topicAlias.entries()),\n\t\t\t\t\t...(newAliases as [string, string][]),\n\t\t\t\t]);\n\n\t\t\t\t// group by urls\n\t\t\t\tconst map: [\n\t\t\t\t\tstring,\n\t\t\t\t\t{ url: string; topics: Set }\n\t\t\t\t][] = Object.entries(\n\t\t\t\t\ttargetTopics.reduce((acc, elem) => {\n\t\t\t\t\t\tconst connectionInfoForTopic = mqttConnections.find(\n\t\t\t\t\t\t\tc => c.topics.indexOf(elem) > -1\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (connectionInfoForTopic) {\n\t\t\t\t\t\t\tconst { client: clientId, url } = connectionInfoForTopic;\n\n\t\t\t\t\t\t\tif (!acc[clientId]) {\n\t\t\t\t\t\t\t\tacc[clientId] = {\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t\ttopics: new Set(),\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tacc[clientId].topics.add(elem);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}, {})\n\t\t\t\t);\n\n\t\t\t\t// reconnect everything we have in the map\n\t\t\t\tawait Promise.all(\n\t\t\t\t\tmap.map(async ([clientId, { url, topics }]) => {\n\t\t\t\t\t\t// connect to new client\n\t\t\t\t\t\tlet client = null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tclient = await this.connect(clientId, {\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tobserver.error({ message: 'Failed to connect', error: err });\n\t\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// subscribe to all topics for this client\n\t\t\t\t\t\t// store topic-client mapping\n\t\t\t\t\t\ttopics.forEach(topic => {\n\t\t\t\t\t\t\tif (client.isConnected()) {\n\t\t\t\t\t\t\t\tclient.subscribe(topic);\n\n\t\t\t\t\t\t\t\tthis._topicClient.set(topic, client);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn client;\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t})();\n\n\t\t\treturn () => {\n\t\t\t\tlogger.debug('Unsubscribing from topic(s)', targetTopics.join(','));\n\n\t\t\t\ttargetTopics.forEach(t => {\n\t\t\t\t\tconst client = this._topicClient.get(t);\n\n\t\t\t\t\tif (client && client.isConnected()) {\n\t\t\t\t\t\tclient.unsubscribe(t);\n\t\t\t\t\t\tthis._topicClient.delete(t);\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!Array.from(this._topicClient.values()).some(c => c === client)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthis.disconnect(client.clientId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._topicObservers.delete(t);\n\t\t\t\t});\n\t\t\t};\n\t\t});\n\n\t\treturn Observable.from(result).map(value => {\n\t\t\tconst topic = this.getTopicForValue(value);\n\t\t\tconst alias = this._topicAlias.get(topic);\n\n\t\t\tvalue.data = Object.entries(value.data).reduce(\n\t\t\t\t(obj, [origKey, val]) => (\n\t\t\t\t\t(obj[(alias || origKey) as string] = val), obj\n\t\t\t\t),\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\treturn value;\n\t\t});\n\t}\n}\n","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { getLocation } from '../language/location';\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\nexport function printError(error) {\n var printedLocations = [];\n\n if (error.nodes) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = error.nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var node = _step.value;\n\n if (node.loc) {\n printedLocations.push(highlightSourceAtLocation(node.loc.source, getLocation(node.loc.source, node.loc.start)));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else if (error.source && error.locations) {\n var source = error.source;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = error.locations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var location = _step2.value;\n printedLocations.push(highlightSourceAtLocation(source, location));\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\\n\\n') + '\\n';\n}\n/**\n * Render a helpful description of the location of the error in the GraphQL\n * Source document.\n */\n\nfunction highlightSourceAtLocation(source, location) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = location.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = location.line + lineOffset;\n var columnOffset = location.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = location.column + columnOffset;\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n return \"\".concat(source.name, \" (\").concat(lineNum, \":\").concat(columnNum, \")\\n\") + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1, \": \"), lines[lineIndex - 1]], [\"\".concat(lineNum, \": \"), lines[lineIndex]], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1, \": \"), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = 0;\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = existingLines[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _ref4 = _step3.value;\n var prefix = _ref4[0];\n padLen = Math.max(padLen, prefix.length);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return lpad(padLen, prefix) + line;\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction lpad(len, str) {\n return whitespace(len - str.length) + str;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { printError } from './printError';\nimport { getLocation } from '../language/location';\nexport function GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return getLocation(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(getLocation(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions || originalError && originalError.extensions;\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_locations)\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(path)\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _extensions || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_extensions)\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}\nGraphQLError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: GraphQLError\n },\n name: {\n value: 'GraphQLError'\n },\n toString: {\n value: function toString() {\n return printError(this);\n }\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 */\nimport Observable, { ZenObservable } from 'zen-observable-ts';\nimport { GraphQLError } from 'graphql';\nimport * as url from 'url';\nimport { v4 as uuid } from 'uuid';\nimport { Buffer } from 'buffer';\nimport { ProvidertOptions } from '../types';\nimport {\n\tLogger,\n\tCredentials,\n\tSigner,\n\tHub,\n\tConstants,\n\tUSER_AGENT_HEADER,\n\tjitteredExponentialRetry,\n\tNonRetryableError,\n} from '@aws-amplify/core';\nimport Cache from '@aws-amplify/cache';\nimport Auth from '@aws-amplify/auth';\nimport { AbstractPubSubProvider } from './PubSubProvider';\nimport { CONTROL_MSG } from '../index';\n\nconst logger = new Logger('AWSAppSyncRealTimeProvider');\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 dispatchApiEvent = (event: string, data: any, message: string) => {\n\tHub.dispatch('api', { event, data, message }, 'PubSub', AMPLIFY_SYMBOL);\n};\n\nconst MAX_DELAY_MS = 5000;\n\nconst NON_RETRYABLE_CODES = [400, 401, 403];\n\ntype ObserverQuery = {\n\tobserver: ZenObservable.SubscriptionObserver;\n\tquery: string;\n\tvariables: object;\n\tsubscriptionState: SUBSCRIPTION_STATUS;\n\tsubscriptionReadyCallback?: Function;\n\tsubscriptionFailedCallback?: Function;\n\tstartAckTimeoutId?;\n};\n\nenum MESSAGE_TYPES {\n\t/**\n\t * Client -> Server message.\n\t * This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication\n\t */\n\tGQL_CONNECTION_INIT = 'connection_init',\n\t/**\n\t * Server -> Client message\n\t * This message type is in case there is an issue with AWS AppSync RealTime when establishing connection\n\t */\n\tGQL_CONNECTION_ERROR = 'connection_error',\n\t/**\n\t * Server -> Client message.\n\t * This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message\n\t */\n\tGQL_CONNECTION_ACK = 'connection_ack',\n\t/**\n\t * Client -> Server message.\n\t * This message type is for register subscriptions with AWS AppSync RealTime\n\t */\n\tGQL_START = 'start',\n\t/**\n\t * Server -> Client message.\n\t * This message type is for the ack response from AWS AppSync RealTime for GQL_START message\n\t */\n\tGQL_START_ACK = 'start_ack',\n\t/**\n\t * Server -> Client message.\n\t * This message type is for subscription message from AWS AppSync RealTime\n\t */\n\tGQL_DATA = 'data',\n\t/**\n\t * Server -> Client message.\n\t * This message type helps the client to know is still receiving messages from AWS AppSync RealTime\n\t */\n\tGQL_CONNECTION_KEEP_ALIVE = 'ka',\n\t/**\n\t * Client -> Server message.\n\t * This message type is for unregister subscriptions with AWS AppSync RealTime\n\t */\n\tGQL_STOP = 'stop',\n\t/**\n\t * Server -> Client message.\n\t * This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message\n\t */\n\tGQL_COMPLETE = 'complete',\n\t/**\n\t * Server -> Client message.\n\t * This message type is for sending error messages from AWS AppSync RealTime to the client\n\t */\n\tGQL_ERROR = 'error', // Server -> Client\n}\n\nenum SUBSCRIPTION_STATUS {\n\tPENDING,\n\tCONNECTED,\n\tFAILED,\n}\n\nenum SOCKET_STATUS {\n\tCLOSED,\n\tREADY,\n\tCONNECTING,\n}\n\nconst AWS_APPSYNC_REALTIME_HEADERS = {\n\taccept: 'application/json, text/javascript',\n\t'content-encoding': 'amz-1.0',\n\t'content-type': 'application/json; charset=UTF-8',\n};\n\n/**\n * Time in milleseconds to wait for GQL_CONNECTION_INIT message\n */\nconst CONNECTION_INIT_TIMEOUT = 15000;\n\n/**\n * Time in milleseconds to wait for GQL_START_ACK message\n */\nconst START_ACK_TIMEOUT = 15000;\n\n/**\n * Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message\n */\nconst DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;\n\nexport class AWSAppSyncRealTimeProvider extends AbstractPubSubProvider {\n\tprivate awsRealTimeSocket: WebSocket;\n\tprivate socketStatus: SOCKET_STATUS = SOCKET_STATUS.CLOSED;\n\tprivate keepAliveTimeoutId;\n\tprivate keepAliveTimeout = DEFAULT_KEEP_ALIVE_TIMEOUT;\n\tprivate subscriptionObserverMap: Map = new Map();\n\tprivate promiseArray: Array<{ res: Function; rej: Function }> = [];\n\n\tgetProviderName() {\n\t\treturn 'AWSAppSyncRealTimeProvider';\n\t}\n\n\tnewClient(): Promise {\n\t\tthrow new Error('Not used here');\n\t}\n\n\tpublic async publish(_topics: string[] | string, _msg: any, _options?: any) {\n\t\tthrow new Error('Operation not supported');\n\t}\n\n\tsubscribe(\n\t\t_topics: string[] | string,\n\t\toptions?: ProvidertOptions\n\t): Observable {\n\t\tconst { appSyncGraphqlEndpoint } = options;\n\n\t\treturn new Observable(observer => {\n\t\t\tif (!appSyncGraphqlEndpoint) {\n\t\t\t\tobserver.error({\n\t\t\t\t\terrors: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...new GraphQLError(\n\t\t\t\t\t\t\t\t`Subscribe only available for AWS AppSync endpoint`\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\tobserver.complete();\n\t\t\t} else {\n\t\t\t\tconst subscriptionId = uuid();\n\t\t\t\tthis._startSubscriptionWithAWSAppSyncRealTime({\n\t\t\t\t\toptions,\n\t\t\t\t\tobserver,\n\t\t\t\t\tsubscriptionId,\n\t\t\t\t});\n\n\t\t\t\treturn async () => {\n\t\t\t\t\t// Cleanup after unsubscribing or observer.complete was called after _startSubscriptionWithAWSAppSyncRealTime\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Waiting that subscription has been connected before trying to unsubscribe\n\t\t\t\t\t\tawait this._waitForSubscriptionToBeConnected(subscriptionId);\n\n\t\t\t\t\t\tconst { subscriptionState } =\n\t\t\t\t\t\t\tthis.subscriptionObserverMap.get(subscriptionId) || {};\n\n\t\t\t\t\t\tif (!subscriptionState) {\n\t\t\t\t\t\t\t// subscription already unsubscribed\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (subscriptionState === SUBSCRIPTION_STATUS.CONNECTED) {\n\t\t\t\t\t\t\tthis._sendUnsubscriptionMessage(subscriptionId);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error('Subscription never connected');\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tlogger.debug(`Error while unsubscribing ${err}`);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis._removeSubscriptionObserver(subscriptionId);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected get isSSLEnabled() {\n\t\treturn !this.options\n\t\t\t.aws_appsync_dangerously_connect_to_http_endpoint_for_testing;\n\t}\n\tprivate async _startSubscriptionWithAWSAppSyncRealTime({\n\t\toptions,\n\t\tobserver,\n\t\tsubscriptionId,\n\t}) {\n\t\tconst {\n\t\t\tappSyncGraphqlEndpoint,\n\t\t\tauthenticationType,\n\t\t\tquery,\n\t\t\tvariables,\n\t\t\tapiKey,\n\t\t\tregion,\n\t\t\tgraphql_headers = () => ({}),\n\t\t\tadditionalHeaders = {},\n\t\t} = options;\n\n\t\tconst subscriptionState: SUBSCRIPTION_STATUS = SUBSCRIPTION_STATUS.PENDING;\n\t\tconst data = {\n\t\t\tquery,\n\t\t\tvariables,\n\t\t};\n\t\t// Having a subscription id map will make it simple to forward messages received\n\t\tthis.subscriptionObserverMap.set(subscriptionId, {\n\t\t\tobserver,\n\t\t\tquery,\n\t\t\tvariables,\n\t\t\tsubscriptionState,\n\t\t\tstartAckTimeoutId: null,\n\t\t});\n\n\t\t// Preparing payload for subscription message\n\n\t\tconst dataString = JSON.stringify(data);\n\t\tconst headerObj = {\n\t\t\t...(await this._awsRealTimeHeaderBasedAuth({\n\t\t\t\tapiKey,\n\t\t\t\tappSyncGraphqlEndpoint,\n\t\t\t\tauthenticationType,\n\t\t\t\tpayload: dataString,\n\t\t\t\tcanonicalUri: '',\n\t\t\t\tregion,\n\t\t\t})),\n\t\t\t...(await graphql_headers()),\n\t\t\t...additionalHeaders,\n\t\t\t[USER_AGENT_HEADER]: Constants.userAgent,\n\t\t};\n\n\t\tconst subscriptionMessage = {\n\t\t\tid: subscriptionId,\n\t\t\tpayload: {\n\t\t\t\tdata: dataString,\n\t\t\t\textensions: {\n\t\t\t\t\tauthorization: {\n\t\t\t\t\t\t...headerObj,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\ttype: MESSAGE_TYPES.GQL_START,\n\t\t};\n\n\t\tconst stringToAWSRealTime = JSON.stringify(subscriptionMessage);\n\n\t\ttry {\n\t\t\tawait this._initializeWebSocketConnection({\n\t\t\t\tapiKey,\n\t\t\t\tappSyncGraphqlEndpoint,\n\t\t\t\tauthenticationType,\n\t\t\t\tregion,\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tlogger.debug({ err });\n\t\t\tconst { message = '' } = err;\n\t\t\tobserver.error({\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...new GraphQLError(`Connection failed: ${message}`),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t});\n\t\t\tobserver.complete();\n\n\t\t\tconst { subscriptionFailedCallback } =\n\t\t\t\tthis.subscriptionObserverMap.get(subscriptionId) || {};\n\n\t\t\t// Notify concurrent unsubscription\n\t\t\tif (typeof subscriptionFailedCallback === 'function') {\n\t\t\t\tsubscriptionFailedCallback();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Potential race condition can occur when unsubscribe is called during _initializeWebSocketConnection.\n\t\t// E.g.unsubscribe gets invoked prior to finishing WebSocket handshake or START_ACK.\n\t\t// Both subscriptionFailedCallback and subscriptionReadyCallback are used to synchronized this.\n\n\t\tconst {\n\t\t\tsubscriptionFailedCallback,\n\t\t\tsubscriptionReadyCallback,\n\t\t} = this.subscriptionObserverMap.get(subscriptionId);\n\n\t\t// This must be done before sending the message in order to be listening immediately\n\t\tthis.subscriptionObserverMap.set(subscriptionId, {\n\t\t\tobserver,\n\t\t\tsubscriptionState,\n\t\t\tvariables,\n\t\t\tquery,\n\t\t\tsubscriptionReadyCallback,\n\t\t\tsubscriptionFailedCallback,\n\t\t\tstartAckTimeoutId: setTimeout(() => {\n\t\t\t\tthis._timeoutStartSubscriptionAck.call(this, subscriptionId);\n\t\t\t}, START_ACK_TIMEOUT),\n\t\t});\n\t\tif (this.awsRealTimeSocket) {\n\t\t\tthis.awsRealTimeSocket.send(stringToAWSRealTime);\n\t\t}\n\t}\n\n\t// Waiting that subscription has been connected before trying to unsubscribe\n\tprivate async _waitForSubscriptionToBeConnected(subscriptionId) {\n\t\tconst { subscriptionState } = this.subscriptionObserverMap.get(\n\t\t\tsubscriptionId\n\t\t);\n\t\t// This in case unsubscribe is invoked before sending start subscription message\n\t\tif (subscriptionState === SUBSCRIPTION_STATUS.PENDING) {\n\t\t\treturn new Promise((res, rej) => {\n\t\t\t\tconst {\n\t\t\t\t\tobserver,\n\t\t\t\t\tsubscriptionState,\n\t\t\t\t\tvariables,\n\t\t\t\t\tquery,\n\t\t\t\t} = this.subscriptionObserverMap.get(subscriptionId);\n\t\t\t\tthis.subscriptionObserverMap.set(subscriptionId, {\n\t\t\t\t\tobserver,\n\t\t\t\t\tsubscriptionState,\n\t\t\t\t\tvariables,\n\t\t\t\t\tquery,\n\t\t\t\t\tsubscriptionReadyCallback: res,\n\t\t\t\t\tsubscriptionFailedCallback: rej,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _sendUnsubscriptionMessage(subscriptionId) {\n\t\ttry {\n\t\t\tif (\n\t\t\t\tthis.awsRealTimeSocket &&\n\t\t\t\tthis.awsRealTimeSocket.readyState === WebSocket.OPEN &&\n\t\t\t\tthis.socketStatus === SOCKET_STATUS.READY\n\t\t\t) {\n\t\t\t\t// Preparing unsubscribe message to stop receiving messages for that subscription\n\t\t\t\tconst unsubscribeMessage = {\n\t\t\t\t\tid: subscriptionId,\n\t\t\t\t\ttype: MESSAGE_TYPES.GQL_STOP,\n\t\t\t\t};\n\t\t\t\tconst stringToAWSRealTime = JSON.stringify(unsubscribeMessage);\n\t\t\t\tthis.awsRealTimeSocket.send(stringToAWSRealTime);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t// If GQL_STOP is not sent because of disconnection issue, then there is nothing the client can do\n\t\t\tlogger.debug({ err });\n\t\t}\n\t}\n\n\tprivate _removeSubscriptionObserver(subscriptionId) {\n\t\tthis.subscriptionObserverMap.delete(subscriptionId);\n\n\t\t// Verifying 1000ms after removing subscription in case there are new subscription unmount/mount\n\t\tsetTimeout(this._closeSocketIfRequired.bind(this), 1000);\n\t}\n\n\tprivate _closeSocketIfRequired() {\n\t\tif (this.subscriptionObserverMap.size > 0) {\n\t\t\t// Active subscriptions on the WebSocket\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.awsRealTimeSocket) {\n\t\t\tthis.socketStatus = SOCKET_STATUS.CLOSED;\n\t\t\treturn;\n\t\t}\n\t\tif (this.awsRealTimeSocket.bufferedAmount > 0) {\n\t\t\t// Still data on the WebSocket\n\t\t\tsetTimeout(this._closeSocketIfRequired.bind(this), 1000);\n\t\t} else {\n\t\t\tlogger.debug('closing WebSocket...');\n\t\t\tclearTimeout(this.keepAliveTimeoutId);\n\t\t\tconst tempSocket = this.awsRealTimeSocket;\n\t\t\t// Cleaning callbacks to avoid race condition, socket still exists\n\t\t\ttempSocket.onclose = undefined;\n\t\t\ttempSocket.onerror = undefined;\n\t\t\ttempSocket.close(1000);\n\t\t\tthis.awsRealTimeSocket = null;\n\t\t\tthis.socketStatus = SOCKET_STATUS.CLOSED;\n\t\t}\n\t}\n\n\tprivate _handleIncomingSubscriptionMessage(message: MessageEvent) {\n\t\tlogger.debug(\n\t\t\t`subscription message from AWS AppSync RealTime: ${message.data}`\n\t\t);\n\t\tconst { id = '', payload, type } = JSON.parse(message.data);\n\t\tconst {\n\t\t\tobserver = null,\n\t\t\tquery = '',\n\t\t\tvariables = {},\n\t\t\tstartAckTimeoutId,\n\t\t\tsubscriptionReadyCallback,\n\t\t\tsubscriptionFailedCallback,\n\t\t} = this.subscriptionObserverMap.get(id) || {};\n\n\t\tlogger.debug({ id, observer, query, variables });\n\n\t\tif (type === MESSAGE_TYPES.GQL_DATA && payload && payload.data) {\n\t\t\tif (observer) {\n\t\t\t\tobserver.next(payload);\n\t\t\t} else {\n\t\t\t\tlogger.debug(`observer not found for id: ${id}`);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === MESSAGE_TYPES.GQL_START_ACK) {\n\t\t\tlogger.debug(\n\t\t\t\t`subscription ready for ${JSON.stringify({ query, variables })}`\n\t\t\t);\n\t\t\tif (typeof subscriptionReadyCallback === 'function') {\n\t\t\t\tsubscriptionReadyCallback();\n\t\t\t}\n\t\t\tclearTimeout(startAckTimeoutId);\n\t\t\tdispatchApiEvent(\n\t\t\t\tCONTROL_MSG.SUBSCRIPTION_ACK,\n\t\t\t\t{ query, variables },\n\t\t\t\t'Connection established for subscription'\n\t\t\t);\n\t\t\tconst subscriptionState = SUBSCRIPTION_STATUS.CONNECTED;\n\t\t\tthis.subscriptionObserverMap.set(id, {\n\t\t\t\tobserver,\n\t\t\t\tquery,\n\t\t\t\tvariables,\n\t\t\t\tstartAckTimeoutId: null,\n\t\t\t\tsubscriptionState,\n\t\t\t\tsubscriptionReadyCallback,\n\t\t\t\tsubscriptionFailedCallback,\n\t\t\t});\n\n\t\t\t// TODO: emit event on hub but it requires to store the id first\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === MESSAGE_TYPES.GQL_CONNECTION_KEEP_ALIVE) {\n\t\t\tclearTimeout(this.keepAliveTimeoutId);\n\t\t\tthis.keepAliveTimeoutId = setTimeout(\n\t\t\t\tthis._errorDisconnect.bind(this, CONTROL_MSG.TIMEOUT_DISCONNECT),\n\t\t\t\tthis.keepAliveTimeout\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === MESSAGE_TYPES.GQL_ERROR) {\n\t\t\tconst subscriptionState = SUBSCRIPTION_STATUS.FAILED;\n\t\t\tthis.subscriptionObserverMap.set(id, {\n\t\t\t\tobserver,\n\t\t\t\tquery,\n\t\t\t\tvariables,\n\t\t\t\tstartAckTimeoutId,\n\t\t\t\tsubscriptionReadyCallback,\n\t\t\t\tsubscriptionFailedCallback,\n\t\t\t\tsubscriptionState,\n\t\t\t});\n\n\t\t\tobserver.error({\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...new GraphQLError(\n\t\t\t\t\t\t\t`Connection failed: ${JSON.stringify(payload)}`\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\tclearTimeout(startAckTimeoutId);\n\n\t\t\tobserver.complete();\n\t\t\tif (typeof subscriptionFailedCallback === 'function') {\n\t\t\t\tsubscriptionFailedCallback();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _errorDisconnect(msg: string) {\n\t\tlogger.debug(`Disconnect error: ${msg}`);\n\t\tthis.subscriptionObserverMap.forEach(({ observer }) => {\n\t\t\tif (observer && !observer.closed) {\n\t\t\t\tobserver.error({\n\t\t\t\t\terrors: [{ ...new GraphQLError(msg) }],\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis.subscriptionObserverMap.clear();\n\t\tif (this.awsRealTimeSocket) {\n\t\t\tthis.awsRealTimeSocket.close();\n\t\t}\n\n\t\tthis.socketStatus = SOCKET_STATUS.CLOSED;\n\t}\n\n\tprivate _timeoutStartSubscriptionAck(subscriptionId) {\n\t\tconst { observer, query, variables } =\n\t\t\tthis.subscriptionObserverMap.get(subscriptionId) || {};\n\t\tif (!observer) {\n\t\t\treturn;\n\t\t}\n\t\tthis.subscriptionObserverMap.set(subscriptionId, {\n\t\t\tobserver,\n\t\t\tquery,\n\t\t\tvariables,\n\t\t\tsubscriptionState: SUBSCRIPTION_STATUS.FAILED,\n\t\t});\n\n\t\tif (observer && !observer.closed) {\n\t\t\tobserver.error({\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...new GraphQLError(\n\t\t\t\t\t\t\t`Subscription timeout ${JSON.stringify({ query, variables })}`\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\t// Cleanup will be automatically executed\n\t\t\tobserver.complete();\n\t\t}\n\t\tlogger.debug(\n\t\t\t'timeoutStartSubscription',\n\t\t\tJSON.stringify({ query, variables })\n\t\t);\n\t}\n\n\tprivate _initializeWebSocketConnection({\n\t\tappSyncGraphqlEndpoint,\n\t\tauthenticationType,\n\t\tapiKey,\n\t\tregion,\n\t}) {\n\t\tif (this.socketStatus === SOCKET_STATUS.READY) {\n\t\t\treturn;\n\t\t}\n\t\treturn new Promise(async (res, rej) => {\n\t\t\tthis.promiseArray.push({ res, rej });\n\n\t\t\tif (this.socketStatus === SOCKET_STATUS.CLOSED) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.socketStatus = SOCKET_STATUS.CONNECTING;\n\t\t\t\t\t// Creating websocket url with required query strings\n\t\t\t\t\tconst protocol = this.isSSLEnabled ? 'wss://' : 'ws://';\n\t\t\t\t\tconst discoverableEndpoint = appSyncGraphqlEndpoint\n\t\t\t\t\t\t.replace('https://', protocol)\n\t\t\t\t\t\t.replace('http://', protocol)\n\t\t\t\t\t\t.replace('appsync-api', 'appsync-realtime-api')\n\t\t\t\t\t\t.replace('gogi-beta', 'grt-beta');\n\n\t\t\t\t\tconst payloadString = '{}';\n\t\t\t\t\tconst headerString = JSON.stringify(\n\t\t\t\t\t\tawait this._awsRealTimeHeaderBasedAuth({\n\t\t\t\t\t\t\tauthenticationType,\n\t\t\t\t\t\t\tpayload: payloadString,\n\t\t\t\t\t\t\tcanonicalUri: '/connect',\n\t\t\t\t\t\t\tapiKey,\n\t\t\t\t\t\t\tappSyncGraphqlEndpoint,\n\t\t\t\t\t\t\tregion,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tconst headerQs = Buffer.from(headerString).toString('base64');\n\n\t\t\t\t\tconst payloadQs = Buffer.from(payloadString).toString('base64');\n\t\t\t\t\tconst awsRealTimeUrl = `${discoverableEndpoint}?header=${headerQs}&payload=${payloadQs}`;\n\n\t\t\t\t\tawait this._initializeRetryableHandshake({ awsRealTimeUrl });\n\n\t\t\t\t\tthis.promiseArray.forEach(({ res }) => {\n\t\t\t\t\t\tlogger.debug('Notifying connection successful');\n\t\t\t\t\t\tres();\n\t\t\t\t\t});\n\t\t\t\t\tthis.socketStatus = SOCKET_STATUS.READY;\n\t\t\t\t\tthis.promiseArray = [];\n\t\t\t\t} catch (err) {\n\t\t\t\t\tthis.promiseArray.forEach(({ rej }) => rej(err));\n\t\t\t\t\tthis.promiseArray = [];\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.awsRealTimeSocket &&\n\t\t\t\t\t\tthis.awsRealTimeSocket.readyState === WebSocket.OPEN\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.awsRealTimeSocket.close(3001);\n\t\t\t\t\t}\n\t\t\t\t\tthis.awsRealTimeSocket = null;\n\t\t\t\t\tthis.socketStatus = SOCKET_STATUS.CLOSED;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate async _initializeRetryableHandshake({ awsRealTimeUrl }) {\n\t\tlogger.debug(`Initializaling retryable Handshake`);\n\t\tawait jitteredExponentialRetry(\n\t\t\tthis._initializeHandshake.bind(this),\n\t\t\t[{ awsRealTimeUrl }],\n\t\t\tMAX_DELAY_MS\n\t\t);\n\t}\n\n\tprivate async _initializeHandshake({ awsRealTimeUrl }) {\n\t\tlogger.debug(`Initializing handshake ${awsRealTimeUrl}`);\n\t\t// Because connecting the socket is async, is waiting until connection is open\n\t\t// Step 1: connect websocket\n\t\ttry {\n\t\t\tawait (() => {\n\t\t\t\treturn new Promise((res, rej) => {\n\t\t\t\t\tconst newSocket = new WebSocket(awsRealTimeUrl, 'graphql-ws');\n\t\t\t\t\tnewSocket.onerror = () => {\n\t\t\t\t\t\tlogger.debug(`WebSocket connection error`);\n\t\t\t\t\t};\n\t\t\t\t\tnewSocket.onclose = () => {\n\t\t\t\t\t\trej(new Error('Connection handshake error'));\n\t\t\t\t\t};\n\t\t\t\t\tnewSocket.onopen = () => {\n\t\t\t\t\t\tthis.awsRealTimeSocket = newSocket;\n\t\t\t\t\t\treturn res();\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t})();\n\n\t\t\t// Step 2: wait for ack from AWS AppSyncReaTime after sending init\n\t\t\tawait (() => {\n\t\t\t\treturn new Promise((res, rej) => {\n\t\t\t\t\tlet ackOk = false;\n\t\t\t\t\tthis.awsRealTimeSocket.onerror = error => {\n\t\t\t\t\t\tlogger.debug(`WebSocket error ${JSON.stringify(error)}`);\n\t\t\t\t\t};\n\t\t\t\t\tthis.awsRealTimeSocket.onclose = event => {\n\t\t\t\t\t\tlogger.debug(`WebSocket closed ${event.reason}`);\n\t\t\t\t\t\trej(new Error(JSON.stringify(event)));\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.awsRealTimeSocket.onmessage = (message: MessageEvent) => {\n\t\t\t\t\t\tlogger.debug(\n\t\t\t\t\t\t\t`subscription message from AWS AppSyncRealTime: ${message.data} `\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst data = JSON.parse(message.data);\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\tconnectionTimeoutMs = DEFAULT_KEEP_ALIVE_TIMEOUT,\n\t\t\t\t\t\t\t} = {},\n\t\t\t\t\t\t} = data;\n\t\t\t\t\t\tif (type === MESSAGE_TYPES.GQL_CONNECTION_ACK) {\n\t\t\t\t\t\t\tackOk = true;\n\t\t\t\t\t\t\tthis.keepAliveTimeout = connectionTimeoutMs;\n\t\t\t\t\t\t\tthis.awsRealTimeSocket.onmessage = this._handleIncomingSubscriptionMessage.bind(\n\t\t\t\t\t\t\t\tthis\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tthis.awsRealTimeSocket.onerror = err => {\n\t\t\t\t\t\t\t\tlogger.debug(err);\n\t\t\t\t\t\t\t\tthis._errorDisconnect(CONTROL_MSG.CONNECTION_CLOSED);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tthis.awsRealTimeSocket.onclose = event => {\n\t\t\t\t\t\t\t\tlogger.debug(`WebSocket closed ${event.reason}`);\n\t\t\t\t\t\t\t\tthis._errorDisconnect(CONTROL_MSG.CONNECTION_CLOSED);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tres('Cool, connected to AWS AppSyncRealTime');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (type === MESSAGE_TYPES.GQL_CONNECTION_ERROR) {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\t\terrors: [{ errorType = '', errorCode = 0 } = {}] = [],\n\t\t\t\t\t\t\t\t} = {},\n\t\t\t\t\t\t\t} = data;\n\n\t\t\t\t\t\t\trej({ errorType, errorCode });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tconst gqlInit = {\n\t\t\t\t\t\ttype: MESSAGE_TYPES.GQL_CONNECTION_INIT,\n\t\t\t\t\t};\n\t\t\t\t\tthis.awsRealTimeSocket.send(JSON.stringify(gqlInit));\n\n\t\t\t\t\tfunction checkAckOk() {\n\t\t\t\t\t\tif (!ackOk) {\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`Connection timeout: ack from AWSRealTime was not received on ${CONNECTION_INIT_TIMEOUT} ms`\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\tsetTimeout(checkAckOk.bind(this), CONNECTION_INIT_TIMEOUT);\n\t\t\t\t});\n\t\t\t})();\n\t\t} catch (err) {\n\t\t\tconst { errorType, errorCode } = err;\n\n\t\t\tif (NON_RETRYABLE_CODES.includes(errorCode)) {\n\t\t\t\tthrow new NonRetryableError(errorType);\n\t\t\t} else if (errorType) {\n\t\t\t\tthrow new Error(errorType);\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async _awsRealTimeHeaderBasedAuth({\n\t\tauthenticationType,\n\t\tpayload,\n\t\tcanonicalUri,\n\t\tappSyncGraphqlEndpoint,\n\t\tapiKey,\n\t\tregion,\n\t}): Promise {\n\t\tconst headerHandler = {\n\t\t\tAPI_KEY: this._awsRealTimeApiKeyHeader.bind(this),\n\t\t\tAWS_IAM: this._awsRealTimeIAMHeader.bind(this),\n\t\t\tOPENID_CONNECT: this._awsRealTimeOPENIDHeader.bind(this),\n\t\t\tAMAZON_COGNITO_USER_POOLS: this._awsRealTimeCUPHeader.bind(this),\n\t\t};\n\n\t\tconst handler = headerHandler[authenticationType];\n\n\t\tif (typeof handler !== 'function') {\n\t\t\tlogger.debug(`Authentication type ${authenticationType} not supported`);\n\t\t\treturn '';\n\t\t}\n\n\t\tconst { host } = url.parse(appSyncGraphqlEndpoint);\n\n\t\tconst result = await handler({\n\t\t\tpayload,\n\t\t\tcanonicalUri,\n\t\t\tappSyncGraphqlEndpoint,\n\t\t\tapiKey,\n\t\t\tregion,\n\t\t\thost,\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tprivate async _awsRealTimeCUPHeader({ host }) {\n\t\tconst session = await Auth.currentSession();\n\t\treturn {\n\t\t\tAuthorization: session.getAccessToken().getJwtToken(),\n\t\t\thost,\n\t\t};\n\t}\n\n\tprivate async _awsRealTimeOPENIDHeader({ host }) {\n\t\tlet token;\n\t\t// backwards compatibility\n\t\tconst federatedInfo = await Cache.getItem('federatedInfo');\n\t\tif (federatedInfo) {\n\t\t\ttoken = federatedInfo.token;\n\t\t} else {\n\t\t\tconst currentUser = await Auth.currentAuthenticatedUser();\n\t\t\tif (currentUser) {\n\t\t\t\ttoken = currentUser.token;\n\t\t\t}\n\t\t}\n\t\tif (!token) {\n\t\t\tthrow new Error('No federated jwt');\n\t\t}\n\t\treturn {\n\t\t\tAuthorization: token,\n\t\t\thost,\n\t\t};\n\t}\n\n\tprivate async _awsRealTimeApiKeyHeader({ apiKey, host }) {\n\t\tconst dt = new Date();\n\t\tconst dtStr = dt.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '');\n\n\t\treturn {\n\t\t\thost,\n\t\t\t'x-amz-date': dtStr,\n\t\t\t'x-api-key': apiKey,\n\t\t};\n\t}\n\n\tprivate async _awsRealTimeIAMHeader({\n\t\tpayload,\n\t\tcanonicalUri,\n\t\tappSyncGraphqlEndpoint,\n\t\tregion,\n\t}) {\n\t\tconst endpointInfo = {\n\t\t\tregion,\n\t\t\tservice: 'appsync',\n\t\t};\n\n\t\tconst credentialsOK = await this._ensureCredentials();\n\t\tif (!credentialsOK) {\n\t\t\tthrow new Error('No credentials');\n\t\t}\n\t\tconst creds = await Credentials.get().then(credentials => ({\n\t\t\tsecret_key: credentials.secretAccessKey,\n\t\t\taccess_key: credentials.accessKeyId,\n\t\t\tsession_token: credentials.sessionToken,\n\t\t}));\n\n\t\tconst request = {\n\t\t\turl: `${appSyncGraphqlEndpoint}${canonicalUri}`,\n\t\t\tdata: payload,\n\t\t\tmethod: 'POST',\n\t\t\theaders: { ...AWS_APPSYNC_REALTIME_HEADERS },\n\t\t};\n\n\t\tconst signed_params = Signer.sign(request, creds, endpointInfo);\n\t\treturn signed_params.headers;\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_ensureCredentials() {\n\t\treturn Credentials.get()\n\t\t\t.then(credentials => {\n\t\t\t\tif (!credentials) return false;\n\t\t\t\tconst cred = Credentials.shear(credentials);\n\t\t\t\tlogger.debug('set credentials for AWSAppSyncRealTimeProvider', cred);\n\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tlogger.warn('ensure credentials error', err);\n\t\t\t\treturn false;\n\t\t\t});\n\t}\n}\n","/*\n * Copyright 2017-2018 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 { PubSub } from './PubSub';\n\nexport * from './Providers';\n\nenum CONTROL_MSG {\n\tCONNECTION_CLOSED = 'Connection closed',\n\tTIMEOUT_DISCONNECT = 'Timeout disconnect',\n\tSUBSCRIPTION_ACK = 'Subscription ack',\n}\n\nexport { PubSub, CONTROL_MSG };\n\n/**\n * @deprecated use named import\n */\nexport default PubSub;\n","/*\n * Copyright 2017-2018 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// import '../Common/Polyfills';\nimport Observable from 'zen-observable-ts';\n\nimport {\n\tAmplify,\n\tbrowserOrNode,\n\tConsoleLogger as Logger,\n\tINTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER,\n\tINTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER,\n} from '@aws-amplify/core';\nimport { PubSubProvider, PubSubOptions, ProvidertOptions } from './types';\nimport { AWSAppSyncProvider, AWSAppSyncRealTimeProvider } from './Providers';\n\nconst { isNode } = browserOrNode();\nconst logger = new Logger('PubSub');\n\nexport class PubSubClass {\n\tprivate _options: PubSubOptions;\n\n\tprivate _pluggables: PubSubProvider[];\n\n\t/**\n\t * Internal instance of AWSAppSyncProvider used by the API category to subscribe to AppSync\n\t */\n\tprivate _awsAppSyncProvider: AWSAppSyncProvider;\n\n\t/**\n\t * Internal instance of AWSAppSyncRealTimeProvider used by the API category to subscribe to AppSync\n\t */\n\tprivate _awsAppSyncRealTimeProvider: AWSAppSyncRealTimeProvider;\n\n\t/**\n\t * Lazy instantiate AWSAppSyncProvider when it is required by the API category\n\t */\n\tprivate get awsAppSyncProvider() {\n\t\tif (!this._awsAppSyncProvider) {\n\t\t\tthis._awsAppSyncProvider = new AWSAppSyncProvider(this._options);\n\t\t}\n\t\treturn this._awsAppSyncProvider;\n\t}\n\n\t/**\n\t * Lazy instantiate AWSAppSyncRealTimeProvider when it is required by the API category\n\t */\n\tprivate get awsAppSyncRealTimeProvider() {\n\t\tif (!this._awsAppSyncRealTimeProvider) {\n\t\t\tthis._awsAppSyncRealTimeProvider = new AWSAppSyncRealTimeProvider(\n\t\t\t\tthis._options\n\t\t\t);\n\t\t}\n\t\treturn this._awsAppSyncRealTimeProvider;\n\t}\n\n\t/**\n\t * Initialize PubSub with AWS configurations\n\t *\n\t * @param {PubSubOptions} options - Configuration object for PubSub\n\t */\n\tconstructor(options: PubSubOptions) {\n\t\tthis._options = options;\n\t\tlogger.debug('PubSub Options', this._options);\n\t\tthis._pluggables = [];\n\t\tthis.subscribe = this.subscribe.bind(this);\n\t}\n\n\tpublic getModuleName() {\n\t\treturn 'PubSub';\n\t}\n\n\t/**\n\t * Configure PubSub part with configurations\n\t *\n\t * @param {PubSubOptions} config - Configuration for PubSub\n\t * @return {Object} - The current configuration\n\t */\n\tconfigure(options: PubSubOptions) {\n\t\tconst opt = options ? options.PubSub || options : {};\n\t\tlogger.debug('configure PubSub', { opt });\n\n\t\tthis._options = Object.assign({}, this._options, opt);\n\n\t\tthis._pluggables.map(pluggable => pluggable.configure(this._options));\n\n\t\treturn this._options;\n\t}\n\n\t/**\n\t * add plugin into Analytics category\n\t * @param {Object} pluggable - an instance of the plugin\n\t */\n\tpublic async addPluggable(pluggable: PubSubProvider) {\n\t\tif (pluggable && pluggable.getCategory() === 'PubSub') {\n\t\t\tthis._pluggables.push(pluggable);\n\n\t\t\tconst config = pluggable.configure(this._options);\n\n\t\t\treturn config;\n\t\t}\n\t}\n\n\tprivate getProviderByName(providerName) {\n\t\tif (providerName === INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER) {\n\t\t\treturn this.awsAppSyncProvider;\n\t\t}\n\t\tif (providerName === INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER) {\n\t\t\treturn this.awsAppSyncRealTimeProvider;\n\t\t}\n\n\t\treturn this._pluggables.find(\n\t\t\tpluggable => pluggable.getProviderName() === providerName\n\t\t);\n\t}\n\n\tprivate getProviders(options: ProvidertOptions = {}) {\n\t\tconst { provider: providerName } = options;\n\t\tif (!providerName) {\n\t\t\treturn this._pluggables;\n\t\t}\n\n\t\tconst provider = this.getProviderByName(providerName);\n\t\tif (!provider) {\n\t\t\tthrow new Error(`Could not find provider named ${providerName}`);\n\t\t}\n\n\t\treturn [provider];\n\t}\n\n\tasync publish(\n\t\ttopics: string[] | string,\n\t\tmsg: any,\n\t\toptions?: ProvidertOptions\n\t) {\n\t\treturn Promise.all(\n\t\t\tthis.getProviders(options).map(provider =>\n\t\t\t\tprovider.publish(topics, msg, options)\n\t\t\t)\n\t\t);\n\t}\n\n\tsubscribe(\n\t\ttopics: string[] | string,\n\t\toptions?: ProvidertOptions\n\t): Observable {\n\t\tif (isNode && this._options && this._options.ssr) {\n\t\t\tthrow new Error(\n\t\t\t\t'Subscriptions are not supported for Server-Side Rendering (SSR)'\n\t\t\t);\n\t\t}\n\n\t\tlogger.debug('subscribe options', options);\n\n\t\tconst providers = this.getProviders(options);\n\n\t\treturn new Observable(observer => {\n\t\t\tconst observables = providers.map(provider => ({\n\t\t\t\tprovider,\n\t\t\t\tobservable: provider.subscribe(topics, options),\n\t\t\t}));\n\n\t\t\tconst subscriptions = observables.map(({ provider, observable }) =>\n\t\t\t\tobservable.subscribe({\n\t\t\t\t\tstart: console.error,\n\t\t\t\t\tnext: value => observer.next({ provider, value }),\n\t\t\t\t\terror: error => observer.error({ provider, error }),\n\t\t\t\t\t// complete: observer.complete, // TODO: when all completed, complete the outer one\n\t\t\t\t})\n\t\t\t);\n\n\t\t\treturn () =>\n\t\t\t\tsubscriptions.forEach(subscription => subscription.unsubscribe());\n\t\t});\n\t}\n}\n\nexport const PubSub = new PubSubClass(null);\nAmplify.register(PubSub);\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"aws_amplify_ui\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"aws_amplify_ui\"] = factory();\n\telse\n\t\troot[\"aws_amplify_ui\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/*\n * Copyright 2018 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 */\nexport * from './Anchor.css';\nexport * from './Button.css';\nexport * from './Form.css';\nexport * from './Hint.css';\nexport * from './Input.css';\nexport * from './Nav.css';\nexport * from './PhotoPicker.css';\nexport * from './Section.css';\nexport * from './SelectInput.css';\nexport * from './Strike.css';\nexport * from './Toast.css';\nexport * from './Totp.css';\nexport * from './XR.css';\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"a\":\"Anchor__a___1_Iz8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"button\":\"Button__button___vS7Mv\",\"signInButton\":\"Button__signInButton___3bUH-\",\"googleSignInButton\":\"Button__googleSignInButton___1YiCu\",\"signInButtonIcon\":\"Button__signInButtonIcon___ihN75\",\"auth0SignInButton\":\"Button__auth0SignInButton___znnCj\",\"facebookSignInButton\":\"Button__facebookSignInButton___34Txh\",\"amazonSignInButton\":\"Button__amazonSignInButton___2EMtl\",\"oAuthSignInButton\":\"Button__oAuthSignInButton___3UGOl\",\"signInButtonContent\":\"Button__signInButtonContent___xqTXJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"formContainer\":\"Form__formContainer___1GA3x\",\"formSection\":\"Form__formSection___1PPvW\",\"formField\":\"Form__formField___38Ikl\",\"formRow\":\"Form__formRow___2mwRs\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"hint\":\"Hint__hint___2XngB\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"input\":\"Input__input___3e_bf\",\"inputLabel\":\"Input__inputLabel___3VF0S\",\"label\":\"Input__label___23sO8\",\"radio\":\"Input__radio___2hllK\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"navBar\":\"Nav__navBar___xtCFA\",\"navRight\":\"Nav__navRight___1QG2J\",\"nav\":\"Nav__nav___2Dx2Y\",\"navItem\":\"Nav__navItem___1LtFQ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"photoPickerButton\":\"PhotoPicker__photoPickerButton___2XdVn\",\"photoPlaceholder\":\"PhotoPicker__photoPlaceholder___2JXO4\",\"photoPlaceholderIcon\":\"PhotoPicker__photoPlaceholderIcon___3Et71\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"Section__container___3YYTG\",\"actionRow\":\"Section__actionRow___2LWSU\",\"sectionHeader\":\"Section__sectionHeader___2djyg\",\"sectionHeaderHint\":\"Section__sectionHeaderHint___3Wxdc\",\"sectionBody\":\"Section__sectionBody___ihqqd\",\"sectionHeaderContent\":\"Section__sectionHeaderContent___1UCqa\",\"sectionFooter\":\"Section__sectionFooter___1T54C\",\"sectionFooterPrimaryContent\":\"Section__sectionFooterPrimaryContent___2r9ZX\",\"sectionFooterSecondaryContent\":\"Section__sectionFooterSecondaryContent___Nj41Q\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"selectInput\":\"SelectInput__selectInput___3efO4\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"strike\":\"Strike__strike___1XV1b\",\"strikeContent\":\"Strike__strikeContent___10gLb\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"toast\":\"Toast__toast___XXr3v\",\"toastClose\":\"Toast__toastClose___18lU4\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"totpQrcode\":\"Totp__totpQrcode___1crLx\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"sumerianSceneContainer\":\"XR__sumerianSceneContainer___3nVMt\",\"sumerianScene\":\"XR__sumerianScene___2Tt7-\",\"loadingOverlay\":\"XR__loadingOverlay___IbqcI\",\"loadingContainer\":\"XR__loadingContainer___2Itxb\",\"loadingLogo\":\"XR__loadingLogo___Ub7xQ\",\"loadingSceneName\":\"XR__loadingSceneName___3__ne\",\"loadingBar\":\"XR__loadingBar___2vcke\",\"loadingBarFill\":\"XR__loadingBarFill___3M-D9\",\"sceneErrorText\":\"XR__sceneErrorText___2y0tp\",\"sceneBar\":\"XR__sceneBar___2ShrP\",\"sceneName\":\"XR__sceneName___1ApHr\",\"sceneActions\":\"XR__sceneActions___7plGs\",\"actionButton\":\"XR__actionButton___2poIM\",\"tooltip\":\"XR__tooltip___UYyhn\",\"actionIcon\":\"XR__actionIcon___2qnd2\",\"autoShowTooltip\":\"XR__autoShowTooltip___V1QH7\"};","export function crc32(data: Uint8Array): number {\n return new Crc32().update(data).digest();\n}\n\nexport class Crc32 {\n private checksum = 0xffffffff;\n\n update(data: Uint8Array): this {\n for (const byte of data) {\n this.checksum =\n (this.checksum >>> 8) ^ lookupTable[(this.checksum ^ byte) & 0xff];\n }\n\n return this;\n }\n\n digest(): number {\n return (this.checksum ^ 0xffffffff) >>> 0;\n }\n}\n\n// prettier-ignore\nconst lookupTable = Uint32Array.from([\n 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,\n 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,\n 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,\n 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,\n 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,\n 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,\n 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,\n 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,\n 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,\n 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,\n 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,\n 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,\n 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,\n 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,\n 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,\n 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,\n 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,\n 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,\n 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,\n 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,\n 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,\n 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,\n 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,\n 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,\n 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,\n 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,\n 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,\n 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,\n 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,\n 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,\n 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,\n 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,\n 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,\n 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,\n 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,\n 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,\n 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,\n 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,\n 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,\n 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,\n 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,\n 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,\n 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,\n 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,\n 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,\n 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,\n 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,\n 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,\n 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,\n 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,\n 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,\n 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,\n 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,\n 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,\n 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,\n 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,\n 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,\n 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,\n 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,\n 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,\n 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,\n 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,\n 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,\n 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D,\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","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(\"Error encountered finalizing hash\");\n };\n operation.oncomplete = () => {\n if (operation.result) {\n resolve(new Uint8Array(operation.result));\n }\n reject(\"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(\"ImportKey completed without importing key.\");\n };\n keyOperation.onerror = () => {\n reject(\"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 { fromUtf8 } from \"@aws-sdk/util-utf8-browser\";\nimport { isEmptyData } from \"./isEmptyData\";\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\nfunction convertToBuffer(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","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 { fromUtf8 } from \"@aws-sdk/util-utf8-browser\";\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\nfunction isEmptyData(data: SourceData): boolean {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n\n return data.byteLength === 0;\n}\n\nfunction convertToBuffer(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 \"./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","/**\n * Copyright 2018 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 { Amplify } from '../Amplify';\n/**\n * Provides a means to registering a service worker in the browser\n * and communicating with it via postMessage events.\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/\n *\n * postMessage events are currently not supported in all browsers. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n *\n * At the minmum this class will register the service worker and listen\n * and attempt to dispatch messages on state change and record analytics\n * events based on the service worker lifecycle.\n */\nexport class ServiceWorkerClass {\n\t// The active service worker will be set once it is registered\n\tprivate _serviceWorker: ServiceWorker;\n\n\t// The service worker registration object\n\tprivate _registration: ServiceWorkerRegistration;\n\n\t// The application server public key for Push\n\t// https://web-push-codelab.glitch.me/\n\tprivate _publicKey: string;\n\n\t// push subscription\n\tprivate _subscription: PushSubscription;\n\n\t// The AWS Amplify logger\n\tprivate _logger: Logger = new Logger('ServiceWorker');\n\n\tconstructor() { }\n\n\t/**\n\t * Get the currently active service worker\n\t */\n\tget serviceWorker(): ServiceWorker {\n\t\treturn this._serviceWorker;\n\t}\n\n\t/**\n\t * Register the service-worker.js file in the browser\n\t * Make sure the service-worker.js is part of the build\n\t * for example with Angular, modify the angular-cli.json file\n\t * and add to \"assets\" array \"service-worker.js\"\n\t * @param {string} - (optional) Service worker file. Defaults to \"/service-worker.js\"\n\t * @param {string} - (optional) The service worker scope. Defaults to \"/\"\n\t * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register\n\t * @returns {Promise}\n\t *\t- resolve(ServiceWorkerRegistration)\n\t *\t- reject(Error)\n\t **/\n\tregister(filePath: string = '/service-worker.js', scope: string = '/') {\n\t\tthis._logger.debug(`registering ${filePath}`);\n\t\tthis._logger.debug(`registering service worker with scope ${scope}`);\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (navigator && 'serviceWorker' in navigator) {\n\t\t\t\tnavigator.serviceWorker\n\t\t\t\t\t.register(filePath, {\n\t\t\t\t\t\tscope,\n\t\t\t\t\t})\n\t\t\t\t\t.then(registration => {\n\t\t\t\t\t\tif (registration.installing) {\n\t\t\t\t\t\t\tthis._serviceWorker = registration.installing;\n\t\t\t\t\t\t} else if (registration.waiting) {\n\t\t\t\t\t\t\tthis._serviceWorker = registration.waiting;\n\t\t\t\t\t\t} else if (registration.active) {\n\t\t\t\t\t\t\tthis._serviceWorker = registration.active;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._registration = registration;\n\t\t\t\t\t\tthis._setupListeners();\n\t\t\t\t\t\tthis._logger.debug(\n\t\t\t\t\t\t\t`Service Worker Registration Success: ${registration}`\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn resolve(registration);\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => {\n\t\t\t\t\t\tthis._logger.debug(`Service Worker Registration Failed ${error}`);\n\t\t\t\t\t\treturn reject(error);\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn reject(new Error('Service Worker not available'));\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Enable web push notifications. If not subscribed, a new subscription will\n\t * be created and registered.\n\t * \tTest Push Server: https://web-push-codelab.glitch.me/\n\t * \tPush Server Libraries: https://github.com/web-push-libs/\n\t * \tAPI Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/\n\t * @param publicKey\n\t * @returns {Promise}\n\t * \t- resolve(PushSubscription)\n\t * - reject(Error)\n\t */\n\tenablePush(publicKey: string) {\n\t\tif (!this._registration) throw new Error('Service Worker not registered');\n\t\tthis._publicKey = publicKey;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (browserOrNode().isBrowser) {\n\t\t\t\tthis._registration.pushManager.getSubscription().then(subscription => {\n\t\t\t\t\tif (subscription) {\n\t\t\t\t\t\tthis._subscription = subscription;\n\t\t\t\t\t\tthis._logger.debug(\n\t\t\t\t\t\t\t`User is subscribed to push: ${JSON.stringify(subscription)}`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresolve(subscription);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._logger.debug(`User is NOT subscribed to push`);\n\t\t\t\t\t\treturn this._registration.pushManager\n\t\t\t\t\t\t\t.subscribe({\n\t\t\t\t\t\t\t\tuserVisibleOnly: true,\n\t\t\t\t\t\t\t\tapplicationServerKey: this._urlB64ToUint8Array(publicKey),\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.then(subscription => {\n\t\t\t\t\t\t\t\tthis._subscription = subscription;\n\t\t\t\t\t\t\t\tthis._logger.debug(\n\t\t\t\t\t\t\t\t\t`User subscribed: ${JSON.stringify(subscription)}`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tresolve(subscription);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(error => {\n\t\t\t\t\t\t\t\tthis._logger.error(error);\n\t\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\treturn reject(new Error('Service Worker not available'));\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Convert a base64 encoded string to a Uint8 array for the push server key\n\t * @param base64String\n\t */\n\tprivate _urlB64ToUint8Array(base64String: string) {\n\t\tconst padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n\t\tconst base64 = (base64String + padding)\n\t\t\t.replace(/\\-/g, '+')\n\t\t\t.replace(/_/g, '/');\n\n\t\tconst rawData = window.atob(base64);\n\t\tconst outputArray = new Uint8Array(rawData.length);\n\n\t\tfor (let i = 0; i < rawData.length; ++i) {\n\t\t\toutputArray[i] = rawData.charCodeAt(i);\n\t\t}\n\t\treturn outputArray;\n\t}\n\n\t/**\n\t * Send a message to the service worker. The service worker needs\n\t * to implement `self.addEventListener('message') to handle the\n\t * message. This ***currently*** does not work in Safari or IE.\n\t * @param {object | string} - An arbitrary JSON object or string message to send to the service worker\n\t *\t- see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable\n\t * @returns {Promise}\n\t **/\n\tsend(message: object | string) {\n\t\tif (this._serviceWorker) {\n\t\t\tthis._serviceWorker.postMessage(\n\t\t\t\ttypeof message === 'object' ? JSON.stringify(message) : message\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Listen for service worker state change and message events\n\t * https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state\n\t **/\n\t_setupListeners() {\n\t\tthis._serviceWorker.addEventListener('statechange', event => {\n\t\t\tconst currentState = this._serviceWorker.state;\n\t\t\tthis._logger.debug(`ServiceWorker statechange: ${currentState}`);\n\t\t\tif (Amplify.Analytics && typeof Amplify.Analytics.record === 'function') {\n\t\t\t\tAmplify.Analytics.record({\n\t\t\t\t\tname: 'ServiceWorker',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tstate: currentState,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tthis._serviceWorker.addEventListener('message', event => {\n\t\t\tthis._logger.debug(`ServiceWorker message event: ${event}`);\n\t\t});\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default ServiceWorkerClass;\n","/*\r\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\r\n * the License. A copy of the License is located at\r\n *\r\n * http://aws.amazon.com/apache2.0/\r\n *\r\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\r\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\r\n * and limitations under the License.\r\n */\r\n\r\nimport { HttpHandlerOptions } from '@aws-sdk/types';\r\nimport { HttpHandler, HttpRequest, HttpResponse } from '@aws-sdk/protocol-http';\r\nimport { buildQueryString } from '@aws-sdk/querystring-builder';\r\nimport axios, { AxiosRequestConfig, Method } from 'axios';\r\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\r\nimport { FetchHttpHandlerOptions } from '@aws-sdk/fetch-http-handler';\r\n\r\nconst logger = new Logger('axios-http-handler');\r\nexport const SEND_PROGRESS_EVENT = 'sendProgress';\r\n\r\nexport class AxiosHttpHandler implements HttpHandler {\r\n\tconstructor(\r\n\t\tprivate readonly httpOptions: FetchHttpHandlerOptions = {},\r\n\t\tprivate readonly emitter?: any\r\n\t) {}\r\n\r\n\tdestroy(): void {\r\n\t\t// Do nothing. TLS and HTTP/2 connection pooling is handled by the\r\n\t\t// browser.\r\n\t}\r\n\r\n\thandle(\r\n\t\trequest: HttpRequest,\r\n\t\toptions: HttpHandlerOptions\r\n\t): Promise<{ response: HttpResponse }> {\r\n\t\tconst requestTimeoutInMs = this.httpOptions.requestTimeout;\r\n\t\tconst emitter = this.emitter;\r\n\r\n\t\tlet path = request.path;\r\n\t\tif (request.query) {\r\n\t\t\tconst queryString = buildQueryString(request.query);\r\n\t\t\tif (queryString) {\r\n\t\t\t\tpath += `?${queryString}`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst port = request.port;\r\n\t\tconst url = `${request.protocol}//${request.hostname}${\r\n\t\t\tport ? `:${port}` : ''\r\n\t\t}${path}`;\r\n\r\n\t\tconst axiosRequest: AxiosRequestConfig = {};\r\n\t\taxiosRequest.url = url;\r\n\t\taxiosRequest.method = request.method as Method;\r\n\t\taxiosRequest.headers = request.headers;\r\n\r\n\t\t// The host header is automatically added by the browser and adding it explicitly in the\r\n\t\t// axios request throws an error https://github.com/aws-amplify/amplify-js/issues/5376\r\n\t\t// This is because the host header is a forbidden header for the http client to set\r\n\t\t// see https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name and\r\n\t\t// https://fetch.spec.whatwg.org/#forbidden-header-name\r\n\t\t// The reason we are removing this header here instead of in the aws-sdk's client\r\n\t\t// middleware is that the host header is required to be in the request signature and if\r\n\t\t// we remove it from the middlewares, then the request fails because the header is added\r\n\t\t// by the browser but is absent from the signature.\r\n\t\tdelete axiosRequest.headers['host'];\r\n\r\n\t\tif (request.body) {\r\n\t\t\taxiosRequest.data = request.body;\r\n\t\t} else {\r\n\t\t\t// Fix for https://github.com/aws-amplify/amplify-js/issues/5432\r\n\r\n\t\t\t// If the POST request body is empty but content-type header is set, axios is forcibly removing it\r\n\t\t\t// See https://github.com/axios/axios/issues/1535 and refusing to fix it https://github.com/axios/axios/issues/755\r\n\t\t\t// This change is a workaround to set the data as null (instead of undefined) to prevent axios from\r\n\t\t\t// removing the content-type header. Link for the source code\r\n\t\t\t// https://github.com/axios/axios/blob/dc4bc49673943e35280e5df831f5c3d0347a9393/lib/adapters/xhr.js#L121-L123\r\n\r\n\t\t\tif (axiosRequest.headers['Content-Type']) {\r\n\t\t\t\taxiosRequest.data = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (emitter) {\r\n\t\t\taxiosRequest.onUploadProgress = function(event) {\r\n\t\t\t\temitter.emit(SEND_PROGRESS_EVENT, event);\r\n\t\t\t\tlogger.debug(event);\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\t// From gamma release, aws-sdk now expects all response type to be of blob or streams\r\n\t\taxiosRequest.responseType = 'blob';\r\n\r\n\t\tconst raceOfPromises = [\r\n\t\t\taxios\r\n\t\t\t\t.request(axiosRequest)\r\n\t\t\t\t.then(response => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tresponse: new HttpResponse({\r\n\t\t\t\t\t\t\theaders: response.headers,\r\n\t\t\t\t\t\t\tstatusCode: response.status,\r\n\t\t\t\t\t\t\tbody: response.data,\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t};\r\n\t\t\t\t})\r\n\t\t\t\t.catch(error => {\r\n\t\t\t\t\t// Error\r\n\t\t\t\t\tlogger.error(error);\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t}),\r\n\t\t\trequestTimeout(requestTimeoutInMs),\r\n\t\t];\r\n\t\treturn Promise.race(raceOfPromises);\r\n\t}\r\n}\r\n\r\nfunction requestTimeout(timeoutInMs: number = 0): Promise {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\tif (timeoutInMs) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tconst timeoutError = new Error(\r\n\t\t\t\t\t`Request did not complete within ${timeoutInMs} ms`\r\n\t\t\t\t);\r\n\t\t\t\ttimeoutError.name = 'TimeoutError';\r\n\t\t\t\treject(timeoutError);\r\n\t\t\t}, timeoutInMs);\r\n\t\t}\r\n\t});\r\n}\r\n","/*\r\n * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\r\n * the License. A copy of the License is located at\r\n *\r\n * http://aws.amazon.com/apache2.0/\r\n *\r\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\r\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\r\n * and limitations under the License.\r\n */\r\n\r\nimport {\r\n\tConsoleLogger as Logger,\r\n\tgetAmplifyUserAgent,\r\n\tPlatform,\r\n\tCredentials,\r\n} from '@aws-amplify/core';\r\nimport {\r\n\tS3Client,\r\n\tPutObjectCommand,\r\n\tCreateMultipartUploadCommand,\r\n\tUploadPartCommand,\r\n\tCompleteMultipartUploadCommand,\r\n\tCompleteMultipartUploadCommandInput,\r\n\tUploadPartCommandOutput,\r\n\tUploadPartCommandInput,\r\n\tListPartsCommand,\r\n\tAbortMultipartUploadCommand,\r\n} from '@aws-sdk/client-s3';\r\nimport { AxiosHttpHandler, SEND_PROGRESS_EVENT } from './axios-http-handler';\r\nimport * as events from 'events';\r\nimport { streamCollector } from '@aws-sdk/fetch-http-handler';\r\n\r\nconst logger = new Logger('AWSS3ProviderManagedUpload');\r\n\r\nconst localTestingStorageEndpoint = 'http://localhost:20005';\r\n\r\nconst SET_CONTENT_LENGTH_HEADER = 'contentLengthMiddleware';\r\nexport declare interface Part {\r\n\tbodyPart: any;\r\n\tpartNumber: number;\r\n\temitter: any;\r\n\tetag?: string;\r\n\t_lastUploadedBytes: number;\r\n}\r\n\r\nexport class AWSS3ProviderManagedUpload {\r\n\t// Defaults\r\n\tprotected minPartSize = 5 * 1024 * 1024; // in MB\r\n\tprivate queueSize = 4;\r\n\r\n\t// Data for current upload\r\n\tprivate body = null;\r\n\tprivate params = null;\r\n\tprivate opts = null;\r\n\tprivate multiPartMap = [];\r\n\tprivate cancel: boolean = false;\r\n\r\n\t// Progress reporting\r\n\tprivate bytesUploaded = 0;\r\n\tprivate totalBytesToUpload = 0;\r\n\tprivate emitter = null;\r\n\r\n\tconstructor(params, opts, emitter) {\r\n\t\tthis.params = params;\r\n\t\tthis.opts = opts;\r\n\t\tthis.emitter = emitter;\r\n\t}\r\n\r\n\tpublic async upload() {\r\n\t\tthis.body = await this.validateAndSanitizeBody(this.params.Body);\r\n\t\tthis.totalBytesToUpload = this.byteLength(this.body);\r\n\t\tif (this.totalBytesToUpload <= this.minPartSize) {\r\n\t\t\t// Multipart upload is not required. Upload the sanitized body as is\r\n\t\t\tthis.params.Body = this.body;\r\n\t\t\tconst putObjectCommand = new PutObjectCommand(this.params);\r\n\t\t\tconst s3 = await this._createNewS3Client(this.opts, this.emitter);\r\n\t\t\treturn s3.send(putObjectCommand);\r\n\t\t} else {\r\n\t\t\t// Step 1: Initiate the multi part upload\r\n\t\t\tconst uploadId = await this.createMultiPartUpload();\r\n\r\n\t\t\t// Step 2: Upload chunks in parallel as requested\r\n\t\t\tconst numberOfPartsToUpload = Math.ceil(\r\n\t\t\t\tthis.totalBytesToUpload / this.minPartSize\r\n\t\t\t);\r\n\t\t\tfor (\r\n\t\t\t\tlet start = 0;\r\n\t\t\t\tstart < numberOfPartsToUpload;\r\n\t\t\t\tstart += this.queueSize\r\n\t\t\t) {\r\n\t\t\t\t/** This first block will try to cancel the upload if the cancel\r\n\t\t\t\t *\trequest came before any parts uploads have started.\r\n\t\t\t\t **/\r\n\t\t\t\tawait this.checkIfUploadCancelled(uploadId);\r\n\r\n\t\t\t\t// Upload as many as `queueSize` parts simultaneously\r\n\t\t\t\tconst parts: Part[] = this.createParts(start);\r\n\t\t\t\tawait this.uploadParts(uploadId, parts);\r\n\r\n\t\t\t\t/** Call cleanup a second time in case there were part upload requests\r\n\t\t\t\t * in flight. This is to ensure that all parts are cleaned up.\r\n\t\t\t\t */\r\n\t\t\t\tawait this.checkIfUploadCancelled(uploadId);\r\n\t\t\t}\r\n\r\n\t\t\t// Step 3: Finalize the upload such that S3 can recreate the file\r\n\t\t\treturn await this.finishMultiPartUpload(uploadId);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate createParts(startPartNumber: number): Part[] {\r\n\t\tconst parts: Part[] = [];\r\n\t\tlet partNumber = startPartNumber;\r\n\t\tfor (\r\n\t\t\tlet bodyStart = startPartNumber * this.minPartSize;\r\n\t\t\tbodyStart < this.totalBytesToUpload && parts.length < this.queueSize;\r\n\r\n\t\t) {\r\n\t\t\tconst bodyEnd = Math.min(\r\n\t\t\t\tbodyStart + this.minPartSize,\r\n\t\t\t\tthis.totalBytesToUpload\r\n\t\t\t);\r\n\t\t\tparts.push({\r\n\t\t\t\tbodyPart: this.body.slice(bodyStart, bodyEnd),\r\n\t\t\t\tpartNumber: ++partNumber,\r\n\t\t\t\temitter: new events.EventEmitter(),\r\n\t\t\t\t_lastUploadedBytes: 0,\r\n\t\t\t});\r\n\t\t\tbodyStart += this.minPartSize;\r\n\t\t}\r\n\t\treturn parts;\r\n\t}\r\n\r\n\tprivate async createMultiPartUpload() {\r\n\t\tconst createMultiPartUploadCommand = new CreateMultipartUploadCommand(\r\n\t\t\tthis.params\r\n\t\t);\r\n\t\tconst s3 = await this._createNewS3Client(this.opts);\r\n\r\n\t\t// @aws-sdk/client-s3 seems to be ignoring the `ContentType` parameter, so we\r\n\t\t// are explicitly adding it via middleware.\r\n\t\t// https://github.com/aws/aws-sdk-js-v3/issues/2000\r\n\t\ts3.middlewareStack.add(\r\n\t\t\tnext => (args: any) => {\r\n\t\t\t\tif (\r\n\t\t\t\t\tthis.params.ContentType &&\r\n\t\t\t\t\targs &&\r\n\t\t\t\t\targs.request &&\r\n\t\t\t\t\targs.request.headers\r\n\t\t\t\t) {\r\n\t\t\t\t\targs.request.headers['Content-Type'] = this.params.ContentType;\r\n\t\t\t\t}\r\n\t\t\t\treturn next(args);\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tstep: 'build',\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tconst response = await s3.send(createMultiPartUploadCommand);\r\n\t\tlogger.debug(response.UploadId);\r\n\t\treturn response.UploadId;\r\n\t}\r\n\r\n\t/**\r\n\t * @private Not to be extended outside of tests\r\n\t * @VisibleFotTesting\r\n\t */\r\n\tprotected async uploadParts(uploadId: string, parts: Part[]) {\r\n\t\tconst promises: Array> = [];\r\n\t\tfor (const part of parts) {\r\n\t\t\tthis.setupEventListener(part);\r\n\t\t\tconst uploadPartCommandInput: UploadPartCommandInput = {\r\n\t\t\t\tPartNumber: part.partNumber,\r\n\t\t\t\tBody: part.bodyPart,\r\n\t\t\t\tUploadId: uploadId,\r\n\t\t\t\tKey: this.params.Key,\r\n\t\t\t\tBucket: this.params.Bucket,\r\n\t\t\t};\r\n\t\t\tconst uploadPartCommand = new UploadPartCommand(uploadPartCommandInput);\r\n\t\t\tconst s3 = await this._createNewS3Client(this.opts, part.emitter);\r\n\t\t\tpromises.push(s3.send(uploadPartCommand));\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tconst allResults: Array = await Promise.all(\r\n\t\t\t\tpromises\r\n\t\t\t);\r\n\t\t\t// The order of resolved promises is the same as input promise order.\r\n\t\t\tfor (let i = 0; i < allResults.length; i++) {\r\n\t\t\t\tthis.multiPartMap.push({\r\n\t\t\t\t\tPartNumber: parts[i].partNumber,\r\n\t\t\t\t\tETag: allResults[i].ETag,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tlogger.error(\r\n\t\t\t\t'error happened while uploading a part. Cancelling the multipart upload',\r\n\t\t\t\terror\r\n\t\t\t);\r\n\t\t\tthis.cancelUpload();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate async finishMultiPartUpload(uploadId: string) {\r\n\t\tconst input: CompleteMultipartUploadCommandInput = {\r\n\t\t\tBucket: this.params.Bucket,\r\n\t\t\tKey: this.params.Key,\r\n\t\t\tUploadId: uploadId,\r\n\t\t\tMultipartUpload: { Parts: this.multiPartMap },\r\n\t\t};\r\n\t\tconst completeUploadCommand = new CompleteMultipartUploadCommand(input);\r\n\t\tconst s3 = await this._createNewS3Client(this.opts);\r\n\t\ttry {\r\n\t\t\tconst data = await s3.send(completeUploadCommand);\r\n\t\t\treturn data.Key;\r\n\t\t} catch (error) {\r\n\t\t\tlogger.error(\r\n\t\t\t\t'error happened while finishing the upload. Cancelling the multipart upload',\r\n\t\t\t\terror\r\n\t\t\t);\r\n\t\t\tthis.cancelUpload();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate async checkIfUploadCancelled(uploadId: string) {\r\n\t\tif (this.cancel) {\r\n\t\t\tlet errorMessage = 'Upload was cancelled.';\r\n\t\t\ttry {\r\n\t\t\t\tawait this.cleanup(uploadId);\r\n\t\t\t} catch (error) {\r\n\t\t\t\terrorMessage += error.errorMessage;\r\n\t\t\t}\r\n\t\t\tthrow new Error(errorMessage);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic cancelUpload() {\r\n\t\tthis.cancel = true;\r\n\t}\r\n\r\n\tprivate async cleanup(uploadId: string) {\r\n\t\t// Reset this's state\r\n\t\tthis.body = null;\r\n\t\tthis.multiPartMap = [];\r\n\t\tthis.bytesUploaded = 0;\r\n\t\tthis.totalBytesToUpload = 0;\r\n\r\n\t\tconst input = {\r\n\t\t\tBucket: this.params.Bucket,\r\n\t\t\tKey: this.params.Key,\r\n\t\t\tUploadId: uploadId,\r\n\t\t};\r\n\r\n\t\tconst s3 = await this._createNewS3Client(this.opts);\r\n\t\tawait s3.send(new AbortMultipartUploadCommand(input));\r\n\r\n\t\t// verify that all parts are removed.\r\n\t\tconst data = await s3.send(new ListPartsCommand(input));\r\n\r\n\t\tif (data && data.Parts && data.Parts.length > 0) {\r\n\t\t\tthrow new Error('Multi Part upload clean up failed');\r\n\t\t}\r\n\t}\r\n\r\n\tprivate setupEventListener(part: Part) {\r\n\t\tpart.emitter.on(SEND_PROGRESS_EVENT, progress => {\r\n\t\t\tthis.progressChanged(\r\n\t\t\t\tpart.partNumber,\r\n\t\t\t\tprogress.loaded - part._lastUploadedBytes\r\n\t\t\t);\r\n\t\t\tpart._lastUploadedBytes = progress.loaded;\r\n\t\t});\r\n\t}\r\n\r\n\tprivate progressChanged(partNumber: number, incrementalUpdate: number) {\r\n\t\tthis.bytesUploaded += incrementalUpdate;\r\n\t\tthis.emitter.emit(SEND_PROGRESS_EVENT, {\r\n\t\t\tloaded: this.bytesUploaded,\r\n\t\t\ttotal: this.totalBytesToUpload,\r\n\t\t\tpart: partNumber,\r\n\t\t\tkey: this.params.Key,\r\n\t\t});\r\n\t}\r\n\r\n\tprivate byteLength(input: any) {\r\n\t\tif (input === null || input === undefined) return 0;\r\n\t\tif (typeof input.byteLength === 'number') {\r\n\t\t\treturn input.byteLength;\r\n\t\t} else if (typeof input.length === 'number') {\r\n\t\t\treturn input.length;\r\n\t\t} else if (typeof input.size === 'number') {\r\n\t\t\treturn input.size;\r\n\t\t} else if (typeof input.path === 'string') {\r\n\t\t\t/* NodeJs Support\r\n\t\t\treturn require('fs').lstatSync(input.path).size;\r\n\t\t\t*/\r\n\t\t} else {\r\n\t\t\tthrow new Error('Cannot determine length of ' + input);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate async validateAndSanitizeBody(body: any): Promise {\r\n\t\tif (this.isGenericObject(body)) {\r\n\t\t\t// Any javascript object\r\n\t\t\treturn JSON.stringify(body);\r\n\t\t} else if (this.isBlob(body)) {\r\n\t\t\t// If it's a blob, we need to convert it to an array buffer as axios has issues\r\n\t\t\t// with correctly identifying blobs in *react native* environment. For more\r\n\t\t\t// details see https://github.com/aws-amplify/amplify-js/issues/5311\r\n\t\t\tif (Platform.isReactNative) {\r\n\t\t\t\treturn await streamCollector(body);\r\n\t\t\t}\r\n\t\t\treturn body;\r\n\t\t} else {\r\n\t\t\t// Files, arrayBuffer etc\r\n\t\t\treturn body;\r\n\t\t}\r\n\t\t/* TODO: streams and files for nodejs \r\n\t\tif (\r\n\t\t\ttypeof body.path === 'string' &&\r\n\t\t\trequire('fs').lstatSync(body.path).size > 0\r\n\t\t) {\r\n\t\t\treturn body;\r\n\t\t} */\r\n\t}\r\n\r\n\tprivate isBlob(body: any) {\r\n\t\treturn typeof Blob !== 'undefined' && body instanceof Blob;\r\n\t}\r\n\r\n\tprivate isGenericObject(body: any) {\r\n\t\tif (body !== null && typeof body === 'object') {\r\n\t\t\ttry {\r\n\t\t\t\treturn !(this.byteLength(body) >= 0);\r\n\t\t\t} catch (error) {\r\n\t\t\t\t// If we cannot determine the length of the body, consider it\r\n\t\t\t\t// as a generic object and upload a stringified version of it\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * @private\r\n\t * creates an S3 client with new V3 aws sdk\r\n\t */\r\n\tprotected async _createNewS3Client(config, emitter?) {\r\n\t\tconst credentials = await this._getCredentials();\r\n\t\tconst { region, dangerouslyConnectToHttpEndpointForTesting } = config;\r\n\t\tlet localTestingConfig = {};\r\n\r\n\t\tif (dangerouslyConnectToHttpEndpointForTesting) {\r\n\t\t\tlocalTestingConfig = {\r\n\t\t\t\tendpoint: localTestingStorageEndpoint,\r\n\t\t\t\ttls: false,\r\n\t\t\t\tbucketEndpoint: false,\r\n\t\t\t\tforcePathStyle: true,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst client = new S3Client({\r\n\t\t\tregion,\r\n\t\t\tcredentials,\r\n\t\t\t...localTestingConfig,\r\n\t\t\trequestHandler: new AxiosHttpHandler({}, emitter),\r\n\t\t\tcustomUserAgent: getAmplifyUserAgent(),\r\n\t\t});\r\n\t\tclient.middlewareStack.remove(SET_CONTENT_LENGTH_HEADER);\r\n\t\treturn client;\r\n\t}\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getCredentials() {\r\n\t\treturn Credentials.get()\r\n\t\t\t.then(credentials => {\r\n\t\t\t\tif (!credentials) return false;\r\n\t\t\t\tconst cred = Credentials.shear(credentials);\r\n\t\t\t\tlogger.debug('set credentials for storage', cred);\r\n\t\t\t\treturn cred;\r\n\t\t\t})\r\n\t\t\t.catch(error => {\r\n\t\t\t\tlogger.warn('ensure credentials error', error);\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t}\r\n}\r\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 {\n\tConsoleLogger as Logger,\n\tHub,\n\tCredentials,\n\tParser,\n\tgetAmplifyUserAgent,\n} from '@aws-amplify/core';\nimport {\n\tS3Client,\n\tGetObjectCommand,\n\tDeleteObjectCommand,\n\tListObjectsCommand,\n} from '@aws-sdk/client-s3';\nimport { formatUrl } from '@aws-sdk/util-format-url';\nimport { createRequest } from '@aws-sdk/util-create-request';\nimport { S3RequestPresigner } from '@aws-sdk/s3-request-presigner';\nimport { StorageOptions, StorageProvider } from '../types';\nimport { AxiosHttpHandler } from './axios-http-handler';\nimport { AWSS3ProviderManagedUpload } from './AWSS3ProviderManagedUpload';\nimport * as events from 'events';\n\nconst logger = new Logger('AWSS3Provider');\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 dispatchStorageEvent = (\n\ttrack: boolean,\n\tevent: string,\n\tattrs: any,\n\tmetrics: any,\n\tmessage: string\n) => {\n\tif (track) {\n\t\tconst data = { attrs };\n\t\tif (metrics) {\n\t\t\tdata['metrics'] = metrics;\n\t\t}\n\t\tHub.dispatch(\n\t\t\t'storage',\n\t\t\t{\n\t\t\t\tevent,\n\t\t\t\tdata,\n\t\t\t\tmessage,\n\t\t\t},\n\t\t\t'Storage',\n\t\t\tAMPLIFY_SYMBOL\n\t\t);\n\t}\n};\n\nconst localTestingStorageEndpoint = 'http://localhost:20005';\n/**\n * Provide storage methods to use AWS S3\n */\nexport class AWSS3Provider implements StorageProvider {\n\tstatic CATEGORY = 'Storage';\n\tstatic PROVIDER_NAME = 'AWSS3';\n\t/**\n\t * @private\n\t */\n\tprivate _config;\n\n\t/**\n\t * Initialize Storage with AWS configurations\n\t * @param {Object} config - Configuration object for storage\n\t */\n\tconstructor(config?: StorageOptions) {\n\t\tthis._config = config ? config : {};\n\t\tlogger.debug('Storage Options', this._config);\n\t}\n\n\t/**\n\t * get the category of the plugin\n\t */\n\tpublic getCategory(): string {\n\t\treturn AWSS3Provider.CATEGORY;\n\t}\n\n\t/**\n\t * get provider name of the plugin\n\t */\n\tgetProviderName(): string {\n\t\treturn AWSS3Provider.PROVIDER_NAME;\n\t}\n\n\t/**\n\t * Configure Storage part with aws configuration\n\t * @param {Object} config - Configuration of the Storage\n\t * @return {Object} - Current configuration\n\t */\n\tpublic configure(config?): object {\n\t\tlogger.debug('configure Storage', config);\n\t\tif (!config) return this._config;\n\t\tconst amplifyConfig = Parser.parseMobilehubConfig(config);\n\t\tthis._config = Object.assign({}, this._config, amplifyConfig.Storage);\n\t\tif (!this._config.bucket) {\n\t\t\tlogger.debug('Do not have bucket yet');\n\t\t}\n\t\treturn this._config;\n\t}\n\n\t/**\n\t * Get a presigned URL of the file or the object data when download:true\n\t *\n\t * @param {string} key - key of the object\n\t * @param {Object} [config] - { level : private|protected|public, download: true|false }\n\t * @return - A promise resolves to Amazon S3 presigned URL on success\n\t */\n\tpublic async get(key: string, config?): Promise {\n\t\tconst credentialsOK = await this._ensureCredentials();\n\t\tif (!credentialsOK) {\n\t\t\treturn Promise.reject('No credentials');\n\t\t}\n\n\t\tconst opt = Object.assign({}, this._config, config);\n\t\tconst {\n\t\t\tbucket,\n\t\t\tdownload,\n\t\t\tcacheControl,\n\t\t\tcontentDisposition,\n\t\t\tcontentEncoding,\n\t\t\tcontentLanguage,\n\t\t\tcontentType,\n\t\t\texpires,\n\t\t\ttrack,\n\t\t} = opt;\n\t\tconst prefix = this._prefix(opt);\n\t\tconst final_key = prefix + key;\n\t\tconst s3 = this._createNewS3Client(opt);\n\t\tlogger.debug('get ' + key + ' from ' + final_key);\n\n\t\tconst params: any = {\n\t\t\tBucket: bucket,\n\t\t\tKey: final_key,\n\t\t};\n\n\t\t// See: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property\n\t\tif (cacheControl) params.ResponseCacheControl = cacheControl;\n\t\tif (contentDisposition)\n\t\t\tparams.ResponseContentDisposition = contentDisposition;\n\t\tif (contentEncoding) params.ResponseContentEncoding = contentEncoding;\n\t\tif (contentLanguage) params.ResponseContentLanguage = contentLanguage;\n\t\tif (contentType) params.ResponseContentType = contentType;\n\n\t\tif (download === true) {\n\t\t\tconst getObjectCommand = new GetObjectCommand(params);\n\t\t\ttry {\n\t\t\t\tconst response = await s3.send(getObjectCommand);\n\t\t\t\tdispatchStorageEvent(\n\t\t\t\t\ttrack,\n\t\t\t\t\t'download',\n\t\t\t\t\t{ method: 'get', result: 'success' },\n\t\t\t\t\t{\n\t\t\t\t\t\tfileSize: Number(response.Body['size'] || response.Body['length']),\n\t\t\t\t\t},\n\t\t\t\t\t`Download success for ${key}`\n\t\t\t\t);\n\t\t\t\treturn response;\n\t\t\t} catch (error) {\n\t\t\t\tdispatchStorageEvent(\n\t\t\t\t\ttrack,\n\t\t\t\t\t'download',\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'get',\n\t\t\t\t\t\tresult: 'failed',\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t`Download failed with ${error.message}`\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\tparams.Expires = expires || 900; // Default is 15 mins as defined in V2 AWS SDK\n\n\t\ttry {\n\t\t\tconst signer = new S3RequestPresigner({ ...s3.config });\n\t\t\tconst request = await createRequest(s3, new GetObjectCommand(params));\n\t\t\tconst url = formatUrl(\n\t\t\t\t(await signer.presign(request, { expiresIn: params.Expires })) as any\n\t\t\t);\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'getSignedUrl',\n\t\t\t\t{ method: 'get', result: 'success' },\n\t\t\t\tnull,\n\t\t\t\t`Signed URL: ${url}`\n\t\t\t);\n\t\t\treturn url;\n\t\t} catch (error) {\n\t\t\tlogger.warn('get signed url error', error);\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'getSignedUrl',\n\t\t\t\t{ method: 'get', result: 'failed' },\n\t\t\t\tnull,\n\t\t\t\t`Could not get a signed URL for ${key}`\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Put a file in S3 bucket specified to configure method\n\t * @param {string} key - key of the object\n\t * @param {Object} object - File to be put in Amazon S3 bucket\n\t * @param {Object} [config] - { level : private|protected|public, contentType: MIME Types,\n\t * progressCallback: function }\n\t * @return - promise resolves to object on success\n\t */\n\tpublic async put(key: string, object, config?): Promise {\n\t\tconst credentialsOK = await this._ensureCredentials();\n\t\tif (!credentialsOK) {\n\t\t\treturn Promise.reject('No credentials');\n\t\t}\n\n\t\tconst opt = Object.assign({}, this._config, config);\n\t\tconst { bucket, track, progressCallback } = opt;\n\t\tconst {\n\t\t\tcontentType,\n\t\t\tcontentDisposition,\n\t\t\tcacheControl,\n\t\t\texpires,\n\t\t\tmetadata,\n\t\t\ttagging,\n\t\t\tacl,\n\t\t} = opt;\n\t\tconst {\n\t\t\tserverSideEncryption,\n\t\t\tSSECustomerAlgorithm,\n\t\t\tSSECustomerKey,\n\t\t\tSSECustomerKeyMD5,\n\t\t\tSSEKMSKeyId,\n\t\t} = opt;\n\t\tconst type = contentType ? contentType : 'binary/octet-stream';\n\n\t\tconst prefix = this._prefix(opt);\n\t\tconst final_key = prefix + key;\n\t\tlogger.debug('put ' + key + ' to ' + final_key);\n\n\t\tconst params: any = {\n\t\t\tBucket: bucket,\n\t\t\tKey: final_key,\n\t\t\tBody: object,\n\t\t\tContentType: type,\n\t\t};\n\t\tif (cacheControl) {\n\t\t\tparams.CacheControl = cacheControl;\n\t\t}\n\t\tif (contentDisposition) {\n\t\t\tparams.ContentDisposition = contentDisposition;\n\t\t}\n\t\tif (expires) {\n\t\t\tparams.Expires = expires;\n\t\t}\n\t\tif (metadata) {\n\t\t\tparams.Metadata = metadata;\n\t\t}\n\t\tif (tagging) {\n\t\t\tparams.Tagging = tagging;\n\t\t}\n\t\tif (serverSideEncryption) {\n\t\t\tparams.ServerSideEncryption = serverSideEncryption;\n\t\t\tif (SSECustomerAlgorithm) {\n\t\t\t\tparams.SSECustomerAlgorithm = SSECustomerAlgorithm;\n\t\t\t}\n\t\t\tif (SSECustomerKey) {\n\t\t\t\tparams.SSECustomerKey = SSECustomerKey;\n\t\t\t}\n\t\t\tif (SSECustomerKeyMD5) {\n\t\t\t\tparams.SSECustomerKeyMD5 = SSECustomerKeyMD5;\n\t\t\t}\n\t\t\tif (SSEKMSKeyId) {\n\t\t\t\tparams.SSEKMSKeyId = SSEKMSKeyId;\n\t\t\t}\n\t\t}\n\n\t\tconst emitter = new events.EventEmitter();\n\t\tconst uploader = new AWSS3ProviderManagedUpload(params, opt, emitter);\n\n\t\tif (acl) {\n\t\t\tparams.ACL = acl;\n\t\t}\n\n\t\ttry {\n\t\t\temitter.on('sendProgress', progress => {\n\t\t\t\tif (progressCallback) {\n\t\t\t\t\tif (typeof progressCallback === 'function') {\n\t\t\t\t\t\tprogressCallback(progress);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t\t'progressCallback should be a function, not a ' +\n\t\t\t\t\t\t\t\ttypeof progressCallback\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\tconst response = await uploader.upload();\n\n\t\t\tlogger.debug('upload result', response);\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'upload',\n\t\t\t\t{ method: 'put', result: 'success' },\n\t\t\t\tnull,\n\t\t\t\t`Upload success for ${key}`\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tkey,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tlogger.warn('error uploading', error);\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'upload',\n\t\t\t\t{ method: 'put', result: 'failed' },\n\t\t\t\tnull,\n\t\t\t\t`Error uploading ${key}`\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Remove the object for specified key\n\t * @param {string} key - key of the object\n\t * @param {Object} [config] - { level : private|protected|public }\n\t * @return - Promise resolves upon successful removal of the object\n\t */\n\tpublic async remove(key: string, config?): Promise {\n\t\tconst credentialsOK = await this._ensureCredentials();\n\t\tif (!credentialsOK) {\n\t\t\treturn Promise.reject('No credentials');\n\t\t}\n\n\t\tconst opt = Object.assign({}, this._config, config);\n\t\tconst { bucket, track } = opt;\n\n\t\tconst prefix = this._prefix(opt);\n\t\tconst final_key = prefix + key;\n\t\tconst s3 = this._createNewS3Client(opt);\n\t\tlogger.debug('remove ' + key + ' from ' + final_key);\n\n\t\tconst params = {\n\t\t\tBucket: bucket,\n\t\t\tKey: final_key,\n\t\t};\n\n\t\tconst deleteObjectCommand = new DeleteObjectCommand(params);\n\n\t\ttry {\n\t\t\tconst response = await s3.send(deleteObjectCommand);\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'delete',\n\t\t\t\t{ method: 'remove', result: 'success' },\n\t\t\t\tnull,\n\t\t\t\t`Deleted ${key} successfully`\n\t\t\t);\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'delete',\n\t\t\t\t{ method: 'remove', result: 'failed' },\n\t\t\t\tnull,\n\t\t\t\t`Deletion of ${key} failed with ${error}`\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * List bucket objects relative to the level and prefix specified\n\t * @param {string} path - the path that contains objects\n\t * @param {Object} [config] - { level : private|protected|public }\n\t * @return - Promise resolves to list of keys for all objects in path\n\t */\n\tpublic async list(path, config?): Promise {\n\t\tconst credentialsOK = await this._ensureCredentials();\n\t\tif (!credentialsOK) {\n\t\t\treturn Promise.reject('No credentials');\n\t\t}\n\n\t\tconst opt = Object.assign({}, this._config, config);\n\t\tconst { bucket, track, maxKeys } = opt;\n\n\t\tconst prefix = this._prefix(opt);\n\t\tconst final_path = prefix + path;\n\t\tconst s3 = this._createNewS3Client(opt);\n\t\tlogger.debug('list ' + path + ' from ' + final_path);\n\n\t\tconst params = {\n\t\t\tBucket: bucket,\n\t\t\tPrefix: final_path,\n\t\t\tMaxKeys: maxKeys,\n\t\t};\n\n\t\tconst listObjectsCommand = new ListObjectsCommand(params);\n\n\t\ttry {\n\t\t\tconst response = await s3.send(listObjectsCommand);\n\t\t\tlet list = [];\n\t\t\tif (response && response.Contents) {\n\t\t\t\tlist = response.Contents.map(item => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: item.Key.substr(prefix.length),\n\t\t\t\t\t\teTag: item.ETag,\n\t\t\t\t\t\tlastModified: item.LastModified,\n\t\t\t\t\t\tsize: item.Size,\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'list',\n\t\t\t\t{ method: 'list', result: 'success' },\n\t\t\t\tnull,\n\t\t\t\t`${list.length} items returned from list operation`\n\t\t\t);\n\t\t\tlogger.debug('list', list);\n\t\t\treturn list;\n\t\t} catch (error) {\n\t\t\tlogger.warn('list error', error);\n\t\t\tdispatchStorageEvent(\n\t\t\t\ttrack,\n\t\t\t\t'list',\n\t\t\t\t{ method: 'list', result: 'failed' },\n\t\t\t\tnull,\n\t\t\t\t`Listing items failed: ${error.message}`\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_ensureCredentials() {\n\t\treturn Credentials.get()\n\t\t\t.then(credentials => {\n\t\t\t\tif (!credentials) return false;\n\t\t\t\tconst cred = Credentials.shear(credentials);\n\t\t\t\tlogger.debug('set credentials for storage', cred);\n\t\t\t\tthis._config.credentials = cred;\n\n\t\t\t\treturn true;\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tlogger.warn('ensure credentials error', error);\n\t\t\t\treturn false;\n\t\t\t});\n\t}\n\n\t/**\n\t * @private\n\t */\n\tprivate _prefix(config) {\n\t\tconst { credentials, level } = config;\n\n\t\tconst customPrefix = config.customPrefix || {};\n\t\tconst identityId = config.identityId || credentials.identityId;\n\t\tconst privatePath =\n\t\t\t(customPrefix.private !== undefined ? customPrefix.private : 'private/') +\n\t\t\tidentityId +\n\t\t\t'/';\n\t\tconst protectedPath =\n\t\t\t(customPrefix.protected !== undefined\n\t\t\t\t? customPrefix.protected\n\t\t\t\t: 'protected/') +\n\t\t\tidentityId +\n\t\t\t'/';\n\t\tconst publicPath =\n\t\t\tcustomPrefix.public !== undefined ? customPrefix.public : 'public/';\n\n\t\tswitch (level) {\n\t\t\tcase 'private':\n\t\t\t\treturn privatePath;\n\t\t\tcase 'protected':\n\t\t\t\treturn protectedPath;\n\t\t\tdefault:\n\t\t\t\treturn publicPath;\n\t\t}\n\t}\n\n\t/**\n\t * @private creates an S3 client with new V3 aws sdk\n\t */\n\tprivate _createNewS3Client(config, emitter?) {\n\t\tconst {\n\t\t\tregion,\n\t\t\tcredentials,\n\t\t\tdangerouslyConnectToHttpEndpointForTesting,\n\t\t} = config;\n\t\tlet localTestingConfig = {};\n\n\t\tif (dangerouslyConnectToHttpEndpointForTesting) {\n\t\t\tlocalTestingConfig = {\n\t\t\t\tendpoint: localTestingStorageEndpoint,\n\t\t\t\ttls: false,\n\t\t\t\tbucketEndpoint: false,\n\t\t\t\tforcePathStyle: true,\n\t\t\t};\n\t\t}\n\n\t\tconst s3client = new S3Client({\n\t\t\tregion,\n\t\t\tcredentials,\n\t\t\tcustomUserAgent: getAmplifyUserAgent(),\n\t\t\t...localTestingConfig,\n\t\t\trequestHandler: new AxiosHttpHandler({}, emitter),\n\t\t});\n\t\treturn s3client;\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default AWSS3Provider;\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, Parser } from '@aws-amplify/core';\nimport { AWSS3Provider } from './providers';\nimport { StorageProvider } from './types';\n\nconst logger = new Logger('StorageClass');\n\nconst DEFAULT_PROVIDER = 'AWSS3';\n/**\n * Provide storage methods to use AWS S3\n */\nexport class Storage {\n\t/**\n\t * @private\n\t */\n\tprivate _config;\n\tprivate _pluggables: StorageProvider[];\n\n\t/**\n\t * @public\n\t */\n\tpublic vault: Storage;\n\n\t/**\n\t * Initialize Storage\n\t * @param {Object} config - Configuration object for storage\n\t */\n\tconstructor() {\n\t\tthis._config = {};\n\t\tthis._pluggables = [];\n\t\tlogger.debug('Storage Options', this._config);\n\n\t\tthis.get = this.get.bind(this);\n\t\tthis.put = this.put.bind(this);\n\t\tthis.remove = this.remove.bind(this);\n\t\tthis.list = this.list.bind(this);\n\t}\n\n\tpublic getModuleName() {\n\t\treturn 'Storage';\n\t}\n\n\t/**\n\t * add plugin into Storage category\n\t * @param {Object} pluggable - an instance of the plugin\n\t */\n\tpublic addPluggable(pluggable: StorageProvider) {\n\t\tif (pluggable && pluggable.getCategory() === 'Storage') {\n\t\t\tthis._pluggables.push(pluggable);\n\t\t\tlet config = {};\n\n\t\t\tconfig = pluggable.configure(this._config[pluggable.getProviderName()]);\n\n\t\t\treturn config;\n\t\t}\n\t}\n\n\t/**\n\t * Get the plugin object\n\t * @param providerName - the name of the plugin\n\t */\n\tpublic getPluggable(providerName: string) {\n\t\tconst pluggable = this._pluggables.find(\n\t\t\tpluggable => pluggable.getProviderName() === providerName\n\t\t);\n\t\tif (pluggable === undefined) {\n\t\t\tlogger.debug('No plugin found with providerName', providerName);\n\t\t\treturn null;\n\t\t} else return pluggable;\n\t}\n\n\t/**\n\t * Remove the plugin object\n\t * @param providerName - the name of the plugin\n\t */\n\tpublic removePluggable(providerName: string) {\n\t\tthis._pluggables = this._pluggables.filter(\n\t\t\tpluggable => pluggable.getProviderName() !== providerName\n\t\t);\n\t\treturn;\n\t}\n\n\t/**\n\t * Configure Storage\n\t * @param {Object} config - Configuration object for storage\n\t * @return {Object} - Current configuration\n\t */\n\tconfigure(config?) {\n\t\tlogger.debug('configure Storage');\n\t\tif (!config) return this._config;\n\n\t\tconst amplifyConfig = Parser.parseMobilehubConfig(config);\n\n\t\tconst storageKeysFromConfig = Object.keys(amplifyConfig.Storage);\n\n\t\tconst storageArrayKeys = [\n\t\t\t'bucket',\n\t\t\t'region',\n\t\t\t'level',\n\t\t\t'track',\n\t\t\t'customPrefix',\n\t\t\t'serverSideEncryption',\n\t\t\t'SSECustomerAlgorithm',\n\t\t\t'SSECustomerKey',\n\t\t\t'SSECustomerKeyMD5',\n\t\t\t'SSEKMSKeyId',\n\t\t];\n\n\t\tconst isInStorageArrayKeys = (k: string) =>\n\t\t\tstorageArrayKeys.some(x => x === k);\n\t\tconst checkConfigKeysFromArray = (k: string[]) =>\n\t\t\tk.find(k => isInStorageArrayKeys(k));\n\n\t\tif (\n\t\t\tstorageKeysFromConfig &&\n\t\t\tcheckConfigKeysFromArray(storageKeysFromConfig) &&\n\t\t\t!amplifyConfig.Storage[DEFAULT_PROVIDER]\n\t\t) {\n\t\t\tamplifyConfig.Storage[DEFAULT_PROVIDER] = {};\n\t\t}\n\n\t\tObject.entries(amplifyConfig.Storage).map(([key, value]) => {\n\t\t\tif (key && isInStorageArrayKeys(key) && value !== undefined) {\n\t\t\t\tamplifyConfig.Storage[DEFAULT_PROVIDER][key] = value;\n\t\t\t\tdelete amplifyConfig.Storage[key];\n\t\t\t}\n\t\t});\n\n\t\t// only update new values for each provider\n\t\tObject.keys(amplifyConfig.Storage).forEach(providerName => {\n\t\t\tif (typeof amplifyConfig.Storage[providerName] !== 'string') {\n\t\t\t\tthis._config[providerName] = {\n\t\t\t\t\t...this._config[providerName],\n\t\t\t\t\t...amplifyConfig.Storage[providerName],\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\tthis._pluggables.forEach(pluggable => {\n\t\t\tpluggable.configure(this._config[pluggable.getProviderName()]);\n\t\t});\n\n\t\tif (this._pluggables.length === 0) {\n\t\t\tthis.addPluggable(new AWSS3Provider());\n\t\t}\n\n\t\treturn this._config;\n\t}\n\n\t/**\n\t * Get a presigned URL of the file or the object data when download:true\n\t *\n\t * @param {string} key - key of the object\n\t * @param {Object} [config] - { level : private|protected|public, download: true|false }\n\t * @return - A promise resolves to either a presigned url or the object\n\t */\n\tpublic async get(key: string, config?): Promise {\n\t\tconst { provider = DEFAULT_PROVIDER } = config || {};\n\t\tconst prov = this._pluggables.find(\n\t\t\tpluggable => pluggable.getProviderName() === provider\n\t\t);\n\t\tif (prov === undefined) {\n\t\t\tlogger.debug('No plugin found with providerName', provider);\n\t\t\tPromise.reject('No plugin found in Storage for the provider');\n\t\t}\n\t\treturn prov.get(key, config);\n\t}\n\n\t/**\n\t * Put a file in storage bucket specified to configure method\n\t * @param {string} key - key of the object\n\t * @param {Object} object - File to be put in bucket\n\t * @param {Object} [config] - { level : private|protected|public, contentType: MIME Types,\n\t * progressCallback: function }\n\t * @return - promise resolves to object on success\n\t */\n\tpublic async put(key: string, object, config?): Promise {\n\t\tconst { provider = DEFAULT_PROVIDER } = config || {};\n\t\tconst prov = this._pluggables.find(\n\t\t\tpluggable => pluggable.getProviderName() === provider\n\t\t);\n\t\tif (prov === undefined) {\n\t\t\tlogger.debug('No plugin found with providerName', provider);\n\t\t\tPromise.reject('No plugin found in Storage for the provider');\n\t\t}\n\t\treturn prov.put(key, object, config);\n\t}\n\n\t/**\n\t * Remove the object for specified key\n\t * @param {string} key - key of the object\n\t * @param {Object} [config] - { level : private|protected|public }\n\t * @return - Promise resolves upon successful removal of the object\n\t */\n\tpublic async remove(key: string, config?): Promise {\n\t\tconst { provider = DEFAULT_PROVIDER } = config || {};\n\t\tconst prov = this._pluggables.find(\n\t\t\tpluggable => pluggable.getProviderName() === provider\n\t\t);\n\t\tif (prov === undefined) {\n\t\t\tlogger.debug('No plugin found with providerName', provider);\n\t\t\tPromise.reject('No plugin found in Storage for the provider');\n\t\t}\n\t\treturn prov.remove(key, config);\n\t}\n\n\t/**\n\t * List bucket objects relative to the level and prefix specified\n\t * @param {String} path - the path that contains objects\n\t * @param {Object} [config] - { level : private|protected|public, maxKeys: NUMBER }\n\t * @return - Promise resolves to list of keys for all objects in path\n\t */\n\tpublic async list(path, config?): Promise {\n\t\tconst { provider = DEFAULT_PROVIDER } = config || {};\n\t\tconst prov = this._pluggables.find(\n\t\t\tpluggable => pluggable.getProviderName() === provider\n\t\t);\n\t\tif (prov === undefined) {\n\t\t\tlogger.debug('No plugin found with providerName', provider);\n\t\t\tPromise.reject('No plugin found in Storage for the provider');\n\t\t}\n\t\treturn prov.list(path, config);\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default Storage;\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 { Storage as StorageClass } from './Storage';\n\nimport { Amplify, ConsoleLogger as Logger } from '@aws-amplify/core';\n\nconst logger = new Logger('Storage');\n\nlet _instance: StorageClass = null;\n\nconst getInstance = () => {\n\tif (_instance) {\n\t\treturn _instance;\n\t}\n\tlogger.debug('Create Storage Instance, debug');\n\t_instance = new StorageClass();\n\t_instance.vault = new StorageClass();\n\n\tconst old_configure = _instance.configure;\n\t_instance.configure = options => {\n\t\tlogger.debug('storage configure called');\n\t\tconst vaultConfig = { ...old_configure.call(_instance, options) };\n\n\t\t// set level private for each provider for the vault\n\t\tObject.keys(vaultConfig).forEach(providerName => {\n\t\t\tif (typeof vaultConfig[providerName] !== 'string') {\n\t\t\t\tvaultConfig[providerName] = {\n\t\t\t\t\t...vaultConfig[providerName],\n\t\t\t\t\tlevel: 'private',\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\tlogger.debug('storage vault configure called');\n\t\t_instance.vault.configure(vaultConfig);\n\t};\n\treturn _instance;\n};\n\nexport const Storage: StorageClass = getInstance();\nAmplify.register(Storage);\n\n/**\n * @deprecated use named import\n */\nexport default Storage;\n\nexport { StorageClass };\nexport * from './providers';\nexport * from './types';\n","/*\n * Copyright 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 { Amplify, ServiceWorker } from '@aws-amplify/core';\nimport { Auth } from '@aws-amplify/auth';\nimport Cache from '@aws-amplify/cache';\n\n/** Always importing Auth when users import Amplify such that\n\tfor unauthenticated access (no sign in and sign up),\n\tusers don't have to import Auth explicitly **/\nAmplify.Auth = Auth;\nAmplify.Cache = Cache;\nAmplify.ServiceWorker = ServiceWorker;\n\nexport {\n\tAnalytics,\n\tAWSPinpointProvider,\n\tAWSKinesisProvider,\n\tAWSKinesisFirehoseProvider,\n\tAmazonPersonalizeProvider,\n} from '@aws-amplify/analytics';\n\nexport { Auth } from '@aws-amplify/auth';\nexport { Storage, StorageClass } from '@aws-amplify/storage';\nexport { API, APIClass, graphqlOperation } from '@aws-amplify/api';\nexport {\n\tDataStore,\n\tPredicates,\n\tSortDirection,\n\tsyncExpression,\n} from '@aws-amplify/datastore';\nexport { PubSub } from '@aws-amplify/pubsub';\nexport { default as Cache } from '@aws-amplify/cache';\nexport { Interactions } from '@aws-amplify/interactions';\nexport * from '@aws-amplify/ui';\nexport { XR } from '@aws-amplify/xr';\nexport { Predictions } from '@aws-amplify/predictions';\nexport {\n\tConsoleLogger as Logger,\n\tHub,\n\tJS,\n\tClientDevice,\n\tSigner,\n\tI18n,\n\tServiceWorker,\n} from '@aws-amplify/core';\nexport { withSSRContext } from './withSSRContext';\n\nexport { Amplify };\n\n/**\n * @deprecated use named import\n */\nexport default Amplify;\n","// TODO: Move these values to or extract them from the Cognito Provider in the Auth category for Auth V2\nvar AuthState;\n(function (AuthState) {\n AuthState[\"SignUp\"] = \"signup\";\n AuthState[\"SignOut\"] = \"signout\";\n AuthState[\"SignIn\"] = \"signin\";\n AuthState[\"Loading\"] = \"loading\";\n AuthState[\"SignedOut\"] = \"signedout\";\n AuthState[\"SignedIn\"] = \"signedin\";\n AuthState[\"SigningUp\"] = \"signingup\";\n AuthState[\"ConfirmSignUp\"] = \"confirmSignUp\";\n AuthState[\"confirmingSignUpCustomFlow\"] = \"confirmsignupcustomflow\";\n AuthState[\"ConfirmSignIn\"] = \"confirmSignIn\";\n AuthState[\"confirmingSignInCustomFlow\"] = \"confirmingsignincustomflow\";\n AuthState[\"VerifyingAttributes\"] = \"verifyingattributes\";\n AuthState[\"ForgotPassword\"] = \"forgotpassword\";\n AuthState[\"ResetPassword\"] = \"resettingpassword\";\n AuthState[\"SettingMFA\"] = \"settingMFA\";\n AuthState[\"TOTPSetup\"] = \"TOTPSetup\";\n AuthState[\"CustomConfirmSignIn\"] = \"customConfirmSignIn\";\n AuthState[\"VerifyContact\"] = \"verifyContact\";\n})(AuthState || (AuthState = {}));\nvar MfaOption;\n(function (MfaOption) {\n MfaOption[\"TOTP\"] = \"TOTP\";\n MfaOption[\"SMS\"] = \"SMS\";\n MfaOption[\"NOMFA\"] = \"NOMFA\";\n})(MfaOption || (MfaOption = {}));\nvar ChallengeName;\n(function (ChallengeName) {\n ChallengeName[\"SoftwareTokenMFA\"] = \"SOFTWARE_TOKEN_MFA\";\n ChallengeName[\"SMSMFA\"] = \"SMS_MFA\";\n ChallengeName[\"NewPasswordRequired\"] = \"NEW_PASSWORD_REQUIRED\";\n ChallengeName[\"MFASetup\"] = \"MFA_SETUP\";\n ChallengeName[\"CustomChallenge\"] = \"CUSTOM_CHALLENGE\";\n})(ChallengeName || (ChallengeName = {}));\nvar AuthFormField;\n(function (AuthFormField) {\n AuthFormField[\"Password\"] = \"password\";\n})(AuthFormField || (AuthFormField = {}));\nvar UsernameAlias;\n(function (UsernameAlias) {\n UsernameAlias[\"username\"] = \"username\";\n UsernameAlias[\"email\"] = \"email\";\n UsernameAlias[\"phone_number\"] = \"phone_number\";\n})(UsernameAlias || (UsernameAlias = {}));\nexport { AuthState as A, ChallengeName as C, MfaOption as M, UsernameAlias as U, AuthFormField as a };\n","var AccessLevel;\n(function (AccessLevel) {\n AccessLevel[\"Public\"] = \"public\";\n AccessLevel[\"Private\"] = \"private\";\n AccessLevel[\"Protected\"] = \"protected\";\n})(AccessLevel || (AccessLevel = {}));\nexport { AccessLevel as A };\n","import { AuthErrorStrings } from '@aws-amplify/auth';\nvar AuthStrings;\n(function (AuthStrings) {\n AuthStrings[\"BACK_TO_SIGN_IN\"] = \"Back to Sign In\";\n AuthStrings[\"CHANGE_PASSWORD_ACTION\"] = \"Change\";\n AuthStrings[\"CHANGE_PASSWORD\"] = \"Change Password\";\n AuthStrings[\"CODE_LABEL\"] = \"Verification code\";\n AuthStrings[\"CODE_PLACEHOLDER\"] = \"Enter code\";\n AuthStrings[\"CONFIRM_SIGN_UP_CODE_LABEL\"] = \"Confirmation Code\";\n AuthStrings[\"CONFIRM_SIGN_UP_CODE_PLACEHOLDER\"] = \"Enter your code\";\n AuthStrings[\"CONFIRM_SIGN_UP_HEADER_TEXT\"] = \"Confirm Sign up\";\n AuthStrings[\"CONFIRM_SIGN_UP_LOST_CODE\"] = \"Lost your code?\";\n AuthStrings[\"CONFIRM_SIGN_UP_RESEND_CODE\"] = \"Resend Code\";\n AuthStrings[\"CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT\"] = \"Confirm\";\n AuthStrings[\"CONFIRM_SMS_CODE\"] = \"Confirm SMS Code\";\n AuthStrings[\"CONFIRM_TOTP_CODE\"] = \"Confirm TOTP Code\";\n AuthStrings[\"CONFIRM\"] = \"Confirm\";\n AuthStrings[\"CREATE_ACCOUNT_TEXT\"] = \"Create account\";\n AuthStrings[\"EMAIL_LABEL\"] = \"Email Address *\";\n AuthStrings[\"EMAIL_PLACEHOLDER\"] = \"Enter your email address\";\n AuthStrings[\"FORGOT_PASSWORD_TEXT\"] = \"Forgot your password?\";\n AuthStrings[\"LESS_THAN_TWO_MFA_VALUES_MESSAGE\"] = \"Less than two MFA types available\";\n AuthStrings[\"NEW_PASSWORD_LABEL\"] = \"New password\";\n AuthStrings[\"NEW_PASSWORD_PLACEHOLDER\"] = \"Enter your new password\";\n AuthStrings[\"NO_ACCOUNT_TEXT\"] = \"No account?\";\n AuthStrings[\"USERNAME_REMOVE_WHITESPACE\"] = \"Username cannot contain whitespace\";\n AuthStrings[\"PASSWORD_REMOVE_WHITESPACE\"] = \"Password cannot start or end with whitespace\";\n AuthStrings[\"PASSWORD_LABEL\"] = \"Password *\";\n AuthStrings[\"PASSWORD_PLACEHOLDER\"] = \"Enter your password\";\n AuthStrings[\"PHONE_LABEL\"] = \"Phone Number *\";\n AuthStrings[\"PHONE_PLACEHOLDER\"] = \"(555) 555-1212\";\n AuthStrings[\"QR_CODE_ALT\"] = \"qrcode\";\n AuthStrings[\"RESET_PASSWORD_TEXT\"] = \"Reset password\";\n AuthStrings[\"RESET_YOUR_PASSWORD\"] = \"Reset your password\";\n AuthStrings[\"SELECT_MFA_TYPE_HEADER_TEXT\"] = \"Select MFA Type\";\n AuthStrings[\"SELECT_MFA_TYPE_SUBMIT_BUTTON_TEXT\"] = \"Verify\";\n AuthStrings[\"SEND_CODE\"] = \"Send Code\";\n AuthStrings[\"SUBMIT\"] = \"Submit\";\n AuthStrings[\"SETUP_TOTP_REQUIRED\"] = \"TOTP needs to be configured\";\n AuthStrings[\"SIGN_IN_ACTION\"] = \"Sign In\";\n AuthStrings[\"SIGN_IN_HEADER_TEXT\"] = \"Sign in to your account\";\n AuthStrings[\"SIGN_IN_TEXT\"] = \"Sign in\";\n AuthStrings[\"SIGN_IN_WITH_AMAZON\"] = \"Sign in with Amazon\";\n AuthStrings[\"SIGN_IN_WITH_AUTH0\"] = \"Sign in with Auth0\";\n AuthStrings[\"SIGN_IN_WITH_AWS\"] = \"Sign in with AWS\";\n AuthStrings[\"SIGN_IN_WITH_FACEBOOK\"] = \"Sign in with Facebook\";\n AuthStrings[\"SIGN_IN_WITH_GOOGLE\"] = \"Sign in with Google\";\n AuthStrings[\"SIGN_OUT\"] = \"Sign Out\";\n AuthStrings[\"SIGN_UP_EMAIL_PLACEHOLDER\"] = \"Email\";\n AuthStrings[\"SIGN_UP_HAVE_ACCOUNT_TEXT\"] = \"Have an account?\";\n AuthStrings[\"SIGN_UP_HEADER_TEXT\"] = \"Create a new account\";\n AuthStrings[\"SIGN_UP_PASSWORD_PLACEHOLDER\"] = \"Password\";\n AuthStrings[\"SIGN_UP_SUBMIT_BUTTON_TEXT\"] = \"Create Account\";\n AuthStrings[\"SIGN_UP_USERNAME_PLACEHOLDER\"] = \"Username\";\n AuthStrings[\"SKIP\"] = \"Skip\";\n AuthStrings[\"SUCCESS_MFA_TYPE\"] = \"Success! Your MFA Type is now:\";\n AuthStrings[\"TOTP_HEADER_TEXT\"] = \"Scan then enter verification code\";\n AuthStrings[\"TOTP_LABEL\"] = \"Enter Security Code:\";\n AuthStrings[\"TOTP_ISSUER\"] = \"AWSCognito\";\n AuthStrings[\"TOTP_SETUP_FAILURE\"] = \"TOTP Setup has failed\";\n AuthStrings[\"TOTP_SUBMIT_BUTTON_TEXT\"] = \"Verify Security Token\";\n AuthStrings[\"TOTP_SUCCESS_MESSAGE\"] = \"Setup TOTP successfully!\";\n AuthStrings[\"UNABLE_TO_SETUP_MFA_AT_THIS_TIME\"] = \"Failed! Unable to configure MFA at this time\";\n AuthStrings[\"USERNAME_LABEL\"] = \"Username *\";\n AuthStrings[\"USERNAME_PLACEHOLDER\"] = \"Enter your username\";\n AuthStrings[\"VERIFY_CONTACT_EMAIL_LABEL\"] = \"Email\";\n AuthStrings[\"VERIFY_CONTACT_HEADER_TEXT\"] = \"Account recovery requires verified contact information\";\n AuthStrings[\"VERIFY_CONTACT_PHONE_LABEL\"] = \"Phone Number\";\n AuthStrings[\"VERIFY_CONTACT_SUBMIT_LABEL\"] = \"Submit\";\n AuthStrings[\"VERIFY_CONTACT_VERIFY_LABEL\"] = \"Verify\";\n AuthStrings[\"ADDRESS_LABEL\"] = \"Address\";\n AuthStrings[\"ADDRESS_PLACEHOLDER\"] = \"Enter your address\";\n AuthStrings[\"NICKNAME_LABEL\"] = \"Nickname\";\n AuthStrings[\"NICKNAME_PLACEHOLDER\"] = \"Enter your nickname\";\n AuthStrings[\"BIRTHDATE_LABEL\"] = \"Birthday\";\n AuthStrings[\"BIRTHDATE_PLACEHOLDER\"] = \"Enter your birthday\";\n AuthStrings[\"PICTURE_LABEL\"] = \"Picture URL\";\n AuthStrings[\"PICTURE_PLACEHOLDER\"] = \"Enter your picture URL\";\n AuthStrings[\"FAMILY_NAME_LABEL\"] = \"Family Name\";\n AuthStrings[\"FAMILY_NAME_PLACEHOLDER\"] = \"Enter your family name\";\n AuthStrings[\"PREFERRED_USERNAME_LABEL\"] = \"Preferred Username\";\n AuthStrings[\"PREFERRED_USERNAME_PLACEHOLDER\"] = \"Enter your preferred username\";\n AuthStrings[\"GENDER_LABEL\"] = \"Gender\";\n AuthStrings[\"GENDER_PLACEHOLDER\"] = \"Enter your gender\";\n AuthStrings[\"PROFILE_LABEL\"] = \"Profile URL\";\n AuthStrings[\"PROFILE_PLACEHOLDER\"] = \"Enter your profile URL\";\n AuthStrings[\"GIVEN_NAME_LABEL\"] = \"First Name\";\n AuthStrings[\"GIVEN_NAME_PLACEHOLDER\"] = \"Enter your first name\";\n AuthStrings[\"ZONEINFO_LABEL\"] = \"Time zone\";\n AuthStrings[\"ZONEINFO_PLACEHOLDER\"] = \"Enter your time zone\";\n AuthStrings[\"LOCALE_LABEL\"] = \"Locale\";\n AuthStrings[\"LOCALE_PLACEHOLDER\"] = \"Enter your locale\";\n AuthStrings[\"UPDATED_AT_LABEL\"] = \"Updated At\";\n AuthStrings[\"UPDATED_AT_PLACEHOLDER\"] = \"Enter the time the information was last updated\";\n AuthStrings[\"MIDDLE_NAME_LABEL\"] = \"Middle Name\";\n AuthStrings[\"MIDDLE_NAME_PLACEHOLDER\"] = \"Enter your middle name\";\n AuthStrings[\"WEBSITE_LABEL\"] = \"Website\";\n AuthStrings[\"WEBSITE_PLACEHOLDER\"] = \"Enter your website\";\n AuthStrings[\"NAME_LABEL\"] = \"Full Name\";\n AuthStrings[\"NAME_PLACEHOLDER\"] = \"Enter your full name\";\n AuthStrings[\"PHOTO_PICKER_TITLE\"] = \"Picker Title\";\n AuthStrings[\"PHOTO_PICKER_HINT\"] = \"Ancillary text or content may occupy this space here\";\n AuthStrings[\"PHOTO_PICKER_PLACEHOLDER_HINT\"] = \"Placeholder hint\";\n AuthStrings[\"PHOTO_PICKER_BUTTON_TEXT\"] = \"Button\";\n AuthStrings[\"IMAGE_PICKER_TITLE\"] = \"Add Profile Photo\";\n AuthStrings[\"IMAGE_PICKER_HINT\"] = \"Preview the image before upload\";\n AuthStrings[\"IMAGE_PICKER_PLACEHOLDER_HINT\"] = \"Tap to image select\";\n AuthStrings[\"IMAGE_PICKER_BUTTON_TEXT\"] = \"Upload\";\n AuthStrings[\"PICKER_TEXT\"] = \"Pick a file\";\n AuthStrings[\"TEXT_FALLBACK_CONTENT\"] = \"Fallback Content\";\n AuthStrings[\"CONFIRM_SIGN_UP_FAILED\"] = \"Confirm Sign Up Failed\";\n AuthStrings[\"SIGN_UP_FAILED\"] = \"Sign Up Failed\";\n})(AuthStrings || (AuthStrings = {}));\nvar InteractionsStrings;\n(function (InteractionsStrings) {\n InteractionsStrings[\"CHATBOT_TITLE\"] = \"ChatBot Lex\";\n InteractionsStrings[\"TEXT_INPUT_PLACEHOLDER\"] = \"Write a message\";\n InteractionsStrings[\"VOICE_INPUT_PLACEHOLDER\"] = \"Click mic to speak\";\n InteractionsStrings[\"CHAT_DISABLED_ERROR\"] = \"Error: Either voice or text must be enabled for the chatbot\";\n InteractionsStrings[\"NO_BOT_NAME_ERROR\"] = \"Error: Bot name must be provided to ChatBot\";\n})(InteractionsStrings || (InteractionsStrings = {}));\nvar Translations = Object.assign(Object.assign(Object.assign({}, AuthStrings), AuthErrorStrings), InteractionsStrings);\nexport { Translations as T };\n","// Dictionaries\n// fieldId constants\nvar USERNAME_SUFFIX = 'username';\nvar EMAIL_SUFFIX = 'email';\nvar CODE_SUFFIX = 'code';\nvar PHONE_SUFFIX = 'phone';\nvar PASSWORD_SUFFIX = 'password';\n// Country Dial Code common constants\nvar COUNTRY_DIAL_CODE_SUFFIX = 'country-dial-code-select';\nvar COUNTRY_DIAL_CODE_DEFAULT = '+1';\n// Auth Keys\nvar AUTH_SOURCE_KEY = 'amplify-auth-source';\n// Error message Common Constants\nvar PHONE_EMPTY_ERROR_MESSAGE = 'Phone number can not be empty';\nvar NO_AUTH_MODULE_FOUND = 'No Auth module found, please ensure @aws-amplify/auth is imported';\nvar NO_STORAGE_MODULE_FOUND = 'No Storage module found, please ensure @aws-amplify/storage is imported';\nvar NO_INTERACTIONS_MODULE_FOUND = 'No Interactions module found, please ensure @aws-amplify/interactions is imported';\n// Select MFA Types Messages\nvar USER_NOT_SETUP_SOFTWARE_TOKEN_MFA = 'User has not set up software token mfa';\nvar USER_NOT_VERIFIED_SOFTWARE_TOKEN_MFA = 'User has not verified software token mfa';\n// Hub Events and Channels\nvar AUTH_CHANNEL = 'auth';\nvar UI_AUTH_CHANNEL = 'UI Auth';\nvar TOAST_AUTH_ERROR_EVENT = 'ToastAuthError';\nvar AUTH_STATE_CHANGE_EVENT = 'AuthStateChange';\nexport { AUTH_CHANNEL as A, COUNTRY_DIAL_CODE_SUFFIX as C, EMAIL_SUFFIX as E, NO_AUTH_MODULE_FOUND as N, PHONE_EMPTY_ERROR_MESSAGE as P, TOAST_AUTH_ERROR_EVENT as T, UI_AUTH_CHANNEL as U, AUTH_STATE_CHANGE_EVENT as a, PHONE_SUFFIX as b, NO_INTERACTIONS_MODULE_FOUND as c, NO_STORAGE_MODULE_FOUND as d, USER_NOT_SETUP_SOFTWARE_TOKEN_MFA as e, USER_NOT_VERIFIED_SOFTWARE_TOKEN_MFA as f, COUNTRY_DIAL_CODE_DEFAULT as g, AUTH_SOURCE_KEY as h, CODE_SUFFIX as i, PASSWORD_SUFFIX as j, USERNAME_SUFFIX as k };\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { Logger, Hub, I18n } from '@aws-amplify/core';\nimport { U as UsernameAlias, A as AuthState } from './auth-types-78df304e.js';\nimport Auth from '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nimport { U as UI_AUTH_CHANNEL, T as TOAST_AUTH_ERROR_EVENT, a as AUTH_STATE_CHANGE_EVENT, P as PHONE_EMPTY_ERROR_MESSAGE, C as COUNTRY_DIAL_CODE_SUFFIX, b as PHONE_SUFFIX } from './constants-c8ecaa24.js';\nvar logger = new Logger('helpers');\n/**\n * Finds closest element that matches the selector from the ancestor tree.\n * Trasverses through shadow DOM and slots.\n *\n * Adpated from: https://stackoverflow.com/a/56105394\n */\nvar closestElement = function (selector, base) {\n function _closestFrom(el) {\n if (!el || el === document || el === window)\n return null;\n if (el.matches(selector))\n return base; // return if current element matches the selector\n if (el.assignedSlot)\n el = el.assignedSlot; // traverse up slots if slotted\n var found = el.closest(selector);\n return found ? found : _closestFrom(el.getRootNode().host); // try to traverse up shadows\n }\n return _closestFrom(base);\n};\nvar dispatchToastHubEvent = function (error) {\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: TOAST_AUTH_ERROR_EVENT,\n message: I18n.get(error.message),\n });\n};\nvar dispatchAuthStateChangeEvent = function (nextAuthState, data) {\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: nextAuthState,\n data: data,\n });\n};\nvar composePhoneNumberInput = function (phoneNumber) {\n if (!phoneNumber.phoneNumberValue) {\n throw new Error(PHONE_EMPTY_ERROR_MESSAGE);\n }\n var sanitizedPhoneNumberValue = phoneNumber.phoneNumberValue.replace(/[-()\\s]/g, '');\n return \"\" + phoneNumber.countryDialCodeValue + sanitizedPhoneNumberValue;\n};\nvar checkUsernameAlias = function (usernameAlias) {\n if (!(usernameAlias in UsernameAlias)) {\n throw new Error(\"Invalid username Alias - \" + usernameAlias + \". Instead use \" + Object.values(UsernameAlias));\n }\n};\nvar onAuthUIStateChange = function (authStateHandler) {\n var authUIStateHandler = function (data) { return __awaiter(void 0, void 0, void 0, function () {\n var payload, _a, user, e_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n payload = data.payload;\n _a = payload.event;\n switch (_a) {\n case AUTH_STATE_CHANGE_EVENT: return [3 /*break*/, 1];\n }\n return [3 /*break*/, 8];\n case 1:\n if (!payload.message) return [3 /*break*/, 7];\n if (!(payload.message === AuthState.SignedIn)) return [3 /*break*/, 6];\n _b.label = 2;\n case 2:\n _b.trys.push([2, 4, , 5]);\n return [4 /*yield*/, Auth.currentAuthenticatedUser()];\n case 3:\n user = _b.sent();\n authStateHandler(payload.message, user);\n return [3 /*break*/, 5];\n case 4:\n e_1 = _b.sent();\n logger.error('User is not authenticated');\n return [3 /*break*/, 5];\n case 5: return [3 /*break*/, 7];\n case 6:\n authStateHandler(payload.message, payload.data);\n _b.label = 7;\n case 7: return [3 /*break*/, 8];\n case 8: return [2 /*return*/];\n }\n });\n }); };\n Hub.listen(UI_AUTH_CHANNEL, authUIStateHandler);\n var unsubscribe = function () {\n // Replace user's `authStateHandler` with a noop so that we don't trigger side-effects during the async `authUIStateHandler` when unsubscribed\n authStateHandler = function () { };\n Hub.remove(UI_AUTH_CHANNEL, authUIStateHandler);\n };\n return unsubscribe;\n};\nvar isHintValid = function (field) {\n return !(field['hint'] === null || typeof field['hint'] === 'string');\n};\n// Required attributes come from https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims\nvar getRequiredAttributesMap = function () { return ({\n address: {\n label: I18n.get(Translations.ADDRESS_LABEL),\n placeholder: I18n.get(Translations.ADDRESS_PLACEHOLDER),\n },\n nickname: {\n label: I18n.get(Translations.NICKNAME_LABEL),\n placeholder: I18n.get(Translations.NICKNAME_PLACEHOLDER),\n },\n birthdate: {\n label: I18n.get(Translations.BIRTHDATE_LABEL),\n placeholder: I18n.get(Translations.BIRTHDATE_PLACEHOLDER),\n },\n phone_number: {\n label: I18n.get(Translations.PHONE_LABEL),\n placeholder: I18n.get(Translations.PHONE_PLACEHOLDER),\n },\n email: {\n lable: I18n.get(Translations.EMAIL_LABEL),\n placeholder: I18n.get(Translations.EMAIL_PLACEHOLDER),\n },\n picture: {\n label: I18n.get(Translations.PICTURE_LABEL),\n placeholder: I18n.get(Translations.PICTURE_PLACEHOLDER),\n },\n family_name: {\n label: I18n.get(Translations.FAMILY_NAME_LABEL),\n placeholder: I18n.get(Translations.FAMILY_NAME_PLACEHOLDER),\n },\n preferred_username: {\n label: I18n.get(Translations.PREFERRED_USERNAME_LABEL),\n placeholder: I18n.get(Translations.PREFERRED_USERNAME_PLACEHOLDER),\n },\n gender: {\n label: I18n.get(Translations.GENDER_LABEL),\n placeholder: I18n.get(Translations.GENDER_PLACEHOLDER),\n },\n profile: {\n label: I18n.get(Translations.PROFILE_LABEL),\n placeholder: I18n.get(Translations.PROFILE_PLACEHOLDER),\n },\n given_name: {\n label: I18n.get(Translations.GIVEN_NAME_LABEL),\n placeholder: I18n.get(Translations.GIVEN_NAME_PLACEHOLDER),\n },\n zoneinfo: {\n label: I18n.get(Translations.ZONEINFO_LABEL),\n placeholder: I18n.get(Translations.ZONEINFO_PLACEHOLDER),\n },\n locale: {\n label: I18n.get(Translations.LOCALE_LABEL),\n placeholder: I18n.get(Translations.LOCALE_PLACEHOLDER),\n },\n updated_at: {\n label: I18n.get(Translations.UPDATED_AT_LABEL),\n placeholder: I18n.get(Translations.UPDATED_AT_PLACEHOLDER),\n },\n middle_name: {\n label: I18n.get(Translations.MIDDLE_NAME_LABEL),\n placeholder: I18n.get(Translations.MIDDLE_NAME_PLACEHOLDER),\n },\n website: {\n label: I18n.get(Translations.WEBSITE_LABEL),\n placeholder: I18n.get(Translations.WEBSITE_PLACEHOLDER),\n },\n name: {\n label: I18n.get(Translations.NAME_LABEL),\n placeholder: I18n.get(Translations.NAME_PLACEHOLDER),\n },\n}); };\nfunction handlePhoneNumberChange(event, phoneNumber) {\n var name = event.target.name;\n var value = event.target.value;\n /** Cognito expects to have a string be passed when signing up. Since the Select input is separate\n * input from the phone number input, we need to first capture both components values and combined\n * them together.\n */\n if (name === COUNTRY_DIAL_CODE_SUFFIX) {\n phoneNumber.countryDialCodeValue = value;\n }\n if (name === PHONE_SUFFIX) {\n phoneNumber.phoneNumberValue = value;\n }\n}\nexport { dispatchToastHubEvent as a, composePhoneNumberInput as b, checkUsernameAlias as c, dispatchAuthStateChangeEvent as d, closestElement as e, getRequiredAttributesMap as g, handlePhoneNumberChange as h, isHintValid as i, onAuthUIStateChange as o };\n"],"names":["logger","Amplify","_components","_config","_modules","Auth","Analytics","API","Credentials","Storage","I18n","Cache","PubSub","Interactions","Pushnotification","UI","XR","Predictions","DataStore","Logger","ServiceWorker","register","comp","debug","this","push","getModuleName","configure","config","Object","assign","entries","forEach","keys","property","map","addPluggable","pluggable","waitForInit","Promise","res","rej","isBrowser","window","auth2","setTimeout","initialized","refreshGoogleToken","bind","_refreshGoogleTokenImpl","ga","getAuthInstance","then","googleAuth","googleUser","currentUser","get","isSignedIn","reloadAuthResponse","authResponse","token","id_token","expires_at","catch","err","error","reject","refreshFacebookToken","_refreshFacebookTokenImpl","fb","errorMessage","getLoginStatus","fbResponse","response","accessToken","expiresIn","Date","getTime","scope","GoogleOAuth","FacebookOAuth","_gettingCredPromise","_refreshHandlers","undefined","getCredSource","_credentials_source","refreshHandlers","_storage","storage","StorageHelper","getStorage","_storageSync","resolve","_pickupCredentials","isPending","_keepAlive","cred","_credentials","_isExpired","_isPastTTL","currentUserCredentials","currentUserPoolUser","currentSession","session","refreshToken","refreshSession","data","refreshFederatedToken","federatedInfo","provider","user","identity_id","getFullYear","that","_setCredentialsFromFederation","_providerRefreshWithRetry","refreshHandler","clear","e","toLowerCase","lastIndexOf","length","credentials","ts","now","expiration","_nextCredentialsRefresh","_setCredentialsForGuest","identityPoolId","region","identityId","getItem","_identityId","cognitoClient","CognitoIdentityClient","customUserAgent","fromCognitoIdentity","client","credentialsProvider","send","GetIdCommand","IdentityPoolId","IdentityId","credentialsFromCognitoIdentity","_loadCredentials","name","message","removeItem","params","domain","google","facebook","amazon","developer","logins","fromCognitoIdentityPool","_setCredentialsFromSession","idToken","getIdToken","getJwtToken","userPoolId","Logins","source","authenticated","info","id","setItem","JSON","stringify","set","shear","accessKeyId","sessionToken","secretAccessKey","AMPLIFY_SYMBOL","Symbol","for","Hub","listeners","patterns","protectedChannels","remove","channel","listener","RegExp","find","pattern","warn","filter","x","holder","callback","dispatch","payload","ampSymbol","indexOf","capsule","patternInfo","_toListeners","listen","listenerName","cb","onHubCapsule","isLegacyCallback","Error","match","dispatchingCapsule","groups","MIME_MAP","type","ext","isEmpty","obj","sortByField","list","field","dir","sort","dirX","a","b","a_val","b_val","objectLessAttributes","less","ret","attr","filenameToContentType","filename","defVal","filtered","mime","endsWith","isTextFile","contentType","startsWith","generateRandomString","result","chars","i","Math","floor","random","makeQuerablePromise","promise","isResolved","isRejected","isFullfilled","isWebWorker","self","selfContext","WorkerGlobalScope","browserOrNode","document","isNode","process","versions","node","transferKeyToLowerCase","whiteListForItself","whiteListForChildren","isStrictObject","key","hasOwnProperty","includes","slice","transferKeyToUpperCase","toUpperCase","Array","Function","Number","String","Boolean","LOG_LEVELS","VERBOSE","DEBUG","INFO","WARN","ERROR","level","_padding","n","_ts","dt","getMinutes","getSeconds","join","getMilliseconds","_log","logger_level_name","ConsoleLogger","LOG_LEVEL","logger_level","type_level","log","console","prefix","msg","verbose","parseMobileHubConfig","storageConfig","amplifyConfig","AWSPinpoint","appId","userPoolWebClientId","identityPoolRegion","mandatorySignIn","AWSS3","bucket","dangerouslyConnectToHttpEndpointForTesting","parseMobilehubConfig","BASE_USER_AGENT","Platform","userAgent","product","navigator","isReactNative","getAmplifyUserAgent","DEFAULT_ALGORITHM","encrypt","src","hash","update","digestSync","arg","signed_headers","headers","canonical_request","request","query","url_info","url","method","encodeURIComponent","pathname","replace","split","key_val","reencoded_val","c","charCodeAt","toString","key_a","key_b","value","trim","item","parse_service_info","parsed","host","reverse","service","credential_scope","d_str","string_to_sign","algorithm","dt_str","get_signing_key","secret_key","service_info","k_date","k_region","k_service","get_signature","signing_key","str_to_sign","sign","access_info","toISOString","substr","session_token","request_str","serviceInfo","signature","authorization_header","access_key","get_authorization_header","signUrl","urlOrRequest","accessInfo","urlToSign","body","today","signedHeaders","credentialScope","sessionTokenRequired","queryParams","canonicalRequest","parsedUrl","stringToSign","additionalQueryParams","protocol","slashes","hostname","port","dataMemory","prototype","call","storageWindow","localStorage","exception","MemoryStorage","context","cookies","store","create","req","cookie","getAll","from","_","getLocalItem","getUniversalItem","index","removeLocalItem","removeUniversalItem","path","setLocalItem","pop","setUniversalItem","sameSite","secure","location","DateUtils","clockOffset","getDateWithClockOffset","getClockOffset","getHeaderStringFromDate","date","getDateFromHeaderString","header","month","day","hour","minute","second","UTC","isClockSkewed","serverDate","abs","isClockSkewError","setClockOffset","offset","nonRetryable","retry","functionToRetry","args","delayFn","attempt","jitteredExponentialRetry","maxDelayMs","delay","jitteredBackoff","urlSafeEncode","str","char","padStart","urlSafeDecode","hex","fromCharCode","parseInt","hasSymbol","INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER","INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER","USER_AGENT_HEADER","options","_options","_lang","_dict","language","setLanguage","lang","val","getByLanguage","lang_dict","putVocabulariesForLanguage","vocabularies","putVocabularies","_i18n","createInstance","checkConfig","Constants","state","Int32Array","INIT","temp","buffer","Uint8Array","bufferLength","bytesHashed","finished","position","byteLength","MAX_HASHABLE_LENGTH","BLOCK_SIZE","hashBuffer","digest","bitsHashed","bufferView","DataView","byteOffset","undecoratedLength","setUint8","setUint32","out","DIGEST_LENGTH","state0","state1","state2","state3","state4","state5","state6","state7","u","t1","KEY","t2","RawSha256","Uint32Array","secret","outer","inner","input","convertToBuffer","bufferHash","bufferFromSecret","toHash","isEmptyData","fromUtf8","ArrayBuffer","isView","BYTES_PER_ELEMENT","Sha256","TextEncoder","encode","bytes","len","surrogatePair","TextDecoder","decode","decoded","byte","nextByte","encoded","byteValue","decodeURIComponent","getProviderName","getCategory","promises","Map","clientId","clientFactory","delete","topicSymbol","uuid","_clientsQueue","ClientsQueue","_topicObservers","_clientIdObservers","aws_pubsub_endpoint","aws_appsync_dangerously_connect_to_http_endpoint_for_testing","getTopicForValue","onDisconnect","errorCode","clientIdObservers","observer","observerForTopic","observerTopic","size","topic","newClient","onMessageArrived","_onMessage","destinationName","payloadString","onConnectionLost","connect","useSSL","isSSLEnabled","mqttVersion","onSuccess","onFailure","clientsQueue","disconnect","isConnected","publish","topics","targetTopics","concat","endpoint","filterArray","topicArray","left","mqttTopicMatch","parse","observersForTopic","next","subscribe","Set","add","observersForClientId","unsubscribe","AbstractPubSubProvider","_topicClient","_topicAlias","_cleanUp","t","_cleanUpForTopic","topicsForClient","has","obs","closed","mqttConnections","newAliases","reduce","acc","elem","connectionInfoForTopic","all","complete","values","some","alias","MqttOverWSProvider","getLocation","lineRegexp","line","column","exec","highlightSourceAtLocation","firstLineColumnOffset","locationOffset","whitespace","lineIndex","lineNum","columnNum","lines","existingLines","_ref","padLen","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","iterator","done","max","return","_ref3","printPrefixedLines","GraphQLError","nodes","positions","originalError","extensions","_nodes","isArray","_source","loc","_locations","_positions","start","pos","_extensions","defineProperties","enumerable","writable","locations","stack","defineProperty","configurable","captureStackTrace","constructor","printedLocations","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","printError","MESSAGE_TYPES","SUBSCRIPTION_STATUS","SOCKET_STATUS","NON_RETRYABLE_CODES","CONTROL_MSG","AWS_APPSYNC_REALTIME_HEADERS","accept","DEFAULT_KEEP_ALIVE_TIMEOUT","socketStatus","CLOSED","keepAliveTimeout","subscriptionObserverMap","promiseArray","_topics","_msg","appSyncGraphqlEndpoint","_startSubscriptionWithAWSAppSyncRealTime","subscriptionId","_waitForSubscriptionToBeConnected","subscriptionState","CONNECTED","_sendUnsubscriptionMessage","_removeSubscriptionObserver","errors","authenticationType","apiKey","graphql_headers","additionalHeaders","variables","PENDING","startAckTimeoutId","dataString","_awsRealTimeHeaderBasedAuth","canonicalUri","headerObj","subscriptionMessage","authorization","GQL_START","stringToAWSRealTime","_initializeWebSocketConnection","subscriptionReadyCallback","subscriptionFailedCallback","_timeoutStartSubscriptionAck","awsRealTimeSocket","readyState","WebSocket","OPEN","READY","GQL_STOP","_closeSocketIfRequired","bufferedAmount","clearTimeout","keepAliveTimeoutId","tempSocket","onclose","onerror","close","_handleIncomingSubscriptionMessage","GQL_DATA","GQL_START_ACK","event","dispatchApiEvent","SUBSCRIPTION_ACK","GQL_CONNECTION_KEEP_ALIVE","_errorDisconnect","TIMEOUT_DISCONNECT","GQL_ERROR","FAILED","CONNECTING","discoverableEndpoint","headerString","headerQs","payloadQs","_initializeRetryableHandshake","awsRealTimeUrl","_initializeHandshake","newSocket","onopen","ackOk","reason","onmessage","connectionTimeoutMs","GQL_CONNECTION_ACK","CONNECTION_CLOSED","GQL_CONNECTION_ERROR","errorType","GQL_CONNECTION_INIT","headerHandler","API_KEY","_awsRealTimeApiKeyHeader","AWS_IAM","_awsRealTimeIAMHeader","OPENID_CONNECT","_awsRealTimeOPENIDHeader","AMAZON_COGNITO_USER_POOLS","_awsRealTimeCUPHeader","handler","Authorization","getAccessToken","dtStr","endpointInfo","_ensureCredentials","creds","Signer","_pluggables","_awsAppSyncProvider","AWSAppSyncProvider","_awsAppSyncRealTimeProvider","AWSAppSyncRealTimeProvider","opt","getProviderByName","providerName","awsAppSyncProvider","awsAppSyncRealTimeProvider","getProviders","ssr","providers","subscriptions","observable","subscription","module","exports","installedModules","__webpack_require__","moduleId","l","modules","m","d","getter","o","r","toStringTag","mode","__esModule","ns","object","p","s","checksum","lookupTable","Crc32","msSubtleCryptoMethods","quacksLikeAnMsWindow","msCrypto","subtle","getRandomValues","methodName","every","SHA_256_HASH","SHA_256_HMAC_ALGO","EMPTY_DATA_SHA_256","supportsWebCrypto","locateWindow","isMsWindow","encoding","operation","keyOperation","importKey","toArrayBufferView","oncomplete","getKeyPromise","keyData","finish","crypto","typedArray","subtleCryptoMethods","supportsSecureRandom","supportsSubtleCrypto","generateKey","iv","additionalData","tagLength","_logger","_serviceWorker","filePath","serviceWorker","registration","installing","waiting","active","_registration","_setupListeners","enablePush","publicKey","_publicKey","pushManager","getSubscription","userVisibleOnly","applicationServerKey","_urlB64ToUint8Array","_subscription","base64String","base64","repeat","rawData","atob","outputArray","postMessage","addEventListener","currentState","attributes","SEND_PROGRESS_EVENT","httpOptions","emitter","destroy","handle","requestTimeoutInMs","requestTimeout","queryString","axiosRequest","onUploadProgress","emit","responseType","raceOfPromises","statusCode","status","race","timeoutInMs","timeoutError","opts","minPartSize","queueSize","multiPartMap","cancel","bytesUploaded","totalBytesToUpload","upload","validateAndSanitizeBody","Body","putObjectCommand","PutObjectCommand","_createNewS3Client","createMultiPartUpload","uploadId","numberOfPartsToUpload","ceil","checkIfUploadCancelled","parts","createParts","uploadParts","finishMultiPartUpload","startPartNumber","partNumber","bodyStart","bodyEnd","min","bodyPart","events","EventEmitter","_lastUploadedBytes","createMultiPartUploadCommand","CreateMultipartUploadCommand","s3","middlewareStack","ContentType","step","UploadId","setupEventListener","part","uploadPartCommand","UploadPartCommand","PartNumber","Key","Bucket","allResults","ETag","cancelUpload","completeUploadCommand","CompleteMultipartUploadCommand","MultipartUpload","Parts","cleanup","AbortMultipartUploadCommand","ListPartsCommand","on","progress","progressChanged","loaded","incrementalUpdate","total","isGenericObject","isBlob","Blob","_getCredentials","localTestingConfig","tls","bucketEndpoint","forcePathStyle","S3Client","requestHandler","AxiosHttpHandler","dispatchStorageEvent","track","attrs","metrics","AWSS3Provider","CATEGORY","PROVIDER_NAME","Parser","download","cacheControl","contentDisposition","contentEncoding","contentLanguage","expires","_prefix","final_key","ResponseCacheControl","ResponseContentDisposition","ResponseContentEncoding","ResponseContentLanguage","ResponseContentType","getObjectCommand","GetObjectCommand","fileSize","Expires","signer","presign","put","progressCallback","metadata","tagging","acl","serverSideEncryption","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId","CacheControl","ContentDisposition","Metadata","Tagging","ServerSideEncryption","uploader","AWSS3ProviderManagedUpload","ACL","deleteObjectCommand","DeleteObjectCommand","maxKeys","final_path","listObjectsCommand","ListObjectsCommand","Prefix","MaxKeys","Contents","eTag","lastModified","LastModified","Size","customPrefix","privatePath","private","protectedPath","protected","publicPath","public","DEFAULT_PROVIDER","getPluggable","removePluggable","storageKeysFromConfig","storageArrayKeys","isInStorageArrayKeys","k","prov","_instance","vault","old_configure","vaultConfig","getInstance","AuthState","MfaOption","ChallengeName","AuthFormField","AccessLevel","UsernameAlias","AuthStrings","InteractionsStrings","AuthErrorStrings","A","__awaiter","thisArg","_arguments","P","generator","fulfilled","rejected","apply","__generator","f","y","g","label","sent","trys","ops","verb","v","op","TypeError","onAuthUIStateChange","authStateHandler","authUIStateHandler","_b","SignedIn"],"sourceRoot":""}