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TD,GACC,gBAAC,IAAa,SACH,CACP1K,OAAO,OAAc0K,GAAuBhH,c,gHCzRjD,MAAMtE,EAAsC,EACjDkM,uBAAAA,EACAC,SAAAA,EACAC,iBAAAA,M,cAEA,MAAM,kBAAEC,EAAiB,sBAAEC,IACzB,UACI,OAAE5K,EAA6B,cAAE6K,IACrC,UAEI5J,EAAqB,QAAV,EAAAjB,MAAAA,OAAM,EAANA,EAAQ8K,UAAE,eAAE7J,SAS7B,OAPA,IAAAwB,YAAU,UACsBO,IAA1B4H,GAEFC,EAAc,gCAAiCD,KAEhD,CAACA,IAGF,gBAAC,KAA0B,KAEzB,gBAAC,KAAuB,CACtBG,SAA2B,QAAjB,EAAS,QAAT,EAAA/K,EAAO8K,UAAE,eAAEjH,cAAM,eAAEmH,qBAE7B,gBAAC,IAAe,CACdpM,KAAK,SACLqM,wBAAyBN,EACzBD,iBAAkBA,KAItB,gBAAC,KAAgC,KAC/B,gBAAC,MAAa,CAAC/K,KAAM,YAGvB,gBAAC,KAAuB,CACtBoL,SAAgC,QAAtB,EAAS,QAAT,EAAA/K,EAAO8K,UAAE,eAAEI,mBAAW,eAAEF,qBAElC,gBAAC,IAAe,CACdpM,KAAK,cACLqM,wBAAyBN,IAE3B,gBAAC,IAAY,CACX1J,SAAUA,EACVuJ,uBAAwBA,EACxBC,SAAUA","sources":["webpack://leadsbridge/./src/features/SignupSurvey/FormInner.tsx","webpack://leadsbridge/./src/features/nbee/BridgeChooserForm/FormInner.tsx","webpack://leadsbridge/./src/features/nbee/EmailReceipt/FormInner.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/FormInner.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/FormInner.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/FormInner.tsx"],"sourcesContent":["import React from 'react'\nimport { FormikInputField } from '@components/Formik/FormikInputField'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { useFastAppSurveyIndustries } from '@app/api/fastAppSurveyIndustries'\nimport { FormikInputSelect } from '@components/Formik/FormikInputSelect'\nimport styled from 'styled-components'\nimport { FormikInputCheckbox } from '@components/Formik/FormikInputCheckbox'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { useFormikContext } from 'formik'\nimport { SignupSurveyFormValues } from 'SignupSurvey'\nimport { Link, useLocation } from 'react-router-dom'\nimport { makeLoginUrl } from '@features/SignupSurvey/formUtils'\n\nconst Wrapper = styled.div`\n max-width: 450px;\n margin: 0 auto 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n`\n\nconst TermsText = styled.div`\n a {\n &:hover {\n text-decoration: underline;\n }\n }\n`\n\nexport const FormInner: React.VFC = () => {\n const { t } = useTranslation()\n const location = useLocation()\n const getIndustries = useFastAppSurveyIndustries()\n const { isSubmitting } = useFormikContext<SignupSurveyFormValues>()\n\n return (\n <Wrapper>\n <FormikInputField\n name='email'\n type='email'\n label={t('auth.signupSurvey.labelEmail')}\n $fluid\n $hasMargin\n />\n\n <FormikInputField name='phone' type='tel' label='Phone' $fluid />\n\n <FormikInputSelect\n $options={getIndustries.data || []}\n $loading={getIndustries.isLoading}\n disabled={Boolean(getIndustries.error)}\n $optionsLabel={\n getIndustries.error\n ? 'Unable to retrieve industries'\n : t('auth.signupSurvey.industryLabel')\n }\n name={'industry'}\n $label={'Industry'}\n $hasMargin\n />\n\n <div>\n <FormikInputCheckbox name='privacyConsent'>\n <TermsText>\n <Trans\n ns={'all'}\n i18nKey={'auth.signup.termsAndCondition'}\n components={{\n a: <a />,\n }}\n />\n </TermsText>\n </FormikInputCheckbox>\n </div>\n\n <Button\n type={'submit'}\n $variant={'primary'}\n $loading={isSubmitting}\n disabled={isSubmitting}\n >\n {t('auth.signupSurvey.submitCta')}\n </Button>\n\n <div\n style={{\n textAlign: 'center',\n }}\n >\n {t('auth.signin.alreadyHaveAnAccount')}{' '}\n <Link to={makeLoginUrl(location.pathname)}>\n {t('auth.signin.ctaLoginViaEmail')}\n </Link>\n </div>\n </Wrapper>\n )\n}\n","import React from 'react'\nimport {\n SimpleBridgeBuilderWrapper,\n SimpleBridgeBuilderCard,\n SimpleBridgeBuilderCardSeparator,\n} from '../SimpleBridgeBuilderForm/styled'\nimport { AppSelector } from '@features/nbee/SimpleBridgeBuilderForm/fields/AppSelector'\nimport { useTranslation } from 'react-i18next'\nimport { AiOutlinePlus } from 'react-icons/ai'\nimport { useHandleAppsCompatibility } from '@features/nbee/SimpleBridgeBuilderForm/appsCompatibility/useHandleAppsCompatibility'\n\nexport const FormInner: React.FC = () => {\n const { t } = useTranslation()\n const { appsAreCompatible } = useHandleAppsCompatibility()\n\n return (\n <SimpleBridgeBuilderWrapper>\n {/* SOURCE */}\n <SimpleBridgeBuilderCard>\n <h1>{t('nbee.bridgeBuilder.sourceTitle')}</h1>\n <h4>{t('nbee.bridgeBuilder.sourceSubTitle')}</h4>\n <AppSelector type='source' />\n </SimpleBridgeBuilderCard>\n\n {/* SEPARATOR */}\n <SimpleBridgeBuilderCardSeparator>\n <AiOutlinePlus size={'1.5rem'} />\n </SimpleBridgeBuilderCardSeparator>\n\n {/* DESTINATION */}\n <SimpleBridgeBuilderCard>\n <h1>{t('nbee.bridgeBuilder.destinationTitle')}</h1>\n <h4>{t('nbee.bridgeBuilder.destinationSubTitle')}</h4>\n <AppSelector type='destination' />\n </SimpleBridgeBuilderCard>\n </SimpleBridgeBuilderWrapper>\n )\n}\n","import React, { useEffect } from 'react'\nimport { FieldToggleStatus } from '@features/nbee/EmailReceipt/FieldToggleStatus'\nimport { FieldRecipients } from '@features/nbee/EmailReceipt/FieldRecipients'\nimport { FieldSubject } from '@features/nbee/EmailReceipt/FieldSubject'\nimport { Form, useFormikContext } from 'formik'\nimport { EmailReceiptStyled } from '@features/nbee/EmailReceipt/styled'\nimport { EmailReceiptSettings, BridgeFormValues } from 'Nbee'\nimport { useEmailReceiptValidation } from '@features/nbee/EmailReceipt/useEmailReceiptValidation'\n\nconst { SettingsFieldsContainer, Wrapper } = EmailReceiptStyled\n\ninterface Props {\n handleSubmit: (values: EmailReceiptSettings) => void\n isBridgeEnabled?: boolean\n initialValues: EmailReceiptSettings\n}\n\nexport const FormInner: React.VFC<Props> = ({\n handleSubmit,\n isBridgeEnabled,\n initialValues,\n}) => {\n const { values, setValues } = useFormikContext<BridgeFormValues>()\n const validationErrors = useEmailReceiptValidation(values)\n\n return (\n <Wrapper>\n <FieldToggleStatus\n forcedDisabled={isBridgeEnabled}\n onStatusChange={(isActive) => {\n const newEmailReceiptSettings = {\n ...initialValues,\n active: isActive,\n }\n\n const updatedValues = {\n ...values,\n settings: {\n ...values.settings,\n emailReceipt: newEmailReceiptSettings,\n },\n }\n\n setValues(updatedValues, false)\n handleSubmit(newEmailReceiptSettings)\n }}\n />\n\n {initialValues.active ? (\n <SettingsFieldsContainer>\n <FieldSubject\n disabled={isBridgeEnabled}\n error={validationErrors.subject}\n />\n <FieldRecipients\n disabled={isBridgeEnabled}\n error={validationErrors.recipients}\n />\n </SettingsFieldsContainer>\n ) : null}\n </Wrapper>\n )\n}\n","import React, { useContext, useEffect, useMemo, useState } from 'react'\nimport { FieldMappingRow } from './FieldMappingRow/FieldMappingRow'\nimport { SelectValueMulti } from '@components/Form/MultiCreatableCustom'\nimport Fuse from 'fuse.js'\nimport { useField, useFormikContext } from 'formik'\nimport { MappedField, BridgeFormValues, MappedFieldType } from 'Nbee'\nimport { ApiBridgeFieldsList, ApiUserModuleItem } from 'BackendApi'\nimport { PanelPopupContext } from '@components/Panel'\nimport { FieldMappingEmptyState } from '@features/nbee/FieldsMappingForm/FieldMappingEmptyState'\nimport { getSortedFields, sortByFieldLabel } from './sortingUtils'\nimport { PopupContentNoSelectOptions } from '@features/nbee/FieldsMappingForm/popupContent/PopupContentNoSelectOptions'\nimport { isFieldMapped } from '@features/nbee/FieldsMappingForm/utils'\nimport {\n closeAlertMessage,\n sendAlertMessage,\n} from '@app/store/actions/ApplicationConfigurationActions'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { useTranslation } from 'react-i18next'\nimport { useGetFormulasSchema } from '@app/api/getFormulasSchema'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { useHistory } from 'react-router-dom'\nimport { useUpdateBridgeToPricing } from '@features/nbee/utils'\n\ninterface Props {\n bridgeId: number\n filterText: string\n showAllFields: boolean\n onResetFilterRequest: () => void\n allBridgeFields?: ApiBridgeFieldsList\n formulaUserModule?: ApiUserModuleItem | undefined\n totalFieldsMapped: number\n maxFields?: number\n showWelcomeMessage?: boolean\n sourceLogoUri?: string\n}\n\nexport const FormInner: React.FC<Props> = ({\n filterText,\n showAllFields,\n onResetFilterRequest,\n allBridgeFields,\n bridgeId,\n formulaUserModule,\n totalFieldsMapped,\n maxFields,\n showWelcomeMessage,\n sourceLogoUri,\n}) => {\n const dispatch = useAppDispatch()\n const history = useHistory()\n const { t } = useTranslation()\n const panelContext = useContext(PanelPopupContext)\n const [field, meta, helpers] = useField<MappedField[]>('fieldsMapping')\n\n const { data: formulasSchemaData } = useGetFormulasSchema(`${bridgeId}`)\n const [redirectToPricing, setRedirectToPricing] = useState(false)\n\n const updateBridgeToPricing = useUpdateBridgeToPricing(bridgeId)\n\n const foundSomeAutoMapped = field.value.some(\n (f) => isFieldMapped(f) && f.mappingType === 'auto'\n )\n\n const { isValid, setFieldValue } = useFormikContext<BridgeFormValues>()\n\n const unmapAllFields = () => {\n const updatedArray = field.value.map((item) => {\n return { ...item, sourceFieldId: undefined, mapping: [] }\n })\n helpers.setValue(updatedArray)\n }\n\n const handleRedirectToPricing = (redirect: boolean) => {\n setRedirectToPricing(redirect)\n }\n\n const handleCloseAlert = () => {\n setRedirectToPricing(false)\n dispatch(closeAlertMessage())\n }\n\n useEffect(() => {\n if (redirectToPricing) {\n dispatch(\n sendAlertMessage({\n isDismissable: true,\n onClose: handleCloseAlert,\n message: t('nbee.fieldsMapping.fieldMappingAlertFormulaTitle'),\n useTranslation: true,\n buttons: (\n <Button\n onClick={() => {\n setRedirectToPricing(false)\n updateBridgeToPricing()\n }}\n $variant={'primary'}\n $size={'standard'}\n >\n {t('nbee.checkCompatibility.updatePlanCta')}\n </Button>\n ),\n })\n )\n } else {\n setRedirectToPricing(false)\n dispatch(closeAlertMessage())\n }\n }, [redirectToPricing])\n\n useEffect(() => {\n if (maxFields !== undefined && totalFieldsMapped > maxFields) {\n dispatch(\n sendAlertMessage({\n isDismissable: false,\n message: t('nbee.fieldsMapping.fieldMappingAlertTitle'),\n useTranslation: true,\n transValue: maxFields,\n buttons: (\n <div style={{ display: 'flex', gap: '3rem' }}>\n <Button\n onClick={() => {\n updateBridgeToPricing()\n }}\n $variant={'primary'}\n $size={'small'}\n >\n {t('nbee.checkCompatibility.updatePlanCta')}\n </Button>\n <Button\n onClick={() => unmapAllFields()}\n $variant={'action'}\n $size={'small'}\n >\n Unmap All Fields\n </Button>\n </div>\n ),\n })\n )\n } else if (maxFields !== undefined && totalFieldsMapped <= maxFields) {\n dispatch(closeAlertMessage())\n }\n }, [totalFieldsMapped])\n\n // this is to scroll to the first error found on the page\n // this will be possibile since InputFeedback component has a `data-error` attribute\n /* useEffect(() => {\n const fieldWithError = document.querySelector(\"[data-error='true']\")\n if (fieldWithError) {\n fieldWithError.scrollIntoView({\n behavior: 'smooth',\n block: 'end',\n inline: 'nearest',\n })\n }\n }, [isValid]) */\n\n const formFields = field.value\n const sourceFields =\n allBridgeFields?.source.sort((a, b) => a.label.localeCompare(b.label)) || []\n\n const selectOptions: SelectValueMulti[] = useMemo(() => {\n const sourceFieldOptions = sourceFields.map((field) => ({\n value: field.id,\n lastValue: field.lastValue,\n label: field.label,\n fieldType: 'source' as MappedFieldType,\n isFormula: false,\n }))\n return [...sourceFieldOptions]\n }, [sourceFields, meta.touched])\n\n // Since we also need to perform search against selected value, we can compute it\n // and prepare a computedMappedString which contains the \"label\" of the selected source field\n // or the text manually added\n const formFieldsWithComputedMappedValues = formFields\n .map((field) => {\n // Attempt to find the first mapping with a sourceFieldId and use its label, or fall back to destinationText if not found\n const firstMappingWithSource = field.mapping.find((m) => m.sourceFieldId)\n const sourceFieldLabel = firstMappingWithSource\n ? sourceFields.find(\n (sf) => sf.id === firstMappingWithSource.sourceFieldId\n )?.label\n : ''\n\n return {\n ...field,\n computedMappedString:\n sourceFieldLabel || field.mapping.find((m) => m.text)?.text || '',\n }\n })\n .sort(sortByFieldLabel)\n\n const fuzzySearch = new Fuse(formFieldsWithComputedMappedValues, {\n isCaseSensitive: false,\n shouldSort: true,\n findAllMatches: true,\n includeMatches: true,\n includeScore: true,\n threshold: 0.25, // 0 for exact match of letter and location, 1 to match everything\n distance: 500,\n keys: ['destinationFieldLabel', 'computedMappedString'],\n })\n\n const filteredDestinationFieldsByText = filterText\n ? fuzzySearch.search(filterText).map(({ item }) => item)\n : formFields\n\n const filteredDestinationFieldsByState = showAllFields\n ? filteredDestinationFieldsByText\n : filteredDestinationFieldsByText.filter((mappedField) =>\n mappedField.mapping.some(\n (mappingItem) =>\n mappingItem.text || mappingItem.sourceFieldId || mappingItem.formula\n )\n )\n\n // we memoize the sorting so we won't loose order while mapping by moving fields up and down\n const fieldsToRender = useMemo(\n () => getSortedFields(filteredDestinationFieldsByState),\n [filterText, showAllFields, formFields.length]\n )\n\n const noSelectOptions = selectOptions.length < 1\n\n useEffect(() => {\n if (noSelectOptions) {\n if (panelContext && panelContext.sendPopup) {\n panelContext.sendPopup({\n content: <PopupContentNoSelectOptions />,\n dismissable: true,\n })\n }\n }\n }, [noSelectOptions])\n\n useEffect(() => {\n // Extract source fields used directly and in formulas\n const sourceFieldsUsedDirectly = formFields\n .filter((f) => f.mapping.some((m) => m.fieldType === 'source'))\n .flatMap((f) =>\n f.mapping\n .filter((m) => m.fieldType === 'source')\n .map((m) => m.sourceFieldId)\n )\n\n const sourceFieldsUsedInFormulas = formFields\n .flatMap((f) => f.mapping)\n .filter((m) => m.fieldType === 'formula' && m.formula)\n .flatMap((m) =>\n m.formula!.params.filter((p) => p.type === 'field').map((p) => p.values)\n )\n\n // Combine all source fields used\n const allSourceFieldsUsed = [\n ...sourceFieldsUsedDirectly,\n ...sourceFieldsUsedInFormulas,\n ].filter(Boolean) as string[]\n\n // Determine which source fields are no longer available\n const allAvailableOptions = selectOptions.map((o) => o.value)\n const usedSourceFieldsNotAvailable = allSourceFieldsUsed.filter(\n (usedField) => !allAvailableOptions.includes(usedField)\n )\n\n // Clean up Formik state for mappings using unavailable source fields\n const cleanedFormFieldValues = formFields.map((field) => {\n // Skip cleaning for fields without any mapping\n if (field.mapping.length === 0) {\n return field\n }\n\n return {\n ...field,\n\n mapping: field.mapping\n .map((mapping) => {\n // We return a modified mapping or the original mapping\n // This is a placeholder logic to illustrate; adjust according to your actual logic\n\n return mapping // Return the original mapping if no modification is needed\n })\n .filter(\n (mapping) =>\n mapping.sourceFieldId || mapping.formula || mapping.text\n ), // Remove empty/default mappings that might have been inadvertently added\n }\n })\n\n helpers.setValue(cleanedFormFieldValues)\n\n // Notify user about unavailable source fields\n if (usedSourceFieldsNotAvailable.length > 0) {\n dispatch(\n sendAlertMessage({\n isDismissable: true,\n message: t('nbee.fieldsMapping.missingMappedFields', {\n listOfNotFoundIds: usedSourceFieldsNotAvailable.join(', '),\n }),\n })\n )\n }\n }, [selectOptions])\n\n return allBridgeFields ? (\n <div style={{ paddingBottom: showWelcomeMessage ? '0rem' : '2rem' }}>\n {fieldsToRender.length ? (\n fieldsToRender.map((field) => {\n // we pass the index of formFields and not the one of the filtered array\n // or the entire formik logic inside the component (get value, error and touched state)\n // will not work because will refer to different index\n const index = formFields.findIndex(\n ({ destinationFieldId }) =>\n field.destinationFieldId === destinationFieldId\n )\n\n if (index < 0) {\n // prevent passing negative index in case a field does not exists anymore (after field refresh)\n return null\n }\n\n return (\n <FieldMappingRow\n index={index}\n key={field.destinationFieldId}\n selectOptions={selectOptions}\n formulaUserModule={formulaUserModule}\n showWelcomeMessage={showWelcomeMessage}\n formulaSchema={formulasSchemaData?.data}\n sourceLogoUri={sourceLogoUri}\n onRedirectToPricing={handleRedirectToPricing}\n />\n )\n })\n ) : !showWelcomeMessage ? (\n <FieldMappingEmptyState\n onResetFilterRequest={onResetFilterRequest}\n isFiltered={!!formFields.length}\n />\n ) : null}\n </div>\n ) : null\n}\n","import React, { useEffect, useState } from 'react'\nimport {\n fieldsForInput,\n fieldsForSmartSelect,\n fieldsForToggle,\n fieldsForDomain,\n fieldsForSmartCreatableSelect,\n} from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/utils'\nimport { useFormikContext } from 'formik'\nimport { IntegrationFormValues } from 'Nbee'\nimport { CredentialFieldInput } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldInput'\nimport { CredentialFieldSmartSelect } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldSmartSelect'\nimport { CredentialFieldToggle } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldToggle'\nimport { FormInputGroup } from '@features/nbee/IntegrationCredentialsContent/styled'\nimport { Label } from '@components/Form/Label'\nimport { IntegrationNameInput } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/IntegrationNameInput'\nimport { useTranslation } from 'react-i18next'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { CredentialFieldDomain } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldDomain'\nimport { CredentialFieldSmartCreatableSelect } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldSmartCreatableSelect'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useRefetchCredentialSchema } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/useRefetchCredentialSchema'\nimport { CredentialFieldVerifyEmail } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldVerifyEmail'\nimport { generateRandomId } from '@app/utils/randomIdGenerator'\nimport { useGetVerifiedEmails } from '@app/api/getVerifiedEmails'\nimport { ApiUserVerifiedEmailsObj } from '@app/@typings/Api/user'\n\ninterface Props {\n showName: boolean\n appName: string\n appId: number\n handleErrorsUpdate: (status: boolean) => void\n}\n\nexport const FormInner: React.VFC<Props> = ({\n showName,\n appName,\n appId,\n handleErrorsUpdate,\n}) => {\n const { t } = useTranslation()\n const { values, setValues } = useFormikContext<IntegrationFormValues>()\n const fields = [...values.credentials] || []\n const [emailsUpdated, setEmailsUpdated] = useState<\n ApiUserVerifiedEmailsObj[] | undefined\n >([])\n\n const isEmailValidation = fields.some(\n (field) =>\n field.type === 'validate_email' || field.type === 'validate_email_multi'\n )\n\n // Fetch Verified Emails\n const {\n data: emailsData,\n isLoading: isEmailsLoading,\n refetch: refetchEmails,\n } = useGetVerifiedEmails(isEmailValidation)\n\n // Add new value to emailsDataUpdated\n const handleAddNewValue = (newValue: ApiUserVerifiedEmailsObj) => {\n if (emailsUpdated) setEmailsUpdated([...emailsUpdated, newValue])\n }\n\n // Handle email refetch\n const handleEmailsRefetch = () => {\n refetchEmails().then((res) => {\n setEmailsUpdated(res?.data?.contacts)\n })\n }\n\n /**\n * Verify all email fields and update the form error state.\n *\n * This function iterates over the email fields in the `fields` array and checks that they have all been verified.\n * If any of the email fields are invalid, the `handleErrorsUpdate` function is called with a `true` parameter to\n * update the form error state.\n */\n const verifyAllEmails = () => {\n const allVerified = [...values.credentials]\n .filter(\n (field) =>\n field.type === 'validate_email' ||\n field.type === 'validate_email_multi'\n )\n .every((field) => {\n if (\n Array.isArray(field.value) &&\n field.type === 'validate_email_multi'\n ) {\n if (!field.isRequired) {\n if (field.value.length === 1 && field.value[0] === '') {\n return true\n }\n if (\n field.value.length > 1 &&\n field.value[field.value.length - 1] === ''\n ) {\n return false\n }\n if (\n field.value.length > 0 &&\n field.value[field.value.length - 1] !== ''\n ) {\n const areAllEmailsVerified = field.value.every((email) => {\n const emailData = emailsUpdated?.find(\n (data) => data.email === email\n )\n if (emailData && emailData.status === 'verified') return true\n else return false\n })\n\n return areAllEmailsVerified\n }\n\n return field.value.every((email) => {\n return typeof email === 'string' // If we don't do this check, pressing Enter submits the form!\n })\n } else if (field.isRequired) {\n if (\n field.value.length > 1 &&\n field.value[field.value.length - 1] === ''\n ) {\n return false\n }\n return field.value.every((email) => {\n const emailData = emailsUpdated?.find(\n (data) => data.email === email\n )\n return emailData && emailData.status === 'verified'\n })\n } else {\n const emailData = emailsUpdated?.find(\n (data) => data.email === field.value\n )\n return emailData && emailData.status === 'verified'\n }\n } else {\n const emailData = emailsUpdated?.find(\n (data) => data.email === field.value\n )\n return emailData && emailData.status === 'verified'\n }\n })\n handleErrorsUpdate(!allVerified)\n }\n\n useEffect(() => {\n if (!isEmailsLoading && emailsData) {\n setEmailsUpdated(emailsData.contacts)\n }\n }, [isEmailsLoading, emailsData])\n\n useEffect(() => {\n verifyAllEmails()\n }, [values, emailsUpdated, isEmailsLoading])\n\n // Assign an empty string to the empty array we get from the api for cc and bcc\n // in order to be able to map the fields\n useEffect(() => {\n for (const field of [...values.credentials]) {\n if (field.type === 'validate_email_multi') {\n if (Array.isArray(field.value) && field.value.length === 0) {\n // if we find that in the array of fields there's an empty array,\n // we want to convert those empty arrays in an array with an empty string.\n // in order to do so, we need to create a shallow copy of fields\n // and pass the new value when the type is validate_email_multi\n // and the field is not required (e.g. 'cc' and 'bcc')\n const newFields = fields.map((mappedField) => {\n if (\n Array.isArray(mappedField.value) &&\n mappedField.value.length === 0\n ) {\n return { ...mappedField, value: [''] }\n } else {\n return mappedField\n }\n })\n // lastly, we use the Formik setValues method to update the Formik state\n setValues({ ...values, credentials: newFields })\n }\n }\n }\n }, [values])\n\n // This function handles when the Add recipient button should be shown or not\n const handleAddRecipient = (typeId: string) => {\n const toObject = [...values.credentials].find(({ id }) => id === typeId)\n if (!toObject) {\n return\n }\n const toObjectIndex = [...values.credentials].findIndex(\n ({ id }) => id === typeId\n )\n const newFields = [...values.credentials]\n newFields[toObjectIndex] = {\n ...toObject,\n value: Array.isArray(toObject.value) ? [...toObject.value, ''] : [''],\n }\n\n setValues({ ...values, credentials: newFields })\n }\n\n // every time a field with hasChild as true is updated we need to check if\n // new fields are available by calling our api endpoint\n const { errorApiAppAuthSchema, isLoadingAppAuthSchema } =\n useRefetchCredentialSchema(appId)\n\n return showName ? (\n <FormInputGroup centered>\n <Label $label={t('nbee.bridgeBuilder.integrationName')} />\n <IntegrationNameInput appName={appName} />\n </FormInputGroup>\n ) : (\n <>\n {fields.map((field, index) =>\n field.hide ? null : (\n <FormInputGroup key={field.id}>\n {field.type !== 'toggle' ? (\n <LabelWithDocTooltip\n label={field.label}\n htmlFor={field.id}\n isRequired={field.isRequired}\n tooltip={field.tooltip}\n docUrl={field.docUrl}\n />\n ) : null}\n {fieldsForInput.includes(field.type) ? (\n <CredentialFieldInput\n index={index}\n isLoading={isLoadingAppAuthSchema}\n />\n ) : fieldsForSmartSelect.includes(field.type) ? (\n <CredentialFieldSmartSelect\n index={index}\n isLoading={isLoadingAppAuthSchema}\n apiHasError={!!errorApiAppAuthSchema}\n />\n ) : field.type === 'validate_email' ? (\n <>\n <CredentialFieldVerifyEmail\n index={index}\n isLoading={isLoadingAppAuthSchema}\n apiHasError={!!errorApiAppAuthSchema}\n handleAddRecipient={handleAddRecipient}\n emailsUpdated={emailsUpdated}\n handleNewValue={handleAddNewValue}\n handleEmailsRefetch={handleEmailsRefetch}\n />\n </>\n ) : field.type === 'validate_email_multi' &&\n Array.isArray(field.value) ? (\n <>\n {field.value.length > 0\n ? field.value.map((value, idx) => (\n <div\n style={{ marginBottom: '.5rem' }}\n key={generateRandomId()}\n >\n <CredentialFieldVerifyEmail\n index={index}\n isLoading={isLoadingAppAuthSchema}\n apiHasError={!!errorApiAppAuthSchema}\n handleAddRecipient={handleAddRecipient}\n isLast={\n Array.isArray(field.value) &&\n idx === field.value.length - 1\n }\n idx={idx}\n emailsUpdated={emailsUpdated}\n handleNewValue={handleAddNewValue}\n handleEmailsRefetch={handleEmailsRefetch}\n />\n </div>\n ))\n : null}\n </>\n ) : fieldsForSmartCreatableSelect.includes(field.type) ? (\n <CredentialFieldSmartCreatableSelect\n index={index}\n isLoading={isLoadingAppAuthSchema}\n />\n ) : fieldsForToggle.includes(field.type) ? (\n <CredentialFieldToggle\n index={index}\n isLoading={isLoadingAppAuthSchema}\n />\n ) : fieldsForDomain.includes(field.type) ? (\n <CredentialFieldDomain\n index={index}\n isLoading={isLoadingAppAuthSchema}\n />\n ) : null}\n </FormInputGroup>\n )\n )}\n\n {errorApiAppAuthSchema && (\n <InputFeedback\n $status={{\n error: parseApiError(errorApiAppAuthSchema).message,\n }}\n />\n )}\n </>\n )\n}\n","import React, { useEffect } from 'react'\nimport { AppConfigurator } from './fields/AppConfigurator'\nimport {\n SimpleBridgeBuilderCard,\n SimpleBridgeBuilderCardSeparator,\n SimpleBridgeBuilderWrapper,\n} from './styled'\nimport { AiOutlinePlus } from 'react-icons/ai'\nimport { useHandleAppsCompatibility } from '@features/nbee/SimpleBridgeBuilderForm/appsCompatibility/useHandleAppsCompatibility'\nimport { useFormikContext } from 'formik'\nimport { BridgeFormValues, AppIntegrationSetting } from 'Nbee'\nimport { EmailReceipt } from '@features/nbee/EmailReceipt'\nimport { ApiUserModuleItem, ApiUser } from 'BackendApi'\n\ninterface FormInnerProps {\n emailReceiptUserModule?: ApiUserModuleItem\n userData?: ApiUser\n templateSettings?: AppIntegrationSetting[]\n}\n\nexport const FormInner: React.FC<FormInnerProps> = ({\n emailReceiptUserModule,\n userData,\n templateSettings,\n}) => {\n const { appsAreCompatible, emailFeatureAvailable } =\n useHandleAppsCompatibility()\n const { values, isValid, isSubmitting, setFieldValue } =\n useFormikContext<BridgeFormValues>()\n\n const bridgeId = values?.ui?.bridgeId\n\n useEffect(() => {\n if (emailFeatureAvailable !== undefined) {\n // update formik context with email feature availability\n setFieldValue('settings.emailReceipt.canShow', emailFeatureAvailable)\n }\n }, [emailFeatureAvailable])\n\n return (\n <SimpleBridgeBuilderWrapper>\n {/* SOURCE */}\n <SimpleBridgeBuilderCard\n hasError={values.ui?.source?.hasSettingsApiError}\n >\n <AppConfigurator\n type='source'\n canShowIntegrationField={appsAreCompatible}\n templateSettings={templateSettings}\n />\n </SimpleBridgeBuilderCard>\n {/* SEPARATOR */}\n <SimpleBridgeBuilderCardSeparator>\n <AiOutlinePlus size={'1.5rem'} />\n </SimpleBridgeBuilderCardSeparator>\n {/* DESTINATION */}\n <SimpleBridgeBuilderCard\n hasError={values.ui?.destination?.hasSettingsApiError}\n >\n <AppConfigurator\n type='destination'\n canShowIntegrationField={appsAreCompatible}\n />\n <EmailReceipt\n bridgeId={bridgeId}\n emailReceiptUserModule={emailReceiptUserModule}\n userData={userData}\n />\n </SimpleBridgeBuilderCard>\n </SimpleBridgeBuilderWrapper>\n )\n}\n"],"names":["Wrapper","TermsText","FormInner","t","location","getIndustries","isSubmitting","name","type","label","data","isLoading","disabled","Boolean","error","ns","i18nKey","components","a","style","textAlign","to","pathname","size","SettingsFieldsContainer","handleSubmit","isBridgeEnabled","initialValues","values","setValues","validationErrors","forcedDisabled","onStatusChange","isActive","newEmailReceiptSettings","active","updatedValues","settings","emailReceipt","subject","recipients","filterText","showAllFields","onResetFilterRequest","allBridgeFields","bridgeId","formulaUserModule","totalFieldsMapped","maxFields","showWelcomeMessage","sourceLogoUri","dispatch","panelContext","useContext","field","meta","helpers","formulasSchemaData","redirectToPricing","setRedirectToPricing","useState","updateBridgeToPricing","handleRedirectToPricing","value","some","f","mappingType","redirect","handleCloseAlert","useEffect","isDismissable","onClose","message","useTranslation","buttons","onClick","undefined","transValue","display","gap","updatedArray","map","item","sourceFieldId","mapping","setValue","unmapAllFields","formFields","sourceFields","source","sort","b","localeCompare","selectOptions","useMemo","sourceFieldOptions","id","lastValue","fieldType","isFormula","touched","formFieldsWithComputedMappedValues","firstMappingWithSource","find","m","sourceFieldLabel","sf","computedMappedString","text","fuzzySearch","isCaseSensitive","shouldSort","findAllMatches","includeMatches","includeScore","threshold","distance","keys","filteredDestinationFieldsByText","search","filteredDestinationFieldsByState","filter","mappedField","mappingItem","formula","fieldsToRender","length","noSelectOptions","sendPopup","content","dismissable","allSourceFieldsUsed","flatMap","params","p","allAvailableOptions","o","usedSourceFieldsNotAvailable","usedField","includes","cleanedFormFieldValues","listOfNotFoundIds","join","paddingBottom","index","findIndex","destinationFieldId","key","formulaSchema","onRedirectToPricing","isFiltered","showName","appName","appId","handleErrorsUpdate","fields","credentials","emailsUpdated","setEmailsUpdated","isEmailValidation","emailsData","isEmailsLoading","refetch","refetchEmails","handleAddNewValue","newValue","handleEmailsRefetch","then","res","contacts","allVerified","every","Array","isArray","isRequired","email","emailData","status","verifyAllEmails","newFields","handleAddRecipient","typeId","toObject","toObjectIndex","errorApiAppAuthSchema","isLoadingAppAuthSchema","centered","hide","htmlFor","tooltip","docUrl","apiHasError","handleNewValue","idx","marginBottom","isLast","emailReceiptUserModule","userData","templateSettings","appsAreCompatible","emailFeatureAvailable","setFieldValue","ui","hasError","hasSettingsApiError","canShowIntegrationField","destination"],"sourceRoot":""}