\n\n\n\n\n\n","import { render } from \"./Forgot.vue?vue&type=template&id=61bca11a&scoped=true\"\nimport script from \"./Forgot.vue?vue&type=script&lang=js\"\nexport * from \"./Forgot.vue?vue&type=script&lang=js\"\n\nimport \"./Forgot.vue?vue&type=style&index=0&id=61bca11a&lang=scss&scoped=true\"\n\nimport exportComponent from \"/codebuild/output/src853508750/src/superapp-total-health-web/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-61bca11a\"]])\n\nexport default __exports__",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64 encoding strategy.\n\t */\n\t var Base64 = C_enc.Base64 = {\n\t /**\n\t * Converts a word array to a Base64 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Base64 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64 string to a word array.\n\t *\n\t * @param {string} base64Str The Base64 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n\t */\n\t parse: function (base64Str) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64;\n\n}));","'use strict';\nvar global = require('../internals/global');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar RangeError = global.RangeError;\n\n// `String.prototype.repeat` method implementation\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\nmodule.exports = function repeat(count) {\n var str = toString(requireObjectCoercible(this));\n var result = '';\n var n = toIntegerOrInfinity(count);\n if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar isRegExp = require('../internals/is-regexp');\nvar anObject = require('../internals/an-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar arraySlice = require('../internals/array-slice-simple');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar MAX_UINT32 = 0xFFFFFFFF;\nvar min = Math.min;\nvar $push = [].push;\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis($push);\nvar stringSlice = uncurryThis(''.slice);\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] == 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length != 4 ||\n 'ab'.split(/(?:ab)*/).length != 2 ||\n '.'.split(/(.?)(.?)/).length != 4 ||\n // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return call(nativeSplit, string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = call(regexpExec, separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n push(output, stringSlice(string, lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !exec(separatorCopy, '')) push(output, '');\n } else push(output, stringSlice(string, lastLastIndex));\n return output.length > lim ? arraySlice(output, 0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);\n return splitter\n ? call(splitter, separator, O, limit)\n : call(internalSplit, toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n push(A, stringSlice(S, p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n push(A, z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n push(A, stringSlice(S, p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Check if typed arrays are supported\n\t if (typeof ArrayBuffer != 'function') {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\n\t // Reference original init\n\t var superInit = WordArray.init;\n\n\t // Augment WordArray.init to handle typed arrays\n\t var subInit = WordArray.init = function (typedArray) {\n\t // Convert buffers to uint8\n\t if (typedArray instanceof ArrayBuffer) {\n\t typedArray = new Uint8Array(typedArray);\n\t }\n\n\t // Convert other array views to uint8\n\t if (\n\t typedArray instanceof Int8Array ||\n\t (typeof Uint8ClampedArray !== \"undefined\" && typedArray instanceof Uint8ClampedArray) ||\n\t typedArray instanceof Int16Array ||\n\t typedArray instanceof Uint16Array ||\n\t typedArray instanceof Int32Array ||\n\t typedArray instanceof Uint32Array ||\n\t typedArray instanceof Float32Array ||\n\t typedArray instanceof Float64Array\n\t ) {\n\t typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);\n\t }\n\n\t // Handle Uint8Array\n\t if (typedArray instanceof Uint8Array) {\n\t // Shortcut\n\t var typedArrayByteLength = typedArray.byteLength;\n\n\t // Extract bytes\n\t var words = [];\n\t for (var i = 0; i < typedArrayByteLength; i++) {\n\t words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);\n\t }\n\n\t // Initialize this word array\n\t superInit.call(this, words, typedArrayByteLength);\n\t } else {\n\t // Else call normal init\n\t superInit.apply(this, arguments);\n\t }\n\t };\n\n\t subInit.prototype = WordArray;\n\t}());\n\n\n\treturn CryptoJS.lib.WordArray;\n\n}));","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Signin.vue?vue&type=style&index=0&id=be6eb0b8&lang=scss&scoped=true\"","\n
\n \n
\n\n","import { render } from \"./ArrowBack.vue?vue&type=template&id=5e6f22e2\"\nconst script = {}\n\nimport exportComponent from \"/codebuild/output/src853508750/src/superapp-total-health-web/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Register.vue?vue&type=style&index=0&id=28e8b112&lang=scss&scoped=true\"","\n \n
\n
\n
\n
\n {{ $t(\"sex\") }}\n
\n
\n
\n
\n
\n \n\n \n {{ $t(\"male\") }}\n
\n
\n
\n
\n \n\n \n {{ $t(\"female\") }}\n
\n
\n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"dateofbirth\") }}\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"bodydetail\") }}\n
\n
\n
\n
\n
\n {{ $t(\"height\") }}\n
\n \n
\n {{ $t(\"centimeter\") }}\n
\n
\n
\n\n
\n
\n
\n {{ $t(\"weight\") }}\n
\n \n
\n {{ $t(\"kilogram\") }}\n
\n
\n
\n\n
\n
\n
\n {{ $t(\"bmi\") }}\n
\n \n
\n {{ $t(\"bmiunit\") }}\n
\n
\n
\n\n
\n
\n
\n {{ $t(\"waistline\") }}\n
\n \n
\n {{ $t(\"inch\") }}\n
\n
\n
\n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"healthdetail\") }}\n \n
\n {{ $t(\"optional\") }}\n
\n
\n\n
\n
\n {{ $t(\"bloodpressure\") }}\n
\n
\n
\n
\n {{ $t(\"sbp\") }}\n
\n
\n \n
\n {{ $t(\"mmhg\") }}\n
\n
\n
\n
\n
\n {{ $t(\"dbp\") }}\n
\n
\n \n
\n {{ $t(\"mmhg\") }}\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n {{ $t(\"cholesterolLDL\") }}\n
\n \n
\n {{ $t(\"mgdl\") }}\n
\n
\n
\n
\n
\n
\n {{ $t(\"bloodsugar\") }}\n
\n \n
\n {{ $t(\"mgdl\") }}\n
\n
\n
\n
\n
\n
\n {{ $t(\"HbA1c\") }}\n
\n \n
\n {{ $t(\"mgdl\") }}\n
\n
\n
\n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"behavior\") }}\n
\n {{ $t(\"morethanone\") }}\n
\n
\n
\n
\n
\n
\n \n
\n
\n {{ $t(\"snoring\") }}\n
\n
\n \n
\n
\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n
\n
\n {{ $t(\"smoking\") }}\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n {{ $t(\"airPollution\") }}\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n {{ $t(\"healthcheck\") }}\n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n {{ $t(\"nothealthcheck\") }}\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"disease\") }}\n
\n {{ $t(\"morethanonedisease\") }}\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n {{ $t(\"cancer\") }}\n
\n
\n
\n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"diabete\") }}\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n {{ $t(\"hypertension\") }}\n
\n
\n
\n\n
\n \n
\n
\n \n
\n
{{ $t(\"cvd\") }}
\n
\n
\n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"kidney\") }}\n
\n
\n
\n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"stroke\") }}\n
\n
\n
\n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"metabolic\") }}\n
\n
\n
\n\n \n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"other\") }}\n
\n
\n
\n\n \n
\n
\n \n
\n
\n
\n\n
\n {{ $t(\"suggestedisease\") }}\n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"famdisease\") }}\n
\n {{ $t(\"morethanonediseaseFamily\") }}\n
\n
\n
\n
\n \n
\n
\n \n
\n\n
\n {{ $t(\"famcancer\") }}\n
\n
\n
\n
\n \n
\n
\n \n
\n
{{ $t(\"famdiabete\") }}
\n
\n
\n
\n \n
\n
\n \n
\n
{{ $t(\"famhypertension\") }}
\n
\n
\n
\n \n
\n
\n \n
\n
{{ $t(\"famcvd\") }}
\n
\n
\n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"kidney\") }}\n
\n
\n
\n \n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"stroke\") }}\n
\n
\n
\n\n
\n \n
\n
\n \n
\n
\n {{ $t(\"metabolic\") }}\n
\n
\n
\n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n {{ $t(\"exercise\") }}\n\n \n
\n
\n
\n
\n \n\n
{{ $t(\"lessThan3day\") }}
\n
\n
\n\n
\n
\n \n\n
{{ $t(\"d3To5\") }}
\n
\n
\n\n
\n
\n \n\n
\n {{ $t(\"d6To7\") }}\n
\n
\n
\n\n
\n
\n \n\n
{{ $t(\"dontdo\") }}
\n
\n
\n\n
\n \n
\n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
{{ $t(\"termTitle\") }}
\n \n
\n \n
\n
\n
\n
\n
\n
\n\n \n
\n
\n
\n
\n \n
\n
{{ $t(\"privacytitle\") }}
\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
{{ $t(\"wating\") }}
\n \n
\n
\n
\n
\n
\n\n \n\n
\n
\n
\n
\n \n
\n \n\n
Something went wrong
\n
\n please try again later or contract us +66(0) 2022 2222\n
\n
error : {{ errmsg }}
\n
\n
\n
\n
\n
\n\n\n\n\n\n","import { render } from \"./Register.vue?vue&type=template&id=e6966734&scoped=true\"\nimport script from \"./Register.vue?vue&type=script&lang=js\"\nexport * from \"./Register.vue?vue&type=script&lang=js\"\n\nimport \"./Register.vue?vue&type=style&index=0&id=e6966734&lang=scss&scoped=true\"\n\nimport exportComponent from \"/codebuild/output/src853508750/src/superapp-total-health-web/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-e6966734\"]])\n\nexport default __exports__","var isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');\n};\n","\n
\n
\n \n
\n
\n
\n
\n
\n {{ $t(\"password\") }}\n
\n \n
\n
\n\n
\n
\n
\n {{ $t(\"confirmpass\") }}\n
\n \n
\n
\n\n
\n
{{ $t(\"PassSuggest\") }}
\n
\n\n
{{ this.errmsg }}
\n
\n \n
\n\n\n\n\n\n","import { render } from \"./ChangePass.vue?vue&type=template&id=34c9659b&scoped=true\"\nimport script from \"./ChangePass.vue?vue&type=script&lang=js\"\nexport * from \"./ChangePass.vue?vue&type=script&lang=js\"\n\nimport \"./ChangePass.vue?vue&type=style&index=0&id=34c9659b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/codebuild/output/src853508750/src/superapp-total-health-web/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-34c9659b\"]])\n\nexport default __exports__","\n \n
\n \n \n
\n
\n \n \n
\n\n\n\n\n\n","import { render } from \"./Signin.vue?vue&type=template&id=be6eb0b8&scoped=true\"\nimport script from \"./Signin.vue?vue&type=script&lang=js\"\nexport * from \"./Signin.vue?vue&type=script&lang=js\"\n\nimport \"./Signin.vue?vue&type=style&index=0&id=be6eb0b8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/codebuild/output/src853508750/src/superapp-total-health-web/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-be6eb0b8\"]])\n\nexport default __exports__","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @class */\nvar AuthenticationDetails = /*#__PURE__*/function () {\n /**\n * Constructs a new AuthenticationDetails object\n * @param {object=} data Creation options.\n * @param {string} data.Username User being authenticated.\n * @param {string} data.Password Plain-text password to authenticate with.\n * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n */\n function AuthenticationDetails(data) {\n var _ref = data || {},\n ValidationData = _ref.ValidationData,\n Username = _ref.Username,\n Password = _ref.Password,\n AuthParameters = _ref.AuthParameters,\n ClientMetadata = _ref.ClientMetadata;\n\n this.validationData = ValidationData || {};\n this.authParameters = AuthParameters || {};\n this.clientMetadata = ClientMetadata || {};\n this.username = Username;\n this.password = Password;\n }\n /**\n * @returns {string} the record's username\n */\n\n\n var _proto = AuthenticationDetails.prototype;\n\n _proto.getUsername = function getUsername() {\n return this.username;\n }\n /**\n * @returns {string} the record's password\n */\n ;\n\n _proto.getPassword = function getPassword() {\n return this.password;\n }\n /**\n * @returns {Array} the record's validationData\n */\n ;\n\n _proto.getValidationData = function getValidationData() {\n return this.validationData;\n }\n /**\n * @returns {Array} the record's authParameters\n */\n ;\n\n _proto.getAuthParameters = function getAuthParameters() {\n return this.authParameters;\n }\n /**\n * @returns {ClientMetadata} the clientMetadata for a Lambda trigger\n */\n ;\n\n _proto.getClientMetadata = function getClientMetadata() {\n return this.clientMetadata;\n };\n\n return AuthenticationDetails;\n}();\n\nexport { AuthenticationDetails as default };","import cryptoSecureRandomInt from './cryptoSecureRandomInt';\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\n\nfunction hexStringify(wordArray) {\n // Shortcuts\n var words = wordArray.words;\n var sigBytes = wordArray.sigBytes; // Convert\n\n var hexChars = [];\n\n for (var i = 0; i < sigBytes; i++) {\n var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n\n return hexChars.join('');\n}\n\nvar WordArray = /*#__PURE__*/function () {\n function WordArray(words, sigBytes) {\n words = this.words = words || [];\n\n if (sigBytes != undefined) {\n this.sigBytes = sigBytes;\n } else {\n this.sigBytes = words.length * 4;\n }\n }\n\n var _proto = WordArray.prototype;\n\n _proto.random = function random(nBytes) {\n var words = [];\n\n for (var i = 0; i < nBytes; i += 4) {\n words.push(cryptoSecureRandomInt());\n }\n\n return new WordArray(words, nBytes);\n };\n\n _proto.toString = function toString() {\n return hexStringify(this);\n };\n\n return WordArray;\n}();\n\nexport { WordArray as default };","// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\nexport default BigInteger;\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n// (public) Constructor\n\nfunction BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n} // return new, unset BigInteger\n\n\nfunction nbi() {\n return new BigInteger(null);\n} // Bits per digit\n\n\nvar dbits; // JavaScript engine analysis\n\nvar canary = 0xdeadbeefcafe;\nvar j_lm = (canary & 0xffffff) == 0xefcafe; // am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n\nfunction am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n var v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n\n return c;\n} // am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n\n\nfunction am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n\n return c;\n} // Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\n\n\nfunction am3(i, x, w, j, c, n) {\n var xl = x & 0x3fff,\n xh = x >> 14;\n\n while (--n >= 0) {\n var l = this[i] & 0x3fff;\n var h = this[i++] >> 14;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n c = (l >> 28) + (m >> 14) + xh * h;\n w[j++] = l & 0xfffffff;\n }\n\n return c;\n}\n\nvar inBrowser = typeof navigator !== 'undefined';\n\nif (inBrowser && j_lm && navigator.appName == 'Microsoft Internet Explorer') {\n BigInteger.prototype.am = am2;\n dbits = 30;\n} else if (inBrowser && j_lm && navigator.appName != 'Netscape') {\n BigInteger.prototype.am = am1;\n dbits = 26;\n} else {\n // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP; // Digit conversions\n\nvar BI_RM = '0123456789abcdefghijklmnopqrstuvwxyz';\nvar BI_RC = new Array();\nvar rr, vv;\nrr = '0'.charCodeAt(0);\n\nfor (vv = 0; vv <= 9; ++vv) {\n BI_RC[rr++] = vv;\n}\n\nrr = 'a'.charCodeAt(0);\n\nfor (vv = 10; vv < 36; ++vv) {\n BI_RC[rr++] = vv;\n}\n\nrr = 'A'.charCodeAt(0);\n\nfor (vv = 10; vv < 36; ++vv) {\n BI_RC[rr++] = vv;\n}\n\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\n\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n} // (protected) copy this to r\n\n\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) {\n r[i] = this[i];\n }\n\n r.t = this.t;\n r.s = this.s;\n} // (protected) set from integer value x, -DV <= x < DV\n\n\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0;\n} // return bigint initialized to value\n\n\nfunction nbv(i) {\n var r = nbi();\n r.fromInt(i);\n return r;\n} // (protected) set from string and radix\n\n\nfunction bnpFromString(s, b) {\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n this.t = 0;\n this.s = 0;\n var i = s.length,\n mi = false,\n sh = 0;\n\n while (--i >= 0) {\n var x = intAt(s, i);\n\n if (x < 0) {\n if (s.charAt(i) == '-') mi = true;\n continue;\n }\n\n mi = false;\n if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n} // (protected) clamp off excess high words\n\n\nfunction bnpClamp() {\n var c = this.s & this.DM;\n\n while (this.t > 0 && this[this.t - 1] == c) {\n --this.t;\n }\n} // (public) return string representation in given radix\n\n\nfunction bnToString(b) {\n if (this.s < 0) return '-' + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n var km = (1 << k) - 1,\n d,\n m = false,\n r = '',\n i = this.t;\n var p = this.DB - i * this.DB % k;\n\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n\n return m ? r : '0';\n} // (public) -this\n\n\nfunction bnNegate() {\n var r = nbi();\n BigInteger.ZERO.subTo(this, r);\n return r;\n} // (public) |this|\n\n\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n} // (public) return + if this > a, - if this < a, 0 if equal\n\n\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n\n while (--i >= 0) {\n if ((r = this[i] - a[i]) != 0) return r;\n }\n\n return 0;\n} // returns bit length of the integer x\n\n\nfunction nbits(x) {\n var r = 1,\n t;\n\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n\n return r;\n} // (public) return the number of bits in \"this\"\n\n\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n} // (protected) r = this << n*DB\n\n\nfunction bnpDLShiftTo(n, r) {\n var i;\n\n for (i = this.t - 1; i >= 0; --i) {\n r[i + n] = this[i];\n }\n\n for (i = n - 1; i >= 0; --i) {\n r[i] = 0;\n }\n\n r.t = this.t + n;\n r.s = this.s;\n} // (protected) r = this >> n*DB\n\n\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i) {\n r[i - n] = this[i];\n }\n\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n} // (protected) r = this << n\n\n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB),\n c = this.s << bs & this.DM,\n i;\n\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n\n for (i = ds - 1; i >= 0; --i) {\n r[i] = 0;\n }\n\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n} // (protected) r = this >> n\n\n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n} // (protected) r = this - a\n\n\nfunction bnpSubTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n if (a.t < this.t) {\n c -= a.s;\n\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c += this.s;\n } else {\n c += this.s;\n\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c -= a.s;\n }\n\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n} // (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\n\n\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < y.t; ++i) {\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n }\n\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n} // (protected) r = this^2, r != this (HAC 14.16)\n\n\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n\n if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n} // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\n\n\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) {\n y[y.t++] = 0;\n }\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n} // (public) this mod a\n\n\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n} // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\n\n\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) == 0) return 0;\n var y = x & 3; // y == 1/x mod 2^2\n\n y = y * (2 - (x & 0xf) * y) & 0xf; // y == 1/x mod 2^4\n\n y = y * (2 - (x & 0xff) * y) & 0xff; // y == 1/x mod 2^8\n\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n\n y = y * (2 - x * y % this.DV) % this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n\n return y > 0 ? this.DV - y : -y;\n}\n\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n} // (protected) r = this + a\n\n\nfunction bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n if (a.t < this.t) {\n c += a.s;\n\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c += this.s;\n } else {\n c += this.s;\n\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n\n c += a.s;\n }\n\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n} // (public) this + a\n\n\nfunction bnAdd(a) {\n var r = nbi();\n this.addTo(a, r);\n return r;\n} // (public) this - a\n\n\nfunction bnSubtract(a) {\n var r = nbi();\n this.subTo(a, r);\n return r;\n} // (public) this * a\n\n\nfunction bnMultiply(a) {\n var r = nbi();\n this.multiplyTo(a, r);\n return r;\n} // (public) this / a\n\n\nfunction bnDivide(a) {\n var r = nbi();\n this.divRemTo(a, r, null);\n return r;\n} // Montgomery reduction\n\n\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n} // xR mod m\n\n\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n} // x/R mod m\n\n\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n} // x = x/R mod m (HAC 14.32)\n\n\nfunction montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }\n\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; // use am to combine the multiply-shift-add into one call\n\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t); // propagate carry\n\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n} // r = \"x^2/R mod m\"; x != r\n\n\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n} // r = \"xy/R mod m\"; x,y != r\n\n\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo; // (public) this^e % m (HAC 14.85)\n\nfunction bnModPow(e, m, callback) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z = new Montgomery(m);\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6; // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n var result = z.revert(r);\n callback(null, result);\n return result;\n} // protected\n\n\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo; // public\n\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow; // \"constants\"\n\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { Buffer } from 'buffer';\nimport CryptoJS from 'crypto-js/core';\nimport 'crypto-js/lib-typedarrays'; // necessary for crypto js\n\nimport SHA256 from 'crypto-js/sha256';\nimport HmacSHA256 from 'crypto-js/hmac-sha256';\nimport WordArray from './utils/WordArray';\n/**\n * Returns a Buffer with a sequence of random nBytes\n *\n * @param {number} nBytes\n * @returns {Buffer} fixed-length sequence of random bytes\n */\n\nfunction randomBytes(nBytes) {\n return Buffer.from(new WordArray().random(nBytes).toString(), 'hex');\n}\n\nimport BigInteger from './BigInteger';\n/**\n * Tests if a hex string has it most significant bit set (case-insensitive regex)\n */\n\nvar HEX_MSB_REGEX = /^[89a-f]/i;\nvar initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\nvar newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n/** @class */\n\nvar AuthenticationHelper = /*#__PURE__*/function () {\n /**\n * Constructs a new AuthenticationHelper object\n * @param {string} PoolName Cognito user pool name.\n */\n function AuthenticationHelper(PoolName) {\n this.N = new BigInteger(initN, 16);\n this.g = new BigInteger('2', 16);\n this.k = new BigInteger(this.hexHash(\"\" + this.padHex(this.N) + this.padHex(this.g)), 16);\n this.smallAValue = this.generateRandomSmallA();\n this.getLargeAValue(function () {});\n this.infoBits = Buffer.from('Caldera Derived Key', 'utf8');\n this.poolName = PoolName;\n }\n /**\n * @returns {BigInteger} small A, a random number\n */\n\n\n var _proto = AuthenticationHelper.prototype;\n\n _proto.getSmallAValue = function getSmallAValue() {\n return this.smallAValue;\n }\n /**\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n */\n ;\n\n _proto.getLargeAValue = function getLargeAValue(callback) {\n var _this = this;\n\n if (this.largeAValue) {\n callback(null, this.largeAValue);\n } else {\n this.calculateA(this.smallAValue, function (err, largeAValue) {\n if (err) {\n callback(err, null);\n }\n\n _this.largeAValue = largeAValue;\n callback(null, _this.largeAValue);\n });\n }\n }\n /**\n * helper function to generate a random big integer\n * @returns {BigInteger} a random value.\n * @private\n */\n ;\n\n _proto.generateRandomSmallA = function generateRandomSmallA() {\n // This will be interpreted as a postive 128-bit integer\n var hexRandom = randomBytes(128).toString('hex');\n var randomBigInt = new BigInteger(hexRandom, 16); // There is no need to do randomBigInt.mod(this.N - 1) as N (3072-bit) is > 128 bytes (1024-bit)\n\n return randomBigInt;\n }\n /**\n * helper function to generate a random string\n * @returns {string} a random value.\n * @private\n */\n ;\n\n _proto.generateRandomString = function generateRandomString() {\n return randomBytes(40).toString('base64');\n }\n /**\n * @returns {string} Generated random value included in password hash.\n */\n ;\n\n _proto.getRandomPassword = function getRandomPassword() {\n return this.randomPassword;\n }\n /**\n * @returns {string} Generated random value included in devices hash.\n */\n ;\n\n _proto.getSaltDevices = function getSaltDevices() {\n return this.SaltToHashDevices;\n }\n /**\n * @returns {string} Value used to verify devices.\n */\n ;\n\n _proto.getVerifierDevices = function getVerifierDevices() {\n return this.verifierDevices;\n }\n /**\n * Generate salts and compute verifier.\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n * @param {nodeCallback} callback Called with (err, null)\n * @returns {void}\n */\n ;\n\n _proto.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) {\n var _this2 = this;\n\n this.randomPassword = this.generateRandomString();\n var combinedString = \"\" + deviceGroupKey + username + \":\" + this.randomPassword;\n var hashedString = this.hash(combinedString);\n var hexRandom = randomBytes(16).toString('hex'); // The random hex will be unambiguously represented as a postive integer\n\n this.SaltToHashDevices = this.padHex(new BigInteger(hexRandom, 16));\n this.g.modPow(new BigInteger(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) {\n if (err) {\n callback(err, null);\n }\n\n _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded);\n callback(null, null);\n });\n }\n /**\n * Calculate the client's public value A = g^a%N\n * with the generated random number a\n * @param {BigInteger} a Randomly generated small A.\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n * @private\n */\n ;\n\n _proto.calculateA = function calculateA(a, callback) {\n var _this3 = this;\n\n this.g.modPow(a, this.N, function (err, A) {\n if (err) {\n callback(err, null);\n }\n\n if (A.mod(_this3.N).equals(BigInteger.ZERO)) {\n callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n }\n\n callback(null, A);\n });\n }\n /**\n * Calculate the client's value U which is the hash of A and B\n * @param {BigInteger} A Large A value.\n * @param {BigInteger} B Server B value.\n * @returns {BigInteger} Computed U value.\n * @private\n */\n ;\n\n _proto.calculateU = function calculateU(A, B) {\n this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n var finalU = new BigInteger(this.UHexHash, 16);\n return finalU;\n }\n /**\n * Calculate a hash from a bitArray\n * @param {Buffer} buf Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n ;\n\n _proto.hash = function hash(buf) {\n var str = buf instanceof Buffer ? CryptoJS.lib.WordArray.create(buf) : buf;\n var hashHex = SHA256(str).toString();\n return new Array(64 - hashHex.length).join('0') + hashHex;\n }\n /**\n * Calculate a hash from a hex string\n * @param {String} hexStr Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n ;\n\n _proto.hexHash = function hexHash(hexStr) {\n return this.hash(Buffer.from(hexStr, 'hex'));\n }\n /**\n * Standard hkdf algorithm\n * @param {Buffer} ikm Input key material.\n * @param {Buffer} salt Salt value.\n * @returns {Buffer} Strong key material.\n * @private\n */\n ;\n\n _proto.computehkdf = function computehkdf(ikm, salt) {\n var infoBitsWordArray = CryptoJS.lib.WordArray.create(Buffer.concat([this.infoBits, Buffer.from(String.fromCharCode(1), 'utf8')]));\n var ikmWordArray = ikm instanceof Buffer ? CryptoJS.lib.WordArray.create(ikm) : ikm;\n var saltWordArray = salt instanceof Buffer ? CryptoJS.lib.WordArray.create(salt) : salt;\n var prk = HmacSHA256(ikmWordArray, saltWordArray);\n var hmac = HmacSHA256(infoBitsWordArray, prk);\n return Buffer.from(hmac.toString(), 'hex').slice(0, 16);\n }\n /**\n * Calculates the final hkdf based on computed S value, and computed U value and the key\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {BigInteger} serverBValue Server B value.\n * @param {BigInteger} salt Generated salt.\n * @param {nodeCallback} callback Called with (err, hkdfValue)\n * @returns {void}\n */\n ;\n\n _proto.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n var _this4 = this;\n\n if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n\n this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\n if (this.UValue.equals(BigInteger.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n\n var usernamePassword = \"\" + this.poolName + username + \":\" + password;\n var usernamePasswordHash = this.hash(usernamePassword);\n var xValue = new BigInteger(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n this.calculateS(xValue, serverBValue, function (err, sValue) {\n if (err) {\n callback(err, null);\n }\n\n var hkdf = _this4.computehkdf(Buffer.from(_this4.padHex(sValue), 'hex'), Buffer.from(_this4.padHex(_this4.UValue), 'hex'));\n\n callback(null, hkdf);\n });\n }\n /**\n * Calculates the S value used in getPasswordAuthenticationKey\n * @param {BigInteger} xValue Salted password hash value.\n * @param {BigInteger} serverBValue Server B value.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.calculateS = function calculateS(xValue, serverBValue, callback) {\n var _this5 = this;\n\n this.g.modPow(xValue, this.N, function (err, gModPowXN) {\n if (err) {\n callback(err, null);\n }\n\n var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN));\n intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) {\n if (err2) {\n callback(err2, null);\n }\n\n callback(null, result.mod(_this5.N));\n });\n });\n }\n /**\n * Return constant newPasswordRequiredChallengeUserAttributePrefix\n * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n */\n ;\n\n _proto.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() {\n return newPasswordRequiredChallengeUserAttributePrefix;\n }\n /**\n * Returns an unambiguous, even-length hex string of the two's complement encoding of an integer.\n *\n * It is compatible with the hex encoding of Java's BigInteger's toByteArray(), wich returns a\n * byte array containing the two's-complement representation of a BigInteger. The array contains\n * the minimum number of bytes required to represent the BigInteger, including at least one sign bit.\n *\n * Examples showing how ambiguity is avoided by left padding with:\n * \t\"00\" (for positive values where the most-significant-bit is set)\n * \"FF\" (for negative values where the most-significant-bit is set)\n *\n * padHex(bigInteger.fromInt(-236)) === \"FF14\"\n * padHex(bigInteger.fromInt(20)) === \"14\"\n *\n * padHex(bigInteger.fromInt(-200)) === \"FF38\"\n * padHex(bigInteger.fromInt(56)) === \"38\"\n *\n * padHex(bigInteger.fromInt(-20)) === \"EC\"\n * padHex(bigInteger.fromInt(236)) === \"00EC\"\n *\n * padHex(bigInteger.fromInt(-56)) === \"C8\"\n * padHex(bigInteger.fromInt(200)) === \"00C8\"\n *\n * @param {BigInteger} bigInt Number to encode.\n * @returns {String} even-length hex string of the two's complement encoding.\n */\n ;\n\n _proto.padHex = function padHex(bigInt) {\n if (!(bigInt instanceof BigInteger)) {\n throw new Error('Not a BigInteger');\n }\n\n var isNegative = bigInt.compareTo(BigInteger.ZERO) < 0;\n /* Get a hex string for abs(bigInt) */\n\n var hexStr = bigInt.abs().toString(16);\n /* Pad hex to even length if needed */\n\n hexStr = hexStr.length % 2 !== 0 ? \"0\" + hexStr : hexStr;\n /* Prepend \"00\" if the most significant bit is set */\n\n hexStr = HEX_MSB_REGEX.test(hexStr) ? \"00\" + hexStr : hexStr;\n\n if (isNegative) {\n /* Flip the bits of the representation */\n var invertedNibbles = hexStr.split('').map(function (x) {\n var invertedNibble = ~parseInt(x, 16) & 0xf;\n return '0123456789ABCDEF'.charAt(invertedNibble);\n }).join('');\n /* After flipping the bits, add one to get the 2's complement representation */\n\n var flippedBitsBI = new BigInteger(invertedNibbles, 16).add(BigInteger.ONE);\n hexStr = flippedBitsBI.toString(16);\n /*\n For hex strings starting with 'FF8', 'FF' can be dropped, e.g. 0xFFFF80=0xFF80=0x80=-128\n \t\tAny sequence of '1' bits on the left can always be substituted with a single '1' bit\n without changing the represented value.\n \t\tThis only happens in the case when the input is 80...00\n */\n\n if (hexStr.toUpperCase().startsWith('FF8')) {\n hexStr = hexStr.substring(2);\n }\n }\n\n return hexStr;\n };\n\n return AuthenticationHelper;\n}();\n\nexport { AuthenticationHelper as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { Buffer } from 'buffer';\n/** @class */\n\nvar CognitoJwtToken = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoJwtToken object\n * @param {string=} token The JWT token.\n */\n function CognitoJwtToken(token) {\n // Assign object\n this.jwtToken = token || '';\n this.payload = this.decodePayload();\n }\n /**\n * @returns {string} the record's token.\n */\n\n\n var _proto = CognitoJwtToken.prototype;\n\n _proto.getJwtToken = function getJwtToken() {\n return this.jwtToken;\n }\n /**\n * @returns {int} the token's expiration (exp member).\n */\n ;\n\n _proto.getExpiration = function getExpiration() {\n return this.payload.exp;\n }\n /**\n * @returns {int} the token's \"issued at\" (iat member).\n */\n ;\n\n _proto.getIssuedAt = function getIssuedAt() {\n return this.payload.iat;\n }\n /**\n * @returns {object} the token's payload.\n */\n ;\n\n _proto.decodePayload = function decodePayload() {\n var payload = this.jwtToken.split('.')[1];\n\n try {\n return JSON.parse(Buffer.from(payload, 'base64').toString('utf8'));\n } catch (err) {\n return {};\n }\n };\n\n return CognitoJwtToken;\n}();\n\nexport { CognitoJwtToken as default };","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport CognitoJwtToken from './CognitoJwtToken';\n/** @class */\n\nvar CognitoAccessToken = /*#__PURE__*/function (_CognitoJwtToken) {\n _inheritsLoose(CognitoAccessToken, _CognitoJwtToken);\n\n /**\n * Constructs a new CognitoAccessToken object\n * @param {string=} AccessToken The JWT access token.\n */\n function CognitoAccessToken(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n AccessToken = _ref.AccessToken;\n\n return _CognitoJwtToken.call(this, AccessToken || '') || this;\n }\n\n return CognitoAccessToken;\n}(CognitoJwtToken);\n\nexport { CognitoAccessToken as default };","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport CognitoJwtToken from './CognitoJwtToken';\n/** @class */\n\nvar CognitoIdToken = /*#__PURE__*/function (_CognitoJwtToken) {\n _inheritsLoose(CognitoIdToken, _CognitoJwtToken);\n\n /**\n * Constructs a new CognitoIdToken object\n * @param {string=} IdToken The JWT Id token\n */\n function CognitoIdToken(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n IdToken = _ref.IdToken;\n\n return _CognitoJwtToken.call(this, IdToken || '') || this;\n }\n\n return CognitoIdToken;\n}(CognitoJwtToken);\n\nexport { CognitoIdToken as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @class */\nvar CognitoRefreshToken = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoRefreshToken object\n * @param {string=} RefreshToken The JWT refresh token.\n */\n function CognitoRefreshToken(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n RefreshToken = _ref.RefreshToken;\n\n // Assign object\n this.token = RefreshToken || '';\n }\n /**\n * @returns {string} the record's token.\n */\n\n\n var _proto = CognitoRefreshToken.prototype;\n\n _proto.getToken = function getToken() {\n return this.token;\n };\n\n return CognitoRefreshToken;\n}();\n\nexport { CognitoRefreshToken as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @class */\nvar CognitoUserSession = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUserSession object\n * @param {CognitoIdToken} IdToken The session's Id token.\n * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n * @param {CognitoAccessToken} AccessToken The session's access token.\n * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n */\n function CognitoUserSession(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n IdToken = _ref.IdToken,\n RefreshToken = _ref.RefreshToken,\n AccessToken = _ref.AccessToken,\n ClockDrift = _ref.ClockDrift;\n\n if (AccessToken == null || IdToken == null) {\n throw new Error('Id token and Access Token must be present.');\n }\n\n this.idToken = IdToken;\n this.refreshToken = RefreshToken;\n this.accessToken = AccessToken;\n this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n }\n /**\n * @returns {CognitoIdToken} the session's Id token\n */\n\n\n var _proto = CognitoUserSession.prototype;\n\n _proto.getIdToken = function getIdToken() {\n return this.idToken;\n }\n /**\n * @returns {CognitoRefreshToken} the session's refresh token\n */\n ;\n\n _proto.getRefreshToken = function getRefreshToken() {\n return this.refreshToken;\n }\n /**\n * @returns {CognitoAccessToken} the session's access token\n */\n ;\n\n _proto.getAccessToken = function getAccessToken() {\n return this.accessToken;\n }\n /**\n * @returns {int} the session's clock drift\n */\n ;\n\n _proto.getClockDrift = function getClockDrift() {\n return this.clockDrift;\n }\n /**\n * @returns {int} the computer's clock drift\n */\n ;\n\n _proto.calculateClockDrift = function calculateClockDrift() {\n var now = Math.floor(new Date() / 1000);\n var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n return now - iat;\n }\n /**\n * Checks to see if the session is still valid based on session expiry information found\n * in tokens and the current time (adjusted with clock drift)\n * @returns {boolean} if the session is still valid\n */\n ;\n\n _proto.isValid = function isValid() {\n var now = Math.floor(new Date() / 1000);\n var adjusted = now - this.clockDrift;\n return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n };\n\n return CognitoUserSession;\n}();\n\nexport { CognitoUserSession as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nvar monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n/** @class */\n\nvar DateHelper = /*#__PURE__*/function () {\n function DateHelper() {}\n\n var _proto = DateHelper.prototype;\n\n /**\n * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n */\n _proto.getNowString = function getNowString() {\n var now = new Date();\n var weekDay = weekNames[now.getUTCDay()];\n var month = monthNames[now.getUTCMonth()];\n var day = now.getUTCDate();\n var hours = now.getUTCHours();\n\n if (hours < 10) {\n hours = \"0\" + hours;\n }\n\n var minutes = now.getUTCMinutes();\n\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n var seconds = now.getUTCSeconds();\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n var year = now.getUTCFullYear(); // ddd MMM D HH:mm:ss UTC YYYY\n\n var dateNow = weekDay + \" \" + month + \" \" + day + \" \" + hours + \":\" + minutes + \":\" + seconds + \" UTC \" + year;\n return dateNow;\n };\n\n return DateHelper;\n}();\n\nexport { DateHelper as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @class */\nvar CognitoUserAttribute = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUserAttribute object\n * @param {string=} Name The record's name\n * @param {string=} Value The record's value\n */\n function CognitoUserAttribute(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n Name = _ref.Name,\n Value = _ref.Value;\n\n this.Name = Name || '';\n this.Value = Value || '';\n }\n /**\n * @returns {string} the record's value.\n */\n\n\n var _proto = CognitoUserAttribute.prototype;\n\n _proto.getValue = function getValue() {\n return this.Value;\n }\n /**\n * Sets the record's value.\n * @param {string} value The new value.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n ;\n\n _proto.setValue = function setValue(value) {\n this.Value = value;\n return this;\n }\n /**\n * @returns {string} the record's name.\n */\n ;\n\n _proto.getName = function getName() {\n return this.Name;\n }\n /**\n * Sets the record's name\n * @param {string} name The new name.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n ;\n\n _proto.setName = function setName(name) {\n this.Name = name;\n return this;\n }\n /**\n * @returns {string} a string representation of the record.\n */\n ;\n\n _proto.toString = function toString() {\n return JSON.stringify(this);\n }\n /**\n * @returns {object} a flat object representing the record.\n */\n ;\n\n _proto.toJSON = function toJSON() {\n return {\n Name: this.Name,\n Value: this.Value\n };\n };\n\n return CognitoUserAttribute;\n}();\n\nexport { CognitoUserAttribute as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nvar dataMemory = {};\n/** @class */\n\nexport var MemoryStorage = /*#__PURE__*/function () {\n function MemoryStorage() {}\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n MemoryStorage.setItem = function setItem(key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n ;\n\n MemoryStorage.getItem = function getItem(key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {boolean} return true\n */\n ;\n\n MemoryStorage.removeItem = function removeItem(key) {\n return delete dataMemory[key];\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n ;\n\n MemoryStorage.clear = function clear() {\n dataMemory = {};\n return dataMemory;\n };\n\n return MemoryStorage;\n}();\n/** @class */\n\nvar StorageHelper = /*#__PURE__*/function () {\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n function StorageHelper() {\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.cognito.test-ls', 1);\n this.storageWindow.removeItem('aws.cognito.test-ls');\n } catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n\n\n var _proto = StorageHelper.prototype;\n\n _proto.getStorage = function getStorage() {\n return this.storageWindow;\n };\n\n return StorageHelper;\n}();\n\nexport { StorageHelper as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { Buffer } from 'buffer';\nimport CryptoJS from 'crypto-js/core';\nimport TypedArrays from 'crypto-js/lib-typedarrays'; // necessary for crypto js\n\nimport Base64 from 'crypto-js/enc-base64';\nimport HmacSHA256 from 'crypto-js/hmac-sha256';\nimport BigInteger from './BigInteger';\nimport AuthenticationHelper from './AuthenticationHelper';\nimport CognitoAccessToken from './CognitoAccessToken';\nimport CognitoIdToken from './CognitoIdToken';\nimport CognitoRefreshToken from './CognitoRefreshToken';\nimport CognitoUserSession from './CognitoUserSession';\nimport DateHelper from './DateHelper';\nimport CognitoUserAttribute from './CognitoUserAttribute';\nimport StorageHelper from './StorageHelper';\n/**\n * @callback nodeCallback\n * @template T result\n * @param {*} err The operation failure reason, or null.\n * @param {T} result The operation result.\n */\n\n/**\n * @callback onFailure\n * @param {*} err Failure reason.\n */\n\n/**\n * @callback onSuccess\n * @template T result\n * @param {T} result The operation result.\n */\n\n/**\n * @callback mfaRequired\n * @param {*} details MFA challenge details.\n */\n\n/**\n * @callback customChallenge\n * @param {*} details Custom challenge details.\n */\n\n/**\n * @callback inputVerificationCode\n * @param {*} data Server response.\n */\n\n/**\n * @callback authSuccess\n * @param {CognitoUserSession} session The new session.\n * @param {bool=} userConfirmationNecessary User must be confirmed.\n */\n\nvar isBrowser = typeof navigator !== 'undefined';\nvar userAgent = isBrowser ? navigator.userAgent : 'nodejs';\n/** @class */\n\nvar CognitoUser = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUser object\n * @param {object} data Creation options\n * @param {string} data.Username The user's username.\n * @param {CognitoUserPool} data.Pool Pool containing the user.\n * @param {object} data.Storage Optional storage object.\n */\n function CognitoUser(data) {\n if (data == null || data.Username == null || data.Pool == null) {\n throw new Error('Username and Pool information are required.');\n }\n\n this.username = data.Username || '';\n this.pool = data.Pool;\n this.Session = null;\n this.client = data.Pool.client;\n this.signInUserSession = null;\n this.authenticationFlowType = 'USER_SRP_AUTH';\n this.storage = data.Storage || new StorageHelper().getStorage();\n this.keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n this.userDataKey = this.keyPrefix + \".\" + this.username + \".userData\";\n }\n /**\n * Sets the session for this user\n * @param {CognitoUserSession} signInUserSession the session\n * @returns {void}\n */\n\n\n var _proto = CognitoUser.prototype;\n\n _proto.setSignInUserSession = function setSignInUserSession(signInUserSession) {\n this.clearCachedUserData();\n this.signInUserSession = signInUserSession;\n this.cacheTokens();\n }\n /**\n * @returns {CognitoUserSession} the current session for this user\n */\n ;\n\n _proto.getSignInUserSession = function getSignInUserSession() {\n return this.signInUserSession;\n }\n /**\n * @returns {string} the user's username\n */\n ;\n\n _proto.getUsername = function getUsername() {\n return this.username;\n }\n /**\n * @returns {String} the authentication flow type\n */\n ;\n\n _proto.getAuthenticationFlowType = function getAuthenticationFlowType() {\n return this.authenticationFlowType;\n }\n /**\n * sets authentication flow type\n * @param {string} authenticationFlowType New value.\n * @returns {void}\n */\n ;\n\n _proto.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) {\n this.authenticationFlowType = authenticationFlowType;\n }\n /**\n * This is used for authenticating the user through the custom authentication flow.\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n ;\n\n _proto.initiateAuth = function initiateAuth(authDetails, callback) {\n var _this = this;\n\n var authParameters = authDetails.getAuthParameters();\n authParameters.USERNAME = this.username;\n var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata();\n var jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: clientMetaData\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('InitiateAuth', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeName = data.ChallengeName;\n var challengeParameters = data.ChallengeParameters;\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n _this.Session = data.Session;\n return callback.customChallenge(challengeParameters);\n }\n\n _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult);\n\n _this.cacheTokens();\n\n return callback.onSuccess(_this.signInUserSession);\n });\n }\n /**\n * This is used for authenticating the user.\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n ;\n\n _proto.authenticateUser = function authenticateUser(authDetails, callback) {\n if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') {\n return this.authenticateUserPlainUsernamePassword(authDetails, callback);\n } else if (this.authenticationFlowType === 'USER_SRP_AUTH' || this.authenticationFlowType === 'CUSTOM_AUTH') {\n return this.authenticateUserDefaultAuth(authDetails, callback);\n }\n\n return callback.onFailure(new Error('Authentication flow type is invalid.'));\n }\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * It calls the AuthenticationHelper for SRP related\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n ;\n\n _proto.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) {\n var _this2 = this;\n\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split('_')[1]);\n var dateHelper = new DateHelper();\n var serverBValue;\n var salt;\n var authParameters = {};\n\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n authParameters.USERNAME = this.username;\n authenticationHelper.getLargeAValue(function (errOnAValue, aValue) {\n // getLargeAValue callback start\n if (errOnAValue) {\n callback.onFailure(errOnAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n if (_this2.authenticationFlowType === 'CUSTOM_AUTH') {\n authParameters.CHALLENGE_NAME = 'SRP_A';\n }\n\n var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata();\n var jsonReq = {\n AuthFlow: _this2.authenticationFlowType,\n ClientId: _this2.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: clientMetaData\n };\n\n if (_this2.getUserContextData(_this2.username)) {\n jsonReq.UserContextData = _this2.getUserContextData(_this2.username);\n }\n\n _this2.client.request('InitiateAuth', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeParameters = data.ChallengeParameters;\n _this2.username = challengeParameters.USER_ID_FOR_SRP;\n _this2.userDataKey = _this2.keyPrefix + \".\" + _this2.username + \".userData\";\n serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n salt = new BigInteger(challengeParameters.SALT, 16);\n\n _this2.getCachedDeviceKeyAndPassword();\n\n authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) {\n // getPasswordAuthenticationKey callback start\n if (errOnHkdf) {\n callback.onFailure(errOnHkdf);\n }\n\n var dateNow = dateHelper.getNowString();\n var message = CryptoJS.lib.WordArray.create(Buffer.concat([Buffer.from(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), Buffer.from(_this2.username, 'utf8'), Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), Buffer.from(dateNow, 'utf8')]));\n var key = CryptoJS.lib.WordArray.create(hkdf);\n var signatureString = Base64.stringify(HmacSHA256(message, key));\n var challengeResponses = {};\n challengeResponses.USERNAME = _this2.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\n if (_this2.deviceKey != null) {\n challengeResponses.DEVICE_KEY = _this2.deviceKey;\n }\n\n var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) {\n return _this2.client.request('RespondToAuthChallenge', challenge, function (errChallenge, dataChallenge) {\n if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n challengeResponses.DEVICE_KEY = null;\n _this2.deviceKey = null;\n _this2.randomPassword = null;\n _this2.deviceGroupKey = null;\n\n _this2.clearCachedDeviceKeyAndPassword();\n\n return respondToAuthChallenge(challenge, challengeCallback);\n }\n\n return challengeCallback(errChallenge, dataChallenge);\n });\n };\n\n var jsonReqResp = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ClientId: _this2.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n ClientMetadata: clientMetaData\n };\n\n if (_this2.getUserContextData()) {\n jsonReqResp.UserContextData = _this2.getUserContextData();\n }\n\n respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined; // getPasswordAuthenticationKey callback end\n });\n return undefined;\n }); // getLargeAValue callback end\n\n });\n }\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {AuthenticationDetails} authDetails Contains the authentication data.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n ;\n\n _proto.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetails, callback) {\n var _this3 = this;\n\n var authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.PASSWORD = authDetails.getPassword();\n\n if (!authParameters.PASSWORD) {\n callback.onFailure(new Error('PASSWORD parameter is required'));\n return;\n }\n\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata();\n var jsonReq = {\n AuthFlow: 'USER_PASSWORD_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: clientMetaData\n };\n\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n } // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password,\n // Cognito UserPools verifies password and returns tokens.\n\n\n this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return _this3.authenticateUserInternal(authResult, authenticationHelper, callback);\n });\n }\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {object} dataAuthenticate authentication data\n * @param {object} authenticationHelper helper created\n * @param {callback} callback passed on from caller\n * @returns {void}\n */\n ;\n\n _proto.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n var _this4 = this;\n\n var challengeName = dataAuthenticate.ChallengeName;\n var challengeParameters = dataAuthenticate.ChallengeParameters;\n\n if (challengeName === 'SMS_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SELECT_MFA_TYPE') {\n this.Session = dataAuthenticate.Session;\n return callback.selectMFAType(challengeName, challengeParameters);\n }\n\n if (challengeName === 'MFA_SETUP') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaSetup(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.totpRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = dataAuthenticate.Session;\n return callback.customChallenge(challengeParameters);\n }\n\n if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n this.Session = dataAuthenticate.Session;\n var userAttributes = null;\n var rawRequiredAttributes = null;\n var requiredAttributes = [];\n var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\n if (challengeParameters) {\n userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes);\n rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes);\n }\n\n if (rawRequiredAttributes) {\n for (var i = 0; i < rawRequiredAttributes.length; i++) {\n requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length);\n }\n }\n\n return callback.newPasswordRequired(userAttributes, requiredAttributes);\n }\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.Session = dataAuthenticate.Session;\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.challengeName = challengeName;\n this.cacheTokens();\n var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n\n if (newDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n var deviceSecretVerifierConfig = {\n Salt: Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n PasswordVerifier: Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n };\n _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n _this4.randomPassword = authenticationHelper.getRandomPassword();\n\n _this4.client.request('ConfirmDevice', {\n DeviceKey: newDeviceMetadata.DeviceKey,\n AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: userAgent\n }, function (errConfirm, dataConfirm) {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n\n _this4.cacheDeviceKeyAndPassword();\n\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n\n return callback.onSuccess(_this4.signInUserSession);\n });\n\n return undefined;\n });\n return undefined;\n }\n /**\n * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n * Pass the new password with any new user attributes to be updated.\n * User attribute keys must be of format userAttributes..\n * @param {string} newPassword new password for this user\n * @param {object} requiredAttributeData map with values for all required attributes\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback, clientMetadata) {\n var _this5 = this;\n\n if (!newPassword) {\n return callback.onFailure(new Error('New password is required.'));\n }\n\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split('_')[1]);\n var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n var finalUserAttributes = {};\n\n if (requiredAttributeData) {\n Object.keys(requiredAttributeData).forEach(function (key) {\n finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n });\n }\n\n finalUserAttributes.NEW_PASSWORD = newPassword;\n finalUserAttributes.USERNAME = this.username;\n var jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: finalUserAttributes,\n Session: this.Session,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n }\n /**\n * This is used to get a session using device authentication. It is called at the end of user\n * authentication\n *\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n * @private\n */\n ;\n\n _proto.getDeviceResponse = function getDeviceResponse(callback, clientMetadata) {\n var _this6 = this;\n\n var authenticationHelper = new AuthenticationHelper(this.deviceGroupKey);\n var dateHelper = new DateHelper();\n var authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.DEVICE_KEY = this.deviceKey;\n authenticationHelper.getLargeAValue(function (errAValue, aValue) {\n // getLargeAValue callback start\n if (errAValue) {\n callback.onFailure(errAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n var jsonReq = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: _this6.pool.getClientId(),\n ChallengeResponses: authParameters,\n ClientMetadata: clientMetadata,\n Session: _this6.Session\n };\n\n if (_this6.getUserContextData()) {\n jsonReq.UserContextData = _this6.getUserContextData();\n }\n\n _this6.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeParameters = data.ChallengeParameters;\n var serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n var salt = new BigInteger(challengeParameters.SALT, 16);\n authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function (errHkdf, hkdf) {\n // getPasswordAuthenticationKey callback start\n if (errHkdf) {\n return callback.onFailure(errHkdf);\n }\n\n var dateNow = dateHelper.getNowString();\n var message = CryptoJS.lib.WordArray.create(Buffer.concat([Buffer.from(_this6.deviceGroupKey, 'utf8'), Buffer.from(_this6.deviceKey, 'utf8'), Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), Buffer.from(dateNow, 'utf8')]));\n var key = CryptoJS.lib.WordArray.create(hkdf);\n var signatureString = Base64.stringify(HmacSHA256(message, key));\n var challengeResponses = {};\n challengeResponses.USERNAME = _this6.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n challengeResponses.DEVICE_KEY = _this6.deviceKey;\n var jsonReqResp = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: _this6.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session\n };\n\n if (_this6.getUserContextData()) {\n jsonReqResp.UserContextData = _this6.getUserContextData();\n }\n\n _this6.client.request('RespondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\n _this6.cacheTokens();\n\n return callback.onSuccess(_this6.signInUserSession);\n });\n\n return undefined; // getPasswordAuthenticationKey callback end\n });\n return undefined;\n }); // getLargeAValue callback end\n\n });\n }\n /**\n * This is used for a certain user to confirm the registration by using a confirmation code\n * @param {string} confirmationCode Code entered by user.\n * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n ConfirmationCode: confirmationCode,\n Username: this.username,\n ForceAliasCreation: forceAliasCreation,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('ConfirmSignUp', jsonReq, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, 'SUCCESS');\n });\n }\n /**\n * This is used by the user once he has the responses to a custom challenge\n * @param {string} answerChallenge The custom challenge answer.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge\n * Custom challenge response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback, clientMetadata) {\n var _this7 = this;\n\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return _this7.authenticateUserInternal(data, authenticationHelper, callback);\n });\n }\n /**\n * This is used by the user once he has an MFA code\n * @param {string} confirmationCode The MFA code entered by the user.\n * @param {object} callback Result callback map.\n * @param {string} mfaType The mfa we are replying to.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType, clientMetadata) {\n var _this8 = this;\n\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.SMS_MFA_CODE = confirmationCode;\n var mfaTypeSelection = mfaType || 'SMS_MFA';\n\n if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n }\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n ChallengeName: mfaTypeSelection,\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, dataAuthenticate) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeName = dataAuthenticate.ChallengeName;\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n _this8.getDeviceResponse(callback);\n\n return undefined;\n }\n\n _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\n _this8.cacheTokens();\n\n if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n return callback.onSuccess(_this8.signInUserSession);\n }\n\n var authenticationHelper = new AuthenticationHelper(_this8.pool.getUserPoolId().split('_')[1]);\n authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n var deviceSecretVerifierConfig = {\n Salt: Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n PasswordVerifier: Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n };\n _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey;\n _this8.randomPassword = authenticationHelper.getRandomPassword();\n\n _this8.client.request('ConfirmDevice', {\n DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: userAgent\n }, function (errConfirm, dataConfirm) {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n\n _this8.cacheDeviceKeyAndPassword();\n\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n\n return callback.onSuccess(_this8.signInUserSession);\n });\n\n return undefined;\n });\n return undefined;\n });\n }\n /**\n * This is used by an authenticated user to change the current password\n * @param {string} oldUserPassword The current password.\n * @param {string} newUserPassword The requested new password.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.changePassword = function changePassword(oldUserPassword, newUserPassword, callback, clientMetadata) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('ChangePassword', {\n PreviousPassword: oldUserPassword,\n ProposedPassword: newUserPassword,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n ClientMetadata: clientMetadata\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used by an authenticated user to enable MFA for itself\n * @deprecated\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.enableMFA = function enableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n var mfaOptions = [];\n var mfaEnabled = {\n DeliveryMedium: 'SMS',\n AttributeName: 'phone_number'\n };\n mfaOptions.push(mfaEnabled);\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used by an authenticated user to enable MFA for itself\n * @param {IMfaSettings} smsMfaSettings the sms mfa settings\n * @param {IMFASettings} softwareTokenMfaSettings the software token mfa settings\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('SetUserMFAPreference', {\n SMSMfaSettings: smsMfaSettings,\n SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used by an authenticated user to disable MFA for itself\n * @deprecated\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.disableMFA = function disableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n var mfaOptions = [];\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used by an authenticated user to delete itself\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.deleteUser = function deleteUser(callback, clientMetadata) {\n var _this9 = this;\n\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n ClientMetadata: clientMetadata\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n _this9.clearCachedUser();\n\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n /**\n * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n */\n\n /**\n * This is used by an authenticated user to change a list of attributes\n * @param {AttributeArg[]} attributes A list of the new user attributes.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.updateAttributes = function updateAttributes(attributes, callback, clientMetadata) {\n var _this10 = this;\n\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('UpdateUserAttributes', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserAttributes: attributes,\n ClientMetadata: clientMetadata\n }, function (err) {\n if (err) {\n return callback(err, null);\n } // update cached user\n\n\n return _this10.getUserData(function () {\n return callback(null, 'SUCCESS');\n }, {\n bypassCache: true\n });\n });\n return undefined;\n }\n /**\n * This is used by an authenticated user to get a list of attributes\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.getUserAttributes = function getUserAttributes(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, userData) {\n if (err) {\n return callback(err, null);\n }\n\n var attributeList = [];\n\n for (var i = 0; i < userData.UserAttributes.length; i++) {\n var attribute = {\n Name: userData.UserAttributes[i].Name,\n Value: userData.UserAttributes[i].Value\n };\n var userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n\n return callback(null, attributeList);\n });\n return undefined;\n }\n /**\n * This was previously used by an authenticated user to get MFAOptions,\n * but no longer returns a meaningful response. Refer to the documentation for\n * how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js\n * @deprecated\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.getMFAOptions = function getMFAOptions(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, userData) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, userData.MFAOptions);\n });\n return undefined;\n }\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */\n ;\n\n _proto.createGetUserRequest = function createGetUserRequest() {\n return this.client.promisifyRequest('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n });\n }\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */\n ;\n\n _proto.refreshSessionIfPossible = function refreshSessionIfPossible(options) {\n var _this11 = this;\n\n if (options === void 0) {\n options = {};\n }\n\n // best effort, if not possible\n return new Promise(function (resolve) {\n var refresh = _this11.signInUserSession.getRefreshToken();\n\n if (refresh && refresh.getToken()) {\n _this11.refreshSession(refresh, resolve, options.clientMetadata);\n } else {\n resolve();\n }\n });\n }\n /**\n * @typedef {Object} GetUserDataOptions\n * @property {boolean} bypassCache - force getting data from Cognito service\n * @property {Record} clientMetadata - clientMetadata for getSession\n */\n\n /**\n * This is used by an authenticated users to get the userData\n * @param {nodeCallback} callback Called on success or error.\n * @param {GetUserDataOptions} params\n * @returns {void}\n */\n ;\n\n _proto.getUserData = function getUserData(callback, params) {\n var _this12 = this;\n\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.clearCachedUserData();\n return callback(new Error('User is not authenticated'), null);\n }\n\n var userData = this.getUserDataFromCache();\n\n if (!userData) {\n this.fetchUserData().then(function (data) {\n callback(null, data);\n })[\"catch\"](callback);\n return;\n }\n\n if (this.isFetchUserDataAndTokenRequired(params)) {\n this.fetchUserData().then(function (data) {\n return _this12.refreshSessionIfPossible(params).then(function () {\n return data;\n });\n }).then(function (data) {\n return callback(null, data);\n })[\"catch\"](callback);\n return;\n }\n\n try {\n callback(null, JSON.parse(userData));\n return;\n } catch (err) {\n this.clearCachedUserData();\n callback(err, null);\n return;\n }\n }\n /**\n *\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */\n ;\n\n _proto.getUserDataFromCache = function getUserDataFromCache() {\n var userData = this.storage.getItem(this.userDataKey);\n return userData;\n }\n /**\n *\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */\n ;\n\n _proto.isFetchUserDataAndTokenRequired = function isFetchUserDataAndTokenRequired(params) {\n var _ref = params || {},\n _ref$bypassCache = _ref.bypassCache,\n bypassCache = _ref$bypassCache === void 0 ? false : _ref$bypassCache;\n\n return bypassCache;\n }\n /**\n *\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */\n ;\n\n _proto.fetchUserData = function fetchUserData() {\n var _this13 = this;\n\n return this.createGetUserRequest().then(function (data) {\n _this13.cacheUserData(data);\n\n return data;\n });\n }\n /**\n * This is used by an authenticated user to delete a list of attributes\n * @param {string[]} attributeList Names of the attributes to delete.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.deleteAttributes = function deleteAttributes(attributeList, callback) {\n var _this14 = this;\n\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUserAttributes', {\n UserAttributeNames: attributeList,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n } // update cached user\n\n\n return _this14.getUserData(function () {\n return callback(null, 'SUCCESS');\n }, {\n bypassCache: true\n });\n });\n return undefined;\n }\n /**\n * This is used by a user to resend a confirmation code\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.resendConfirmationCode = function resendConfirmationCode(callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ClientMetadata: clientMetadata\n };\n this.client.request('ResendConfirmationCode', jsonReq, function (err, result) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, result);\n });\n }\n /**\n * @typedef {Object} GetSessionOptions\n * @property {Record} clientMetadata - clientMetadata for getSession\n */\n\n /**\n * This is used to get a session, either from the session object\n * or from the local storage, or by using a refresh token\n *\n * @param {nodeCallback} callback Called on success or error.\n * @param {GetSessionOptions} options\n * @returns {void}\n */\n ;\n\n _proto.getSession = function getSession(callback, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (this.username == null) {\n return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n }\n\n if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n return callback(null, this.signInUserSession);\n }\n\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var idTokenKey = keyPrefix + \".idToken\";\n var accessTokenKey = keyPrefix + \".accessToken\";\n var refreshTokenKey = keyPrefix + \".refreshToken\";\n var clockDriftKey = keyPrefix + \".clockDrift\";\n\n if (this.storage.getItem(idTokenKey)) {\n var idToken = new CognitoIdToken({\n IdToken: this.storage.getItem(idTokenKey)\n });\n var accessToken = new CognitoAccessToken({\n AccessToken: this.storage.getItem(accessTokenKey)\n });\n var refreshToken = new CognitoRefreshToken({\n RefreshToken: this.storage.getItem(refreshTokenKey)\n });\n var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n var sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n ClockDrift: clockDrift\n };\n var cachedSession = new CognitoUserSession(sessionData);\n\n if (cachedSession.isValid()) {\n this.signInUserSession = cachedSession;\n return callback(null, this.signInUserSession);\n }\n\n if (!refreshToken.getToken()) {\n return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n }\n\n this.refreshSession(refreshToken, callback, options.clientMetadata);\n } else {\n callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n }\n\n return undefined;\n }\n /**\n * This uses the refreshToken to retrieve a new session\n * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.refreshSession = function refreshSession(refreshToken, callback, clientMetadata) {\n var _this15 = this;\n\n var wrappedCallback = this.pool.wrapRefreshSessionCallback ? this.pool.wrapRefreshSessionCallback(callback) : callback;\n var authParameters = {};\n authParameters.REFRESH_TOKEN = refreshToken.getToken();\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n var lastUserKey = keyPrefix + \".LastAuthUser\";\n\n if (this.storage.getItem(lastUserKey)) {\n this.username = this.storage.getItem(lastUserKey);\n var deviceKeyKey = keyPrefix + \".\" + this.username + \".deviceKey\";\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters: authParameters,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n if (err) {\n if (err.code === 'NotAuthorizedException') {\n _this15.clearCachedUser();\n }\n\n return wrappedCallback(err, null);\n }\n\n if (authResult) {\n var authenticationResult = authResult.AuthenticationResult;\n\n if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n authenticationResult.RefreshToken = refreshToken.getToken();\n }\n\n _this15.signInUserSession = _this15.getCognitoUserSession(authenticationResult);\n\n _this15.cacheTokens();\n\n return wrappedCallback(null, _this15.signInUserSession);\n }\n\n return undefined;\n });\n }\n /**\n * This is used to save the session tokens to local storage\n * @returns {void}\n */\n ;\n\n _proto.cacheTokens = function cacheTokens() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n var idTokenKey = keyPrefix + \".\" + this.username + \".idToken\";\n var accessTokenKey = keyPrefix + \".\" + this.username + \".accessToken\";\n var refreshTokenKey = keyPrefix + \".\" + this.username + \".refreshToken\";\n var clockDriftKey = keyPrefix + \".\" + this.username + \".clockDrift\";\n var lastUserKey = keyPrefix + \".LastAuthUser\";\n this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n this.storage.setItem(clockDriftKey, \"\" + this.signInUserSession.getClockDrift());\n this.storage.setItem(lastUserKey, this.username);\n }\n /**\n * This is to cache user data\n */\n ;\n\n _proto.cacheUserData = function cacheUserData(userData) {\n this.storage.setItem(this.userDataKey, JSON.stringify(userData));\n }\n /**\n * This is to remove cached user data\n */\n ;\n\n _proto.clearCachedUserData = function clearCachedUserData() {\n this.storage.removeItem(this.userDataKey);\n };\n\n _proto.clearCachedUser = function clearCachedUser() {\n this.clearCachedTokens();\n this.clearCachedUserData();\n }\n /**\n * This is used to cache the device key and device group and device password\n * @returns {void}\n */\n ;\n\n _proto.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var deviceKeyKey = keyPrefix + \".deviceKey\";\n var randomPasswordKey = keyPrefix + \".randomPasswordKey\";\n var deviceGroupKeyKey = keyPrefix + \".deviceGroupKey\";\n this.storage.setItem(deviceKeyKey, this.deviceKey);\n this.storage.setItem(randomPasswordKey, this.randomPassword);\n this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n }\n /**\n * This is used to get current device key and device group and device password\n * @returns {void}\n */\n ;\n\n _proto.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var deviceKeyKey = keyPrefix + \".deviceKey\";\n var randomPasswordKey = keyPrefix + \".randomPasswordKey\";\n var deviceGroupKeyKey = keyPrefix + \".deviceGroupKey\";\n\n if (this.storage.getItem(deviceKeyKey)) {\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n this.randomPassword = this.storage.getItem(randomPasswordKey);\n this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n }\n }\n /**\n * This is used to clear the device key info from local storage\n * @returns {void}\n */\n ;\n\n _proto.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var deviceKeyKey = keyPrefix + \".deviceKey\";\n var randomPasswordKey = keyPrefix + \".randomPasswordKey\";\n var deviceGroupKeyKey = keyPrefix + \".deviceGroupKey\";\n this.storage.removeItem(deviceKeyKey);\n this.storage.removeItem(randomPasswordKey);\n this.storage.removeItem(deviceGroupKeyKey);\n }\n /**\n * This is used to clear the session tokens from local storage\n * @returns {void}\n */\n ;\n\n _proto.clearCachedTokens = function clearCachedTokens() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n var idTokenKey = keyPrefix + \".\" + this.username + \".idToken\";\n var accessTokenKey = keyPrefix + \".\" + this.username + \".accessToken\";\n var refreshTokenKey = keyPrefix + \".\" + this.username + \".refreshToken\";\n var lastUserKey = keyPrefix + \".LastAuthUser\";\n var clockDriftKey = keyPrefix + \".\" + this.username + \".clockDrift\";\n this.storage.removeItem(idTokenKey);\n this.storage.removeItem(accessTokenKey);\n this.storage.removeItem(refreshTokenKey);\n this.storage.removeItem(lastUserKey);\n this.storage.removeItem(clockDriftKey);\n }\n /**\n * This is used to build a user session from tokens retrieved in the authentication result\n * @param {object} authResult Successful auth response from server.\n * @returns {CognitoUserSession} The new user session.\n * @private\n */\n ;\n\n _proto.getCognitoUserSession = function getCognitoUserSession(authResult) {\n var idToken = new CognitoIdToken(authResult);\n var accessToken = new CognitoAccessToken(authResult);\n var refreshToken = new CognitoRefreshToken(authResult);\n var sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken\n };\n return new CognitoUserSession(sessionData);\n }\n /**\n * This is used to initiate a forgot password request\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode?} callback.inputVerificationCode\n * Optional callback raised instead of onSuccess with response data.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.forgotPassword = function forgotPassword(callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('ForgotPassword', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n\n return callback.onSuccess(data);\n });\n }\n /**\n * This is used to confirm a new password using a confirmationCode\n * @param {string} confirmationCode Code entered by user.\n * @param {string} newPassword Confirm new password.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ConfirmationCode: confirmationCode,\n Password: newPassword,\n ClientMetadata: clientMetadata\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('ConfirmForgotPassword', jsonReq, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess('SUCCESS');\n });\n }\n /**\n * This is used to initiate an attribute confirmation request\n * @param {string} attributeName User attribute that needs confirmation.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */\n ;\n\n _proto.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback, clientMetadata) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetUserAttributeVerificationCode', {\n AttributeName: attributeName,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n ClientMetadata: clientMetadata\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used to confirm an attribute using a confirmation code\n * @param {string} attributeName Attribute being confirmed.\n * @param {string} confirmationCode Code entered by user.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n ;\n\n _proto.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('VerifyUserAttribute', {\n AttributeName: attributeName,\n Code: confirmationCode,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used to get the device information using the current device key\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n * @returns {void}\n */\n ;\n\n _proto.getDevice = function getDevice(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess(data);\n });\n return undefined;\n }\n /**\n * This is used to forget a specific device\n * @param {string} deviceKey Device key.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n ;\n\n _proto.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ForgetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: deviceKey\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used to forget the current device\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n ;\n\n _proto.forgetDevice = function forgetDevice(callback) {\n var _this16 = this;\n\n this.forgetSpecificDevice(this.deviceKey, {\n onFailure: callback.onFailure,\n onSuccess: function onSuccess(result) {\n _this16.deviceKey = null;\n _this16.deviceGroupKey = null;\n _this16.randomPassword = null;\n\n _this16.clearCachedDeviceKeyAndPassword();\n\n return callback.onSuccess(result);\n }\n });\n }\n /**\n * This is used to set the device status as remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n ;\n\n _proto.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'remembered'\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used to set the device status as not remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n ;\n\n _proto.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'not_remembered'\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used to list all devices for a user\n *\n * @param {int} limit the number of devices returned in a call\n * @param {string | null} paginationToken the pagination token in case any was returned before\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n * @returns {void}\n */\n ;\n\n _proto.listDevices = function listDevices(limit, paginationToken, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n var requestParams = {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n Limit: limit\n };\n\n if (paginationToken) {\n requestParams.PaginationToken = paginationToken;\n }\n\n this.client.request('ListDevices', requestParams, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess(data);\n });\n return undefined;\n }\n /**\n * This is used to globally revoke all tokens issued to a user\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n ;\n\n _proto.globalSignOut = function globalSignOut(callback) {\n var _this17 = this;\n\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GlobalSignOut', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n\n _this17.clearCachedUser();\n\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n /**\n * This is used for the user to signOut of the application and clear the cached tokens.\n * @returns {void}\n */\n ;\n\n _proto.signOut = function signOut(revokeTokenCallback) {\n var _this18 = this;\n\n // If tokens won't be revoked, we just clean the client data.\n if (!revokeTokenCallback || typeof revokeTokenCallback !== 'function') {\n this.cleanClientData();\n return;\n }\n\n this.getSession(function (error, _session) {\n if (error) {\n return revokeTokenCallback(error);\n }\n\n _this18.revokeTokens(function (err) {\n _this18.cleanClientData();\n\n revokeTokenCallback(err);\n });\n });\n };\n\n _proto.revokeTokens = function revokeTokens(revokeTokenCallback) {\n if (revokeTokenCallback === void 0) {\n revokeTokenCallback = function revokeTokenCallback() {};\n }\n\n if (typeof revokeTokenCallback !== 'function') {\n throw new Error('Invalid revokeTokenCallback. It should be a function.');\n }\n\n var tokensToBeRevoked = [];\n\n if (!this.signInUserSession) {\n var error = new Error('User is not authenticated');\n return revokeTokenCallback(error);\n }\n\n if (!this.signInUserSession.getAccessToken()) {\n var _error = new Error('No Access token available');\n\n return revokeTokenCallback(_error);\n }\n\n var refreshToken = this.signInUserSession.getRefreshToken().getToken();\n var accessToken = this.signInUserSession.getAccessToken();\n\n if (this.isSessionRevocable(accessToken)) {\n if (refreshToken) {\n return this.revokeToken({\n token: refreshToken,\n callback: revokeTokenCallback\n });\n }\n }\n\n revokeTokenCallback();\n };\n\n _proto.isSessionRevocable = function isSessionRevocable(token) {\n if (token && typeof token.decodePayload === 'function') {\n try {\n var _token$decodePayload = token.decodePayload(),\n origin_jti = _token$decodePayload.origin_jti;\n\n return !!origin_jti;\n } catch (err) {// Nothing to do, token doesnt have origin_jti claim\n }\n }\n\n return false;\n };\n\n _proto.cleanClientData = function cleanClientData() {\n this.signInUserSession = null;\n this.clearCachedUser();\n };\n\n _proto.revokeToken = function revokeToken(_ref2) {\n var token = _ref2.token,\n callback = _ref2.callback;\n this.client.requestWithRetry('RevokeToken', {\n Token: token,\n ClientId: this.pool.getClientId()\n }, function (err) {\n if (err) {\n return callback(err);\n }\n\n callback();\n });\n }\n /**\n * This is used by a user trying to select a given MFA\n * @param {string} answerChallenge the mfa the user wants\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) {\n var _this19 = this;\n\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n var jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session\n };\n\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n _this19.Session = data.Session;\n\n if (answerChallenge === 'SMS_MFA') {\n return callback.mfaRequired(data.ChallengeName, data.ChallengeParameters);\n }\n\n if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n return callback.totpRequired(data.ChallengeName, data.ChallengeParameters);\n }\n\n return undefined;\n });\n }\n /**\n * This returns the user context data for advanced security feature.\n * @returns {string} the user context data from CognitoUserPool\n */\n ;\n\n _proto.getUserContextData = function getUserContextData() {\n var pool = this.pool;\n return pool.getUserContextData(this.username);\n }\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.associateSoftwareToken = function associateSoftwareToken(callback) {\n var _this20 = this;\n\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('AssociateSoftwareToken', {\n Session: this.Session\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n _this20.Session = data.Session;\n return callback.associateSecretCode(data.SecretCode);\n });\n } else {\n this.client.request('AssociateSoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.associateSecretCode(data.SecretCode);\n });\n }\n }\n /**\n * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA\n * @param {string} totpCode The MFA code entered by the user.\n * @param {string} friendlyDeviceName The device name we are assigning to the device.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n ;\n\n _proto.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n var _this21 = this;\n\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('VerifySoftwareToken', {\n Session: this.Session,\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n _this21.Session = data.Session;\n var challengeResponses = {};\n challengeResponses.USERNAME = _this21.username;\n var jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ClientId: _this21.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: _this21.Session\n };\n\n if (_this21.getUserContextData()) {\n jsonReq.UserContextData = _this21.getUserContextData();\n }\n\n _this21.client.request('RespondToAuthChallenge', jsonReq, function (errRespond, dataRespond) {\n if (errRespond) {\n return callback.onFailure(errRespond);\n }\n\n _this21.signInUserSession = _this21.getCognitoUserSession(dataRespond.AuthenticationResult);\n\n _this21.cacheTokens();\n\n return callback.onSuccess(_this21.signInUserSession);\n });\n\n return undefined;\n });\n } else {\n this.client.request('VerifySoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return callback.onSuccess(data);\n });\n }\n };\n\n return CognitoUser;\n}();\n\nexport { CognitoUser as default };","// generated by genversion\nexport var version = '5.0.4';","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { version } from './version';\nvar BASE_USER_AGENT = \"aws-amplify/\" + version;\nexport var Platform = {\n userAgent: BASE_USER_AGENT + \" js\",\n product: '',\n navigator: null,\n isReactNative: false\n};\n\nif (typeof navigator !== 'undefined' && navigator.product) {\n Platform.product = navigator.product || '';\n Platform.navigator = navigator || null;\n\n switch (navigator.product) {\n case 'ReactNative':\n Platform.userAgent = BASE_USER_AGENT + \" react-native\";\n Platform.isReactNative = true;\n break;\n\n default:\n Platform.userAgent = BASE_USER_AGENT + \" js\";\n Platform.isReactNative = false;\n break;\n }\n}\n\nexport var getUserAgent = function getUserAgent() {\n return Platform.userAgent;\n};\n/**\n * @deprecated use named import\n */\n\nexport default Platform;","import { getUserAgent } from \"./Platform\"; // constructor\n\nfunction UserAgent() {} // public\n\n\nUserAgent.prototype.userAgent = getUserAgent();\nexport var appendToCognitoUserAgent = function appendToCognitoUserAgent(content) {\n if (!content) {\n return;\n }\n\n if (UserAgent.prototype.userAgent && !UserAgent.prototype.userAgent.includes(content)) {\n UserAgent.prototype.userAgent = UserAgent.prototype.userAgent.concat(' ', content);\n }\n\n if (!UserAgent.prototype.userAgent || UserAgent.prototype.userAgent === '') {\n UserAgent.prototype.userAgent = content;\n }\n}; // class for defining the amzn user-agent\n\nexport default UserAgent;","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport 'isomorphic-unfetch';\nimport UserAgent from './UserAgent';\n\nvar CognitoError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(CognitoError, _Error);\n\n function CognitoError(message, code, name, statusCode) {\n var _this;\n\n _this = _Error.call(this, message) || this;\n _this.code = code;\n _this.name = name;\n _this.statusCode = statusCode;\n return _this;\n }\n\n return CognitoError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/** @class */\n\n\nvar Client = /*#__PURE__*/function () {\n /**\n * Constructs a new AWS Cognito Identity Provider client object\n * @param {string} region AWS region\n * @param {string} endpoint endpoint\n * @param {object} fetchOptions options for fetch API (only credentials is supported)\n */\n function Client(region, endpoint, fetchOptions) {\n this.endpoint = endpoint || \"https://cognito-idp.\" + region + \".amazonaws.com/\";\n\n var _ref = fetchOptions || {},\n credentials = _ref.credentials;\n\n this.fetchOptions = credentials ? {\n credentials: credentials\n } : {};\n }\n /**\n * Makes an unauthenticated request on AWS Cognito Identity Provider API\n * using fetch\n * @param {string} operation API operation\n * @param {object} params Input parameters\n * @returns Promise