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,EAAQnE,MACbwE,EAAOe,MAAM,oCACb1G,EAAsB2C,EAAAA,EAAAA,eAA0B,CAAEiB,SAAUA,KAEtC,8BAAjB0B,EAAQnE,MAAqD,KAAbsE,GACrDE,EAAOe,MAAM,4BACbpB,EAAQqG,QAAU7L,EAAAA,EAAAA,gBAEbwF,EAAQqG,UAAY7L,EAAAA,EAAAA,iBACrBqD,IAAkBiH,EAAAA,EAAAA,QAClB9E,EAAQqG,QAAU7L,EAAAA,EAAAA,aAElBqD,IAAkBiH,EAAAA,EAAAA,eAClB9E,EAAQqG,QAAU7L,EAAAA,EAAAA,eAG1B+B,EAAAA,EAAAA,GAAsByD,GACf,CAAC,EAAa,IACzB,KAAK,GAAI,MAAO,CAAC,GAEzB,GACJ,GAAI,EACAkG,EAAgB,SAAUzK,GAC1B,OAAOA,aAAgB6K,EAAAA,EAC3B,C","sources":["../node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-confirm-sign-in_7.entry.js","../node_modules/@aws-amplify/ui-components/dist/esm-es5/auth-helpers-557b83fc.js"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { r as registerInstance, h, H as Host } from './index-83f2275b.js';\nimport { I18n, Logger, ConsoleLogger, isEmpty } from '@aws-amplify/core';\nimport { M as MfaOption, C as ChallengeName, A as AuthState, a as AuthFormField, U as UsernameAlias } from './auth-types-78df304e.js';\nimport { Auth } from '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nimport { N as NO_AUTH_MODULE_FOUND, g as COUNTRY_DIAL_CODE_DEFAULT, b as PHONE_SUFFIX } from './constants-c8ecaa24.js';\nimport { d as dispatchAuthStateChangeEvent, a as dispatchToastHubEvent, c as checkUsernameAlias, i as isHintValid, h as handlePhoneNumberChange, b as composePhoneNumberInput, g as getRequiredAttributesMap } from './helpers-14fcb50c.js';\nimport { c as checkContact, h as handleSignIn } from './auth-helpers-557b83fc.js';\nvar AmplifyConfirmSignIn = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when confirm sign in form is submitted */\n this.handleSubmit = function (event) { return _this.confirm(event); };\n /** Used for header text in confirm sign in component */\n this.headerText = Translations.CONFIRM_SMS_CODE;\n /** Used for the submit button text in confirm sign in component */\n this.submitButtonText = Translations.CONFIRM;\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Default form field */\n this.defaultFormFields = [\n {\n type: 'code',\n required: true,\n handleInputChange: function (event) { return _this.handleCodeChange(event); },\n },\n ];\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = this.defaultFormFields;\n /** The MFA option to confirm with */\n this.mfaOption = MfaOption.SMS;\n /* Whether or not the confirm-sign-in component is loading */\n this.loading = false;\n }\n class_1.prototype.componentWillLoad = function () {\n this.setup();\n };\n class_1.prototype.userHandler = function () {\n this.setup();\n };\n class_1.prototype.setup = function () {\n if (this.user &&\n this.user['challengeName'] === ChallengeName.SoftwareTokenMFA) {\n this.mfaOption = MfaOption.TOTP;\n // If header text is using default use TOTP string\n if (this.headerText === Translations.CONFIRM_SMS_CODE) {\n this.headerText = Translations.CONFIRM_TOTP_CODE;\n }\n }\n this.constructedFormFieldOptions = this.constructFormFieldOptions(this.formFields);\n };\n class_1.prototype.handleCodeChange = function (event) {\n this.code = event.target.value;\n };\n class_1.prototype.confirm = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var mfaType, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n mfaType = this.user['challengeName'] === ChallengeName.SoftwareTokenMFA\n ? ChallengeName.SoftwareTokenMFA\n : null;\n if (!Auth || typeof Auth.confirmSignIn !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4 /*yield*/, Auth.confirmSignIn(this.user, this.code, mfaType)];\n case 2:\n _a.sent();\n return [4 /*yield*/, checkContact(this.user, this.handleAuthStateChange)];\n case 3:\n _a.sent();\n return [3 /*break*/, 6];\n case 4:\n error_1 = _a.sent();\n dispatchToastHubEvent(error_1);\n return [3 /*break*/, 6];\n case 5:\n this.loading = false;\n return [7 /*endfinally*/];\n case 6: return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.constructFormFieldOptions = function (formFields) {\n var _this = this;\n var content = [];\n if (formFields === undefined)\n return undefined;\n if (formFields.length <= 0)\n return this.defaultFormFields;\n formFields.forEach(function (formField) {\n if (typeof formField === 'string' || formField.type !== 'code') {\n // This is either a `string`, and/or a custom field that isn't `code`. Pass this directly.\n content.push(formField);\n }\n else {\n // This is a code input field. Attach input handler.\n content.push(Object.assign({ handleInputChange: function (event) { return _this.handleCodeChange(event); } }, formField));\n }\n });\n return content;\n };\n class_1.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, submitButtonText: I18n.get(this.submitButtonText), loading: this.loading, secondaryFooterContent: h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN))) }, h(\"amplify-auth-fields\", { formFields: this.constructedFormFieldOptions }))));\n };\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_1;\n}());\nvar AmplifyConfirmSignUp = /** @class */ (function () {\n function class_2(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign up form is submitted */\n this.handleSubmit = function (event) { return _this.confirmSignUp(event); };\n /** Used for header text in confirm sign up component */\n this.headerText = Translations.CONFIRM_SIGN_UP_HEADER_TEXT;\n /** Used for the submit button text in confirm sign up component */\n this.submitButtonText = Translations.CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT;\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Auth state change handler for this components\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n this.loading = false;\n this.newFormFields = [];\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n }\n class_2.prototype.componentWillLoad = function () {\n this.setup();\n };\n class_2.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_2.prototype.userHandler = function () {\n this.setup();\n };\n class_2.prototype.setup = function () {\n // TODO: Use optional chaining instead\n this.userInput = this.user && this.user.username;\n this._signUpAttrs = this.user && this.user.signUpAttrs;\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_2.prototype.buildDefaultFormFields = function () {\n var _this = this;\n this.newFormFields = [\n {\n type: \"\" + this.usernameAlias,\n required: true,\n handleInputChange: this.handleFormFieldInputChange(\"\" + this.usernameAlias),\n value: this.userInput,\n disabled: this.userInput ? true : false,\n inputProps: { autocomplete: 'username' },\n },\n {\n type: 'code',\n label: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_LABEL),\n placeholder: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_PLACEHOLDER),\n required: true,\n hint: (h(\"div\", null, I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.resendConfirmCode(); } }, I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)))),\n handleInputChange: this.handleFormFieldInputChange('code'),\n },\n ];\n };\n class_2.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_1 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n if (newField.type === 'code') {\n newField['hint'] = isHintValid(newField) ? (h(\"div\", null, I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.resendConfirmCode(); } }, I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)))) : (newField['hint']);\n }\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n newFields_1.push(newField);\n });\n this.newFormFields = newFields_1;\n }\n };\n class_2.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'code':\n return function (event) { return (_this.code = event.target.value); };\n default:\n return;\n }\n };\n class_2.prototype.setFieldValue = function (field) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n this.userInput = '';\n }\n else {\n this.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n }\n };\n class_2.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n /**\n * Returns the username of the user to confirm. If a valid `user.username` has been passed as a prop, we return that.\n * Otherwise, we return the `userInput` on the form.\n */\n class_2.prototype.getUsername = function () {\n if (this.user && this.user.username)\n return this.user.username;\n switch (this.usernameAlias) {\n case 'username':\n case 'email':\n return this.userInput;\n case 'phone_number':\n return composePhoneNumberInput(this.phoneNumber);\n }\n };\n class_2.prototype.resendConfirmCode = function () {\n return __awaiter(this, void 0, void 0, function () {\n var username, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.resendSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n username = this.getUsername();\n if (!username)\n throw new Error(Translations.EMPTY_USERNAME);\n return [4 /*yield*/, Auth.resendSignUp(username.trim())];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n error_2 = _a.sent();\n dispatchToastHubEvent(error_2);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n // TODO: Add validation\n // TODO: Prefix\n class_2.prototype.confirmSignUp = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var username, confirmSignUpResult, error_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.confirmSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, 7, 8]);\n username = this.getUsername();\n if (!username)\n throw new Error(Translations.EMPTY_USERNAME);\n username = username.trim();\n return [4 /*yield*/, Auth.confirmSignUp(username, this.code)];\n case 2:\n confirmSignUpResult = _a.sent();\n if (!confirmSignUpResult) {\n throw new Error(I18n.get(Translations.CONFIRM_SIGN_UP_FAILED));\n }\n if (!(this._signUpAttrs &&\n this._signUpAttrs.password &&\n this._signUpAttrs.password !== '')) return [3 /*break*/, 4];\n // Auto sign in user if password is available from previous workflow\n return [4 /*yield*/, handleSignIn(username, this._signUpAttrs.password, this.handleAuthStateChange)];\n case 3:\n // Auto sign in user if password is available from previous workflow\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n this.handleAuthStateChange(AuthState.SignIn);\n _a.label = 5;\n case 5: return [3 /*break*/, 8];\n case 6:\n error_3 = _a.sent();\n dispatchToastHubEvent(error_3);\n return [3 /*break*/, 8];\n case 7:\n this.loading = false;\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n class_2.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), submitButtonText: I18n.get(this.submitButtonText), handleSubmit: this.handleSubmit, loading: this.loading, secondaryFooterContent: h(\"div\", null, h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN)))) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_2, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"],\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_2;\n}());\nvar logger = new Logger('ForgotPassword');\nvar AmplifyForgotPassword = /** @class */ (function () {\n function class_3(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** The header text of the forgot password section */\n this.headerText = Translations.RESET_YOUR_PASSWORD;\n /** The text displayed inside of the send code button for the form */\n this.sendButtonText = Translations.SEND_CODE;\n /** The text displayed inside of the submit button for the form */\n this.submitButtonText = Translations.SUBMIT;\n /** The form fields displayed inside of the forgot password form */\n this.formFields = [];\n /** The function called when making a request to reset password */\n this.handleSend = function (event) { return _this.send(event); };\n /** The function called when submitting a new password */\n this.handleSubmit = function (event) { return _this.submit(event); };\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n this.delivery = null;\n this.loading = false;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.newFormFields = [];\n this.forgotPasswordAttrs = {\n userInput: '',\n password: '',\n code: '',\n };\n }\n class_3.prototype.componentWillLoad = function () {\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_3.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_3.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_2 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n newFields_2.push(newField);\n });\n this.newFormFields = newFields_2;\n }\n };\n class_3.prototype.buildDefaultFormFields = function () {\n switch (this.usernameAlias) {\n case 'email':\n this.newFormFields = [\n {\n type: 'email',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'forgot-password-email-input',\n },\n },\n ];\n break;\n case 'phone_number':\n this.newFormFields = [\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'forgot-password-phone-number-input',\n },\n },\n ];\n break;\n case 'username':\n default:\n this.newFormFields = [\n {\n type: 'username',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'forgot-password-username-input',\n },\n },\n ];\n break;\n }\n };\n class_3.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.forgotPasswordAttrs.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'password':\n case 'code':\n return function (event) { return (_this.forgotPasswordAttrs[fieldType] = event.target.value); };\n default:\n return;\n }\n };\n class_3.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n formAttributes.userInput = '';\n }\n else {\n formAttributes.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n case 'password':\n case 'code':\n if (field.value === undefined) {\n formAttributes[field.type] = '';\n }\n else {\n formAttributes[field.type] = field.value;\n }\n break;\n }\n };\n class_3.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_3.prototype.send = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var data, error_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.forgotPassword !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.forgotPasswordAttrs.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n break;\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.forgotPassword(this.forgotPasswordAttrs.userInput.trim())];\n case 2:\n data = _a.sent();\n logger.debug(data);\n this.newFormFields = [\n {\n type: 'code',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('code'),\n inputProps: {\n 'data-test': 'forgot-password-code-input',\n },\n },\n {\n type: 'password',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n label: I18n.get(Translations.NEW_PASSWORD_LABEL),\n placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER),\n },\n ];\n this.delivery = data.CodeDeliveryDetails;\n return [3 /*break*/, 5];\n case 3:\n error_4 = _a.sent();\n dispatchToastHubEvent(error_4);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_3.prototype.submit = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, userInput, code, password, data, error_5;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.forgotPasswordSubmit !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, 4, 5]);\n _a = this.forgotPasswordAttrs, userInput = _a.userInput, code = _a.code, password = _a.password;\n return [4 /*yield*/, Auth.forgotPasswordSubmit(userInput.trim(), code, password)];\n case 2:\n data = _b.sent();\n logger.debug(data);\n this.handleAuthStateChange(AuthState.SignIn);\n this.delivery = null;\n return [3 /*break*/, 5];\n case 3:\n error_5 = _b.sent();\n dispatchToastHubEvent(error_5);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_3.prototype.render = function () {\n var _this = this;\n var submitFn = this.delivery\n ? function (event) { return _this.handleSubmit(event); }\n : function (event) { return _this.handleSend(event); };\n var submitButtonText = this.delivery\n ? this.submitButtonText\n : this.sendButtonText;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: submitFn, loading: this.loading, secondaryFooterContent: h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); }, \"data-test\": \"forgot-password-back-to-sign-in-link\" }, I18n.get(Translations.BACK_TO_SIGN_IN)), testDataPrefix: 'forgot-password', submitButtonText: I18n.get(submitButtonText) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_3, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_3;\n}());\nvar logger$1 = new ConsoleLogger('amplify-require-new-password');\nvar AmplifyRequireNewPassword = /** @class */ (function () {\n function class_4(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** The header text of the forgot password section */\n this.headerText = Translations.CHANGE_PASSWORD;\n /** The text displayed inside of the submit button for the form */\n this.submitButtonText = Translations.CHANGE_PASSWORD_ACTION;\n /** The function called when submitting a new password */\n this.handleSubmit = function (event) { return _this.completeNewPassword(event); };\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** The form fields displayed inside of the forgot password form */\n this.formFields = [\n {\n type: AuthFormField.Password,\n required: true,\n handleInputChange: function (event) { return _this.handlePasswordChange(event); },\n label: I18n.get(Translations.NEW_PASSWORD_LABEL),\n placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER),\n inputProps: {\n 'data-test': 'require-new-password-password-input',\n },\n },\n ];\n this.loading = false;\n this.requiredAttributes = {};\n this.newFormFields = this.formFields;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: ' ',\n };\n }\n class_4.prototype.userHandler = function () {\n this.setCurrentUser();\n };\n class_4.prototype.handleRequiredAttributeInputChange = function (attribute, event) {\n if (attribute === 'phone_number') {\n this.formatPhoneNumber(event);\n }\n else {\n this.requiredAttributes[attribute] = event.target.value;\n }\n };\n class_4.prototype.setCurrentUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n var user, error_6, userRequiredAttributes, requiredAttributesMap_1;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.user) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Auth.currentAuthenticatedUser()];\n case 2:\n user = _a.sent();\n if (user)\n this.currentUser = user;\n return [3 /*break*/, 4];\n case 3:\n error_6 = _a.sent();\n dispatchToastHubEvent(error_6);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n this.currentUser = this.user;\n _a.label = 6;\n case 6:\n if (this.currentUser &&\n this.currentUser.challengeParam &&\n this.currentUser.challengeParam.requiredAttributes) {\n userRequiredAttributes = this.currentUser.challengeParam\n .requiredAttributes;\n requiredAttributesMap_1 = getRequiredAttributesMap();\n userRequiredAttributes.forEach(function (attribute) {\n var formField = {\n type: attribute,\n required: true,\n label: requiredAttributesMap_1[attribute].label,\n placeholder: requiredAttributesMap_1[attribute].placeholder,\n handleInputChange: function (event) { return _this.handleRequiredAttributeInputChange(attribute, event); },\n inputProps: {\n 'data-test': \"require-new-password-\" + attribute + \"-input\",\n },\n };\n _this.newFormFields = __spreadArrays(_this.newFormFields, [formField]);\n });\n }\n return [2 /*return*/];\n }\n });\n });\n };\n class_4.prototype.componentWillLoad = function () {\n return this.setCurrentUser();\n };\n class_4.prototype.handlePasswordChange = function (event) {\n this.password = event.target.value;\n };\n class_4.prototype.formatPhoneNumber = function (event) {\n handlePhoneNumberChange(event, this.phoneNumber);\n /**\n * composePhoneNumberInput will throw an error if the phoneNumberValue it receives\n * is empty. Adding a check here to try and make sure that doesn't happen...but will\n * wrap it in a try/catch block just in case as well\n */\n try {\n if (event.target.name === PHONE_SUFFIX &&\n this.phoneNumber.phoneNumberValue) {\n var composedInput = composePhoneNumberInput(this.phoneNumber);\n this.requiredAttributes['phone_number'] = composedInput;\n }\n }\n catch (err) {\n logger$1.error(\"error in phone number field - \" + err);\n }\n };\n class_4.prototype.completeNewPassword = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var user, _a, error_7;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.completeNewPassword !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 8, 9, 10]);\n return [4 /*yield*/, Auth.completeNewPassword(this.currentUser, this.password, this.requiredAttributes)];\n case 2:\n user = _b.sent();\n logger$1.debug('complete new password', user);\n _a = user.challengeName;\n switch (_a) {\n case ChallengeName.SMSMFA: return [3 /*break*/, 3];\n case ChallengeName.MFASetup: return [3 /*break*/, 4];\n }\n return [3 /*break*/, 5];\n case 3:\n this.handleAuthStateChange(AuthState.ConfirmSignIn, user);\n return [3 /*break*/, 7];\n case 4:\n logger$1.debug('TOTP setup', user.challengeParam);\n this.handleAuthStateChange(AuthState.TOTPSetup, user);\n return [3 /*break*/, 7];\n case 5: return [4 /*yield*/, checkContact(user, this.handleAuthStateChange)];\n case 6:\n _b.sent();\n _b.label = 7;\n case 7: return [3 /*break*/, 10];\n case 8:\n error_7 = _b.sent();\n dispatchToastHubEvent(error_7);\n return [3 /*break*/, 10];\n case 9:\n this.loading = false;\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n });\n };\n class_4.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, loading: this.loading, secondaryFooterContent: h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN)), submitButtonText: I18n.get(this.submitButtonText) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_4, \"watchers\", {\n get: function () {\n return {\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_4;\n}());\nvar amplifySignInCss = \":host{--footer-size:var(--amplify-text-sm);--footer-color:var(--amplify-grey);--footer-font-family:var(--amplify-font-family);--font-weight:var(--amplify-font-weight)}.sign-in-form-footer{font-family:var(--footer-font-family);font-size:var(--footer-size);color:var(--footer-color);font-weight:--font-weight;display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sign-in-form-footer amplify-button{margin-bottom:0.625rem}@media (min-width: 672px){.sign-in-form-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}.sign-in-form-footer amplify-button{margin-bottom:0}}.sign-in-form-footer *+*{margin-bottom:15px}.full-width-footer-content{width:100%}\";\nvar AmplifySignIn = /** @class */ (function () {\n function class_5(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign in form is submitted */\n this.handleSubmit = function (event) { return _this.signIn(event); };\n /** Used for header text in sign in component */\n this.headerText = Translations.SIGN_IN_HEADER_TEXT;\n /** Used for the submit button text in sign in component */\n this.submitButtonText = Translations.SIGN_IN_ACTION;\n /** Auth state change handler for this component */\n // prettier-ignore\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Hides the sign up link */\n this.hideSignUp = false;\n this.newFormFields = [];\n /* Whether or not the sign-in component is loading */\n this.loading = false;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.signInAttributes = {\n userInput: '',\n password: '',\n };\n }\n class_5.prototype.componentWillLoad = function () {\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_5.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_5.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.signInAttributes.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'password':\n return function (event) { return (_this.signInAttributes.password = event.target.value); };\n default:\n return function () { };\n }\n };\n class_5.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_5.prototype.signIn = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var username;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // avoid submitting the form\n if (event) {\n event.preventDefault();\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.signInAttributes.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n username = this.signInAttributes.userInput.trim();\n return [4 /*yield*/, handleSignIn(username, this.signInAttributes.password, this.handleAuthStateChange, this.usernameAlias)];\n case 1:\n _a.sent();\n this.loading = false;\n return [2 /*return*/];\n }\n });\n });\n };\n class_5.prototype.buildDefaultFormFields = function () {\n var _this = this;\n var formFieldInputs = [];\n switch (this.usernameAlias) {\n case 'email':\n formFieldInputs.push({\n type: 'email',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-in-email-input',\n autocomplete: 'username',\n },\n });\n break;\n case 'phone_number':\n formFieldInputs.push({\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-in-phone-number-input',\n autocomplete: 'username',\n },\n });\n break;\n case 'username':\n default:\n formFieldInputs.push({\n type: 'username',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'sign-in-username-input',\n autocomplete: 'username',\n },\n });\n break;\n }\n formFieldInputs.push({\n type: 'password',\n hint: (h(\"div\", null, I18n.get(Translations.FORGOT_PASSWORD_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.ForgotPassword); }, \"data-test\": \"sign-in-forgot-password-link\" }, I18n.get(Translations.RESET_PASSWORD_TEXT)))),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-in-password-input',\n },\n });\n this.newFormFields = __spreadArrays(formFieldInputs);\n };\n class_5.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_3 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n // TODO: handle hint better\n if (newField.type === 'password') {\n newField['hint'] = isHintValid(newField) ? (h(\"div\", null, I18n.get(Translations.FORGOT_PASSWORD_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.ForgotPassword); }, \"data-test\": \"sign-in-forgot-password-link\" }, I18n.get(Translations.RESET_PASSWORD_TEXT)))) : (newField['hint']);\n }\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n _this.setFieldValue(newField, _this.signInAttributes);\n newFields_3.push(newField);\n });\n this.newFormFields = newFields_3;\n }\n };\n class_5.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n formAttributes.userInput = '';\n }\n else {\n formAttributes.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n case 'password':\n if (field.value === undefined) {\n formAttributes.password = '';\n }\n else {\n formAttributes.password = field.value;\n }\n break;\n }\n };\n class_5.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, testDataPrefix: 'sign-in' }, h(\"div\", { slot: \"subtitle\" }, h(\"slot\", { name: \"header-subtitle\" })), h(\"slot\", { name: \"federated-buttons\" }, h(\"amplify-federated-buttons\", { handleAuthStateChange: this.handleAuthStateChange, federated: this.federated })), !isEmpty(this.federated) && h(\"amplify-strike\", null, \"or\"), h(\"amplify-auth-fields\", { formFields: this.newFormFields }), h(\"div\", { slot: \"amplify-form-section-footer\", class: \"sign-in-form-footer\" }, h(\"slot\", { name: \"footer\" }, !this.hideSignUp && (h(\"slot\", { name: \"secondary-footer-content\" }, h(\"span\", null, I18n.get(Translations.NO_ACCOUNT_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignUp); }, \"data-test\": \"sign-in-create-account-link\" }, I18n.get(Translations.CREATE_ACCOUNT_TEXT))))), h(\"div\", { class: this.hideSignUp ? 'full-width-footer-content' : '' }, h(\"slot\", { name: \"primary-footer-content\" }, h(\"amplify-button\", { type: \"submit\", disabled: this.loading, \"data-test\": \"sign-in-sign-in-button\" }, this.loading ? (h(\"amplify-loading-spinner\", null)) : (h(\"span\", null, I18n.get(this.submitButtonText)))))))))));\n };\n Object.defineProperty(class_5, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_5;\n}());\nAmplifySignIn.style = amplifySignInCss;\nvar amplifySignUpCss = \"amplify-sign-up{--footer-font-family:var(--amplify-font-family);--footer-font-size:var(--amplify-text-sm);--footer-color:var(--amplify-grey);--font-weight:var(--amplify-font-weight)}.sign-up-form-footer{font-family:var(--footer-font-family);font-size:var(--footer-font-size);color:var(--footer-color);font-weight:--font-weight;display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sign-up-form-footer amplify-button{margin-bottom:0.625rem}@media (min-width: 672px){.sign-up-form-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}.sign-up-form-footer amplify-button{margin-bottom:0}}.sign-up-form-footer *+*{margin-bottom:15px}\";\nvar AmplifySignUp = /** @class */ (function () {\n function class_6(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign up form is submitted */\n this.handleSubmit = function (event) { return _this.signUp(event); };\n /** Override for handling the Auth.SignUp API call */\n this.handleSignUp = function (params) { return _this.authSignUp(params); };\n /** Used for header text in sign up component */\n this.headerText = Translations.SIGN_UP_HEADER_TEXT;\n /** Used for the submit button text in sign up component */\n this.submitButtonText = Translations.SIGN_UP_SUBMIT_BUTTON_TEXT;\n /** Used for the submit button text in sign up component */\n this.haveAccountText = Translations.SIGN_UP_HAVE_ACCOUNT_TEXT;\n /** Text used for the sign in hyperlink */\n this.signInText = Translations.SIGN_IN_TEXT;\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Auth state change handler for this component\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n // prettier-ignore\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n // private userInput: string | PhoneNumberInterface;\n this.newFormFields = [];\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.loading = false;\n this.signUpAttributes = {\n username: '',\n password: '',\n attributes: {},\n };\n }\n class_6.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n return function (event) { return (_this.signUpAttributes.username = event.target.value); };\n case 'password':\n return function (event) { return (_this.signUpAttributes.password = event.target.value); };\n case 'email':\n return function (event) { return (_this.signUpAttributes.attributes.email = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n default:\n return function (event) { return (_this.signUpAttributes.attributes[fieldType] = event.target.value); };\n }\n };\n class_6.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_6.prototype.authSignUp = function (params) {\n return __awaiter(this, void 0, void 0, function () {\n var data;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Auth.signUp(params)];\n case 1:\n data = _a.sent();\n if (!data) {\n throw new Error(Translations.SIGN_UP_FAILED);\n }\n return [2 /*return*/, data];\n }\n });\n });\n };\n class_6.prototype.assignPhoneNumberToSignUpAttributes = function () {\n if (this.phoneNumber.phoneNumberValue) {\n try {\n this.signUpAttributes.attributes.phone_number = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n };\n class_6.prototype.assignUserNameAliasToSignUpAttributes = function () {\n switch (this.usernameAlias) {\n case 'email':\n case 'phone_number':\n this.signUpAttributes.username = this.signUpAttributes.attributes[this.usernameAlias];\n break;\n }\n };\n class_6.prototype.assignFormInputToSignUpAttributes = function () {\n this.assignPhoneNumberToSignUpAttributes();\n this.assignUserNameAliasToSignUpAttributes();\n };\n class_6.prototype.validateSignUpAttributes = function () {\n if (!this.signUpAttributes.username) {\n if (this.usernameAlias === UsernameAlias.email) {\n throw new Error(Translations.EMPTY_EMAIL);\n }\n else if (this.usernameAlias === UsernameAlias.phone_number) {\n throw new Error(Translations.EMPTY_PHONE);\n }\n else {\n throw new Error(Translations.EMPTY_USERNAME);\n }\n }\n if (this.signUpAttributes.username.indexOf(' ') >= 0) {\n throw new Error(Translations.USERNAME_REMOVE_WHITESPACE);\n }\n if (this.signUpAttributes.password !== this.signUpAttributes.password.trim()) {\n throw new Error(Translations.PASSWORD_REMOVE_WHITESPACE);\n }\n };\n // TODO: Add validation\n // TODO: Prefix\n class_6.prototype.signUp = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var data, signUpAttrs, error_8;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.signUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n this.assignFormInputToSignUpAttributes();\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, 7, 8]);\n this.validateSignUpAttributes();\n return [4 /*yield*/, this.handleSignUp(this.signUpAttributes)];\n case 2:\n data = _a.sent();\n if (!data.userConfirmed) return [3 /*break*/, 4];\n return [4 /*yield*/, handleSignIn(this.signUpAttributes.username, this.signUpAttributes.password, this.handleAuthStateChange)];\n case 3:\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n signUpAttrs = Object.assign({}, this.signUpAttributes);\n this.handleAuthStateChange(AuthState.ConfirmSignUp, Object.assign(Object.assign({}, data.user), { signUpAttrs: signUpAttrs }));\n _a.label = 5;\n case 5: return [3 /*break*/, 8];\n case 6:\n error_8 = _a.sent();\n dispatchToastHubEvent(error_8);\n return [3 /*break*/, 8];\n case 7:\n this.loading = false;\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n class_6.prototype.buildDefaultFormFields = function () {\n switch (this.usernameAlias) {\n case 'email':\n this.newFormFields = [\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n autocomplete: 'tel-national',\n },\n },\n ];\n break;\n case 'phone_number':\n this.newFormFields = [\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n autocomplete: 'email',\n },\n },\n ];\n break;\n case 'username':\n default:\n this.newFormFields = [\n {\n type: 'username',\n placeholder: I18n.get(Translations.SIGN_UP_USERNAME_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'sign-up-username-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n },\n },\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n },\n },\n ];\n break;\n }\n };\n class_6.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_4 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n _this.setFieldValue(field, _this.signUpAttributes);\n newFields_4.push(newField);\n });\n this.newFormFields = newFields_4;\n }\n };\n class_6.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n if (field.value === undefined) {\n formAttributes.username = '';\n }\n else {\n formAttributes.username = field.value;\n }\n break;\n case 'password':\n if (field.value === undefined) {\n formAttributes.password = '';\n }\n else {\n formAttributes.password = field.value;\n }\n break;\n case 'email':\n formAttributes.attributes.email = field.value;\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n default:\n formAttributes.attributes[field.type] = field.value;\n break;\n }\n };\n class_6.prototype.componentWillLoad = function () {\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_6.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_6.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, testDataPrefix: 'sign-up' }, h(\"div\", { slot: \"subtitle\" }, h(\"slot\", { name: \"header-subtitle\" })), h(\"amplify-auth-fields\", { formFields: this.newFormFields }), h(\"div\", { class: \"sign-up-form-footer\", slot: \"amplify-form-section-footer\" }, h(\"slot\", { name: \"footer\" }, h(\"slot\", { name: \"secondary-footer-content\" }, h(\"span\", null, I18n.get(this.haveAccountText), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); }, \"data-test\": \"sign-up-sign-in-link\" }, I18n.get(this.signInText)))), h(\"slot\", { name: \"primary-footer-content\" }, h(\"amplify-button\", { type: \"submit\", \"data-test\": \"sign-up-create-account-button\", disabled: this.loading }, this.loading ? (h(\"amplify-loading-spinner\", null)) : (h(\"span\", null, I18n.get(this.submitButtonText))))))))));\n };\n Object.defineProperty(class_6, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_6;\n}());\nAmplifySignUp.style = amplifySignUpCss;\nvar logger$2 = new Logger('AmplifyVerifyContact');\nvar AmplifyVerifyContact = /** @class */ (function () {\n function class_7(hostRef) {\n registerInstance(this, hostRef);\n /** Authentication state handler */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n this.loading = false;\n }\n class_7.prototype.handleSubmit = function (event) {\n event.preventDefault();\n this.verifyAttr ? this.submit(this.code) : this.verify(this.contact);\n };\n class_7.prototype.submit = function (code) {\n return __awaiter(this, void 0, void 0, function () {\n var attr, data, error_9;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n attr = this.verifyAttr;\n if (!Auth || typeof Auth.verifyCurrentUserAttributeSubmit !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.verifyCurrentUserAttributeSubmit(attr, code)];\n case 2:\n data = _a.sent();\n logger$2.debug(data);\n this.handleAuthStateChange(AuthState.SignedIn, this.user);\n this.verifyAttr = null;\n return [3 /*break*/, 5];\n case 3:\n error_9 = _a.sent();\n dispatchToastHubEvent(error_9);\n logger$2.error(error_9);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_7.prototype.verify = function (contact) {\n return __awaiter(this, void 0, void 0, function () {\n var data, error_10;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!contact) {\n logger$2.error('Neither Email nor Phone Number selected');\n return [2 /*return*/];\n }\n if (!Auth || typeof Auth.verifyCurrentUserAttribute !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.verifyCurrentUserAttribute(contact)];\n case 2:\n data = _a.sent();\n logger$2.debug(data);\n this.verifyAttr = contact;\n return [3 /*break*/, 5];\n case 3:\n error_10 = _a.sent();\n dispatchToastHubEvent(error_10);\n logger$2.error(error_10);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_7.prototype.handleInputChange = function (event) {\n var inputName = event.target.name;\n if (inputName === 'code') {\n this.code = event.target.value;\n }\n else if (inputName === 'contact') {\n this.contact = event.target.value;\n }\n };\n class_7.prototype.renderSubmit = function () {\n var _this = this;\n return (h(\"div\", null, h(\"amplify-input\", { inputProps: {\n autocomplete: 'off',\n 'data-test': 'verify-contact-code-input',\n }, name: \"code\", placeholder: I18n.get(Translations.CODE_PLACEHOLDER), handleInputChange: function (event) { return _this.handleInputChange(event); } })));\n };\n class_7.prototype.renderVerify = function () {\n var _this = this;\n var user = this.user;\n if (!user) {\n logger$2.debug('No user to verify');\n return null;\n }\n var unverified = user.unverified;\n if (!unverified) {\n logger$2.debug('Unverified variable does not exist on user');\n return null;\n }\n var email = unverified.email, phone_number = unverified.phone_number;\n return (h(\"div\", null, email && (h(\"amplify-radio-button\", { label: I18n.get(Translations.VERIFY_CONTACT_EMAIL_LABEL), key: \"email\", name: \"contact\", value: \"email\", handleInputChange: function (event) { return _this.handleInputChange(event); }, inputProps: {\n 'data-test': 'verify-contact-email-radio',\n } })), phone_number && (h(\"amplify-radio-button\", { label: I18n.get(Translations.VERIFY_CONTACT_PHONE_LABEL), key: \"phone_number\", name: \"contact\", value: \"phone_number\", handleInputChange: function (event) { return _this.handleInputChange(event); }, inputProps: {\n 'data-test': 'verify-contact-phone-number-radio',\n } }))));\n };\n class_7.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { handleSubmit: function (event) { return _this.handleSubmit(event); }, headerText: I18n.get(Translations.VERIFY_CONTACT_HEADER_TEXT), loading: this.loading, secondaryFooterContent: h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignedIn, _this.user); }, \"data-test\": \"verify-contact-skip-link\" }, I18n.get(Translations.SKIP))), submitButtonText: this.verifyAttr\n ? I18n.get(Translations.VERIFY_CONTACT_SUBMIT_LABEL)\n : I18n.get(Translations.VERIFY_CONTACT_VERIFY_LABEL) }, this.verifyAttr ? this.renderSubmit() : this.renderVerify())));\n };\n return class_7;\n}());\nexport { AmplifyConfirmSignIn as amplify_confirm_sign_in, AmplifyConfirmSignUp as amplify_confirm_sign_up, AmplifyForgotPassword as amplify_forgot_password, AmplifyRequireNewPassword as amplify_require_new_password, AmplifySignIn as amplify_sign_in, AmplifySignUp as amplify_sign_up, AmplifyVerifyContact as amplify_verify_contact };\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { Logger, isEmpty } from '@aws-amplify/core';\nimport { A as AuthState, C as ChallengeName, U as UsernameAlias } from './auth-types-78df304e.js';\nimport { Auth, CognitoUser } from '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nimport { N as NO_AUTH_MODULE_FOUND } from './constants-c8ecaa24.js';\nimport { a as dispatchToastHubEvent } from './helpers-14fcb50c.js';\nvar logger = new Logger('auth-helpers');\nfunction checkContact(user, handleAuthStateChange) {\n return __awaiter(this, void 0, void 0, function () {\n var data, newUser, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!Auth || typeof Auth.verifiedContact !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n // If `user` is a federated user, we shouldn't call `verifiedContact`\n // since `user` isn't `CognitoUser`\n if (!isCognitoUser(user)) {\n handleAuthStateChange(AuthState.SignedIn, user);\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Auth.verifiedContact(user)];\n case 2:\n data = _a.sent();\n if (!isEmpty(data.verified) || isEmpty(data.unverified)) {\n handleAuthStateChange(AuthState.SignedIn, user);\n }\n else {\n newUser = Object.assign(user, data);\n handleAuthStateChange(AuthState.VerifyContact, newUser);\n }\n return [3 /*break*/, 4];\n case 3:\n error_1 = _a.sent();\n dispatchToastHubEvent(error_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n}\nvar handleSignIn = function (username, password, handleAuthStateChange, usernameAlias) { return __awaiter(void 0, void 0, void 0, function () {\n var user, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!Auth || typeof Auth.signIn !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 9, , 10]);\n return [4 /*yield*/, Auth.signIn(username, password)];\n case 2:\n user = _a.sent();\n logger.debug(user);\n if (!(user.challengeName === ChallengeName.SMSMFA ||\n user.challengeName === ChallengeName.SoftwareTokenMFA)) return [3 /*break*/, 3];\n logger.debug('confirm user with ' + user.challengeName);\n handleAuthStateChange(AuthState.ConfirmSignIn, user);\n return [3 /*break*/, 8];\n case 3:\n if (!(user.challengeName === ChallengeName.NewPasswordRequired)) return [3 /*break*/, 4];\n logger.debug('require new password', user.challengeParam);\n handleAuthStateChange(AuthState.ResetPassword, user);\n return [3 /*break*/, 8];\n case 4:\n if (!(user.challengeName === ChallengeName.MFASetup)) return [3 /*break*/, 5];\n logger.debug('TOTP setup', user.challengeParam);\n handleAuthStateChange(AuthState.TOTPSetup, user);\n return [3 /*break*/, 8];\n case 5:\n if (!(user.challengeName === ChallengeName.CustomChallenge &&\n user.challengeParam &&\n user.challengeParam.trigger === 'true')) return [3 /*break*/, 6];\n logger.debug('custom challenge', user.challengeParam);\n handleAuthStateChange(AuthState.CustomConfirmSignIn, user);\n return [3 /*break*/, 8];\n case 6: return [4 /*yield*/, checkContact(user, handleAuthStateChange)];\n case 7:\n _a.sent();\n _a.label = 8;\n case 8: return [3 /*break*/, 10];\n case 9:\n error_2 = _a.sent();\n if (error_2.code === 'UserNotConfirmedException') {\n logger.debug('the user is not confirmed');\n handleAuthStateChange(AuthState.ConfirmSignUp, { username: username });\n }\n else if (error_2.code === 'PasswordResetRequiredException') {\n logger.debug('the user requires a new password');\n handleAuthStateChange(AuthState.ForgotPassword, { username: username });\n }\n else if (error_2.code === 'InvalidParameterException' && password === '') {\n logger.debug('Password cannot be empty');\n error_2.message = Translations.EMPTY_PASSWORD;\n }\n else if (error_2.message === Translations.EMPTY_USERNAME) {\n if (usernameAlias === UsernameAlias.email) {\n error_2.message = Translations.EMPTY_EMAIL;\n }\n if (usernameAlias === UsernameAlias.phone_number) {\n error_2.message = Translations.EMPTY_PHONE;\n }\n }\n dispatchToastHubEvent(error_2);\n return [3 /*break*/, 10];\n case 10: return [2 /*return*/];\n }\n });\n}); };\nvar isCognitoUser = function (user) {\n return user instanceof CognitoUser;\n};\nexport { checkContact as c, handleSignIn as h };\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","__spreadArrays","s","i","il","arguments","r","Array","k","a","j","jl","AmplifyConfirmSignIn","class_1","hostRef","_this","registerInstance","handleSubmit","event","confirm","headerText","Translations","submitButtonText","handleAuthStateChange","dispatchAuthStateChangeEvent","defaultFormFields","type","required","handleInputChange","handleCodeChange","formFields","mfaOption","MfaOption","loading","prototype","componentWillLoad","setup","userHandler","user","ChallengeName","constructedFormFieldOptions","constructFormFieldOptions","code","target","mfaType","error_1","_a","preventDefault","Auth","Error","NO_AUTH_MODULE_FOUND","checkContact","dispatchToastHubEvent","content","undefined","forEach","formField","Object","assign","render","h","Host","I18n","secondaryFooterContent","variant","onClick","AuthState","defineProperty","get","enumerable","configurable","AmplifyConfirmSignUp","class_2","confirmSignUp","usernameAlias","newFormFields","phoneNumber","countryDialCodeValue","COUNTRY_DIAL_CODE_DEFAULT","phoneNumberValue","formFieldsHandler","buildFormFields","userInput","username","_signUpAttrs","signUpAttrs","checkUsernameAlias","buildDefaultFormFields","handleFormFieldInputChange","disabled","inputProps","autocomplete","placeholder","hint","resendConfirmCode","newFields_1","field","newField","isHintValid","handleFormFieldInputWithCallback","fieldType","handlePhoneNumberChange","setFieldValue","dialCode","fnToCall","cb","bind","getUsername","composePhoneNumberInput","error_2","trim","error_3","password","handleSignIn","logger","Logger","AmplifyForgotPassword","class_3","sendButtonText","handleSend","send","submit","delivery","forgotPasswordAttrs","newFields_2","formAttributes","data","error_4","error","debug","CodeDeliveryDetails","error_5","_b","submitFn","testDataPrefix","logger$1","ConsoleLogger","AmplifyRequireNewPassword","class_4","completeNewPassword","AuthFormField","handlePasswordChange","requiredAttributes","setCurrentUser","handleRequiredAttributeInputChange","attribute","formatPhoneNumber","error_6","userRequiredAttributes","requiredAttributesMap_1","currentUser","challengeParam","getRequiredAttributesMap","name","PHONE_SUFFIX","composedInput","err","error_7","challengeName","AmplifySignIn","class_5","signIn","hideSignUp","signInAttributes","formFieldInputs","newFields_3","slot","federated","isEmpty","class","style","AmplifySignUp","class_6","signUp","handleSignUp","params","authSignUp","haveAccountText","signInText","signUpAttributes","attributes","email","assignPhoneNumberToSignUpAttributes","phone_number","assignUserNameAliasToSignUpAttributes","assignFormInputToSignUpAttributes","validateSignUpAttributes","UsernameAlias","indexOf","error_8","userConfirmed","newFields_4","logger$2","AmplifyVerifyContact","class_7","verifyAttr","verify","contact","attr","error_9","error_10","inputName","renderSubmit","renderVerify","unverified","key","newUser","isCognitoUser","verified","trigger","message","CognitoUser"],"sourceRoot":""}