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pack://_N_E/./node_modules/lodash/_baseSlice.js","webpack://_N_E/./node_modules/lodash/_castSlice.js","webpack://_N_E/./node_modules/lodash/_createCaseFirst.js","webpack://_N_E/./node_modules/lodash/_hasUnicode.js","webpack://_N_E/./node_modules/lodash/_stringToArray.js","webpack://_N_E/./node_modules/lodash/_unicodeToArray.js","webpack://_N_E/./node_modules/lodash/capitalize.js","webpack://_N_E/./node_modules/lodash/upperFirst.js","webpack://_N_E/./src/components/FormBuilder/buildFormBuilderFormField.ts","webpack://_N_E/./src/components/FormBuilder/buildTranslatedErrorMessageByErrorId.ts","webpack://_N_E/./src/components/Login/EmailVerificationForm.tsx","webpack://_N_E/./src/components/Login/CompleteSignupForm.tsx","webpack://_N_E/./src/components/Login/ResendEmailSection.tsx","webpack://_N_E/./types/ErrorMessageId.ts","webpack://_N_E/./src/components/Login/CompleteSignupForm.module.scss","webpack://_N_E/./src/components/Login/login.module.scss"],"sourcesContent":["/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nmodule.exports = asciiToArray;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice');\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nmodule.exports = castSlice;\n","var castSlice = require('./_castSlice'),\n hasUnicode = require('./_hasUnicode'),\n stringToArray = require('./_stringToArray'),\n toString = require('./toString');\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nmodule.exports = createCaseFirst;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n","var asciiToArray = require('./_asciiToArray'),\n hasUnicode = require('./_hasUnicode'),\n unicodeToArray = require('./_unicodeToArray');\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nmodule.exports = stringToArray;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nmodule.exports = unicodeToArray;\n","var toString = require('./toString'),\n upperFirst = require('./upperFirst');\n\n/**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\nfunction capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n}\n\nmodule.exports = capitalize;\n","var createCaseFirst = require('./_createCaseFirst');\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nmodule.exports = upperFirst;\n","import capitalize from 'lodash/capitalize';\nimport { Translate } from 'next-translate';\n\nimport { FormBuilderFormField } from './FormBuilderTypes';\n\nimport FormField, { FormFieldType } from 'types/FormField';\n\n/**\n * Transform FormField to be FormBuilderFormField\n *\n * FormField and FormBuilderFormField are the same except, FormBuilderFormField is not tied to errorId and translationId\n * - Previously FormBuilder was tied to common.json, next-translate.\n * - and it's also tied to ErrorMessageId\n * - and the `label` is also less flexible because it's tied to `field` value\n *\n * This function help to transform FormField to FormBuilderFormField for common use case.\n * But when we need a more flexible use case, we can use FormBuilderFormField directly. Without using this helper function\n *\n * check ./FormBuilderTypes.ts for more info\n *\n * Note that this function expect the `t` translate function to be used with `common.json`. And expect `form.$field` and `validation.$errorId` to exist.\n *\n * @param {FormField} formField\n * @returns {FormBuilderFormField} formBuilderFormField\n */\nconst buildFormBuilderFormField = (formField: FormField, t: Translate): FormBuilderFormField => {\n return {\n ...formField,\n ...(formField.rules && {\n rules: formField.rules.map((rule) => ({\n type: rule.type,\n value: rule.value,\n errorMessage: t(`common:validation.${rule.errorId}`, {\n field: capitalize(formField.field),\n ...rule.errorExtraParams,\n }),\n })),\n }),\n ...(formField.label && {\n label:\n formField.type === FormFieldType.Checkbox ? formField.label : t(`form.${formField.label}`),\n }),\n ...(formField.defaultValue && { defaultValue: formField.defaultValue }),\n ...(formField.placeholder && { placeholder: formField.placeholder }),\n };\n};\n\nexport default buildFormBuilderFormField;\n","import capitalize from 'lodash/capitalize';\nimport { Translate } from 'next-translate';\n\nimport ErrorMessageId from 'types/ErrorMessageId';\n\nconst DEFAULT_ERROR_ID = ErrorMessageId.InvalidField;\n\nconst buildTranslatedErrorMessageByErrorId = (\n errorId: ErrorMessageId,\n fieldName: string,\n t: Translate,\n extraParams?: Record<string, unknown>,\n) => {\n if (Object.values(ErrorMessageId).includes(errorId)) {\n return t(`common:validation.${errorId}`, { field: capitalize(fieldName), ...extraParams });\n }\n return t(`common:validation.${DEFAULT_ERROR_ID}`, { field: capitalize(fieldName) });\n};\n\nexport default buildTranslatedErrorMessageByErrorId;\n","import { useState } from 'react';\n\nimport Trans from 'next-translate/Trans';\nimport useTranslation from 'next-translate/useTranslation';\nimport { useSWRConfig } from 'swr';\n\nimport buildTranslatedErrorMessageByErrorId from '../FormBuilder/buildTranslatedErrorMessageByErrorId';\nimport FormBuilder from '../FormBuilder/FormBuilder';\nimport { FormBuilderFormField } from '../FormBuilder/FormBuilderTypes';\n\nimport styles from './CompleteSignupForm.module.scss';\nimport ResendEmailSection from './ResendEmailSection';\n\nimport { completeSignup, requestVerificationCode } from '@/utils/auth/api';\nimport { makeUserProfileUrl } from '@/utils/auth/apiPaths';\nimport { logFormSubmission } from '@/utils/eventLogger';\nimport ErrorMessageId from 'types/ErrorMessageId';\nimport { RuleType } from 'types/FieldRule';\nimport { FormFieldType } from 'types/FormField';\n\ntype EmailVerificationFormProps = {\n emailFormField: FormBuilderFormField;\n};\ntype EmailFormData = {\n email: string;\n};\n\ntype VerificationCodeFormData = {\n code: string;\n};\n\nconst EmailVerificationForm = ({ emailFormField }: EmailVerificationFormProps) => {\n const [isSubmitted, setIsSubmitted] = useState(false);\n const { mutate } = useSWRConfig();\n const [email, setEmail] = useState<string>();\n const { t } = useTranslation('common');\n const [forceRerenderKey, setForceRerenderKey] = useState(0);\n\n const onEmailSubmitted = (data: EmailFormData) => {\n logFormSubmission('email_verification');\n requestVerificationCode(data.email);\n setIsSubmitted(true);\n setEmail(data.email);\n };\n\n const verificationCodeFormField: FormBuilderFormField = {\n field: 'code',\n type: FormFieldType.Number,\n placeholder: t('form.code'),\n rules: [\n {\n type: RuleType.Required,\n value: true,\n errorMessage: buildTranslatedErrorMessageByErrorId(ErrorMessageId.RequiredField, 'code', t),\n },\n ],\n };\n\n const onVerificationCodeSubmitted = (data: VerificationCodeFormData) => {\n logFormSubmission('verification_code');\n return completeSignup({ email, verificationCode: data.code.toString() })\n .then(() => {\n // mutate the cache version of users/profile\n mutate(makeUserProfileUrl());\n })\n .catch(async (err) => {\n const result = { errors: { code: err?.message } };\n return result;\n });\n };\n\n const onResendEmailRequested = () => {\n requestVerificationCode(email);\n setForceRerenderKey((preVal) => preVal + 1);\n };\n\n return (\n <div className={styles.container}>\n <h2 className={styles.title}>{t('email-verification.email-verification')}</h2>\n {isSubmitted ? (\n <>\n <p className={styles.emailSent}>\n <Trans\n i18nKey=\"common:email-verification.email-sent\"\n values={{ email }}\n components={{\n strong: <strong className={styles.strong} />,\n }}\n />\n </p>\n <FormBuilder\n formFields={[verificationCodeFormField]}\n onSubmit={onVerificationCodeSubmitted}\n actionText={t('common:email-verification.verify-code')}\n />\n\n <ResendEmailSection\n key={forceRerenderKey}\n onResendButtonClicked={onResendEmailRequested}\n />\n </>\n ) : (\n <FormBuilder\n formFields={[emailFormField]}\n onSubmit={onEmailSubmitted}\n actionText={t('submit')}\n />\n )}\n </div>\n );\n};\n\nexport default EmailVerificationForm;\n","import useTranslation from 'next-translate/useTranslation';\nimport { useSWRConfig } from 'swr';\n\nimport buildFormBuilderFormField from '../FormBuilder/buildFormBuilderFormField';\nimport FormBuilder from '../FormBuilder/FormBuilder';\n\nimport styles from './CompleteSignupForm.module.scss';\nimport EmailVerificationForm from './EmailVerificationForm';\n\nimport { completeSignup } from '@/utils/auth/api';\nimport { makeUserProfileUrl } from '@/utils/auth/apiPaths';\nimport { logFormSubmission } from '@/utils/eventLogger';\nimport FormField from 'types/FormField';\n\ntype CompleteSignupFormProps = {\n requiredFields: FormField[];\n};\n\n/**\n * If users' email is empty, return email verification form\n * otherwise, return normal user information form\n */\n\nconst CompleteSignupForm: React.FC<CompleteSignupFormProps> = ({ requiredFields }) => {\n const { mutate } = useSWRConfig();\n const { t } = useTranslation('common');\n\n const onSubmit = (data) => {\n logFormSubmission('complete_signUp');\n completeSignup(data).then(() => {\n // mutate the cache version of users/profile\n mutate(makeUserProfileUrl());\n });\n };\n\n const emailFormField = requiredFields.find((field) => field.field === 'email');\n const isEmailRequired = !!emailFormField;\n if (isEmailRequired) {\n return (\n <EmailVerificationForm\n emailFormField={buildFormBuilderFormField(\n { ...emailFormField, placeholder: t(`form.email`) },\n t,\n )}\n />\n );\n }\n\n return (\n <div className={styles.container}>\n <h2 className={styles.title}>{t('complete-sign-up')}</h2>\n <FormBuilder\n formFields={requiredFields.map((field) =>\n buildFormBuilderFormField({ ...field, placeholder: t(`form.${field.field}`) }, t),\n )}\n onSubmit={onSubmit}\n actionText={t('submit')}\n />\n </div>\n );\n};\n\nexport default CompleteSignupForm;\n","import { useEffect, useState } from 'react';\n\nimport useTranslation from 'next-translate/useTranslation';\n\nimport Button, { ButtonVariant } from '../dls/Button/Button';\n\nimport styles from './login.module.scss';\n\ntype ResendEmailSectionProps = {\n onResendButtonClicked: () => void;\n initialRemainingTimeInSeconds?: number;\n};\n\nconst ResendEmailSection = ({\n onResendButtonClicked,\n initialRemainingTimeInSeconds = 60,\n}: ResendEmailSectionProps) => {\n const [remainingTimeInSeconds, setRemainingTimeInSeconds] = useState(\n initialRemainingTimeInSeconds,\n );\n const { t } = useTranslation('common');\n\n const disabled = remainingTimeInSeconds > 0;\n\n useEffect(() => {\n const interval = setInterval(() => {\n setRemainingTimeInSeconds((prevRemainingTime) => {\n if (prevRemainingTime > 0) {\n return prevRemainingTime - 1;\n }\n return prevRemainingTime;\n });\n }, 1000);\n\n return () => clearInterval(interval);\n }, []);\n\n return (\n <div className={styles.resendEmailSection}>\n <div>{t('email-verification.check-spam')}</div>\n <Button\n className={styles.resendButton}\n isDisabled={disabled}\n variant={ButtonVariant.Outlined}\n onClick={onResendButtonClicked}\n >\n {disabled\n ? t('email-verification.resend-email-in', {\n remainingTime: remainingTimeInSeconds,\n })\n : t('email-verification.resend-email')}\n </Button>\n </div>\n );\n};\n\nexport default ResendEmailSection;\n","enum ErrorMessageId {\n InvalidEmail = 'invalid-email',\n RequiredField = 'required-field',\n InvalidField = 'invalid-field',\n MaximumLength = 'maximum-length',\n MinimumLength = 'minimum-length',\n}\n\nexport default ErrorMessageId;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"CompleteSignupForm_container__WWUVf\",\"title\":\"CompleteSignupForm_title__nNTvk\",\"strong\":\"CompleteSignupForm_strong__XIUxt\",\"emailSent\":\"CompleteSignupForm_emailSent__Nlle8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"outerContainer\":\"login_outerContainer__A5dFD\",\"innerContainer\":\"login_innerContainer__zmY_3\",\"cta\":\"login_cta__wFjiE\",\"title\":\"login_title__2X_RY\",\"loginButton\":\"login_loginButton__dummI\",\"googleButton\":\"login_googleButton__C3bbp\",\"facebookButton\":\"login_facebookButton__fBPjs\",\"emailSentContainer\":\"login_emailSentContainer__WuCgZ\",\"paragraphContainer\":\"login_paragraphContainer__pVbiZ\",\"emailContainer\":\"login_emailContainer___pCrO\",\"verificationCode\":\"login_verificationCode__7ykje\",\"resendEmailSection\":\"login_resendEmailSection__QpqqL\",\"resendButton\":\"login_resendButton__jWH7R\",\"privacyText\":\"login_privacyText__n_Ss5\",\"bold\":\"login_bold__MqfjF\"};"],"names":["module","exports","string","split","array","start","end","index","length","result","Array","baseSlice","undefined","castSlice","hasUnicode","stringToArray","toString","methodName","strSymbols","chr","charAt","trailing","join","slice","reHasUnicode","RegExp","test","asciiToArray","unicodeToArray","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsOptVar","rsSeq","rsSymbol","reUnicode","match","upperFirst","toLowerCase","createCaseFirst","formField","t","rules","map","rule","type","value","errorMessage","errorId","field","capitalize","errorExtraParams","label","FormFieldType","defaultValue","placeholder","DEFAULT_ERROR_ID","ErrorMessageId","fieldName","extraParams","Object","values","includes","emailFormField","useState","isSubmitted","setIsSubmitted","useSWRConfig","mutate","email","setEmail","useTranslation","forceRerenderKey","setForceRerenderKey","verificationCodeFormField","RuleType","buildTranslatedErrorMessageByErrorId","div","className","styles","h2","p","Trans","i18nKey","components","strong","FormBuilder","formFields","onSubmit","data","logFormSubmission","completeSignup","verificationCode","code","then","makeUserProfileUrl","catch","err","errors","message","actionText","ResendEmailSection","onResendButtonClicked","requestVerificationCode","preVal","requiredFields","find","EmailVerificationForm","buildFormBuilderFormField","initialRemainingTimeInSeconds","remainingTimeInSeconds","setRemainingTimeInSeconds","disabled","useEffect","interval","setInterval","prevRemainingTime","clearInterval","Button","isDisabled","variant","ButtonVariant","onClick","remainingTime"],"sourceRoot":""}