{"version":3,"sources":["pages/NewAutomation/formData.ts","apis/workflow.ts","apis/workflow-case.ts","apis/workflow-automation.ts","apis/user.ts","utils/parse.ts","constants/apis.ts","constants/groups.ts","constants/roles.ts","constants/countries.ts","constants/leadWorkflowData.ts","pages/LoadingPage/styles.js","pages/LoadingPage/index.tsx","components/ConfigureCallDrawer/formData.ts","components/AutocompleteInput/styles.ts","components/AutocompleteInput/index.tsx","components/AppAlert/index.tsx","components/AppSnackbar/index.tsx","components/Banner/styles.ts","components/Banner/index.tsx","components/ChipFilter/ChipFilter.styles.ts","components/ChipFilter/ChipFilter.tsx","components/ChipName/index.tsx","components/ChipName/styles.ts","components/ConfigureCaseDrawer/styles.ts","components/ConfigureCaseDrawer/index.tsx","components/ConfigureNotificationDrawer/styles.ts","components/ConfigureNotificationDrawer/index.tsx","components/ConfigureActionDrawer/index.tsx","components/ConfigureCallDrawer/styles.ts","components/ConfigureCallDrawer/index.tsx","components/ContentEditor/constants.ts","components/PersonaliseModal/styles.ts","components/PersonaliseModal/index.tsx","components/ContentEditor/Decorators/styles.ts","components/ContentEditor/Decorators/VariableTag.tsx","components/ContentEditor/Decorators/index.ts","components/ContentEditor/styles.ts","components/ContentEditor/index.tsx","components/ConfigureEmailDrawer/styles.ts","components/ConfigureEmailDrawer/index.tsx","components/ConfigureMergeDuplicationDrawer/styles.ts","components/ConfigureMergeDuplicationDrawer/index.tsx","components/ConfirmationModal/styles.ts","components/ConfirmationModal/index.tsx","components/Drawer/styles.ts","components/Drawer/index.tsx","components/DatePicker/styles.ts","components/DatePicker/index.tsx","components/FilterDrawer/styles.ts","components/FilterDrawer/FilterDrawer.tsx","components/FilterDrawerControlled/FilterDrawerControlled.tsx","components/DebouncedTextFieldInput/index.tsx","components/DropdownMenu/styles.js","components/DropdownMenu/index.tsx","components/FilterFieldDrawer/styles.ts","components/LoadingContentOverlay/styles.js","components/LoadingContentOverlay/index.tsx","components/Pagination/styles.js","components/Pagination/index.tsx","components/PopoverSearchableList/styles.ts","components/PopoverSearchableList/index.tsx","components/SearchInput/styles.ts","components/SearchInput/index.tsx","components/Tab/styles.ts","components/Tab/index.tsx","components/TextFieldInput/styles.ts","components/TextFieldInput/index.tsx","components/TextFieldLabel/styles.ts","components/TextFieldLabel/index.tsx","components/MobileInput/styles.ts","routes/RouteAuthenticated.tsx","routes/routes.ts","routes/index.tsx","config/config.ts","hooks/useAlert.tsx","hooks/useAuth.tsx","hooks/useLoader.tsx","hooks/useToggleState.tsx","reportWebVitals.ts","config/amplifyConfig.ts","styles/globalTheme.ts","pages/App/index.tsx","index.tsx","utils/components.ts","utils/error.ts","utils/string.ts","utils/env.ts","assets/icons/alert.svg","assets/icons/automation_action.svg","assets/icons/back_arrow.svg","assets/icons/call.svg","assets/icons/calendar.svg","assets/icons/delete.svg","assets/icons/checkmark_filled.svg","assets/icons/drag.svg","assets/icons/dollar.svg","assets/icons/edit.svg","assets/icons/email_workflow.svg","assets/icons/lock.svg","assets/icons/link.svg","assets/icons/light_bulb.svg","assets/icons/merge_workflow.svg","assets/icons/reminder.svg","assets/icons/search.svg","assets/icons/search_large.svg","assets/icons/sms_blast.svg","assets/icons/stars.svg","assets/icons/tag.svg","assets/icons/time.svg","assets/icons/world_wide_web.svg","styles/variables.ts","pages/Workflow/Tabs/LeadAutomation/formData.ts"],"names":["creditControlActions","name","types","label","value","initialConditionInput","workflowTypeID","workflowID","workflowAutomationID","subject","field","operator","valueType","initialActionInput","workflowAutomationActionTypeID","sendEmailSubject","sendEmailRecipients","sendEmailTemplate","sendInAppNotificationUserIDs","sendInAppNotificationUserGroups","sendInAppNotificationSetting","titleTemplate","titleTemplateContentState","messageTemplate","messageTemplateContentState","initialValues","enabled","rulesetLinking","conditions","actions","validationSchema","object","shape","string","required","array","of","min","updateStatusWorkflowCaseID","when","is","then","schema","updateStatusWorkflowCaseStatus","completeWorkflowStageID","completeWorkflowStageTaskID","subjectTypeOptions","type","values","val","distinctOptions","generalOptions","distinctSelectCount","options","reduce","count","el","idx","length","some","dopt","filter","option","_ref","every","selected","opt","fieldTypeOptions","includes","operatorTypeOptions","valueTypeOptions","asyncOptions","loanStatusValues","listWorkflows","input","API","get","API_NAME_WORKFLOW","queryStringParameters","createWorkflow","post","body","readWorkflow","updateWorkflow","put","updateWorkflowStage","deleteWorkflow","del","listWorkflowCases","createWorkflowCase","appID","pathAction","customHeaders","payload","apiName","API_NAME_CREDIT_CONTROL","path","headers","updateWorkflowCase","workflowCaseID","listWorkflowAutomations","listAutomations","createWorkflowAutomation","readWorkflowAutomation","automationID","id","updateWorkflowAutomation","workflowAutomationCC","listAffiliates","companyID","API_NAME_USER","parseErrorMessage","data","errorFieldName","result","_JSON$parse","key","JSON","parse","e","parseURLHash","hash","parseInt","slice","ADMIN_COMMUNITY","ADMIN_BASIC","ADMIN","DEVELOPER_HEADQUARTERS","DEVELOPER_BRANCH_LEADER","DEVELOPER_BRANCH_LEADER_SUPERVISOR","DEVELOPER_BRANCH_LEADER_SUPERVISOR_II","DEVELOPER_TEAM_LEADER","DEVELOPER_EXECUTIVE","DEVELOPER_SITEPLAN","DEVELOPER_AGENCY_ADMIN","DEVELOPER_AGENT_LEADER","HEADQUARTERS","MORTGAGE_BANKER","SUPER_ADMIN","TEAM_LEADER","ALL_ACCESS_GROUPS","ROLE_HEADQUARTERS","ROLE_SUPERVISOR","ROLE_SALES_MANAGER","ROLE_SALES_ADMIN","ROLE_STAFF","ROLE_AGENCY_ADMIN","ROLE_AGENCY_LEADER","ROLE_AGENT","ROLE_HEADQUARTERS_GROUPS","ROLE_SUPERVISOR_GROUPS","ROLE_SALES_MANAGER_GROUPS","ROLE_SALES_ADMIN_GROUPS","ROLE_AGENCY_ADMIN_GROUPS","ROLE_AGENCY_LEADERS_GROUPS","STAFF_GROUPS","isHeadquartersRole","groups","Array","isArray","hg","isSupervisorRole","sg","isSalesManagerRole","smg","isSalesAdminRole","sag","isAgencyAdminRole","aag","isAgencyLeaderRole","alr","isStaffRole","getUserRole","isExternalCompanyBranch","arguments","undefined","countries","calling_code","leadDefaultWorkflowID","leadWorkflowTypeOptions","leadDefaultWorkflowEmailAssignee","createdAt","createdByAffiliate","updatedAt","description","progressCalculationMethod","startMethod","triggerFrequency","workflowAutomations","leadDefaultAutomationEmailAssignee","sendEmailOn","makeStyles","loadingPage","height","LoadingPage","error","isLoading","classes","useStyles","_jsx","Grid","container","alignItems","justifyContent","className","children","CircularProgress","Typography","variant","callActionObjectValidationSchema","callLeadAssigneeAttempts","number","integer","callLeadAssigneeAttemptInterval","callLeadAssigneeWeekdayDays","v","otherwise","callLeadAssigneeWeekdayStartTime","callLeadAssigneeWeekdayEndTime","callLeadAssigneeWeekendDays","callLeadAssigneeWeekendStartTime","callLeadAssigneeWeekendEndTime","listBusinessUnit","callLeadAssigneeCaller","test","splitted","split","bu","theme","chip","backgroundColor","tertiaryColors","mediumGrey","margin","spacing","chipDeletable","width","chipLabel","typography","body2","listbox","padding","body1","wordBreak","paddingTop","paddingBottom","paper","boxShadow","border","grey","groupLabel","top","lineHeight","textTransform","fontFamily","openSans","fontWeight","bold","fontSize","groupUl","endAdornment","root","AutocompleteInput","keySelector","labelSelector","emptyValue","disabled","withSelectAll","placeholder","defaultValue","onSelectAll","withCheckBox","onChange","startAdornment","TextFieldProps","MuiAutocompleteProps","isAllSelected","_","findItem","useCallback","identifier","index","findIndex","o","isEqual","getSelectorValue","realValue","_value","_findItem","multiple","item","concat","findValue","defaultGetOptionLabel","createFilterOptions","MuiAutocomplete","getOptions","cOptions","filterSelectedOptions","renderInput","params","TextFieldInput","InputProps","_jsxs","_Fragment","loading","size","noOptionsText","handleOnChange","newValue","ids","uniq","map","renderOption","_ref2","formControlLabel","selectAllProps","isSelectAllOption","checked","Checkbox","icon","CheckBoxOutlineBlank","checkedIcon","CheckBox","style","marginRight","filterOptions","_options","state","getOptionLabel","getOptionSelected","defaultGetOptionSelected","disableClearable","ChipProps","deleteIcon","AppAlert","props","MuiAlert","elevation","AppSnackBar","severity","message","alert","hideAlert","useAlert","Snackbar","open","autoHideDuration","onClose","anchorOrigin","vertical","horizontal","lightBlue","color","secondaryColors","main","mustard","marigold","Banner","content","wrap","clsx","renderIcon","InfoOutlinedIcon","WarningIcon","fontVariants","colorPrimary","palette","common","white","primary","dark","display","deleteIconColorPrimary","ChipFilter","React","forwardRef","ref","Chip","clickable","ChipName","inactive","isSmallerFont","MuiChipProps","fontColor","fontColors","header","darkGrey","secondary","avatar","Avatar","renderNameInitial","charAt","toUpperCase","ctaButton","position","bottom","breakpoints","down","ConfigureCaseDrawer","actionTypeID","formikProps","selectedActionIndex","selectedSuggestion","setActionTypeID","useParams","setAlert","workflowStages","setWorkflowStages","useState","loaders","toggleLoadingState","useLoader","activeStates","toggleState","useToggleState","leaveConfirmation","useEffect","async","_res$workflowStages","res","formattedWorkflowStageOptions","stage","_stage$workflowStageT","stageTasks","workflowStageTasks","task","title","err","getErrorMessage","listCases","getActionOptions","suggestionIndex","action","getTitle","_creditControlActions","find","actionType","ConfirmationModal","onConfirm","onCancel","Formik","onSubmit","workflowValues","updateCaseStatusValues","pick","completeStageValues","completeStageTaskValues","setFieldValue","validateOnMount","touched","errors","dirty","isValidating","isSubmitting","isValid","resetForm","Drawer","Box","component","Form","p","flexDirection","Field","as","fullWidth","helperText","ErrorMessage","event","pb","flatMap","groupBy","Button","ConfigureNotificationDrawer","user","useAuth","recipients","setRecipients","limit","items","handleGetEmailRecipients","_sendInAppNotificatio","sendEmailValues","sendInAppNotificationValues","sendInAppNotificationSettingValues","setFieldTouched","convertStringToArray","email","convertArrayToString","group","capitalize","join","_ref3","meta","_ref4","_values$sendInAppNoti","ContentEditor","defaultContents","contentState","Object","keys","blocks","entityMap","maxLength","htmlContentState","rawContentState","handleEditorTouched","_ref5","ConfigureActionDrawer","initialActionTypeID","useFormikContext","isConfigureCaseDrawerOpen","setIsConfigureCaseDrawerOpen","isConfigureNotificationDrawerOpen","setIsConfigureNotificationDrawerOpen","isCaseAction","isNotificationAction","scheduleBox","lightGrey","timeIcon","opacity","subBody","customMobileSection","marginLeft","marginTop","infoIcon","phoneNumber","lighterGrey","deletedValue","ConfigureCallDrawer","allListBusinessUnit","appendedListBusinessUnit","setAppendedListBusinessUnit","deletedBUNumber","selectedBUs","forEach","isExists","buInfo","push","is_external","msisdn","newList","leadActions","getTimeDifferences","end","start","end24","moment","format","start24","hour","diff","utcOffset","minute","renderConfigurationFields","formik","_appendedListBusiness","setValues","mb","infoText","TextFieldLabel","FormHelperText","weekType","FormControlLabel","control","handleCheckScheduleDay","target","prev","mt","TimePicker","emptyLabel","inputVariant","Icon","alt","src","TimeIcon","mr","ml","FormControl","Tooltip","RadioGroup","currentTarget","Radio","getOptionDisabled","Switch","callLeadAssigneeRecord","onClick","element","labelPlacement","renderBanner","_user$company","showroomWeb","editBUURL","company","apps","_appendedListBusiness2","srIndex","app","webURL","selectedIndex","Link","window","filteredOptions","selectedOptions","getFilterOptions","customTagOptions","dialogContainer","dialogTitle","dialogCaption","PersonaliseModal","variable","setVariable","Dialog","DialogTitle","IconButton","edge","Close","DialogContent","DialogContentText","handleChange","DialogActions","m","pr","handleSubmit","variableTag","borderRadius","tagStrategy","contentBlock","callback","text","getText","tag","matchAll","RegExp","escapeRegExp","match","getTagLabel","TagDecorator","strategy","decoratedText","Tag","contentEditable","Decorator","CompositeDecorator","tagDecorator","buttonContainer","paddingLeft","borderTop","editor","overflow","cursor","borderBottom","marginBottom","hideButtons","editorRef","useRef","editorState","setEditorState","EditorState","createWithContent","convertFromRaw","decorators","blocksFromHTML","convertFromHTML","ContentState","createFromBlockArray","contentBlocks","getInitValue","personalise","contentIsEmpty","es","currentContent","getCurrentContent","isEditorEmpty","hasText","lengthOfTrimmedContent","getPlainText","trim","sendContent","convertToRaw","draftToHtml","handleFocusEditor","current","focus","getContentLength","currentPlainText","totalLength","textLength","totalVariableCharacters","matches","role","tabIndex","onKeyDown","Editor","readOnly","nextState","getBlocksAsArray","tokenIndexesRaw","a","tokenIndexes","tokenIndex","tokenValue","tokenBlockLocation","getEntityAt","entityKey","createEntity","getLastCreatedEntityKey","currentSelectionState","SelectionState","createEmpty","getKey","begin","tokenText","merge","anchorOffset","focusOffset","replacedTokenContent","Modifier","replaceText","blockKey","getAnchorKey","getBlockForKey","getLength","insertText","getSelectionAfter","forceSelection","handleBeforeInput","handlePastedText","pastedText","onFocus","startIcon","TagIcon","getInsertState","trigger","getSelection","getAnchorOffset","anchorKey","substring","lastIndexOf","currentSelection","insertingContent","newEditorState","newES","wordCount","tagDialogCaption","greyText","ConfigureEmailDrawer","sendEmailReminderLimit","max","isLeadDefaultWorkflow","linkLabel","setLinkLabel","isLinkDialogOpen","setIsLinkDialogOpen","inputProps","dayType","defaultChecked","multiline","minRows","maxRows","asterik","radioGroup","tooltipList","remarkTitle","pastelBlue","borderTopLeftRadius","borderTopRightRadius","remarkBody","borderBottomLeftRadius","borderBottomRightRadius","remarkList","listStyleType","switchLabel","ConfigureMergeDuplicationDrawer","leadAssignmentOpts","triggerMergeOn","mergeLeadMasterRecord","mergeLeadBypassRequired","toString","String","toLowerCase","leadAssignment","leadAllowEmptyAssignee","LightBulbIcon","controls","paddingRight","heading","errorButton","peach","lighten","darken","onCancelText","onConfirmText","hideCancel","CloseIcon","drawer__paperAnchorRight","up","sidePadding","primaryColors","contrastText","closeIcon","drawer__iconButton","onBack","MuiDrawer","anchor","paperAnchorRight","NavigateBefore","clearButton","visibility","visibleButton","dayWrapper","endDateWrapper","endDateWeekWrapper","day","caption","borderColor","nonCurrentMonthDay","highlight","background","highlightDay","firstHighlight","endHighlight","DatePicker","simple","onClear","rest","containerRef","anchorEl","setAnchorEl","haveValue","MuiDatePicker","disableToolbar","labelFunc","renderDay","selectedDate","dayInCurrentMonth","dayComponent","renderSelectedDay","selectedDay","dateClone","toDate","date","dayIsBetween","isBetween","isFirstDay","isLastDay","lastDayOfWeek","endOf","isLastDayOfWeek","isSame","wrapperClassName","dayClassName","formatted","isBefore","stopPropagation","preventDefault","CloseOutlined","CalendarIcon","PopoverProps","form","gridContainer","flex","buttonClearAll","buttonWrapper","FilterDrawer","other","direction","Children","child","FilterDrawerControlled","fields","handleClear","prevValues","renderDaterangeInput","_field$onChange","call","renderAutocompleteInput","DebouncedTextFieldInput","TextFieldLabelProps","MuiTextFieldProps","innerValue","setInnerValue","debounceCallBack","debounce","callBack","MuiTextField","persist","backdrop","transition","subtitle1","font","minWidth","tertiary","DropdownMenu","transformOrigin","headerNode","onOpenCallback","handleClose","renderMenuItem","hide","MenuItem","isHeader","handleClickOption","isOpen","Boolean","close","Menu","keepMounted","disableAutoFocusItem","getContentAnchorEl","MenuListProps","disablePadding","defaultProps","flexGrow","section","footer","minHeight","secondaryButtons","primaryButtons","zIndex","fullHeight","LoadingContentOverlay","pages","outline","link","breakLink","activeLink","disabledLink","pageAmountButton","hideNumbers","hideAll","amounts","Pagination","total","onChangePage","onChangeCount","setLimit","page","setPage","isMobile","useMediaQuery","xs","sm","renderCounts","from","to","labelCounts","amount","selectedPage","newPageCount","Math","ceil","handleOnCountChange","ReactPaginate","forcePage","pageRangeDisplayed","marginPagesDisplayed","pageCount","onPageChange","containerClassName","pageLinkClassName","previousLinkClassName","nextLinkClassName","breakLinkClassName","disabledClassName","activeLinkClassName","previousLabel","ChevronLeftIcon","nextLabel","ChevronRightIcon","maxWidth","list","maxHeight","listItem","textOverflow","whiteSpace","PopoverSearchableList","single","onClickOption","search","setSearch","handleSelect","newValues","indexOf","splice","Popover","TextField","SearchIcon","renderList","newOptions","List","ListItem","button","isChecked","renderListItem","adornment","searchIcon","clearIcon","SearchInput","inputValue","setInputValue","handleOnClear","renderSearchIcon","InputAdornment","subLabel","h6","textColorPrimary","Tab","MuiTabProps","MuiTab","gutterBottom","TypographyProps","wrapper","borderLeft","flag","Authenticate","C","authenticated","authenticate","Redirect","RouteAuthenticated","Route","render","routes","workflowList","caseManagementList","newWorkflow","newAutomation","readAutomation","notFound","accessDenied","lazy","ListCaseManagement","Workflow","NewAutomation","AccessDenied","NotFound","Error","Routes","AppSnackbar","Suspense","fallback","exact","config","process","cognito","appClientId","cookieDomain","cookieSecure","identityPoolId","region","userPoolId","api","workflowApiUrl","userApiUrl","leadCampaignApiUrl","leadFormApiUrl","creditControlApiUrl","creditControlRESTApiUrl","leadUsersApiUrl","leadCallApiUrl","alertContext","createContext","showAlert","useContext","ProvideAlert","setSeverity","setMessage","setShowAlert","show","useProvideAlert","Provider","authContext","companyBranchID","Promise","resolve","AuthProvider","auth","setAuthenticated","setLoading","setUser","getMsgFromParent","_event$data","addEventListener","removeEventListener","session","Auth","currentAuthenticatedUser","getSignInUserSession","getIdToken","decodePayload","sub","Bugsnag","addMetadata","user_id","company_id","useAuthProvider","setLoaders","initialLoad","bool","s","toggleStates","setActiveStates","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","amplifyConfig","cookieStorage","domain","secure","mandatorySignIn","userPoolWebClientId","endpoints","endpoint","defaultTheme","createTheme","globalTheme","shadows","fill","red","light","alertRed","overrides","MuiTypography","colorTextPrimary","colorTextSecondary","MuiButton","sizeSmall","regular","sizeLarge","semiBold","containedSecondary","MuiChip","MuiCheckbox","colorSecondary","green","MuiTableRow","hover","MuiTableCell","head","stickyHeader","MuiSwitch","switchBase","transform","track","transitions","create","thumb","MuiTooltip","tooltipPlacementBottom","MuiPickersBasePicker","pickerView","MuiPickersCalendar","transitionContainer","MuiPickersCalendarHeader","switchHeader","daysHeader","MuiPaper","MuiOutlinedInput","boxSizing","MuiRadio","MuiTabs","flexContainer","indicator","MuiFormHelperText","MuiSvgIcon","colorDisabled","colorError","MuiInputBase","disableRipple","disableFocusRipple","App","Amplify","configure","apiKey","releaseStage","plugins","BugsnagPluginReact","httpLink","createHttpLink","uri","authMiddleware","setContext","authorization","currentSession","getJwtToken","generateClient","ApolloClient","cache","InMemoryCache","defaultClient","clientLeadCampaign","clientLeadForm","clientCreditControl","clientLeadUsers","clientLeadCall","ErrorBoundary","getPlugin","createErrorBoundary","LocalizedUtils","MomentUtils","getWeekdays","dayOfWeek","this","weekday","ReactDOM","StrictMode","ThemeProvider","ApolloProvider","client","MuiPickersUtilsProvider","utils","CssBaseline","Router","document","getElementById","selector","isFunction","has","_err$response","_err$response$data$er","_err$response2","_err$response2$data","_err$response3","_err$response3$data","errorCode","response","status","errorMsgFromRes","error_message","errorMsg","humanizeString","str","delimiter","toKey","replace","_config$app","isStaging","_config$app2","_config$app3","_config$app4","greyOne","dimGrey","whiteSmoke","stone","cyprus","dimGreen","lightGreen","darkGreen","blue","alertYellow","amber","lightPink","lightOrange","orange","lavender","medium","montserrat","h1","h2","h3","h4","h5","subtitle2","overline","initialEmaillActionInput","initialCallActionInput","callLeadOn","initialMergeDuplicateActionInput","notifyActionObjectValidationSchema","getValidationSchema","suggestionType","fixedConditions","automation","fixed"],"mappings":"8HAAA,8TAmBO,MAAMA,EAA8C,CACzD,CACEC,KAAM,sBACNC,MAAO,CACL,CAAEC,MAAO,0BAA2BC,MAAO,2BAC3C,CAAED,MAAO,+BAAgCC,MAAO,gCAChD,CAAED,MAAO,qBAAsBC,MAAO,+BACtC,CAAED,MAAO,0BAA2BC,MAAO,cAC3C,CAAED,MAAO,2BAA4BC,MAAO,8BAKrCC,EAAiD,CAC5DC,eAAgB,GAChBC,WAAY,GACZC,qBAAsB,GACtBC,QAAS,GACTC,MAAO,GACPC,SAAU,GACVP,MAAO,GACPQ,UAAW,IAGAC,EAA2C,CACtDP,eAAgB,GAChBC,WAAY,GACZC,qBAAsB,GACtBM,+BAAgC,GAChCC,iBAAkB,GAClBC,oBAAqB,GACrBC,kBAAmB,GACnBC,6BAA8B,GAC9BC,gCAAiC,GACjCC,6BAA8B,CAC5BC,cAAe,GACfC,0BAA2B,GAC3BC,gBAAiB,GACjBC,4BAA6B,KAIpBC,EAAsC,CACjDxB,KAAM,GACNyB,SAAS,EACTpB,eAAgB,GAChBC,WAAY,GACZoB,eAAgB,MAChBC,WAAY,CAACvB,GACbwB,QAAS,IAGEC,EAAmBC,cAASC,MAAM,CAC7C/B,KAAMgC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main.016d255b.chunk.js","sourcesContent":["/* eslint-disable max-len */\nimport { RawDraftContentState } from 'draft-js';\nimport {\n array, object, string,\n} from 'yup';\nimport {\n AutomationFormAction,\n AutomationFormCondition,\n AutomationFormValues,\n DropdownOption,\n WorkflowTypeID,\n} from '../../types';\nimport { AutocompleteOption } from '../../components/AutocompleteInput/types';\n\ninterface CreditControlAction {\n name: WorkflowTypeID;\n types: AutocompleteOption[];\n}\n\nexport const creditControlActions: CreditControlAction[] = [\n {\n name: 'post_sales_tracking',\n types: [\n { label: 'Complete workflow stage', value: 'complete_workflow_stage' },\n { label: 'Complete workflow stage task', value: 'complete_workflow_stage_task' },\n { label: 'Update case status', value: 'update_workflow_case_status' },\n { label: 'Send email notification', value: 'send_email' },\n { label: 'Send in-app notification', value: 'send_inapp_notification' },\n ],\n },\n];\n\nexport const initialConditionInput: AutomationFormCondition = {\n workflowTypeID: '',\n workflowID: '',\n workflowAutomationID: '',\n subject: '',\n field: '',\n operator: '',\n value: '',\n valueType: '',\n};\n\nexport const initialActionInput: AutomationFormAction = {\n workflowTypeID: '',\n workflowID: '',\n workflowAutomationID: '',\n workflowAutomationActionTypeID: '',\n sendEmailSubject: '',\n sendEmailRecipients: '',\n sendEmailTemplate: '',\n sendInAppNotificationUserIDs: '',\n sendInAppNotificationUserGroups: '',\n sendInAppNotificationSetting: {\n titleTemplate: '',\n titleTemplateContentState: {} as RawDraftContentState,\n messageTemplate: '',\n messageTemplateContentState: {} as RawDraftContentState,\n },\n};\n\nexport const initialValues: AutomationFormValues = {\n name: '',\n enabled: true,\n workflowTypeID: '',\n workflowID: '',\n rulesetLinking: 'AND',\n conditions: [initialConditionInput],\n actions: [],\n};\n\nexport const validationSchema = object().shape({\n name: string().required('Label is required'),\n conditions: array()\n .of(\n object().shape({\n subject: string().required('Condition subject is required'),\n field: string().required('Condition field is required'),\n operator: string().required('Condition operator is required.'),\n value: string().required('Condition value is required.'),\n }),\n )\n .min(1, 'At least 1 condition is required'),\n actions: array()\n .of(\n object().shape({\n workflowAutomationActionTypeID: string().required(),\n updateStatusWorkflowCaseID: string().when('workflowAutomationActionTypeID', {\n is: 'update_workflow_case_status',\n then: (schema) => schema.required(),\n }),\n updateStatusWorkflowCaseStatus: string().when('workflowAutomationActionTypeID', {\n is: 'update_workflow_case_status',\n then: (schema) => schema.required(),\n }),\n completeWorkflowStageID: string().when('workflowAutomationActionTypeID', {\n is: 'complete_workflow_stage',\n then: (schema) => schema.required(),\n }),\n completeWorkflowStageTaskID: string().when('workflowAutomationActionTypeID', {\n is: 'complete_workflow_stage_task',\n then: (schema) => schema.required(),\n }),\n sendEmailTemplate: string().when('workflowAutomationActionTypeID', {\n is: 'send_email',\n then: (schema) => schema.required(),\n }),\n sendEmailSubject: string().when('workflowAutomationActionTypeID', {\n is: 'send_email',\n then: (schema) => schema.required(),\n }),\n sendEmailRecipients: string().when('workflowAutomationActionTypeID', {\n is: 'send_email',\n then: (schema) => schema.required(),\n }),\n sendInAppNotificationUserIDs: string().when('workflowAutomationActionTypeID', {\n is: 'send_inapp_notification',\n then: (schema) => schema.required(),\n }),\n sendInAppNotificationUserGroups: string().when('workflowAutomationActionTypeID', {\n is: 'send_inapp_notification',\n then: (schema) => schema.required(),\n }),\n sendInAppNotificationSetting: object().when('workflowAutomationActionTypeID', {\n is: 'send_inapp_notification',\n then: object().shape({\n titleTemplate: string().required(),\n messageTemplate: string().required(),\n }),\n }),\n }),\n ),\n});\n\n// Automation field condition options //\n\nexport const subjectTypeOptions = (\n type: string,\n values: AutomationFormValues,\n val: AutomationFormCondition,\n): DropdownOption[] => {\n let options: DropdownOption[] = [];\n let distinctOptions: DropdownOption[];\n let generalOptions: DropdownOption[];\n let distinctSelectCount: number;\n\n switch (type) {\n case 'credit_control':\n distinctOptions = [\n { label: 'Post sales tracking', value: 'ps_tracking' },\n ];\n generalOptions = [\n { label: 'Project', value: 'project' },\n ];\n options = [\n ...distinctOptions,\n ...generalOptions,\n ];\n\n // count of selected distinct option\n distinctSelectCount = values.conditions.reduce((count, el, idx) => {\n if (values.conditions.length === idx + 1) {\n return count;\n }\n\n const isMatch = distinctOptions.some(\n (dopt) => dopt.value === el.subject,\n );\n\n return count + (isMatch ? 1 : 0);\n }, 0);\n\n options = options\n .filter((option) => {\n const otherSelections = values.conditions\n .filter(({ subject }) => subject !== val.subject);\n return otherSelections\n .every((selected) => selected.subject !== option.value);\n });\n\n if (distinctSelectCount > 0) {\n options = options\n .filter((opt) => {\n if (opt.value === val.subject) {\n return true;\n }\n return !distinctOptions.some((dopt) => dopt.value === opt.value);\n });\n }\n break;\n default:\n break;\n }\n\n return options;\n};\n\nexport const fieldTypeOptions = (\n type: string,\n workflowTypeID?: string,\n subject?: string,\n) => {\n let options: DropdownOption[] = [];\n\n if (subject) {\n switch (type) {\n case 'credit_control':\n if (['ps_tracking'].includes(subject)) {\n options = [\n { label: 'Status', value: 'status' },\n ];\n } else if (subject === 'project') {\n options = [\n { label: 'Name', value: 'id' },\n ];\n }\n break;\n default:\n break;\n }\n }\n\n return options;\n};\n\nexport const operatorTypeOptions = (\n type: string,\n) => {\n let options: DropdownOption[] = [];\n switch (type) {\n case 'credit_control':\n options = [\n { label: 'is', value: '==' },\n ];\n break;\n default:\n break;\n }\n\n return options;\n};\n\nexport const valueTypeOptions = (\n type: string,\n subject?: string,\n field?: string,\n asyncOptions?: DropdownOption[],\n) => {\n let options: DropdownOption[] = [];\n const loanStatusValues = [\n { label: 'Financier first payment', value: 'financier_first_payment' },\n { label: 'Letter of differential sum settled', value: 'letter_of_differential_sum_settled' },\n { label: 'Letter of differential sum unsettled', value: 'letter_of_differential_sum_unsettled' },\n { label: 'Loan agreement', value: 'loan_agreement' },\n { label: 'LOU received', value: 'lou_received' },\n { label: 'LOU replied', value: 'lou_replied' },\n { label: 'Purchaser portion fully paid', value: 'purchaser_portion_fully_paid' },\n { label: 'Letter of advice released', value: 'letter_of_advice_released' },\n { label: 'Memorandum of transfer entitled', value: 'memorandum_of_transfer_entitled' },\n ];\n\n if (subject && field) {\n switch (type) {\n case 'credit_control':\n if (subject === 'ps_tracking') {\n options = [\n { label: 'Booked', value: 'booked' },\n { label: 'Loan offerred', value: 'loan_offered' },\n { label: 'SPA appointment fixed', value: 'spa_appointment_fixed' },\n { label: 'SPA signed', value: 'spa_signed' },\n { label: 'SPA stamped', value: 'spa_stamped' },\n { label: 'SPA reminder sent', value: 'spa_reminder_sent' },\n { label: 'Loan reminder sent', value: 'loan_reminder_sent' },\n ...loanStatusValues,\n ];\n } else if (subject === 'project') {\n options = asyncOptions || [];\n }\n break;\n default:\n break;\n }\n }\n\n return options;\n};\n","import { API } from 'aws-amplify';\n\nimport { API_NAME_WORKFLOW } from '../constants';\nimport type { Workflow, WorkflowType } from '../types';\n\nexport interface ListWorkflowsInput {\n limit?: number;\n page?: number;\n appID?: WorkflowType['appID'];\n companyID?: string;\n isEnabled?: boolean;\n workflowTypeID?: Workflow['workflowTypeID'][];\n name?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n updatedAtFrom?: string;\n updatedAtTo?: string;\n hideGeneratedLeadWorkflows?: boolean;\n}\n\nexport const listWorkflows = (input: ListWorkflowsInput) => API.get(API_NAME_WORKFLOW, '/workflows', { queryStringParameters: input });\n\nexport type CreateWorkflowInput = Pick<\nWorkflow,\n| 'companyID'\n| 'companyBranchID'\n| 'workflowTypeID'\n| 'name'\n| 'description'\n| 'startMethod'\n| 'progressCalculationMethod'\n| 'createdByAffiliateID'\n>;\n\nexport const createWorkflow = (input: CreateWorkflowInput) => API.post(API_NAME_WORKFLOW, '/workflows', { body: input });\n\nexport const readWorkflow = (workflowID: string) => API.get(API_NAME_WORKFLOW, `/workflows/${workflowID}`, {});\n\nexport type UpdateWorkflowInput = Partial<\nPick<\nWorkflow,\n| 'workflowTypeID'\n| 'enabled'\n| 'name'\n| 'description'\n| 'startMethod'\n| 'progressCalculationMethod'\n| 'updatedByAffiliateID'\n>\n>;\n\nexport const updateWorkflow = (\n workflowID: string,\n input: UpdateWorkflowInput,\n) => API.put(API_NAME_WORKFLOW, `/workflows/${workflowID}`, { body: input });\n\ninterface WorkflowStageTaskRequest {\n id?: string;\n name: string;\n sequenceNo: number;\n workflowStageSubTasks?: WorkflowStageTaskRequest[];\n}\ninterface WorkflowStageRequest {\n id?: string;\n name: string;\n sequenceNo: number;\n expectedCompletionDays?: number;\n accessGroups?: string[];\n workflowStageTasks?: WorkflowStageTaskRequest[];\n}\nexport interface UpdateWorkflowStageInput {\n id: string;\n workflowStages: WorkflowStageRequest[];\n}\n\nexport const updateWorkflowStage = (\n workflowID: string,\n input: UpdateWorkflowStageInput,\n) => API.put(API_NAME_WORKFLOW, `/workflows/${workflowID}/stage-tasks`, { body: input });\n\nexport const deleteWorkflow = (workflowID: string) => API.del(API_NAME_WORKFLOW, `/workflows/${workflowID}`, {});\n","import { API } from 'aws-amplify';\n\nimport { API_NAME_WORKFLOW, API_NAME_CREDIT_CONTROL } from '../constants';\nimport type { WorkflowCase, WorkflowType } from '../types';\n\nexport interface ListWorkflowCasesInput {\n limit?: number;\n page?: number;\n companyID?: string;\n status?: WorkflowCase['status'];\n workflowID?: string;\n workflowTypeID?: WorkflowCase['workflowTypeID'][];\n workflowTypeAppID?: WorkflowType['appID'][];\n assigneeID?: string[];\n name?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n updatedAtFrom?: string;\n updatedAtTo?: string;\n projectID?: string;\n projectUnitID?: string;\n}\n\nexport const listWorkflowCases = (input: ListWorkflowCasesInput) => API.get(API_NAME_WORKFLOW, '/workflowcases', {\n queryStringParameters: input,\n});\n\nexport const readWorkflowCase = (workflowCaseID: string) => API.get(API_NAME_WORKFLOW, `/workflowcases/${workflowCaseID}`, {});\n\nexport interface PsTrackingWorkflowCasePayload {\n workflowTypeID: WorkflowCase['workflowTypeID'];\n workflowID: string;\n projectID: string;\n projectUnitIDs: string[];\n}\n\nexport interface PsTrackingWorkflowCaseHeader {\n 'x-company-id': string;\n}\n\nexport interface CreateWorkflowCaseInput {\n appID: WorkflowType['appID'];\n workflowTypeID: WorkflowCase['workflowTypeID'];\n workflowID: string;\n pathAction: 'assign';\n customHeaders: | PsTrackingWorkflowCaseHeader;\n payload: | PsTrackingWorkflowCasePayload;\n}\n\nexport const createWorkflowCase = ({\n appID,\n workflowTypeID,\n workflowID,\n pathAction,\n customHeaders,\n payload,\n}: CreateWorkflowCaseInput) => {\n let apiName = '';\n if (appID === 'credit_control') {\n apiName = API_NAME_CREDIT_CONTROL;\n }\n\n const path = `/workflowcase/${workflowTypeID}/${workflowID}/${pathAction}`;\n return API.post(apiName, path, {\n headers: { ...customHeaders },\n body: { ...payload },\n });\n};\n\nexport type UpdateWorkflowCaseInput = Partial<\nPick<\nWorkflowCase,\n| 'name'\n| 'description'\n| 'status'\n| 'assigneeIDs'\n| 'workflowID'\n>\n>;\n\nexport const updateWorkflowCase = (\n workflowCaseID: string,\n input: UpdateWorkflowCaseInput,\n) => API.put(API_NAME_WORKFLOW, `/workflowcases/${workflowCaseID}`, {\n body: input,\n});\n\nexport const deleteWorkflowCase = (workflowCaseID: string) => API.del(API_NAME_WORKFLOW, `/workflowcases/${workflowCaseID}`, {});\n","import { API } from 'aws-amplify';\n\nimport { API_NAME_WORKFLOW } from '../constants';\nimport type { WorkflowAutomation } from '../types';\n\nexport interface ListWorkflowAutomationInput {\n limit?: number;\n page?: number;\n sortColumn?: string;\n sortDirection?: string;\n companyID? : string;\n origin?: string;\n fields?: string;\n filters?: string;\n}\n\n// To list out automations of a workflow\nexport const listWorkflowAutomations = (\n workflowID: string,\n input?: ListWorkflowAutomationInput,\n) => API.get(API_NAME_WORKFLOW, `/automation/${workflowID}`, { queryStringParameters: input });\n\n// To list out automations without workflow ID\nexport const listAutomations = (\n input?: ListWorkflowAutomationInput,\n) => API.get(API_NAME_WORKFLOW, '/workflows', { queryStringParameters: input });\n\nexport type CreateWorkflowAutomationInput = Pick<\nWorkflowAutomation,\n| 'name'\n| 'enabled'\n| 'workflowTypeID'\n| 'workflowID'\n| 'conditions'\n| 'actions'\n>;\n\nexport const createWorkflowAutomation = (\n input: CreateWorkflowAutomationInput,\n) => API.post(API_NAME_WORKFLOW, '/automation', { body: input });\n\nexport const readWorkflowAutomation = (\n automationID: string,\n) => API.get(API_NAME_WORKFLOW, '/automation', { queryStringParameters: { id: automationID } });\n\nexport type UpdateWorkflowAutomationInput = Partial<\nPick<\nWorkflowAutomation,\n| 'name'\n| 'enabled'\n| 'conditions'\n| 'actions'\n>\n>;\n\nexport const updateWorkflowAutomation = (\n automationID: string,\n input: UpdateWorkflowAutomationInput,\n) => API.put(API_NAME_WORKFLOW, `/automation/${automationID}`, { body: input });\n\nexport const workflowAutomationCC = (\n workflowID: string,\n input: UpdateWorkflowAutomationInput,\n) => API.put(API_NAME_WORKFLOW, `/workflows/${workflowID}/automations`, { body: input });\n\nexport const deleteWorkflowAutomation = (\n workflowAutomationID: string,\n) => API.del(API_NAME_WORKFLOW, `/automation/${workflowAutomationID}`, {});\n","import { API } from 'aws-amplify';\n\nimport { API_NAME_USER } from '../constants';\n\nexport interface LisUsersInput {\n limit?: number;\n page?: number;\n search?:string; // supports name, email, mobile, aws_username\n}\n\n// return ALL Users' record directly streamed from AWS cognito but id is based on psql id\nexport const listUsers = (\n input?: LisUsersInput,\n) => API.get(API_NAME_USER, '/users', { queryStringParameters: input });\n\n// return company Users' record directly streamed from AWS cognito but id is cognito id\nexport const listAffiliates = (\n companyID: string,\n input?: LisUsersInput,\n) => API.get(API_NAME_USER, '/affiliates', {\n headers: {\n 'x-company-id': companyID,\n },\n queryStringParameters: input,\n});\n","export const parseErrorMessage = (data?: string, errorFieldName?: string) => {\n let result: string = '';\n\n if (data) {\n try {\n const key = errorFieldName || 'errorMessage';\n result = JSON.parse(data)?.[key];\n } catch (e) {\n result = data;\n }\n }\n\n return result;\n};\n\nexport const parseURLHash = (hash: string) => parseInt(hash.slice(1) || '0', 10);\n","export const API_NAME_WORKFLOW = 'Workflow';\nexport const API_NAME_USER = 'User';\nexport const API_NAME_CREDIT_CONTROL = 'CreditControl';\n","export const ADMIN_COMMUNITY = 'ADMIN_COMMUNITY';\nexport const ADMIN_BASIC = 'ADMIN_BASIC';\nexport const ADMIN = 'ADMIN';\nexport const AFFILIATE_I = 'AFFILIATE_I';\nexport const AFFILIATE_II = 'AFFILIATE_II';\nexport const AGENT = 'AGENT';\nexport const CREDIT_ADMIN = 'CREDIT_ADMIN';\nexport const CREDIT_CONTROL = 'CREDIT_CONTROL';\nexport const DEVELOPER_HEADQUARTERS = 'DEVELOPER_HEADQUARTERS';\nexport const DEVELOPER_BRANCH_LEADER = 'DEVELOPER_BRANCH_LEADER';\nexport const DEVELOPER_BRANCH_LEADER_SUPERVISOR = 'DEVELOPER_BRANCH_LEADER_SUPERVISOR';\nexport const DEVELOPER_BRANCH_LEADER_SUPERVISOR_II = 'DEVELOPER_BRANCH_LEADER_SUPERVISOR_II';\nexport const DEVELOPER_TEAM_LEADER = 'DEVELOPER_TEAM_LEADER';\nexport const DEVELOPER_EXECUTIVE = 'DEVELOPER_EXECUTIVE';\nexport const DEVELOPER_SITEPLAN = 'DEVELOPER_SITEPLAN';\nexport const DEVELOPER_AGENCY_ADMIN = 'DEVELOPER_AGENCY_ADMIN';\nexport const DEVELOPER_AGENT_LEADER = 'DEVELOPER_AGENT_LEADER';\nexport const HEADQUARTERS = 'HEADQUARTERS';\nexport const FINANCE_EXECUTIVE = 'FINANCE_EXECUTIVE';\nexport const LAWYER = 'LAWYER';\nexport const LAWYER_HEADQUARTERS = 'LAWYER_HEADQUARTERS';\nexport const MARKETPLACE_AGENT = 'MARKETPLACE_AGENT';\nexport const MORTGAGE_BANKER = 'MORTGAGE_BANKER';\nexport const SUPER_ADMIN = 'SUPER_ADMIN';\nexport const TEAM_LEADER = 'TEAM_LEADER';\n\nexport const ALL_ACCESS_GROUPS = [\n ADMIN_COMMUNITY,\n ADMIN_BASIC,\n ADMIN,\n AGENT,\n CREDIT_ADMIN,\n CREDIT_CONTROL,\n DEVELOPER_HEADQUARTERS,\n DEVELOPER_BRANCH_LEADER,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR_II,\n DEVELOPER_TEAM_LEADER,\n DEVELOPER_EXECUTIVE,\n DEVELOPER_SITEPLAN,\n DEVELOPER_AGENCY_ADMIN,\n DEVELOPER_AGENT_LEADER,\n HEADQUARTERS,\n FINANCE_EXECUTIVE,\n LAWYER,\n LAWYER_HEADQUARTERS,\n MARKETPLACE_AGENT,\n MORTGAGE_BANKER,\n SUPER_ADMIN,\n TEAM_LEADER,\n];\n\nexport const VALID_GROUPS = [\n SUPER_ADMIN,\n ADMIN_COMMUNITY,\n ADMIN_BASIC,\n ADMIN,\n HEADQUARTERS,\n MORTGAGE_BANKER,\n TEAM_LEADER,\n DEVELOPER_HEADQUARTERS,\n DEVELOPER_BRANCH_LEADER,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR_II,\n DEVELOPER_TEAM_LEADER,\n DEVELOPER_EXECUTIVE,\n DEVELOPER_SITEPLAN,\n DEVELOPER_AGENCY_ADMIN,\n DEVELOPER_AGENT_LEADER,\n AFFILIATE_I,\n AFFILIATE_II,\n];\n\nexport const ALLOWED_GROUPS = [\n SUPER_ADMIN,\n ADMIN_COMMUNITY,\n ADMIN_BASIC,\n ADMIN,\n DEVELOPER_HEADQUARTERS,\n DEVELOPER_BRANCH_LEADER,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR_II,\n DEVELOPER_TEAM_LEADER,\n DEVELOPER_EXECUTIVE,\n DEVELOPER_SITEPLAN,\n DEVELOPER_AGENCY_ADMIN,\n DEVELOPER_AGENT_LEADER,\n AFFILIATE_I,\n AFFILIATE_II,\n];\n\nexport const UPPER_GROUPS = [\n ADMIN,\n SUPER_ADMIN,\n DEVELOPER_HEADQUARTERS,\n DEVELOPER_BRANCH_LEADER,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR_II,\n];\n\nexport function hasAllowedGroups(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && groups.some((ag) => ALLOWED_GROUPS.some((g) => g === ag))\n );\n}\n\nexport function hasUpperGroups(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && groups.some((ug) => UPPER_GROUPS.some((g) => g === ug))\n );\n}\n","import {\n DEVELOPER_EXECUTIVE,\n DEVELOPER_HEADQUARTERS,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR_II,\n DEVELOPER_BRANCH_LEADER,\n DEVELOPER_AGENCY_ADMIN,\n DEVELOPER_AGENT_LEADER,\n} from './groups';\n\n// Level 1\nexport const ROLE_HEADQUARTERS = 'Headquarters';\n// Level 2\nexport const ROLE_SUPERVISOR = 'Supervisor';\nexport const ROLE_SALES_MANAGER = 'Sales Manager';\nexport const ROLE_SALES_ADMIN = 'Sales Admin';\n// Level 3\nexport const ROLE_STAFF = 'Staff';\nexport const ROLE_AGENCY_ADMIN = 'Agency Admin';\nexport const ROLE_AGENCY_LEADER = 'Agency Leader';\nexport const ROLE_AGENT = 'Agent';\n\n// From backend, 1 = Headquarters ...\nexport const ROLE_MAP = [\n undefined,\n ROLE_HEADQUARTERS,\n ROLE_SUPERVISOR,\n ROLE_SALES_MANAGER,\n ROLE_SALES_ADMIN,\n ROLE_STAFF,\n];\n\nexport const ROLE_HEADQUARTERS_GROUPS = [\n DEVELOPER_EXECUTIVE,\n DEVELOPER_HEADQUARTERS,\n];\n\nexport const ROLE_SUPERVISOR_GROUPS = [\n DEVELOPER_EXECUTIVE,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR,\n];\n\nexport const ROLE_SALES_MANAGER_GROUPS = [\n DEVELOPER_EXECUTIVE,\n DEVELOPER_BRANCH_LEADER_SUPERVISOR_II,\n];\n\nexport const ROLE_SALES_ADMIN_GROUPS = [\n DEVELOPER_EXECUTIVE,\n DEVELOPER_BRANCH_LEADER,\n];\n\nexport const ROLE_AGENCY_ADMIN_GROUPS = [\n DEVELOPER_EXECUTIVE,\n DEVELOPER_AGENCY_ADMIN,\n];\n\nexport const ROLE_AGENCY_LEADERS_GROUPS = [\n DEVELOPER_EXECUTIVE,\n DEVELOPER_AGENT_LEADER,\n];\n\nexport const STAFF_GROUPS = [DEVELOPER_EXECUTIVE];\n\nexport function isHeadquartersRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && ROLE_HEADQUARTERS_GROUPS.every((hg) => groups.includes(hg))\n );\n}\n\nexport function isSupervisorRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && ROLE_SUPERVISOR_GROUPS.every((sg) => groups.includes(sg))\n );\n}\n\nexport function isSalesManagerRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && ROLE_SALES_MANAGER_GROUPS.every((smg) => groups.includes(smg))\n );\n}\n\nexport function isSalesAdminRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && ROLE_SALES_ADMIN_GROUPS.every((sag) => groups.includes(sag))\n );\n}\n\nexport function isAgencyAdminRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && ROLE_AGENCY_ADMIN_GROUPS.every((aag) => groups.includes(aag))\n );\n}\n\nexport function isAgencyLeaderRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && ROLE_AGENCY_LEADERS_GROUPS.every((alr) => groups.includes(alr))\n );\n}\n\nexport function isStaffRole(groups: string[]) {\n return (\n Array.isArray(groups)\n && groups.length > 0 && STAFF_GROUPS.every((sg) => groups.includes(sg))\n );\n}\n\nexport function getUserRole(groups: string[], isExternalCompanyBranch = false) {\n if (groups) {\n switch (true) {\n case isHeadquartersRole(groups):\n return ROLE_HEADQUARTERS;\n case isSupervisorRole(groups):\n return ROLE_SUPERVISOR;\n case isSalesManagerRole(groups):\n return ROLE_SALES_MANAGER;\n case isSalesAdminRole(groups):\n return ROLE_SALES_ADMIN;\n case isAgencyAdminRole(groups) && isExternalCompanyBranch:\n return ROLE_AGENCY_ADMIN;\n case isAgencyLeaderRole(groups) && isExternalCompanyBranch:\n return ROLE_AGENCY_LEADER;\n case isStaffRole(groups) && isExternalCompanyBranch:\n return ROLE_AGENT;\n default:\n return ROLE_STAFF;\n }\n }\n return ROLE_STAFF;\n}\n","export const countries = [\n {\n label: 'Afghanistan',\n value: 'AF',\n calling_code: '93',\n },\n {\n label: 'Albania',\n value: 'AL',\n calling_code: '355',\n },\n {\n label: 'Algeria',\n value: 'DZ',\n calling_code: '213',\n },\n {\n label: 'American Samoa',\n value: 'AS',\n calling_code: '1',\n },\n {\n label: 'Andorra',\n value: 'AD',\n calling_code: '376',\n },\n {\n label: 'Angola',\n value: 'AO',\n calling_code: '244',\n },\n {\n label: 'Anguilla',\n value: 'AI',\n calling_code: '1',\n },\n {\n label: 'Antarctica',\n value: 'AQ',\n calling_code: '1',\n },\n {\n label: 'Antigua & Barbuda',\n value: 'AG',\n calling_code: '1',\n },\n {\n label: 'Argentina',\n value: 'AR',\n calling_code: '54',\n },\n {\n label: 'Armenia',\n value: 'AM',\n calling_code: '374',\n },\n {\n label: 'Aruba',\n value: 'AW',\n calling_code: '297',\n },\n {\n label: 'Australia',\n value: 'AU',\n calling_code: '61',\n },\n {\n label: 'Austria',\n value: 'AT',\n calling_code: '43',\n },\n {\n label: 'Azerbaijan',\n value: 'AZ',\n calling_code: '994',\n },\n {\n label: 'Bahamas',\n value: 'BS',\n calling_code: '1',\n },\n {\n label: 'Bahrain',\n value: 'BH',\n calling_code: '973',\n },\n {\n label: 'Bangladesh',\n value: 'BD',\n calling_code: '880',\n },\n {\n label: 'Barbados',\n value: 'BB',\n calling_code: '1',\n },\n {\n label: 'Belarus',\n value: 'BY',\n calling_code: '375',\n },\n {\n label: 'Belgium',\n value: 'BE',\n calling_code: '32',\n },\n {\n label: 'Belize',\n value: 'BZ',\n calling_code: '501',\n },\n {\n label: 'Benin',\n value: 'BJ',\n calling_code: '229',\n },\n {\n label: 'Bermuda',\n value: 'BM',\n calling_code: '1',\n },\n {\n label: 'Bhutan',\n value: 'BT',\n calling_code: '975',\n },\n {\n label: 'Bolivia',\n value: 'BO',\n calling_code: '591',\n },\n {\n label: 'Bosnia & Herzegovina',\n value: 'BA',\n calling_code: '387',\n },\n {\n label: 'Botswana',\n value: 'BW',\n calling_code: '267',\n },\n {\n label: 'Brazil',\n value: 'BR',\n calling_code: '55',\n },\n {\n label: 'British Indian Ocean Territory',\n value: 'IO',\n calling_code: '246',\n },\n {\n label: 'Brunei',\n value: 'BN',\n calling_code: '673',\n },\n {\n label: 'Bulgaria',\n value: 'BG',\n calling_code: '359',\n },\n {\n label: 'Burkina Faso',\n value: 'BF',\n calling_code: '226',\n },\n {\n label: 'Burundi',\n value: 'BI',\n calling_code: '257',\n },\n {\n label: 'Cambodia',\n value: 'KH',\n calling_code: '855',\n },\n {\n label: 'Cameroon',\n value: 'CM',\n calling_code: '237',\n },\n {\n label: 'Canada',\n value: 'CA',\n calling_code: '1',\n },\n {\n label: 'Cape Verde',\n value: 'CV',\n calling_code: '238',\n },\n {\n label: 'Cayman Islands',\n value: 'KY',\n calling_code: '1',\n },\n {\n label: 'Central African Republic',\n value: 'CF',\n calling_code: '236',\n },\n {\n label: 'Chad',\n value: 'TD',\n calling_code: '235',\n },\n {\n label: 'Chile',\n value: 'CL',\n calling_code: '56',\n },\n {\n label: 'China',\n value: 'CN',\n calling_code: '86',\n },\n {\n label: 'Colombia',\n value: 'CO',\n calling_code: '57',\n },\n {\n label: 'Comoros',\n value: 'KM',\n calling_code: '269',\n },\n {\n label: 'Congo - Brazzaville',\n value: 'CG',\n calling_code: '242',\n },\n {\n label: 'Congo - Kinshasa',\n value: 'CD',\n calling_code: '243',\n },\n {\n label: 'Cook Islands',\n value: 'CK',\n calling_code: '682',\n },\n {\n label: 'Costa Rica',\n value: 'CR',\n calling_code: '506',\n },\n {\n label: 'Cote D\\'Ivoire',\n value: 'CI',\n calling_code: '225',\n },\n {\n label: 'Croatia',\n value: 'HR',\n calling_code: '385',\n },\n {\n label: 'Cuba',\n value: 'CU',\n calling_code: '53',\n },\n {\n label: 'Cyprus',\n value: 'CY',\n calling_code: '357',\n },\n {\n label: 'Czech Republic',\n value: 'CZ',\n calling_code: '420',\n },\n {\n label: 'Denmark',\n value: 'DK',\n calling_code: '45',\n },\n {\n label: 'Djibouti',\n value: 'DJ',\n calling_code: '253',\n },\n {\n label: 'Dominica',\n value: 'DM',\n calling_code: '1',\n },\n {\n label: 'Dominican Republic',\n value: 'DO',\n calling_code: '1',\n },\n {\n label: 'Ecuador',\n value: 'EC',\n calling_code: '593',\n },\n {\n label: 'Egypt',\n value: 'EG',\n calling_code: '20',\n },\n {\n label: 'El Salvador',\n value: 'SV',\n calling_code: '503',\n },\n {\n label: 'Equatorial Guinea',\n value: 'GQ',\n calling_code: '240',\n },\n {\n label: 'Eritrea',\n value: 'ER',\n calling_code: '291',\n },\n {\n label: 'Estonia',\n value: 'EE',\n calling_code: '372',\n },\n {\n label: 'Ethiopia',\n value: 'ET',\n calling_code: '251',\n },\n {\n label: 'Falkland Islands (Malvinas)',\n value: 'FK',\n calling_code: '500',\n },\n {\n label: 'Faroe Islands',\n value: 'FO',\n calling_code: '298',\n },\n {\n label: 'Fiji',\n value: 'FJ',\n calling_code: '679',\n },\n {\n label: 'Finland',\n value: 'FI',\n calling_code: '358',\n },\n {\n label: 'France',\n value: 'FR',\n calling_code: '33',\n },\n {\n label: 'French Guiana',\n value: 'GF',\n calling_code: '594',\n },\n {\n label: 'French Polynesia',\n value: 'PF',\n calling_code: '689',\n },\n {\n label: 'Gabon',\n value: 'GA',\n calling_code: '241',\n },\n {\n label: 'Gambia',\n value: 'GM',\n calling_code: '220',\n },\n {\n label: 'Georgia',\n value: 'GE',\n calling_code: '995',\n },\n {\n label: 'Germany',\n value: 'DE',\n calling_code: '49',\n },\n {\n label: 'Ghana',\n value: 'GH',\n calling_code: '233',\n },\n {\n label: 'Gibraltar',\n value: 'GI',\n calling_code: '350',\n },\n {\n label: 'Greece',\n value: 'GR',\n calling_code: '30',\n },\n {\n label: 'Greenland',\n value: 'GL',\n calling_code: '299',\n },\n {\n label: 'Grenada',\n value: 'GD',\n calling_code: '1',\n },\n {\n label: 'Guadeloupe',\n value: 'GP',\n calling_code: '590',\n },\n {\n label: 'Guam',\n value: 'GU',\n calling_code: '1',\n },\n {\n label: 'Guatemala',\n value: 'GT',\n calling_code: '502',\n },\n {\n label: 'Guinea',\n value: 'GN',\n calling_code: '224',\n },\n {\n label: 'Guinea-Bissau',\n value: 'GW',\n calling_code: '245',\n },\n {\n label: 'Guyana',\n value: 'GY',\n calling_code: '592',\n },\n {\n label: 'Haiti',\n value: 'HT',\n calling_code: '509',\n },\n {\n label: 'Honduras',\n value: 'HN',\n calling_code: '504',\n },\n {\n label: 'Hong Kong',\n value: 'HK',\n calling_code: '852',\n },\n {\n label: 'Hungary',\n value: 'HU',\n calling_code: '36',\n },\n {\n label: 'Iceland',\n value: 'IS',\n calling_code: '354',\n },\n {\n label: 'India',\n value: 'IN',\n calling_code: '91',\n },\n {\n label: 'Indonesia',\n value: 'ID',\n calling_code: '62',\n },\n {\n label: 'Iran',\n value: 'IR',\n calling_code: '98',\n },\n {\n label: 'Iraq',\n value: 'IQ',\n calling_code: '964',\n },\n {\n label: 'Ireland',\n value: 'IE',\n calling_code: '353',\n },\n {\n label: 'Israel',\n value: 'IL',\n calling_code: '972',\n },\n {\n label: 'Italy',\n value: 'IT',\n calling_code: '39',\n },\n {\n label: 'Jamaica',\n value: 'JM',\n calling_code: '1',\n },\n {\n label: 'Japan',\n value: 'JP',\n calling_code: '81',\n },\n {\n label: 'Jordan',\n value: 'JO',\n calling_code: '962',\n },\n {\n label: 'Kazakhstan',\n value: 'KZ',\n calling_code: '7',\n },\n {\n label: 'Kenya',\n value: 'KE',\n calling_code: '254',\n },\n {\n label: 'Kiribati',\n value: 'KI',\n calling_code: '686',\n },\n {\n label: 'Kosovo',\n value: 'XK',\n calling_code: '383',\n },\n {\n label: 'Kuwait',\n value: 'KW',\n calling_code: '965',\n },\n {\n label: 'Kyrgyzstan',\n value: 'KG',\n calling_code: '996',\n },\n {\n label: 'Laos',\n value: 'LA',\n calling_code: '856',\n },\n {\n label: 'Latvia',\n value: 'LV',\n calling_code: '371',\n },\n {\n label: 'Lebanon',\n value: 'LB',\n calling_code: '961',\n },\n {\n label: 'Lesotho',\n value: 'LS',\n calling_code: '266',\n },\n {\n label: 'Liberia',\n value: 'LR',\n calling_code: '231',\n },\n {\n label: 'Libya',\n value: 'LY',\n calling_code: '218',\n },\n {\n label: 'Liechtenstein',\n value: 'LI',\n calling_code: '423',\n },\n {\n label: 'Lithuania',\n value: 'LT',\n calling_code: '370',\n },\n {\n label: 'Luxembourg',\n value: 'LU',\n calling_code: '352',\n },\n {\n label: 'Macao',\n value: 'MO',\n calling_code: '853',\n },\n {\n label: 'Madagascar',\n value: 'MG',\n calling_code: '261',\n },\n {\n label: 'Malawi',\n value: 'MW',\n calling_code: '265',\n },\n {\n label: 'Malaysia',\n value: 'MY',\n calling_code: '60',\n },\n {\n label: 'Maldives',\n value: 'MV',\n calling_code: '960',\n },\n {\n label: 'Mali',\n value: 'ML',\n calling_code: '223',\n },\n {\n label: 'Malta',\n value: 'MT',\n calling_code: '356',\n },\n {\n label: 'Marshall Islands',\n value: 'MH',\n calling_code: '692',\n },\n {\n label: 'Martinique',\n value: 'MQ',\n calling_code: '596',\n },\n {\n label: 'Mauritania',\n value: 'MR',\n calling_code: '222',\n },\n {\n label: 'Mauritius',\n value: 'MU',\n calling_code: '230',\n },\n {\n label: 'Mexico',\n value: 'MX',\n calling_code: '52',\n },\n {\n label: 'Micronesia',\n value: 'FM',\n calling_code: '691',\n },\n {\n label: 'Moldova',\n value: 'MD',\n calling_code: '373',\n },\n {\n label: 'Monaco',\n value: 'MC',\n calling_code: '377',\n },\n {\n label: 'Mongolia',\n value: 'MN',\n calling_code: '976',\n },\n {\n label: 'Montenegro',\n value: 'ME',\n calling_code: '382',\n },\n {\n label: 'Montserrat',\n value: 'MS',\n calling_code: '1',\n },\n {\n label: 'Morocco',\n value: 'MA',\n calling_code: '212',\n },\n {\n label: 'Mozambique',\n value: 'MZ',\n calling_code: '258',\n },\n {\n label: 'Myanmar',\n value: 'MM',\n calling_code: '95',\n },\n {\n label: 'Namibia',\n value: 'NA',\n calling_code: '264',\n },\n {\n label: 'Nauru',\n value: 'NR',\n calling_code: '674',\n },\n {\n label: 'Nepal',\n value: 'NP',\n calling_code: '977',\n },\n {\n label: 'Netherlands',\n value: 'NL',\n calling_code: '31',\n },\n {\n label: 'New Caledonia',\n value: 'NC',\n calling_code: '687',\n },\n {\n label: 'New Zealand',\n value: 'NZ',\n calling_code: '64',\n },\n {\n label: 'Nicaragua',\n value: 'NI',\n calling_code: '505',\n },\n {\n label: 'Niger',\n value: 'NE',\n calling_code: '227',\n },\n {\n label: 'Nigeria',\n value: 'NG',\n calling_code: '234',\n },\n {\n label: 'Niue',\n value: 'NU',\n calling_code: '683',\n },\n {\n label: 'Norfolk Island',\n value: 'NF',\n calling_code: '672',\n },\n {\n label: 'North Korea',\n value: 'KP',\n calling_code: '850',\n },\n {\n label: 'North Macedonia',\n value: 'MK',\n calling_code: '389',\n },\n {\n label: 'Northern Mariana Islands',\n value: 'MP',\n calling_code: '1',\n },\n {\n label: 'Norway',\n value: 'NO',\n calling_code: '47',\n },\n {\n label: 'Oman',\n value: 'OM',\n calling_code: '968',\n },\n {\n label: 'Pakistan',\n value: 'PK',\n calling_code: '92',\n },\n {\n label: 'Palau',\n value: 'PW',\n calling_code: '680',\n },\n {\n label: 'Palestinian',\n value: 'PS',\n calling_code: '970',\n },\n {\n label: 'Panama',\n value: 'PA',\n calling_code: '507',\n },\n {\n label: 'Papua New Guinea',\n value: 'PG',\n calling_code: '675',\n },\n {\n label: 'Paraguay',\n value: 'PY',\n calling_code: '595',\n },\n {\n label: 'Peru',\n value: 'PE',\n calling_code: '51',\n },\n {\n label: 'Philippines',\n value: 'PH',\n calling_code: '63',\n },\n {\n label: 'Poland',\n value: 'PL',\n calling_code: '48',\n },\n {\n label: 'Portugal',\n value: 'PT',\n calling_code: '351',\n },\n {\n label: 'Puerto Rico',\n value: 'PR',\n calling_code: '1',\n },\n {\n label: 'Qatar',\n value: 'QA',\n calling_code: '974',\n },\n {\n label: 'Reunion',\n value: 'RE',\n calling_code: '262',\n },\n {\n label: 'Romania',\n value: 'RO',\n calling_code: '40',\n },\n {\n label: 'Russian',\n value: 'RU',\n calling_code: '7',\n },\n {\n label: 'Rwanda',\n value: 'RW',\n calling_code: '250',\n },\n {\n label: 'Samoa',\n value: 'WS',\n calling_code: '685',\n },\n {\n label: 'San Marino',\n value: 'SM',\n calling_code: '378',\n },\n {\n label: 'Sao Tome & Principe',\n value: 'ST',\n calling_code: '239',\n },\n {\n label: 'Saudi Arabia',\n value: 'SA',\n calling_code: '966',\n },\n {\n label: 'Senegal',\n value: 'SN',\n calling_code: '221',\n },\n {\n label: 'Serbia',\n value: 'CS',\n calling_code: '381',\n },\n {\n label: 'Seychelles',\n value: 'SC',\n calling_code: '248',\n },\n {\n label: 'Sierra Leone',\n value: 'SL',\n calling_code: '232',\n },\n {\n label: 'Singapore',\n value: 'SG',\n calling_code: '65',\n },\n {\n label: 'Slovakia',\n value: 'SK',\n calling_code: '421',\n },\n {\n label: 'Slovenia',\n value: 'SI',\n calling_code: '386',\n },\n {\n label: 'Solomon Islands',\n value: 'SB',\n calling_code: '677',\n },\n {\n label: 'Somalia',\n value: 'SO',\n calling_code: '252',\n },\n {\n label: 'South Africa',\n value: 'ZA',\n calling_code: '27',\n },\n {\n label: 'South Korea',\n value: 'KR',\n calling_code: '82',\n },\n {\n label: 'South Sudan',\n value: 'SS',\n calling_code: '211',\n },\n {\n label: 'Spain',\n value: 'ES',\n calling_code: '34',\n },\n {\n label: 'Sri Lanka',\n value: 'LK',\n calling_code: '94',\n },\n {\n label: 'St. Barthelemy',\n value: 'BL',\n calling_code: '590',\n },\n {\n label: 'St. Helena',\n value: 'SH',\n calling_code: '290',\n },\n {\n label: 'St. Kitts & Nevis',\n value: 'KN',\n calling_code: '1',\n },\n {\n label: 'St. Lucia',\n value: 'LC',\n calling_code: '1',\n },\n {\n label: 'St. Martin',\n value: 'SX',\n calling_code: '590',\n },\n {\n label: 'St. Pierre & Miquelon',\n value: 'PM',\n calling_code: '508',\n },\n {\n label: 'St. Vincent & Grenadines',\n value: 'VC',\n calling_code: '1',\n },\n {\n label: 'Sudan',\n value: 'SD',\n calling_code: '249',\n },\n {\n label: 'Suriname',\n value: 'SR',\n calling_code: '597',\n },\n {\n label: 'Sweden',\n value: 'SE',\n calling_code: '46',\n },\n {\n label: 'Switzerland',\n value: 'CH',\n calling_code: '41',\n },\n {\n label: 'Syrian',\n value: 'SY',\n calling_code: '963',\n },\n {\n label: 'Taiwan',\n value: 'TW',\n calling_code: '886',\n },\n {\n label: 'Tajikistan',\n value: 'TJ',\n calling_code: '992',\n },\n {\n label: 'Tanzania',\n value: 'TZ',\n calling_code: '255',\n },\n {\n label: 'Thailand',\n value: 'TH',\n calling_code: '66',\n },\n {\n label: 'Timor-Leste',\n value: 'TL',\n calling_code: '670',\n },\n {\n label: 'Togo',\n value: 'TG',\n calling_code: '228',\n },\n {\n label: 'Tokelau',\n value: 'TK',\n calling_code: '690',\n },\n {\n label: 'Tonga',\n value: 'TO',\n calling_code: '676',\n },\n {\n label: 'Trinidad & Tobago',\n value: 'TT',\n calling_code: '1',\n },\n {\n label: 'Tunisia',\n value: 'TN',\n calling_code: '216',\n },\n {\n label: 'Turkey',\n value: 'TR',\n calling_code: '90',\n },\n {\n label: 'Turkmenistan',\n value: 'TM',\n calling_code: '993',\n },\n {\n label: 'Turks & Caicos Islands',\n value: 'TC',\n calling_code: '1',\n },\n {\n label: 'Tuvalu',\n value: 'TV',\n calling_code: '688',\n },\n {\n label: 'Uganda',\n value: 'UG',\n calling_code: '256',\n },\n {\n label: 'Ukraine',\n value: 'UA',\n calling_code: '380',\n },\n {\n label: 'United Arab Emirates',\n value: 'AE',\n calling_code: '971',\n },\n {\n label: 'United Kingdom',\n value: 'GB',\n calling_code: '44',\n },\n {\n label: 'United States',\n value: 'US',\n calling_code: '1',\n },\n {\n label: 'Uruguay',\n value: 'UY',\n calling_code: '598',\n },\n {\n label: 'Uzbekistan',\n value: 'UZ',\n calling_code: '998',\n },\n {\n label: 'Vanuatu',\n value: 'VU',\n calling_code: '678',\n },\n {\n label: 'Vatican City',\n value: 'VA',\n calling_code: '39',\n },\n {\n label: 'Venezuela',\n value: 'VE',\n calling_code: '58',\n },\n {\n label: 'Vietnam',\n value: 'VN',\n calling_code: '84',\n },\n {\n label: 'Virgin Islands, British',\n value: 'VG',\n calling_code: '1',\n },\n {\n label: 'Virgin Islands, U.S.',\n value: 'VI',\n calling_code: '1',\n },\n {\n label: 'Wallis & Futuna',\n value: 'WF',\n calling_code: '681',\n },\n {\n label: 'Yemen',\n value: 'YE',\n calling_code: '967',\n },\n {\n label: 'Zambia',\n value: 'ZM',\n calling_code: '260',\n },\n {\n label: 'Zimbabwe',\n value: 'ZW',\n calling_code: '263',\n },\n];\n","export const leadDefaultWorkflowID = 'default-lead-workflow';\n\nexport const leadWorkflowTypeOptions = [\n {\n label: 'Notification',\n value: 'lead_notification',\n },\n {\n label: 'Automation',\n value: 'lead_automation',\n },\n];\n\nexport const leadDefaultWorkflowEmailAssignee = {\n createdAt: '',\n createdByAffiliate: { id: 'system', name: 'System' },\n updatedAt: '',\n description: 'Send an email notification to assignee when lead or opportunity is assigned',\n enabled: true,\n id: leadDefaultWorkflowID,\n name: 'Email assignee when lead/opportunity is assigned',\n progressCalculationMethod: 'by_stage',\n startMethod: 'immediately',\n triggerFrequency: '* * * *',\n workflowAutomations: [{\n createdAt: '',\n updatedAt: '',\n enabled: true,\n id: 'default-lead-automation',\n name: '',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n }],\n workflowTypeID: 'lead_notification',\n};\n\nexport const leadDefaultAutomationEmailAssignee = {\n enabled: true,\n id: 'default-lead-automation',\n name: '',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n rulesetLinking: 'AND',\n actions: [\n {\n id: 'action-id-1',\n sendEmailOn: '* * * * *',\n sendEmailRecipients: 'Assignee',\n sendEmailSubject: 'You have been assigned a new lead',\n sendEmailTemplate: '

Hi {{if .assignee_name}}{{.assignee_name}}{{else}}n/a{{end}},

A new lead has been assigned to you.

Name: {{if .name}}{{.name}}{{else}}n/a{{end}}

Project name: {{if .project_names}}{{range $i, $project_name := .project_names}}{{if $i}}, {{end}}{{$project_name}}{{end}}{{else}}n/a{{end}}

Source: {{if .source}}{{.source}}{{else}}n/a{{end}}

Company name: {{if .company_name}}{{.company_name}}{{else}}n/a{{end}}

Login to our web app to contact this lead. Update the stage and manage your sales. That way, you will have more time to do the things that matter without scrambling through your contacts!

This is a system generated email notification to inform you that you have received a lead on MHub CRM. Do not reply to this email.

{{if .url}}{{.url}}{{else}}n/a{{end}}

',\n workflowAutomationActionTypeID: 'default_notify_lead_email',\n workflowAutomationID: 'default-lead-automation',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n },\n {\n id: 'action-id-2',\n sendEmailOn: '* * * * *',\n sendEmailRecipients: 'Assignee',\n sendEmailSubject: 'You have been assigned a new opportunity',\n sendEmailTemplate: '

Hi {{if .assignee_name}}{{.assignee_name}}{{else}}n/a{{end}},

A new opportunity has been assigned to you.

Name: {{if .name}}{{.name}}{{else}}n/a{{end}}

Project name: {{if .project_names}}{{range $i, $project_name := .project_names}}{{if $i}}, {{end}}{{$project_name}}{{end}}{{else}}n/a{{end}}

Source: {{if .source}}{{.source}}{{else}}n/a{{end}}

Company name: {{if .company_name}}{{.company_name}}{{else}}n/a{{end}}

Login to our web app to contact this lead. Update the stage and manage your sales. That way, you will have more time to do the things that matter without scrambling through your contacts!

This is a system generated email notification to inform you that you have received a lead on MHub CRM. Do not reply to this email.

{{if .url}}{{.url}}{{else}}n/a{{end}}

',\n workflowAutomationActionTypeID: 'default_notify_opportunity_email',\n workflowAutomationID: 'default-lead-automation',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n },\n ],\n conditions: [\n {\n id: 'condition-id',\n subject: 'lead_record',\n field: 'assigned_at',\n operator: '==',\n value: 'now',\n valueType: 'string',\n workflowAutomationID: 'default-lead-automation',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n },\n {\n id: 'condition-id',\n subject: 'lead_record',\n field: 'assigned_to',\n operator: 'exists',\n workflowAutomationID: 'default-lead-automation',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n },\n {\n id: 'condition-id',\n subject: 'lead_record',\n field: 'imported_at',\n operator: 'notexists',\n workflowAutomationID: 'default-lead-automation',\n workflowID: leadDefaultWorkflowID,\n workflowTypeID: 'lead_notification',\n },\n ],\n};\n","import { makeStyles } from '@material-ui/core/styles';\n\nexport default makeStyles(({\n loadingPage: {\n height: '100%',\n },\n}));\n","import {\n CircularProgress,\n Typography,\n Grid,\n} from '@material-ui/core';\nimport { LoadingPageProps } from './types';\nimport useStyles from './styles';\n\nconst LoadingPage = (\n {\n error = false,\n isLoading,\n } : LoadingPageProps,\n) => {\n const classes = useStyles();\n\n if (isLoading) {\n return (\n \n \n \n );\n }\n if (error) {\n return (\n \n \n Sorry, there was a problem loading the page.\n \n \n );\n }\n return null;\n};\n\nexport default LoadingPage;\n","import { object, string, number } from 'yup';\nimport { CompanyBranchOption } from '../../pages/Workflow/Tabs/LeadAutomation/types';\n\nexport const callActionObjectValidationSchema = {\n workflowAutomationActionTypeID: string().required('Action type is required'),\n callLeadAssigneeAttempts: number()\n .required('Call attempts is required')\n .min(1, 'Value cannot be less than one')\n .integer('Invalid format'),\n callLeadAssigneeAttemptInterval: number()\n .required('Call interval is required')\n .min(10, 'Value cannot be less than ten')\n .integer('Invalid format'),\n callLeadAssigneeWeekdayDays: string()\n .when('callLeadAssigneeWeekendDays', {\n is: (v: string) => !(v && v.length > 0),\n then: string().required('Require to check atleast one option'),\n otherwise: string(),\n }),\n callLeadAssigneeWeekdayStartTime: string()\n .when('callLeadAssigneeWeekdayDays', {\n is: (v: string) => v && v.length > 0,\n then: string().required('Start time is required'),\n }),\n callLeadAssigneeWeekdayEndTime: string()\n .when('callLeadAssigneeWeekdayDays', {\n is: (v: string) => v && v.length > 0,\n then: string().required('End time is required'),\n }),\n callLeadAssigneeWeekendDays: string()\n .when('callLeadAssigneeWeekdayDays', {\n is: (v: string) => !(v && v.length > 0),\n then: string().required('Require to check atleast one option'),\n otherwise: string(),\n }),\n callLeadAssigneeWeekendStartTime: string()\n .when('callLeadAssigneeWeekendDays', {\n is: (v: string) => v && v.length > 0,\n then: string().required('Start time is required'),\n }),\n callLeadAssigneeWeekendEndTime: string()\n .when('callLeadAssigneeWeekendDays', {\n is: (v: string) => v && v.length > 0,\n then: string().required('End time is required'),\n }),\n};\n\nexport const validationSchema = (listBusinessUnit: CompanyBranchOption[]) => object().shape(\n {\n ...callActionObjectValidationSchema,\n callLeadAssigneeCaller: string()\n .test(\n 'callLeadAssigneeCaller',\n 'Mobile number is required',\n (value) => {\n if (value === 'assignee') return true;\n if (value) {\n const splitted = value.split('-');\n return (splitted.length > 1 && splitted[1] !== '') || false;\n }\n return false;\n },\n )\n .test(\n 'callLeadAssigneeCaller',\n 'The selected business unit’s number is invalid or has been deleted.',\n (value) => {\n if (value === 'assignee') return true;\n return (!!value\n && listBusinessUnit?.length > 0\n && listBusinessUnit.some((bu: CompanyBranchOption) => bu.id === value));\n },\n ),\n },\n [['callLeadAssigneeWeekdayDays', 'callLeadAssigneeWeekendDays']],\n);\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport {\n fontSize,\n fontFamily,\n tertiaryColors,\n fontWeight,\n} from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n chip: {\n backgroundColor: tertiaryColors.mediumGrey,\n margin: theme.spacing(0.2),\n },\n chipDeletable: {\n width: '18px',\n },\n chipLabel: {\n ...theme.typography.body2,\n },\n listbox: {\n padding: 0,\n margin: 0,\n },\n option: {\n ...theme.typography.body1,\n wordBreak: 'break-all',\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n },\n paper: {\n boxShadow: 'unset',\n border: `1px solid ${tertiaryColors.grey}`,\n margin: 0,\n },\n groupLabel: {\n top: '0',\n lineHeight: 'unset',\n paddingTop: theme.spacing(1.375),\n paddingBottom: theme.spacing(1),\n textTransform: 'uppercase',\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.bold,\n fontSize: fontSize['12px'],\n },\n groupUl: {\n paddingBottom: theme.spacing(1),\n },\n endAdornment: {\n top: 'unset',\n },\n root: {\n '& input': {\n height: '22px',\n },\n },\n}));\n","/* eslint-disable arrow-body-style */\n/* eslint-disable react/require-default-props */\nimport {\n Autocomplete as MuiAutocomplete,\n FilterOptionsState,\n Value,\n} from '@material-ui/lab';\nimport { useCallback } from 'react';\nimport _, {\n isEqual, findIndex, isArray, map, reduce,\n} from 'lodash';\nimport {\n createFilterOptions,\n} from '@material-ui/lab/Autocomplete';\nimport { Checkbox, CheckboxProps, CircularProgress } from '@material-ui/core';\nimport { CheckBox, CheckBoxOutlineBlank } from '@material-ui/icons';\n\nimport { getSelectorValue } from '../../utils';\nimport { AutocompleteOption, AutocompleteProps } from './types';\nimport useStyles from './styles';\nimport { TextFieldInput } from '..';\nimport { DropdownOption } from '../../types';\n\nconst AutocompleteInput = <\n T,\n Multiple extends boolean | undefined,\n DisableClearable extends boolean | undefined,\n FreeSolo extends boolean | undefined,\n>({\n options,\n keySelector,\n labelSelector,\n emptyValue = '',\n disabled,\n name,\n label,\n required,\n withSelectAll = false,\n placeholder = 'Select',\n value,\n defaultValue,\n onSelectAll,\n withCheckBox = false,\n onChange,\n startAdornment,\n TextFieldProps,\n ...MuiAutocompleteProps\n }: AutocompleteProps & {\n onSelectAll?:(isAllSelected: boolean, items: any[]) => void;\n withCheckBox?: boolean;\n withSelectAll?: boolean;\n }) => {\n const classes = useStyles();\n\n const isSelectAllOption = (\n option: any,\n ): option is AutocompleteOption => option && option.label && option.value;\n\n const isAllSelected = _.isArray(value) && value.length === options?.length;\n\n const handleOnChange = (\n e: React.ChangeEvent<{}>,\n newValue: Value,\n ) => {\n let v = emptyValue;\n if (isArray(newValue)) {\n const isSelectAll = _.some(\n newValue as DropdownOption[],\n (opt) => opt.value === 'SELECT_ALL',\n );\n\n if (isSelectAll) {\n const ids = _.uniq(\n _.map(\n options as any[] as DropdownOption[],\n (opt) => opt.value,\n ),\n );\n onSelectAll?.(!isAllSelected, ids);\n return;\n }\n v = map(newValue, (item: T) => getSelectorValue(item, keySelector));\n } else if (newValue) {\n // TODO: replace any type with more precise type\n v = getSelectorValue(newValue, keySelector);\n }\n onChange?.(e, v as any, 'select-option'); // Temporary fix for multiple type (as any)\n };\n\n const findItem = useCallback(\n (identifier: any) => {\n if (options && options.length > 0) {\n const index = findIndex(options, (o: T) => isEqual(\n getSelectorValue(o, keySelector), identifier,\n ));\n if (index > -1) {\n return options[index];\n }\n }\n return null;\n },\n [options, keySelector],\n );\n\n const findValue = useCallback(\n (_value): any => {\n if (MuiAutocompleteProps.multiple) {\n return reduce(\n _value,\n (result: any[], identifier) => {\n const item = findItem(identifier);\n return item ? result.concat(item) : result;\n },\n [],\n );\n }\n return findItem(_value as any) ?? emptyValue; // Temporary fix for multiple type (as any)\n },\n [findItem, MuiAutocompleteProps.multiple, emptyValue],\n );\n\n const realValue = findValue(value ?? defaultValue);\n\n const defaultGetOptionLabel = (option: T) => (option ? getSelectorValue(option, labelSelector) : '');\n\n const filter = createFilterOptions();\n\n const defaultGetOptionSelected = (option: T, selected: T) => isEqual(\n getSelectorValue(option, keySelector),\n getSelectorValue(selected, keySelector),\n );\n\n const getOptions = () => {\n let cOptions = realValue === '' ? [realValue, ...(options || [])] : (options || []);\n cOptions = MuiAutocompleteProps.multiple && withSelectAll\n ? [{ label: 'Select All', value: 'SELECT_ALL' }, ...cOptions]\n : cOptions;\n return cOptions;\n };\n\n return (\n (\n \n {MuiAutocompleteProps.loading && }\n {params.InputProps.endAdornment}\n \n ),\n }}\n {...TextFieldProps}\n />\n )}\n value={realValue}\n noOptionsText=\"No options available\"\n onChange={handleOnChange}\n renderOption={(option: T | AutocompleteOption, { selected }) => {\n let formControlLabel = defaultGetOptionLabel(option as T);\n if (withCheckBox) {\n const selectAllProps: Partial = {};\n if (isSelectAllOption(option) && option.value === 'SELECT_ALL') {\n formControlLabel = option.label;\n selectAllProps.checked = isAllSelected;\n }\n return (\n <>\n }\n checkedIcon={}\n style={{ marginRight: 8 }}\n checked={selected}\n {...selectAllProps}\n />\n {formControlLabel}\n \n );\n }\n return (\n MuiAutocompleteProps.renderOption\n ? MuiAutocompleteProps.renderOption\n : defaultGetOptionLabel(option as T)\n );\n }}\n filterOptions={(_options: T[], state: FilterOptionsState) => filter(_options, state)}\n getOptionLabel={defaultGetOptionLabel}\n getOptionSelected={defaultGetOptionSelected}\n disableClearable={\n !realValue || MuiAutocompleteProps.loading || MuiAutocompleteProps.disableClearable\n }\n ChipProps={{\n className: classes.chip,\n classes: {\n deleteIcon: classes.chipDeletable,\n label: classes.chipLabel,\n },\n }}\n classes={{\n root: classes.root,\n listbox: classes.listbox,\n option: classes.option,\n paper: classes.paper,\n groupLabel: classes.groupLabel,\n groupUl: classes.groupUl,\n endAdornment: classes.endAdornment,\n ...MuiAutocompleteProps.classes,\n }}\n {...MuiAutocompleteProps}\n />\n );\n};\n\nexport default AutocompleteInput;\n","import MuiAlert, {\n AlertProps,\n} from '@material-ui/lab/Alert';\n\nexport default function AppAlert(props: AlertProps) {\n return ;\n}\n","import {\n Snackbar,\n} from '@material-ui/core';\nimport AppAlert from '../AppAlert';\nimport { useAlert } from '../../hooks';\n\nexport default function AppSnackBar() {\n const {\n severity,\n message,\n alert,\n hideAlert,\n } = useAlert();\n return (\n \n \n {message}\n \n \n );\n}\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport { secondaryColors, tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles({\n container: {\n padding: '0.5rem',\n '& > div': {\n marginRight: '0.5rem',\n },\n '&.info': {\n backgroundColor: tertiaryColors.lightBlue,\n '& > div > svg': {\n color: secondaryColors.main,\n },\n },\n '&.warning': {\n backgroundColor: tertiaryColors.mustard,\n '& > div > svg': {\n color: tertiaryColors.marigold,\n },\n },\n },\n});\n","import { Grid } from '@material-ui/core';\nimport {\n InfoOutlined as InfoOutlinedIcon,\n Warning as WarningIcon,\n} from '@material-ui/icons';\nimport clsx from 'clsx';\nimport { BannerProps } from './types';\nimport useStyles from './styles';\n\nconst Banner = ({\n type,\n content,\n}: BannerProps) => {\n const classes = useStyles();\n\n const renderIcon = () => {\n switch (type) {\n case 'info':\n return ;\n case 'warning':\n return ;\n default:\n break;\n }\n return null;\n };\n\n return (\n \n \n { renderIcon() }\n \n \n { content }\n \n \n );\n};\n\nexport default Banner;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport { fontVariants } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n root: fontVariants.body2,\n colorPrimary: {\n color: theme.palette.common.white,\n backgroundColor: theme.palette.primary.main,\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n },\n deleteIcon: {\n display: 'none',\n height: '1.1rem',\n },\n deleteIconColorPrimary: {\n display: 'inline-block',\n color: theme.palette.common.white,\n },\n}));\n","import React from 'react';\n\nimport { Chip, ChipProps } from '@material-ui/core';\n\nimport useStyles from './ChipFilter.styles';\n\nconst ChipFilter = React.forwardRef((props: ChipProps, ref: React.Ref) => {\n const classes = useStyles();\n return (\n \n );\n});\n\nexport default ChipFilter;\n","import {\n Avatar,\n Chip,\n} from '@material-ui/core';\nimport { ChipNameProps } from './types';\nimport { useStyles } from './styles';\n\nconst ChipName = (\n props: ChipNameProps,\n) => {\n const {\n inactive,\n isSmallerFont,\n ...MuiChipProps\n } = props;\n const classes = useStyles(props, isSmallerFont, inactive);\n\n const renderNameInitial = () => {\n if (MuiChipProps.label && typeof MuiChipProps.label === 'string') {\n const { label } = MuiChipProps;\n const initial: string = (label.charAt(0)).toUpperCase();\n return initial;\n }\n return '';\n };\n\n return (\n { renderNameInitial() }}\n classes={{\n root: classes.root,\n ...MuiChipProps.classes,\n }}\n {...MuiChipProps}\n />\n );\n};\n\nexport default ChipName;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontColors, fontSize, tertiaryColors } from '../../styles/variables';\n\nexport function useStyles(props: any, isSmallerFont?: boolean, inactive?: boolean) {\n return makeStyles((theme) => ({\n root: {\n marginRight: '0.5rem',\n fontSize: isSmallerFont ? fontSize['12px'] : fontSize['14px'],\n fontColor: inactive ? fontColors.body : fontColors.header,\n '& > .MuiChip-avatar': {\n backgroundColor: inactive ? tertiaryColors.darkGrey : theme.palette.secondary.main,\n color: theme.palette.common.white,\n },\n },\n }))(props);\n}\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\n\nexport default makeStyles((theme) => ({\n container: {\n paddingBottom: '5rem',\n },\n ctaButton: {\n position: 'fixed',\n bottom: 0,\n backgroundColor: theme.palette.common.white,\n width: '350px',\n padding: '1rem',\n display: 'flex',\n justifyContent: 'flex-end',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n padding: '1rem 7rem 1rem 1rem',\n },\n },\n}));\n","import { Box, Button } from '@material-ui/core';\nimport\n{\n ErrorMessage, Field, Form, Formik,\n} from 'formik';\nimport { pick } from 'lodash';\nimport { ChangeEvent, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { object, string } from 'yup';\nimport { AutocompleteInput, ConfirmationModal, Drawer } from '..';\nimport { readWorkflow } from '../../apis';\nimport { useAlert, useLoader, useToggleState } from '../../hooks';\nimport { creditControlActions } from '../../pages/NewAutomation/formData';\nimport {\n DropdownOption, TParams, WorkflowStage,\n} from '../../types';\nimport { getErrorMessage } from '../../utils';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\nimport useStyles from './styles';\nimport { ConfigureCaseDrawerProps } from './types';\n\nconst ConfigureCaseDrawer = ({\n actionTypeID,\n formikProps,\n open,\n onClose,\n selectedActionIndex,\n selectedSuggestion,\n setActionTypeID,\n}: ConfigureCaseDrawerProps) => {\n const classes = useStyles();\n const { type } = useParams();\n const { setAlert } = useAlert();\n const [workflowStages, setWorkflowStages] = useState([]);\n const { loaders, toggleLoadingState } = useLoader();\n const { activeStates, toggleState } = useToggleState({\n leaveConfirmation: false,\n });\n\n const listCases = async (workflowID: string) => {\n toggleLoadingState('loading', true);\n\n try {\n const res = await readWorkflow(workflowID);\n\n const formattedWorkflowStageOptions = res?.workflowStages?.map((stage: WorkflowStage) => ({\n label: stage?.name,\n value: stage?.id,\n stageTasks: stage?.workflowStageTasks?.map((task) => ({\n label: task?.name,\n value: task?.id,\n title: stage?.name,\n })) || [],\n })) || [];\n\n setWorkflowStages(\n formattedWorkflowStageOptions.filter(\n (option: DropdownOption) => option.label && option.value,\n ),\n );\n } catch (err) {\n setAlert(\n {\n message: getErrorMessage(err),\n severity: 'error',\n },\n true,\n );\n }\n\n toggleLoadingState('loading', false);\n };\n\n useEffect(() => {\n listCases(formikProps.values.workflowID);\n }, []);\n\n const getActionOptions = () => {\n let options: AutocompleteOption[] = [];\n if (type === 'credit_control') {\n if (selectedSuggestion) {\n const suggestionIndex = creditControlActions.findIndex(\n (action) => action.name === selectedSuggestion,\n );\n if (suggestionIndex > -1) {\n options = creditControlActions[suggestionIndex].types;\n }\n } else {\n options = [];\n }\n }\n return options;\n };\n\n const getTitle = () => creditControlActions[0]\n .types.find((actionType) => actionType.value === actionTypeID)?.label || 'N/A';\n\n const renderModal = () => (\n {\n toggleState('leaveConfirmation');\n }}\n type=\"leave\"\n />\n );\n\n return (\n <>\n {renderModal()}\n {\n const workflowValues = [\n 'workflowID',\n 'workflowTypeID',\n 'updateStatusWorkflowCaseID',\n 'workflowAutomationID',\n 'workflowAutomationActionTypeID',\n ];\n\n const updateCaseStatusValues = pick(\n values,\n 'updateStatusWorkflowCaseStatus',\n ...workflowValues,\n );\n\n const completeStageValues = pick(\n values,\n 'completeWorkflowStageID',\n ...workflowValues,\n );\n\n const completeStageTaskValues = pick(\n values,\n 'completeWorkflowStageTaskID',\n ...workflowValues,\n );\n\n switch (values.workflowAutomationActionTypeID) {\n case 'update_workflow_case_status':\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}`,\n updateCaseStatusValues,\n );\n break;\n case 'complete_workflow_stage':\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}`,\n completeStageValues,\n );\n break;\n case 'complete_workflow_stage_task':\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}`,\n completeStageTaskValues,\n );\n break;\n default:\n }\n\n if (values.id) {\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}.id`,\n values.id,\n );\n }\n\n onClose();\n }}\n validationSchema={object({\n workflowAutomationActionTypeID: string().required(\n 'Action type is required',\n ),\n updateStatusWorkflowCaseID: string().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'update_workflow_case_status',\n then: (schema) => schema.required('Workflow case is required'),\n },\n ),\n updateStatusWorkflowCaseStatus: string().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'update_workflow_case_status',\n then: (schema) => schema.required('Workflow case status is required'),\n },\n ),\n completeWorkflowStageID: string().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'complete_workflow_stage',\n then: (schema) => schema.required('Workflow stage is required'),\n },\n ),\n completeWorkflowStageTaskID: string().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'complete_workflow_stage_task',\n then: (schema) => schema.required('Workflow stage task is required'),\n },\n ),\n })}\n validateOnMount\n >\n {({\n touched,\n errors,\n setFieldValue,\n dirty,\n isValidating,\n isSubmitting,\n isValid,\n resetForm,\n values,\n }) => (\n (dirty ? toggleState('leaveConfirmation') : onClose())}\n >\n \n \n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error:\n touched.workflowAutomationActionTypeID\n && !!errors.workflowAutomationActionTypeID,\n helperText: (\n \n ),\n }}\n value={values.workflowAutomationActionTypeID}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setActionTypeID(newValue);\n resetForm();\n setFieldValue('workflowAutomationActionTypeID', newValue);\n }}\n />\n \n {values.workflowAutomationActionTypeID === 'update_workflow_case_status' && (\n <>\n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error:\n touched.updateStatusWorkflowCaseStatus\n && !!errors.updateStatusWorkflowCaseStatus,\n helperText: (\n \n ),\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue(\n 'updateStatusWorkflowCaseStatus',\n newValue,\n );\n }}\n />\n \n \n )}\n {values.workflowAutomationActionTypeID === 'complete_workflow_stage_task' && (\n stage.stageTasks) || []\n }\n loading={loaders.loading}\n groupBy={((option: any) => option?.title.toUpperCase())}\n keySelector={(option: AutocompleteOption) => option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error:\n touched.completeWorkflowStageTaskID\n && !!errors.completeWorkflowStageTaskID,\n helperText: (\n \n ),\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue(\n 'completeWorkflowStageTaskID',\n newValue,\n );\n }}\n />\n )}\n {values.workflowAutomationActionTypeID === 'complete_workflow_stage' && (\n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error:\n touched.completeWorkflowStageID\n && !!errors.completeWorkflowStageID,\n helperText: (\n \n ),\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue('completeWorkflowStageID', newValue);\n }}\n />\n )}\n \n \n Save\n \n \n \n \n \n )}\n \n \n );\n};\n\nexport default ConfigureCaseDrawer;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\n\nexport default makeStyles((theme) => ({\n container: {\n paddingBottom: '5rem',\n },\n ctaButton: {\n position: 'fixed',\n bottom: 0,\n backgroundColor: theme.palette.common.white,\n width: '350px',\n padding: '1rem',\n display: 'flex',\n justifyContent: 'flex-end',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n padding: '1rem 7rem 1rem 1rem',\n },\n },\n}));\n","import\n{\n Box, Button, Typography,\n} from '@material-ui/core';\nimport { RawDraftContentState } from 'draft-js';\nimport\n{\n ErrorMessage,\n Field, FieldProps, Form, Formik,\n} from 'formik';\nimport _ from 'lodash';\nimport { ChangeEvent, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { object, string } from 'yup';\nimport\n{\n ConfirmationModal, ContentEditor, Drawer, TextFieldInput,\n} from '..';\nimport { listAffiliates } from '../../apis';\nimport { ALL_ACCESS_GROUPS } from '../../constants';\nimport { useAlert, useAuth, useToggleState } from '../../hooks';\nimport { creditControlActions } from '../../pages/NewAutomation/formData';\nimport\n{\n AccessGroup, ListingUser, TParams,\n} from '../../types';\nimport { convertArrayToString, convertStringToArray, getErrorMessage } from '../../utils';\nimport AutocompleteInput from '../AutocompleteInput';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\nimport useStyles from './styles';\nimport { ConfigureNotificationProps } from './types';\n\nconst ConfigureNotificationDrawer = ({\n actionTypeID,\n formikProps,\n open,\n onClose,\n selectedActionIndex,\n selectedSuggestion,\n setActionTypeID,\n}: ConfigureNotificationProps) => {\n const { type } = useParams();\n const { user } = useAuth();\n const classes = useStyles();\n const { setAlert } = useAlert();\n const { activeStates, toggleState } = useToggleState({\n leaveConfirmation: false,\n });\n const [recipients, setRecipients] = useState([]);\n const maxEmailLength = 1000;\n\n const getTitle = () => creditControlActions[0].types.find(\n (actionType) => actionType.value === actionTypeID,\n )?.label || 'N/A';\n\n const getActionOptions = () => {\n let options: AutocompleteOption[] = [];\n if (type === 'credit_control') {\n if (selectedSuggestion) {\n const suggestionIndex = creditControlActions.findIndex(\n (action) => action.name === selectedSuggestion,\n );\n if (suggestionIndex > -1) {\n options = _.filter(\n creditControlActions[suggestionIndex].types,\n (opt) => opt.value === 'send_email',\n );\n }\n } else {\n options = [];\n }\n }\n return options;\n };\n\n const handleGetEmailRecipients = async () => {\n try {\n // TODO: Support onScroll/Search to retrieve call after upgrade material to v5\n // Currently autocomplete have can't set inputValue issue\n const res = await listAffiliates(user.companyID, { limit: 1000 });\n if (res && res.items) {\n setRecipients(res.items);\n }\n } catch (err) {\n setAlert(\n {\n message: getErrorMessage(err),\n severity: 'error',\n },\n true,\n );\n }\n };\n\n useEffect(() => {\n handleGetEmailRecipients();\n }, []);\n\n const renderModal = () => (\n {\n toggleState('leaveConfirmation');\n }}\n type=\"leave\"\n />\n );\n\n const getDefaultContents = (contentState: RawDraftContentState | undefined) => {\n if (contentState && Object.keys(contentState).length !== 0\n ) {\n return contentState;\n }\n\n return { blocks: [], entityMap: {} };\n };\n\n return (\n <>\n {renderModal()}\n {\n const workflowValues = [\n 'workflowID',\n 'workflowTypeID',\n 'workflowAutomationID',\n 'workflowAutomationActionTypeID',\n ];\n\n const sendEmailValues = _.pick(\n values,\n 'sendEmailTemplate',\n 'sendEmailSubject',\n 'sendEmailRecipients',\n ...workflowValues,\n );\n\n const sendInAppNotificationValues = _.pick(\n values,\n 'sendInAppNotificationUserIDs',\n 'sendInAppNotificationUserGroups',\n 'sendInAppNotificationSetting',\n ...workflowValues,\n );\n\n let sendInAppNotificationSettingValues = _.pick(\n sendInAppNotificationValues.sendInAppNotificationSetting,\n 'titleTemplate',\n 'titleTemplateContentState',\n 'messageTemplate',\n 'messageTemplateContentState',\n );\n\n if (sendInAppNotificationValues?.sendInAppNotificationSetting?.id) {\n sendInAppNotificationSettingValues = {\n ...sendInAppNotificationSettingValues,\n id: sendInAppNotificationValues.sendInAppNotificationSetting.id,\n };\n }\n\n switch (values.workflowAutomationActionTypeID) {\n case 'send_email':\n formikProps.setFieldValue(`actions.${selectedActionIndex}`, {\n ...sendEmailValues,\n sendEmailOn: '* * * * *',\n });\n break;\n case 'send_inapp_notification': {\n formikProps.setFieldValue(`actions.${selectedActionIndex}`, {\n ...sendInAppNotificationValues,\n sendInAppNotificationSetting: {\n ...sendInAppNotificationSettingValues,\n appID: 'credit_control',\n },\n });\n break;\n }\n default:\n }\n\n if (values.id) {\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}.id`,\n values.id,\n );\n }\n\n onClose();\n }}\n validationSchema={object({\n workflowAutomationActionTypeID: string().required(\n 'Action type is required',\n ),\n sendEmailTemplate: string().when('workflowAutomationActionTypeID', {\n is: 'send_email',\n then: (schema) => schema.required('Email text is required'),\n }),\n sendEmailSubject: string().when('workflowAutomationActionTypeID', {\n is: 'send_email',\n then: (schema) => schema.required('Email subject is required'),\n }),\n sendEmailRecipients: string().when('workflowAutomationActionTypeID', {\n is: 'send_email',\n then: (schema) => schema.required('Send email to is required'),\n }),\n sendInAppNotificationUserIDs: string().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'send_inapp_notification',\n then: (schema) => schema.required('Send in-app notification to is required'),\n },\n ),\n sendInAppNotificationUserGroups: string().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'send_inapp_notification',\n then: (schema) => schema.required('User groups is required'),\n },\n ),\n sendInAppNotificationSetting: object().when(\n 'workflowAutomationActionTypeID',\n {\n is: 'send_inapp_notification',\n then: object().shape({\n titleTemplate: string().required('Title template is required'),\n messageTemplate: string().required(\n 'Message template is required',\n ),\n }),\n },\n ),\n })}\n validateOnMount\n >\n {({\n values,\n touched,\n errors,\n setFieldTouched,\n setFieldValue,\n dirty,\n isValidating,\n isSubmitting,\n isValid,\n resetForm,\n }) => (\n (dirty ? toggleState('leaveConfirmation') : onClose())}\n >\n \n \n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error:\n touched.workflowAutomationActionTypeID\n && !!errors.workflowAutomationActionTypeID,\n helperText: (\n \n ),\n }}\n value={values.workflowAutomationActionTypeID}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setActionTypeID(newValue);\n resetForm();\n setFieldValue('workflowAutomationActionTypeID', newValue);\n }}\n />\n \n {values.workflowAutomationActionTypeID === 'send_email' && (\n option.id}\n labelSelector={(option: ListingUser) => option.email}\n onChange={(e: ChangeEvent<{}>, newValue: string[]) => {\n setFieldValue(\n 'sendEmailRecipients',\n convertArrayToString(newValue),\n );\n }}\n TextFieldProps={{\n error:\n touched.sendEmailRecipients\n && !!errors.sendEmailRecipients,\n helperText: ,\n }}\n renderOption={(option: ListingUser) => (\n
\n {option.name}\n {option.email}\n
\n )}\n />\n )}\n {values.workflowAutomationActionTypeID\n === 'send_inapp_notification' && (\n <>\n option.id}\n labelSelector={(option: ListingUser) => option.email}\n onChange={(e: ChangeEvent<{}>, newValue: string[]) => {\n setFieldValue(\n 'sendInAppNotificationUserIDs',\n convertArrayToString(newValue),\n );\n }}\n TextFieldProps={{\n error:\n touched.sendInAppNotificationUserIDs\n && !!errors.sendInAppNotificationUserIDs,\n helperText: (\n \n ),\n }}\n renderOption={(option: ListingUser) => (\n
\n {option.name}\n \n {option.email}\n \n
\n )}\n />\n \n ({\n id: group,\n }))}\n keySelector={(option: AccessGroup) => option.id}\n labelSelector={(option: AccessGroup) => _.capitalize(option.id.split('_').join(' '))}\n onChange={(e: ChangeEvent<{}>, newValue: string[]) => {\n setFieldValue(\n 'sendInAppNotificationUserGroups',\n convertArrayToString(newValue),\n );\n }}\n TextFieldProps={{\n error:\n touched.sendInAppNotificationUserGroups\n && !!errors.sendInAppNotificationUserGroups,\n helperText: (\n \n ),\n }}\n />\n \n \n {({ field, meta }: FieldProps) => (\n }\n {...field}\n value={meta.value || ''}\n />\n )}\n \n \n \n {({ field, meta }: FieldProps) => (\n {\n setFieldValue(\n 'sendInAppNotificationSetting.messageTemplate',\n htmlContentState,\n );\n setFieldValue(\n 'sendInAppNotificationSetting.messageTemplateContentState',\n rawContentState,\n );\n }}\n handleEditorTouched={() => setFieldTouched(field.name)}\n />\n )}\n \n \n )}\n \n {values.workflowAutomationActionTypeID === 'send_email' && (\n <>\n }\n />\n \n \n {({ field, meta }: FieldProps) => (\n {\n setFieldValue('sendEmailTemplate', newValue);\n }}\n handleEditorTouched={() => setFieldTouched(field.name)}\n />\n )}\n \n \n )}\n \n \n \n Save\n \n \n \n \n \n )}\n \n \n );\n};\n\nexport default ConfigureNotificationDrawer;\n","import { useFormikContext } from 'formik';\nimport { useEffect, useState } from 'react';\nimport { AutomationFormValues } from '../../types';\nimport ConfigureCaseDrawer from '../ConfigureCaseDrawer';\nimport ConfigureNotificationDrawer from '../ConfigureNotificationDrawer';\nimport { ConfigureActionDrawerProps } from './types';\n\nconst ConfigureActionDrawer = ({\n initialActionTypeID = '',\n onClose,\n selectedActionIndex,\n selectedSuggestion,\n}: ConfigureActionDrawerProps) => {\n const formikProps = useFormikContext();\n const [actionTypeID, setActionTypeID] = useState(initialActionTypeID);\n const [isConfigureCaseDrawerOpen, setIsConfigureCaseDrawerOpen] = useState(false);\n const [\n isConfigureNotificationDrawerOpen,\n setIsConfigureNotificationDrawerOpen,\n ] = useState(false);\n\n const isCaseAction = [\n 'update_workflow_case_status',\n 'complete_workflow_stage',\n 'complete_workflow_stage_task',\n ].includes(actionTypeID);\n\n const isNotificationAction = [\n 'send_email',\n 'send_inapp_notification',\n ].includes(actionTypeID);\n\n useEffect(() => {\n setIsConfigureCaseDrawerOpen(isCaseAction);\n setIsConfigureNotificationDrawerOpen(isNotificationAction);\n }, [actionTypeID]);\n\n return (\n <>\n {isCaseAction && (\n \n )}\n {isNotificationAction && (\n \n )}\n \n );\n};\n\nexport default ConfigureActionDrawer;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport { fontColors, fontSize, tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n container: {\n paddingBottom: '5rem',\n },\n scheduleBox: {\n backgroundColor: tertiaryColors.lightGrey,\n padding: '0.5rem 1rem 1rem 1rem',\n },\n timeIcon: {\n color: fontColors.body,\n opacity: 0.6,\n },\n placeholder: {\n color: fontColors.subBody,\n },\n customMobileSection: {\n marginLeft: '-11px',\n marginTop: '0.5rem',\n },\n infoIcon: {\n fontSize: fontSize['15px'],\n color: fontColors.body,\n marginLeft: theme.spacing(1),\n },\n ctaButton: {\n position: 'fixed',\n bottom: 0,\n backgroundColor: theme.palette.common.white,\n width: '350px',\n padding: '1rem 7rem 1rem 1rem',\n display: 'flex',\n justifyContent: 'flex-end',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n },\n },\n phoneNumber: {\n color: tertiaryColors.lighterGrey,\n },\n deletedValue: {\n '& > div > div': {\n color: fontColors.subBody,\n },\n },\n}));\n","import { ChangeEvent, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport clsx from 'clsx';\nimport {\n Box,\n Button,\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText,\n Grid,\n Icon,\n Link,\n Radio,\n RadioGroup,\n Switch,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport { InfoOutlined as InfoOutlinedIcon } from '@material-ui/icons';\nimport { TimePicker } from '@material-ui/pickers';\nimport {\n Form,\n Formik,\n Field,\n useFormikContext,\n ErrorMessage,\n FormikProps,\n} from 'formik';\nimport moment from 'moment';\nimport {\n AutocompleteInput,\n Banner,\n Drawer,\n TextFieldInput,\n TextFieldLabel,\n} from '..';\nimport { CallWeekStartEndTimes, CallWeekTypes, ConfigureCallDrawerProps } from './types';\nimport { AutomationFormAction, AutomationFormValues, TParams } from '../../types';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\nimport { leadActions } from '../../pages/Workflow/Tabs/LeadAutomation/formData';\nimport { TimeIcon } from '../../assets/icons';\nimport { validationSchema } from './formData';\nimport { CompanyBranchOption } from '../../pages/Workflow/Tabs/LeadAutomation/types';\nimport { useAuth } from '../../hooks';\nimport useStyles from './styles';\n\nconst ConfigureCallDrawer = ({\n listBusinessUnit,\n allListBusinessUnit,\n actions,\n open,\n onClose,\n selectedActionIndex,\n selectedSuggestion,\n}: ConfigureCallDrawerProps) => {\n const classes = useStyles();\n const { user } = useAuth();\n\n const formikProps = useFormikContext();\n\n const { type } = useParams();\n\n const [appendedListBusinessUnit, setAppendedListBusinessUnit] = useState(listBusinessUnit || []);\n\n useEffect(() => {\n if (actions?.length > 0) {\n const deletedBUNumber: CompanyBranchOption[] = [];\n // Append selected BU numbers that are deleted from the listing\n const selectedBUs = actions\n .filter((action) => action.callLeadAssigneeCaller && action.callLeadAssigneeCaller !== 'assignee')\n .map((action) => action.callLeadAssigneeCaller);\n if (selectedBUs.length > 0) {\n selectedBUs.forEach((id) => {\n const index = listBusinessUnit?.length\n ? listBusinessUnit.findIndex((item) => item.id === id)\n : -1;\n const isExists = index > -1;\n const buInfo = allListBusinessUnit?.length\n ? allListBusinessUnit.find((item) => item.id === id)\n : undefined;\n if (!isExists) {\n deletedBUNumber.push({\n id: id || '',\n name: buInfo?.name || 'Business unit deleted',\n is_external: 'false',\n msisdn: '',\n disabled: true,\n });\n }\n });\n }\n const newList = deletedBUNumber.concat(listBusinessUnit || []);\n setAppendedListBusinessUnit(newList);\n }\n }, [actions, listBusinessUnit]);\n\n const handleCheckScheduleDay = (\n e: ChangeEvent,\n setValues: any,\n ) => {\n const { name, checked } = e.target;\n // NOTE: 0 ~ 6 = Sun ~ Sat\n switch (name) {\n case 'callLeadAssigneeWeekdayDays':\n if (!checked) {\n setValues((prev: any) => ({\n ...prev,\n [name]: '',\n callLeadAssigneeWeekdayStartTime: '',\n callLeadAssigneeWeekdayEndTime: '',\n }));\n } else {\n setValues((prev: any) => ({\n ...prev,\n [name]: '1,2,3,4,5',\n }));\n }\n break;\n case 'callLeadAssigneeWeekendDays':\n if (!checked) {\n setValues((prev: any) => ({\n ...prev,\n [name]: '',\n callLeadAssigneeWeekendStartTime: '',\n callLeadAssigneeWeekendEndTime: '',\n }));\n } else {\n setValues((prev: any) => ({\n ...prev,\n [name]: '0,6',\n }));\n }\n break;\n default:\n break;\n }\n };\n\n const getFilterOptions = (\n options: AutocompleteOption[],\n ) => {\n // Filter out options that selected by own and other action fields\n let filteredOptions = options;\n if (actions?.length) {\n const selectedOptions: string[] = [];\n actions.forEach((action, index) => {\n if (index !== selectedActionIndex && action.workflowAutomationActionTypeID) {\n selectedOptions.push(action.workflowAutomationActionTypeID);\n }\n });\n filteredOptions = options.filter((option) => !selectedOptions.includes(option.value));\n }\n return filteredOptions;\n };\n\n const getActionOptions = () => {\n let options: AutocompleteOption[] = [];\n if (type === 'lead') {\n if (selectedSuggestion) {\n const suggestionIndex = leadActions.findIndex((action) => (\n action.name === selectedSuggestion\n ));\n if (suggestionIndex > -1) {\n options = leadActions[suggestionIndex].types;\n }\n } else {\n options = [];\n }\n }\n return options;\n };\n\n const getTimeDifferences = (end?: string, start?: string) => {\n if (end && start) {\n const end24 = moment(end, ['hh:mmA']).format('HH:mm');\n const start24 = moment(start, ['hh:mmA']).format('HH:mm');\n const hour = moment(moment(end24, 'HH:mm').diff(moment(start24, 'HH:mm'))).utcOffset(0).format('HH');\n const minute = moment(moment(end24, 'HH:mm').diff(moment(start24, 'HH:mm'))).utcOffset(0).format('mm');\n if (hour !== '00' || minute !== '00') {\n return `${hour}hr ${minute !== '00' ? `${minute} minutes` : ''}`;\n }\n }\n return '0hr';\n };\n\n const renderConfigurationFields = (formik: FormikProps) => {\n const {\n values,\n touched,\n errors,\n setFieldValue,\n setValues,\n } = formik;\n if (values.workflowAutomationActionTypeID) {\n switch (values.workflowAutomationActionTypeID) {\n case 'notify_lead_call':\n case 'notify_customer_call':\n return (\n <>\n \n \n \n \n \n {/* TODO: Temporary hides until backend allows user to key in */}\n {/* }\n /> */}\n \n \n \n {/* TODO: Temporary hides until backend allows user to key in */}\n {/* }\n /> */}\n \n\n \n \n \n Schedule calling hours\n \n \n Select the hours that your sales team will be called\n \n {\n (touched.callLeadAssigneeWeekdayDays && !!errors.callLeadAssigneeWeekdayDays)\n || (touched.callLeadAssigneeWeekendDays && !!errors.callLeadAssigneeWeekendDays)\n ? (\n \n {\n errors.callLeadAssigneeWeekdayDays\n || errors.callLeadAssigneeWeekendDays\n }\n \n ) : null\n }\n \n {\n ['Weekday', 'Weekend'].map((weekType) => (\n \n \n handleCheckScheduleDay(e, setValues)}\n />\n )}\n label={{ weekType }}\n />\n \n {\n getTimeDifferences(\n values?.[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes],\n values?.[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes],\n )\n }\n \n \n \n \n \"time\"\n \n )\n ),\n }}\n error={\n touched[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes]\n && !!errors[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes]\n }\n helperText={\n touched[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes]\n && errors[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes]\n }\n value={\n values?.[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes]\n ? moment(values[`callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes], 'hh:mmA')\n : null\n }\n onChange={(v: any) => setFieldValue(\n `callLeadAssignee${weekType}StartTime` as CallWeekStartEndTimes,\n moment(v).format('hh:mmA'),\n )}\n />\n \n \n to\n \n \n \n \"time\"\n \n )\n ),\n }}\n error={\n touched[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes]\n && !!errors[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes]\n }\n helperText={\n touched[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes]\n && errors[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes]\n }\n value={\n values?.[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes]\n ? moment(values[`callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes], 'hh:mmA')\n : null\n }\n onChange={(v: any) => setFieldValue(\n `callLeadAssignee${weekType}EndTime` as CallWeekStartEndTimes,\n moment(v).format('hh:mmA'),\n )}\n />\n \n \n ))\n }\n \n \n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n />\n \n \n \n \n \n {`Calling number to ${values.workflowAutomationActionTypeID === 'notify_lead_call' ? 'lead' : 'customer'}`}\n \n \n \n \n \n {\n const { name, value } = e.currentTarget;\n setFieldValue(name, value);\n }}\n >\n } label=\"Display assignee's dialer number\" value=\"assignee\" />\n \n \n item.id === values.callLeadAssigneeCaller)?.disabled\n ),\n })}\n disabled={values.callLeadAssigneeCaller === 'assignee'}\n options={appendedListBusinessUnit}\n keySelector={(option: CompanyBranchOption) => option.id}\n labelSelector={(option: CompanyBranchOption) => option.name}\n TextFieldProps={{\n error: (\n ((!values.workflowAutomationID && touched.callLeadAssigneeCaller)\n || values.workflowAutomationID)\n && !!errors.callLeadAssigneeCaller\n ),\n helperText: (\n (\n ((!values.workflowAutomationID && touched.callLeadAssigneeCaller)\n || values.workflowAutomationID)\n && errors.callLeadAssigneeCaller\n ) ? errors.callLeadAssigneeCaller\n : ''\n ),\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue('callLeadAssigneeCaller', newValue);\n }}\n getOptionDisabled={(option: CompanyBranchOption) => option.disabled}\n filterOptions={\n (options: CompanyBranchOption[]) => options\n .filter((opt) => opt && opt.id)\n }\n renderOption={(option: CompanyBranchOption) => (\n
\n \n { option.name }\n \n \n { option.msisdn || '(Phone number deleted)' }\n \n
\n )}\n />\n
\n \n
\n
\n \n {\n const element = e.target as HTMLInputElement;\n const { checked } = element;\n setFieldValue('callLeadAssigneeRecord', checked);\n }}\n />\n )}\n label={(\n \n Allow recording\n \n )}\n labelPlacement=\"end\"\n />\n \n \n );\n default:\n return null;\n }\n }\n return null;\n };\n\n const renderBanner = (formik: FormikProps) => {\n const {\n values,\n errors,\n } = formik;\n if (values?.callLeadAssigneeCaller\n && values.callLeadAssigneeCaller !== 'assignee'\n && errors.callLeadAssigneeCaller) {\n let showroomWeb = '';\n let editBUURL = '';\n if (user?.company?.apps && user.company.apps.length > 0) {\n const srIndex = user.company.apps.findIndex((app) => app.appID === 'showroom');\n if (srIndex > -1 && user.company.apps[srIndex].webURL) {\n showroomWeb = user.company.apps[srIndex].webURL || '';\n }\n const selectedIndex = appendedListBusinessUnit\n .findIndex((bu) => bu.id === values.callLeadAssigneeCaller);\n if (selectedIndex > -1 && appendedListBusinessUnit[selectedIndex]?.disabled) {\n // If BU no longer exists\n editBUURL = `${showroomWeb}/business_units/`;\n } else {\n // If BU phone number got deleted\n editBUURL = `${showroomWeb}/business_units/${values.callLeadAssigneeCaller}`;\n }\n }\n return (\n \n \n \n The \n \n window.open(editBUURL, '_blank')}\n >\n selected business unit\n \n \n ’s number is invalid or has been deleted. \n Calling number to lead is now displaying assignee’s number instead.\n \n \n )}\n />\n \n );\n }\n return null;\n };\n\n return (\n {\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}`,\n values,\n );\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}.workflowAutomationActionTypeID`,\n values.workflowAutomationActionTypeID,\n );\n onClose();\n }}\n validationSchema={() => validationSchema(listBusinessUnit || [])}\n validateOnMount\n >\n {(formik) => {\n const {\n values,\n touched,\n errors,\n isSubmitting,\n isValid,\n isValidating,\n setFieldValue,\n } = formik;\n return (\n \n \n \n { renderBanner(formik) }\n \n getFilterOptions(\n options,\n )\n }\n options={getActionOptions()}\n keySelector={(option: AutocompleteOption) => option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error: (\n touched.workflowAutomationActionTypeID\n && !!errors.workflowAutomationActionTypeID\n ),\n helperText: ,\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue('workflowAutomationActionTypeID', newValue);\n }}\n />\n \n {\n values.workflowAutomationActionTypeID\n && renderConfigurationFields(formik)\n }\n \n \n \n Save\n \n \n
\n \n );\n }}\n \n );\n};\n\nexport default ConfigureCallDrawer;\n","import { AutocompleteOption } from '../AutocompleteInput/types';\n\nexport const customTagOptions: AutocompleteOption[] = [\n {\n label: 'Assignee name',\n value: '{{if .assignee_name}}{{.assignee_name}}{{else}}n/a{{end}}',\n },\n {\n label: 'Company name',\n value: '{{if .company_name}}{{.company_name}}{{else}}n/a{{end}}',\n },\n {\n label: 'Lead/Opportunity URL',\n value: '{{if .url}}{{.url}}{{else}}n/a{{end}}',\n },\n {\n label: 'Full name',\n value: '{{if .name}}{{.name}}{{else}}n/a{{end}}',\n },\n {\n label: 'Preferred name',\n value: '{{if .preferred_name}}{{.preferred_name}}{{else}}n/a{{end}}',\n },\n {\n label: 'Project name(s)',\n value: '{{if .project_names}}{{range $i, $project_name := .project_names}}{{if $i}}, {{end}}{{$project_name}}{{end}}{{else}}n/a{{end}}',\n },\n {\n label: 'Source',\n value: '{{if .source}}{{.source}}{{else}}n/a{{end}}',\n },\n {\n label: 'Unit number',\n value: '{{if .unit_number}}{{.unit_number}}{{else}}n/a{{end}}',\n },\n];\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontColors } from '../../styles/variables';\n\nexport default makeStyles(() => ({\n dialogContainer: {\n '& .MuiDialog-paper': {\n width: 400,\n },\n },\n dialogTitle: {\n paddingBottom: 0,\n },\n dialogCaption: {\n color: fontColors.subBody,\n margin: '1rem 0 0 0',\n },\n}));\n","import {\n useState,\n useEffect,\n ChangeEvent,\n} from 'react';\nimport {\n Box,\n Button,\n Dialog,\n DialogTitle,\n DialogActions,\n DialogContent,\n DialogContentText,\n Typography,\n IconButton,\n} from '@material-ui/core';\nimport { Close } from '@material-ui/icons';\nimport { AutocompleteInput } from '..';\nimport { customTagOptions } from '../ContentEditor/constants';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\nimport { PersonaliseModalProps } from './types';\nimport useStyles from './styles';\n\nconst PersonaliseModal = ({\n open,\n onClose,\n onSubmit,\n}: PersonaliseModalProps) => {\n const classes = useStyles();\n\n const [variable, setVariable] = useState('');\n\n useEffect(() => {\n if (!open) {\n setVariable('');\n }\n }, [open]);\n\n const handleChange = (\n e: ChangeEvent<{}>,\n value: any,\n ) => {\n setVariable(value);\n };\n\n const handleSubmit = () => {\n onSubmit(variable);\n };\n\n return (\n \n \n \n Custom tag\n \n \n \n \n \n \n \n Add a custom tag to personalise your email\n by selecting from available field values as below.\n \n \n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n />\n \n \n Note: The character counter assumes a length of 20 characters for each dynamic content.\n If the length of the personalised content selected is longer than 20 characters,\n it will be cut off.\n \n \n \n \n \n Save\n \n \n \n \n );\n};\n\nexport default PersonaliseModal;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { tertiaryColors } from '../../../styles/variables';\n\nexport default makeStyles(() => ({\n variableTag: {\n fontSize: '0.875rem',\n display: 'inline-flex',\n borderRadius: '50px',\n padding: '0.2rem 1rem',\n backgroundColor: tertiaryColors.mediumGrey,\n '&.disabled': {\n backgroundColor: tertiaryColors.darkGrey,\n },\n },\n}));\n","import { ContentBlock } from 'draft-js';\nimport { escapeRegExp, findIndex } from 'lodash';\nimport { TagProps } from './types';\nimport { customTagOptions } from '../constants';\nimport { AutocompleteOption } from '../../AutocompleteInput/types';\nimport useStyles from './styles';\n\nconst tagStrategy = (\n contentBlock: ContentBlock,\n callback: (start: number, end: number) => void,\n) => {\n const text = contentBlock.getText();\n customTagOptions.forEach((tag) => {\n const matches = [...text.matchAll(new RegExp(escapeRegExp(tag.value), 'g'))];\n matches.forEach((match) => {\n if (match.index !== undefined) {\n callback(match.index, match.index + match[0].length);\n }\n });\n });\n};\n\nconst getTagLabel = (text: string) => {\n let label = text;\n\n if (text) {\n const index = findIndex(customTagOptions, (tag: AutocompleteOption) => (\n tag.value === text\n ));\n if (index > -1) {\n label = customTagOptions[index].label;\n }\n }\n return label;\n};\n\nconst Tag = (decoratedText: string, disabled: boolean) => {\n const classes = useStyles();\n return (\n \n { getTagLabel(decoratedText) }\n \n );\n};\n\nconst TagDecorator = (disabled: boolean) => ({\n strategy: tagStrategy,\n component: ({ decoratedText }: TagProps) => Tag(decoratedText, disabled),\n});\n\nexport default TagDecorator;\n","import { CompositeDecorator } from 'draft-js';\n\nimport tagDecorator from './VariableTag';\n\nconst Decorator = (disabled: boolean) => (\n new CompositeDecorator([\n tagDecorator(disabled),\n ])\n);\n\nexport default Decorator;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontColors, fontVariants, tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n buttonContainer: {\n paddingLeft: theme.spacing(2),\n border: '1px solid rgba(0, 0, 0, 0.23)',\n borderRadius: `0px 0px ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`,\n borderTop: `1px solid ${tertiaryColors.mediumGrey}`,\n },\n editor: {\n width: '100%',\n height: '250px',\n overflow: 'auto',\n cursor: 'text',\n padding: '0.5rem 0.5rem 1rem 0.5rem',\n borderRadius: `0px 0px ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`,\n border: '1px solid rgba(0, 0, 0, 0.23)',\n borderBottom: 'none',\n '& .DraftEditor-root': {\n ...fontVariants.body1,\n },\n '& .public-DraftEditorPlaceholder-root': {\n marginBottom: '-20px',\n color: tertiaryColors.grey,\n },\n '&.disabled': {\n color: fontColors.body,\n backgroundColor: tertiaryColors.lightGrey,\n border: 'none',\n },\n },\n}));\n","import {\n useRef,\n useState,\n} from 'react';\nimport {\n SelectionState,\n ContentState,\n convertToRaw,\n Editor,\n EditorState,\n ContentBlock,\n Modifier,\n convertFromHTML,\n RawDraftContentState,\n convertFromRaw,\n} from 'draft-js';\nimport draftToHtml from 'draftjs-to-html';\nimport { escapeRegExp } from 'lodash';\nimport {\n Button,\n FormHelperText,\n Grid,\n Typography,\n} from '@material-ui/core';\nimport PersonaliseModal from '../PersonaliseModal';\nimport decorators from './Decorators';\nimport { ContentEditorProps } from './types';\nimport { customTagOptions } from './constants';\nimport { useToggleState } from '../../hooks';\nimport { TagIcon } from '../../assets/icons';\nimport { TextFieldLabel } from '..';\nimport useStyles from './styles';\n\nconst ContentEditor = ({\n label,\n defaultContents,\n maxLength,\n required,\n error,\n disabled = false,\n handleEditorTouched,\n hideButtons,\n onChange,\n}: ContentEditorProps) => {\n const classes = useStyles();\n const editorRef = useRef(null);\n\n const getInitValue = (\n values: RawDraftContentState | string,\n ) => {\n // If values is of type RawDraftContentState\n if (\n typeof values !== 'string'\n && 'blocks' in values\n && 'entityMap' in values\n ) {\n return EditorState.createWithContent(\n convertFromRaw(values),\n decorators(disabled),\n );\n }\n\n // If values is of type string\n const blocksFromHTML = convertFromHTML(values);\n const state = ContentState.createFromBlockArray(\n blocksFromHTML.contentBlocks,\n blocksFromHTML.entityMap,\n );\n return EditorState.createWithContent(state, decorators(disabled));\n };\n\n const [editorState, setEditorState] = useState(getInitValue(defaultContents));\n const { activeStates, toggleState } = useToggleState({\n personalise: false,\n });\n\n const contentIsEmpty = (es: EditorState) => {\n const currentContent = es.getCurrentContent();\n // Check if editor is empty or have only spaces\n const isEditorEmpty = !currentContent.hasText();\n const currentPlainText = currentContent.getPlainText();\n const lengthOfTrimmedContent = currentPlainText.trim().length;\n const isContainOnlySpaces = !isEditorEmpty && !lengthOfTrimmedContent;\n\n return isEditorEmpty || isContainOnlySpaces;\n };\n\n const getContentLength = () => {\n const currentContent = editorState.getCurrentContent();\n const currentPlainText = currentContent.getPlainText();\n let totalLength = 0;\n\n if (currentPlainText && currentPlainText.length > 0) {\n let textLength = currentPlainText.length || 0;\n\n // One variable = 20 characters\n let totalVariableCharacters = 0;\n customTagOptions.forEach((tag) => {\n const matches = [\n ...currentPlainText.matchAll(new RegExp(escapeRegExp(tag.value), 'g')),\n ];\n if (matches.length > 0) {\n textLength -= tag.value.length;\n totalVariableCharacters += (matches.length * 20);\n }\n });\n totalLength = textLength + totalVariableCharacters;\n }\n return !contentIsEmpty(editorState) ? totalLength : 0;\n };\n\n const sendContent = (es: EditorState) => {\n const currentContent = es.getCurrentContent();\n if (contentIsEmpty(es)) {\n onChange('', {} as RawDraftContentState);\n } else {\n const rawContentState = convertToRaw(currentContent);\n const htmlContentState = draftToHtml(rawContentState);\n onChange(htmlContentState, rawContentState);\n }\n };\n\n const getInsertState = (selectedIndex: number, trigger: string) => {\n const currentSelectionState = editorState.getSelection();\n const end = currentSelectionState.getAnchorOffset();\n const anchorKey = currentSelectionState.getAnchorKey();\n const currentContent = editorState.getCurrentContent();\n const currentBlock = currentContent.getBlockForKey(anchorKey);\n const blockText = currentBlock.getText();\n const start = blockText.substring(0, end).lastIndexOf(trigger);\n return {\n start,\n end,\n trigger,\n selectedIndex,\n };\n };\n\n const handleBeforeInput = () => {\n if (maxLength) {\n const currentContent = editorState.getCurrentContent();\n const currentContentLength = currentContent.getPlainText('').length;\n if (currentContentLength > maxLength - 1) {\n return 'handled';\n }\n }\n return 'not-handled';\n };\n\n const handlePastedText = (pastedText: string) => {\n if (maxLength) {\n const currentContent = editorState.getCurrentContent();\n const currentContentLength = currentContent.getPlainText('').length;\n return currentContentLength + pastedText.length > maxLength ? 'handled' : 'not-handled';\n }\n return 'not-handled';\n };\n\n const handleChange = (es: EditorState) => {\n let nextState = es;\n\n const contentBlocks = nextState\n .getCurrentContent()\n .getBlocksAsArray();\n\n contentBlocks.forEach((contentBlock: ContentBlock) => {\n const text = contentBlock.getText();\n\n const tokenBlockLocations = customTagOptions.map((tag) => {\n const tokenIndexesRaw = [\n ...text.matchAll(new RegExp(escapeRegExp(tag.value), 'g')),\n ].map((a) => a.index);\n const tokenIndexes: number[] = [];\n\n tokenIndexesRaw.forEach((tokenIndex) => {\n if (tokenIndex !== undefined) {\n tokenIndexes.push(tokenIndex);\n }\n });\n\n if (tokenIndexes.length > 0) {\n return { tokenValue: tag.value, tokenIndexes };\n }\n return null;\n });\n\n tokenBlockLocations.forEach((tokenBlockLocation) => {\n if (!tokenBlockLocation) return;\n\n const { tokenValue } = tokenBlockLocation;\n const { tokenIndexes } = tokenBlockLocation;\n\n const entityExistsAtIndex = tokenIndexes\n .some((tokenIndex) => contentBlock.getEntityAt(tokenIndex));\n if (entityExistsAtIndex) return;\n\n tokenIndexes.forEach((tokenIndex) => {\n // Add entity to each index\n const contentStateWithEntity = nextState\n .getCurrentContent()\n .createEntity('token', 'IMMUTABLE');\n const entityKey = contentStateWithEntity.getLastCreatedEntityKey();\n\n const currentSelectionState = SelectionState.createEmpty(contentBlock.getKey());\n const begin = tokenIndex;\n const end = tokenIndex + tokenValue.length;\n\n const tokenText = currentSelectionState.merge({\n anchorOffset: begin,\n focusOffset: end,\n });\n\n let replacedTokenContent = Modifier.replaceText(\n nextState.getCurrentContent(),\n tokenText,\n tokenValue,\n undefined,\n entityKey,\n );\n\n // If the token is inserted at the end, a space is appended right after for\n // a smooth writing experience.\n const blockKey = tokenText.getAnchorKey();\n const blockSize = nextState\n .getCurrentContent()\n .getBlockForKey(blockKey)\n .getLength();\n if (blockSize === end) {\n replacedTokenContent = Modifier.insertText(\n replacedTokenContent,\n replacedTokenContent.getSelectionAfter(),\n ' ',\n );\n }\n\n nextState = EditorState.push(\n nextState,\n replacedTokenContent,\n 'apply-entity',\n );\n\n nextState = EditorState.forceSelection(\n nextState,\n replacedTokenContent.getSelectionAfter(),\n );\n });\n });\n });\n\n sendContent(nextState);\n setEditorState(nextState);\n };\n\n const handleInsertVariable = (variable: string) => {\n const { start, end } = getInsertState(0, variable);\n const currentContent = editorState.getCurrentContent();\n const contentStateWithEntity = editorState\n .getCurrentContent()\n .createEntity('token', 'IMMUTABLE');\n const entityKey = contentStateWithEntity.getLastCreatedEntityKey();\n const currentSelection = editorState.getSelection();\n const currentSelectionState = currentSelection.merge({\n anchorOffset: start,\n focusOffset: end,\n });\n\n let insertingContent = Modifier.insertText(\n currentContent,\n currentSelection,\n variable,\n undefined,\n entityKey,\n );\n\n const blockKey = currentSelectionState.getAnchorKey();\n const blockSize = editorState\n .getCurrentContent()\n .getBlockForKey(blockKey)\n .getLength();\n if (blockSize === end) {\n insertingContent = Modifier.insertText(\n insertingContent,\n insertingContent.getSelectionAfter(),\n ' ',\n );\n }\n\n const newEditorState = EditorState.push(\n editorState,\n insertingContent,\n 'insert-characters',\n );\n\n const newES = EditorState.forceSelection(\n newEditorState,\n insertingContent.getSelectionAfter(),\n );\n\n sendContent(newES);\n setEditorState(newES);\n toggleState('personalise');\n };\n\n const handleFocusEditor = () => {\n if (editorRef.current) {\n editorRef.current.focus();\n }\n };\n\n return (\n <>\n \n \n {label}\n \n {maxLength && maxLength > 0 && (\n \n \n {`${getContentLength()}/${maxLength} characters`}\n \n \n )}\n \n \n \n \n {!hideButtons && (\n \n }\n onClick={() => toggleState('personalise')}\n disabled={disabled}\n >\n Add Tag\n \n \n )}\n \n {!!error && {error}}\n \n toggleState('personalise')}\n />\n \n );\n};\n\nexport default ContentEditor;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport {\n fontColors,\n fontSize,\n tertiaryColors,\n} from '../../styles/variables';\n\nexport default makeStyles((theme) => (({\n container: {\n paddingBottom: '5rem',\n },\n wordCount: {\n display: 'flex',\n justifyContent: 'flex-end',\n position: 'relative',\n top: theme.spacing(2.25),\n },\n dialogContainer: {\n '& .MuiDialog-paper': {\n width: 400,\n },\n },\n dialogTitle: {\n paddingBottom: 0,\n },\n tagDialogCaption: {\n color: fontColors.subBody,\n marginBottom: 0,\n },\n ctaButton: {\n position: 'fixed',\n bottom: 0,\n backgroundColor: theme.palette.common.white,\n width: '350px',\n padding: '1rem 7rem 1rem 1rem',\n display: 'flex',\n justifyContent: 'flex-end',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n },\n },\n greyText: {\n color: tertiaryColors.grey,\n },\n scheduleBox: {\n padding: '1rem',\n backgroundColor: tertiaryColors.lightGrey,\n },\n infoIcon: {\n fontSize: fontSize['15px'],\n color: fontColors.body,\n },\n})));\n","import { useEffect, ChangeEvent, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport moment from 'moment';\nimport {\n Box,\n Button,\n Checkbox,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControlLabel,\n FormHelperText,\n Grid,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport { TimePicker } from '@material-ui/pickers';\nimport { Close } from '@material-ui/icons';\nimport {\n ErrorMessage,\n Field,\n Form,\n Formik,\n FormikProps,\n useFormikContext,\n} from 'formik';\nimport { object, string, number } from 'yup';\nimport {\n AutocompleteInput,\n Drawer,\n TextFieldInput,\n TextFieldLabel,\n} from '..';\nimport { ConfigureEmailDrawerProps } from './types';\nimport {\n AutomationFormAction,\n AutomationFormValues,\n ListingUser,\n TParams,\n} from '../../types';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\nimport ContentEditor from '../ContentEditor';\nimport {\n convertArrayToString,\n convertStringToArray,\n getErrorMessage,\n} from '../../utils';\nimport { listAffiliates } from '../../apis';\nimport { useAlert, useAuth } from '../../hooks';\nimport { leadActions } from '../../pages/Workflow/Tabs/LeadAutomation/formData';\nimport { leadDefaultWorkflowID } from '../../constants';\nimport useStyles from './styles';\n\nconst ConfigureEmailDrawer = ({\n actions,\n open,\n onClose,\n selectedActionIndex,\n selectedSuggestion,\n}: ConfigureEmailDrawerProps) => {\n const classes = useStyles();\n const { setAlert } = useAlert();\n const { user } = useAuth();\n\n const validationSchema = object({\n workflowAutomationActionTypeID: string().required('Action type is required'),\n sendEmailTemplate: string().required('Email text is required'),\n sendEmailSubject: string().required('Email subject is required'),\n sendEmailRecipients: string().required('CC is required'),\n ...(selectedSuggestion === 'reminder_email' ? {\n sendEmailReminderLimit: number()\n .required('Email attempts is required')\n .min(1, 'Min value 1')\n .max(3, 'Max value 3'),\n } : {}),\n });\n\n const isLeadDefaultWorkflow = (\n actions\n && selectedActionIndex !== null\n && actions[selectedActionIndex]\n && actions[selectedActionIndex].workflowID === leadDefaultWorkflowID\n );\n const maxEmailLength = 1000;\n const formikProps = useFormikContext();\n\n const { type } = useParams();\n\n const [linkLabel, setLinkLabel] = useState('');\n const [isLinkDialogOpen, setIsLinkDialogOpen] = useState(false);\n const [recipients, setRecipients] = useState([]);\n\n const handleGetEmailRecipients = async () => {\n try {\n // TODO: Support onScroll/Search to retrieve call after upgrade material to v5\n // Currently autocomplete have can't set inputValue issue\n const res = await listAffiliates(user.companyID, { limit: 1000 });\n if (res && res.items) {\n setRecipients(res.items);\n }\n } catch (err) {\n setAlert(\n {\n message: getErrorMessage(err),\n severity: 'error',\n },\n true,\n );\n }\n };\n\n useEffect(() => {\n if (!isLeadDefaultWorkflow) {\n handleGetEmailRecipients();\n }\n }, []);\n\n const getActionOptions = () => {\n let options: AutocompleteOption[] = [];\n if (type === 'lead') {\n if (selectedSuggestion) {\n const suggestionIndex = leadActions.findIndex((action) => (\n action.name === selectedSuggestion\n ));\n if (suggestionIndex > -1) {\n options = leadActions[suggestionIndex].types;\n }\n } else {\n options = [];\n }\n }\n return options;\n };\n\n // TODO add ability to render links in email\n const renderLinkDialog = () => (\n \n \n \n Add link\n setIsLinkDialogOpen(false)}\n size=\"small\"\n >\n \n \n \n \n \n \n Add a link to your Email Paste the URL below. Customise the middle\n section of your link\n \n \n \n \n \n {`${linkLabel.length}/20 characters`}\n \n {\n setLinkLabel(e.target.value);\n }}\n />\n \n \n \n setIsLinkDialogOpen(false)}\n >\n Apply\n \n \n \n \n );\n\n const renderConfigurationFields = (formik: FormikProps) => {\n const {\n values,\n touched,\n errors,\n setFieldValue,\n } = formik;\n if (values.workflowAutomationActionTypeID) {\n switch (values.workflowAutomationActionTypeID) {\n case 'default_notify_lead_email':\n case 'default_notify_opportunity_email':\n case 'notify_lead_email':\n case 'notify_opportunity_email':\n case 'remind_lead_email':\n case 'remind_opportunity_email':\n return (\n <>\n \n \n \n {\n ['remind_lead_email', 'remind_opportunity_email'].includes(values.workflowAutomationActionTypeID)\n && (\n <>\n \n }\n />\n \n \n \n \n \n )\n }\n \n {\n isLeadDefaultWorkflow\n ? (\n \n )\n : (\n option.id}\n labelSelector={(option: ListingUser) => option.email}\n onChange={(e: ChangeEvent<{}>, newValue: string[]) => {\n setFieldValue('sendEmailRecipients', convertArrayToString(newValue));\n }}\n TextFieldProps={{\n error: (\n touched.sendEmailRecipients\n && !!errors.sendEmailRecipients\n ),\n helperText: ,\n }}\n renderOption={(option: ListingUser) => (\n
\n \n { option.name }\n \n \n { option.email }\n \n
\n )}\n />\n )\n }\n
\n \n }\n />\n \n {\n setFieldValue('sendEmailTemplate', newValue);\n }}\n />\n \n \n \n {\n ['remind_lead_email', 'remind_opportunity_email'].includes(values.workflowAutomationActionTypeID)\n && (\n \n Schedule email hours\n Select the hours that your sales team will be emailed\n {\n ['Weekday', 'Weekend'].map((dayType) => (\n \n \n }\n label={dayType}\n />\n 12hrs\n \n \n \n {}}\n />\n \n to\n \n {}}\n />\n \n \n \n ))\n }\n \n )\n }\n \n );\n default:\n return null;\n }\n }\n return null;\n };\n\n const getFilterOptions = (\n options: AutocompleteOption[],\n ) => {\n // Filter out options that selected by own and other action fields\n let filteredOptions = options;\n if (actions?.length) {\n const selectedOptions: string[] = [];\n actions.forEach((action, index) => {\n if (index !== selectedActionIndex && action.workflowAutomationActionTypeID) {\n selectedOptions.push(action.workflowAutomationActionTypeID);\n }\n });\n filteredOptions = options.filter((option) => !selectedOptions.includes(option.value));\n }\n return filteredOptions;\n };\n\n return (\n {\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}`,\n values,\n );\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}.workflowAutomationActionTypeID`,\n values.workflowAutomationActionTypeID,\n );\n onClose();\n }}\n validationSchema={validationSchema}\n validateOnMount\n >\n {(formik) => {\n const {\n values,\n touched,\n errors,\n setFieldValue,\n isValidating,\n isSubmitting,\n isValid,\n } = formik;\n return (\n <>\n {renderLinkDialog()}\n \n \n \n \n getFilterOptions(\n options,\n )\n }\n options={getActionOptions()}\n keySelector={(option: AutocompleteOption) => option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error: (\n touched.workflowAutomationActionTypeID\n && !!errors.workflowAutomationActionTypeID\n ),\n helperText: ,\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue('workflowAutomationActionTypeID', newValue);\n }}\n />\n \n {\n values.workflowAutomationActionTypeID\n && renderConfigurationFields(formik)\n }\n \n \n \n Save\n \n \n
\n \n \n );\n }}\n \n );\n};\n\nexport default ConfigureEmailDrawer;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport {\n fontColors,\n fontSize,\n tertiaryColors,\n} from '../../styles/variables';\n\nexport default makeStyles((theme) => (({\n asterik: {\n color: 'red',\n },\n container: {\n paddingBottom: '5rem',\n },\n ctaButton: {\n position: 'fixed',\n bottom: 0,\n backgroundColor: theme.palette.common.white,\n width: '350px',\n padding: '1rem',\n display: 'flex',\n justifyContent: 'flex-end',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n },\n },\n infoIcon: {\n fontSize: fontSize['15px'],\n color: fontColors.body,\n marginLeft: theme.spacing(1),\n },\n radioGroup: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n },\n tooltipList: {\n padding: '0 0 0 1rem',\n },\n remarkTitle: {\n backgroundColor: tertiaryColors.pastelBlue,\n borderTopLeftRadius: '5px',\n borderTopRightRadius: '5px',\n padding: '0.7rem 1rem',\n display: 'flex',\n alignItems: 'center',\n '& > img': {\n width: '1.2rem',\n height: '1.2rem',\n marginRight: '0.5rem',\n },\n '& > h6': {\n lineHeight: 'unset',\n },\n },\n remarkBody: {\n backgroundColor: tertiaryColors.lightBlue,\n borderBottomLeftRadius: '5px',\n borderBottomRightRadius: '5px',\n padding: '1rem',\n },\n remarkList: {\n margin: 0,\n padding: 0,\n listStyleType: 'none',\n color: fontColors.body,\n '& > li': {\n display: 'flex',\n alignItems: 'flex-start',\n },\n '& li + li': {\n marginBottom: '0.5rem',\n },\n '& > li::before': {\n content: '\"•\"',\n display: 'inline-block',\n width: '5px',\n marginRight: '0.5rem',\n },\n },\n switchLabel: {\n marginLeft: 0,\n marginRight: 0,\n '& .MuiSwitch-root': {\n marginLeft: 0,\n },\n },\n})));\n","import { ChangeEvent } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n Box,\n Button,\n FormControl,\n FormControlLabel,\n Grid,\n Radio,\n RadioGroup,\n Switch,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport { InfoOutlined as InfoOutlinedIcon } from '@material-ui/icons';\nimport {\n ErrorMessage,\n Field,\n Form,\n Formik,\n FormikProps,\n useFormikContext,\n} from 'formik';\nimport { object, string } from 'yup';\nimport {\n AutocompleteInput,\n Drawer,\n TextFieldInput,\n TextFieldLabel,\n} from '..';\nimport { ConfigureMergeDuplicateDrawerProps } from './types';\nimport {\n AutomationFormAction,\n AutomationFormValues,\n TParams,\n} from '../../types';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\nimport { leadActions } from '../../pages/Workflow/Tabs/LeadAutomation/formData';\nimport { LightBulbIcon } from '../../assets/icons';\nimport useStyles from './styles';\n\nconst ConfigureMergeDuplicationDrawer = ({\n actions,\n open,\n onClose,\n selectedActionIndex,\n selectedSuggestion,\n}: ConfigureMergeDuplicateDrawerProps) => {\n const classes = useStyles();\n\n const validationSchema = object({\n workflowAutomationActionTypeID: string().required('Action type is required'),\n });\n\n const formikProps = useFormikContext();\n\n const { type } = useParams();\n\n const leadAssignmentOpts: AutocompleteOption[] = [\n { label: 'Default: Auto assignment', value: 'default' },\n { label: 'Assign to latest available assignee based on opportunity', value: 'latest' },\n { label: 'Assign to earliest available assignee based on opportunity', value: 'earliest' },\n ];\n\n const getActionOptions = () => {\n let options: AutocompleteOption[] = [];\n if (type === 'lead') {\n if (selectedSuggestion) {\n const suggestionIndex = leadActions.findIndex((action) => (\n action.name === selectedSuggestion\n ));\n if (suggestionIndex > -1) {\n options = leadActions[suggestionIndex].types;\n }\n } else {\n options = [];\n }\n }\n return options;\n };\n\n const renderConfigurationFields = (formik: FormikProps) => {\n const {\n values,\n setFieldValue,\n } = formik;\n switch (values.workflowAutomationActionTypeID) {\n case 'merge_duplicate_leads':\n return (\n <>\n \n \n \n \n \n \n \n Choose the master record\n \n \n
  • \n Incoming record - Merge into previous newest lead while retaining previous\n record's info\n
  • \n
  • \n Latest record - Merge and overwrite previous record with latest info\n
  • \n \n )}\n >\n \n \n
    \n {\n const { name, value } = e.currentTarget;\n setFieldValue(name, value);\n }}\n >\n } label=\"Previous record\" value=\"previous\" />\n } label=\"Incoming record\" value=\"incoming\" />\n \n
    \n
    \n \n );\n case 'merge_duplicate_leads_to_customer':\n return (\n <>\n \n \n \n \n \n \n \n Do you want to bypass required fields?\n \n \n

    \n Selecting 'yes' will skip the verification and\n merge the lead profile directly with the customer profile.\n

    \n

    \n Selecting 'no' will enforce the verification and\n any differences in the profiles will prevent the merging of\n the lead profile and customer profile.\n

    \n \n )}\n >\n \n \n
    \n {\n const { name, value } = e.currentTarget;\n setFieldValue(name, String(value).toLowerCase() === 'true');\n }}\n >\n } label=\"Yes\" value=\"true\" />\n } label=\"No\" value=\"false\" />\n \n
    \n
    \n \n option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n setFieldValue('leadAssignment', newValue);\n }}\n />\n \n {\n values.leadAssignment !== 'default' && (\n \n \n Action for existing customer without assignee\n *\n \n {\n const element = e.target as HTMLInputElement;\n const { checked } = element;\n setFieldValue('leadAllowEmptyAssignee', checked);\n }}\n />\n )}\n label={values.leadAllowEmptyAssignee ? 'Create new opportunity without assignee' : 'Do not merge lead into existing customer'}\n labelPlacement=\"end\"\n />\n \n )\n }\n \n );\n default:\n return null;\n }\n };\n\n const getFilterOptions = (\n options: AutocompleteOption[],\n ) => {\n // Filter out options that selected by own and other action fields\n let filteredOptions = options;\n if (actions?.length) {\n const selectedOptions: string[] = [];\n actions.forEach((action, index) => {\n if (index !== selectedActionIndex && action.workflowAutomationActionTypeID) {\n selectedOptions.push(action.workflowAutomationActionTypeID);\n }\n });\n filteredOptions = options.filter((option) => !selectedOptions.includes(option.value));\n }\n return filteredOptions;\n };\n\n return (\n {\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}`,\n values,\n );\n formikProps.setFieldValue(\n `actions.${selectedActionIndex}.workflowAutomationActionTypeID`,\n values.workflowAutomationActionTypeID,\n );\n onClose();\n }}\n validationSchema={validationSchema}\n validateOnMount\n >\n {(formik) => {\n const {\n values,\n touched,\n errors,\n setFieldValue,\n isValidating,\n isSubmitting,\n isValid,\n } = formik;\n return (\n <>\n \n \n \n \n getFilterOptions(\n options,\n )\n }\n options={getActionOptions()}\n keySelector={(option: AutocompleteOption) => option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n TextFieldProps={{\n error: (\n touched.workflowAutomationActionTypeID\n && !!errors.workflowAutomationActionTypeID\n ),\n helperText: ,\n }}\n onChange={(event: ChangeEvent<{}>, newValue: string) => {\n // Remove unrelevant field values\n if (values.workflowAutomationActionTypeID === 'merge_duplicate_leads'\n && (!newValue || newValue !== 'merge_duplicate_leads')) {\n setFieldValue('mergeLeadMasterRecord', null);\n } else if (values.workflowAutomationActionTypeID === 'merge_duplicate_leads_to_customer'\n && (!newValue || newValue !== 'merge_duplicate_leads_to_customer')) {\n setFieldValue('mergeLeadBypassRequired', null);\n }\n\n setFieldValue('workflowAutomationActionTypeID', newValue);\n\n // This is to set the default data for the action type\n if (newValue === 'merge_duplicate_leads') {\n setFieldValue('mergeLeadMasterRecord', 'previous');\n } else if (newValue === 'merge_duplicate_leads_to_customer') {\n setFieldValue('mergeLeadBypassRequired', true);\n }\n }}\n />\n \n\n {/* Information Bubble Render */}\n {\n (values.workflowAutomationActionTypeID === 'merge_duplicate_leads'\n || values.workflowAutomationActionTypeID === 'merge_duplicate_leads_to_customer')\n && (\n <>\n {renderConfigurationFields(formik)}\n \n \n \"automation\n \n {values.workflowAutomationActionTypeID === 'merge_duplicate_leads'\n ? 'Assignee for duplicated leads'\n : 'Merging leads with opportunities to existing customer'}\n \n \n \n
      \n {values.workflowAutomationActionTypeID === 'merge_duplicate_leads' && (\n <>\n
    • \n \n This workflow will run before Auto assignment\n \n
    • \n
    • \n \n This workflow will merge leads, then assign to previous assignee if available\n \n
    • \n
    • \n \n If previous assignee’s account is deactivated,\n it will assign merged lead via auto-assignment\n \n
    • \n
    • \n \n The workflow will not merge leads if the previous lead’s\n latest opportunity has no assignee.\n In this case, the lead will be assigned via auto-assignment\n \n
    • \n \n )}\n {values.workflowAutomationActionTypeID === 'merge_duplicate_leads_to_customer' && (\n <>\n
    • \n \n This workflow will run before Auto assignment,\n and will only merge leads with opportunity to existing customers\n \n
    • \n
    • \n \n The lead with opportunities will be routed based on\n Auto Assignment rule if it’s present, and will remain without assignee\n if there’s no existing Auto Assignment rule\n \n
    • \n \n )}\n
    \n
    \n
    \n \n )\n}\n\n
    \n \n \n Save\n \n \n
    \n \n \n );\n }}\n \n );\n};\n\nexport default ConfigureMergeDuplicationDrawer;\n","import { darken, lighten, makeStyles } from '@material-ui/core/styles';\nimport { tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n root: {\n width: '450px',\n padding: '1.5rem 2rem',\n [theme.breakpoints.down('xs')]: {\n width: 'unset',\n },\n },\n controls: {\n display: 'flex',\n justifyContent: 'flex-end',\n marginTop: '1.5rem',\n '& button:first-child': {\n marginRight: '0.5rem',\n },\n [theme.breakpoints.down('xs')]: {\n paddingRight: 0,\n justifyContent: 'center',\n },\n },\n heading: {\n marginBottom: '1rem',\n },\n errorButton: {\n backgroundColor: tertiaryColors.peach,\n '&:hover': {\n backgroundColor: lighten(tertiaryColors.peach, 0.2),\n },\n '&:active': {\n backgroundColor: darken(tertiaryColors.peach, 0.2),\n },\n '&:focus': {\n backgroundColor: darken(tertiaryColors.peach, 0.2),\n },\n },\n}));\n","import {\n Grid,\n IconButton,\n Typography,\n Button,\n Dialog,\n} from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\nimport clsx from 'clsx';\nimport { ConfirmationProps } from './types';\nimport useStyles from './styles';\n\nconst ConfirmationModal = (props: ConfirmationProps) => {\n const {\n open,\n header,\n content,\n onCancelText,\n onConfirmText,\n onConfirm,\n onCancel,\n hideCancel,\n type = 'save',\n } = props;\n const classes = useStyles();\n\n const getDefaultHeader = () => {\n if (type === 'delete') {\n return 'Delete';\n }\n if (type === 'save') {\n return 'Save changes?';\n }\n if (type === 'leave') {\n return 'Are you sure you want to leave?';\n }\n\n return '';\n };\n\n const getDefaultConfirmText = () => {\n if (type === 'delete') {\n return 'Delete';\n }\n if (type === 'save') {\n return 'Save';\n }\n if (type === 'leave') {\n return 'Leave';\n }\n\n return '';\n };\n\n const getDefaultCancelText = () => {\n if (type === 'leave') {\n return 'Stay';\n }\n\n return 'Cancel';\n };\n\n const getDefaultContent = () => {\n if (type === 'delete') {\n return (\n <>\n Are you sure you want to do this?\n Note: You cannot undo this\n \n );\n }\n if (type === 'save') {\n return (\n \n All edits that were made will only be applied to a new cases that will\n be associated with this workflow. Cases ongoing cases won’t be\n affected.\n \n );\n }\n if (type === 'leave') {\n return (\n \n You have unsaved changes. If you leave the page, these changes will be\n lost.\n \n );\n }\n\n return '';\n };\n\n return (\n \n
    \n \n {header || getDefaultHeader()}\n \n \n \n \n {content || getDefaultContent()}\n
    \n {\n !hideCancel && (\n \n )\n }\n \n {onConfirmText || getDefaultConfirmText()}\n \n
    \n
    \n
    \n );\n};\n\nexport default ConfirmationModal;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport {\n primaryColors,\n fontColors,\n tertiaryColors,\n} from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n drawer__paperAnchorRight: {\n width: '100%',\n [theme.breakpoints.up('sm')]: {\n width: '395px',\n },\n },\n sidePadding: {\n padding: theme.spacing(0, 3),\n },\n header: {\n backgroundColor: primaryColors.contrastText,\n borderBottom: `1px solid ${tertiaryColors.grey}`,\n paddingBottom: theme.spacing(1),\n paddingTop: theme.spacing(1),\n },\n closeIcon: {\n color: fontColors.body,\n },\n drawer__iconButton: {\n marginRight: theme.spacing(2),\n },\n}));\n","import clsx from 'clsx';\nimport {\n Box, Drawer as MuiDrawer, Grid, IconButton, Typography,\n} from '@material-ui/core';\nimport { NavigateBefore, Close } from '@material-ui/icons';\nimport { DrawerProps } from './types';\nimport useStyles from './styles';\n\nconst Drawer = ({\n children,\n onClose,\n open,\n title,\n onBack,\n}: DrawerProps) => {\n const classes = useStyles();\n\n const renderTitle = () => (typeof title === 'string' ? (\n {title}\n ) : (\n title\n ));\n\n return (\n \n \n \n {onBack && (\n \n \n \n )}\n {renderTitle()}\n \n \n \n \n \n \n \n {children}\n \n );\n};\n\nexport default Drawer;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontColors, fontWeight, tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n clearButton: {\n padding: '0.29rem',\n visibility: 'hidden',\n },\n visibleButton: {\n visibility: 'visible',\n },\n icon: {\n color: fontColors.body,\n opacity: 0.5,\n },\n input: {\n cursor: 'pointer',\n '& input': {\n cursor: 'pointer',\n },\n },\n placeholder: {\n color: fontColors.subBody,\n },\n dayWrapper: {\n paddingRight: '0.72rem',\n marginTop: '0.36rem',\n },\n endDateWrapper: {\n marginRight: '0.72rem',\n marginTop: '0.36rem',\n },\n endDateWeekWrapper: {\n paddingRight: 0,\n marginRight: 0,\n },\n day: {\n width: 30,\n height: 30,\n margin: 0,\n padding: 0,\n fontSize: theme.typography.caption.fontSize,\n color: fontColors.subBody,\n '&:hover': {\n fontWeight: fontWeight.bold,\n border: '1px solid',\n borderColor: theme.palette.primary.main,\n color: fontColors.header,\n },\n },\n nonCurrentMonthDay: {\n visibility: 'hidden',\n },\n highlight: {\n background: tertiaryColors.mediumGrey,\n },\n highlightDay: {\n borderRadius: '50%',\n background: theme.palette.primary.main,\n '& p': {\n color: theme.palette.common.white,\n },\n },\n firstHighlight: {\n background: tertiaryColors.mediumGrey,\n borderRadius: '50% 0 0 50%',\n },\n endHighlight: {\n background: tertiaryColors.mediumGrey,\n borderRadius: '0 50% 50% 0',\n },\n}));\n","import {\n useEffect,\n useState,\n useRef,\n} from 'react';\nimport { DatePicker as MuiDatePicker } from '@material-ui/pickers';\nimport {\n IconButton,\n Typography,\n Icon,\n} from '@material-ui/core';\nimport { CloseOutlined } from '@material-ui/icons';\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\nimport format from 'date-fns/format';\nimport moment from 'moment';\nimport { CalendarIcon } from '../../assets/icons';\nimport { DatePickerProps } from './types';\nimport { TextFieldLabel } from '..';\nimport useStyles from './styles';\n\nexport default function DatePicker(props: DatePickerProps) {\n const {\n value,\n name,\n label,\n simple,\n disableClearable,\n required,\n error,\n onChange,\n onClear,\n ...rest\n } = props;\n\n const classes = useStyles();\n const containerRef = useRef(null);\n const [anchorEl, setAnchorEl] = useState(null);\n\n useEffect(() => {\n if (containerRef && containerRef.current) {\n setAnchorEl(containerRef.current);\n }\n }, []);\n\n const handleOnChangeDate = (\n v: MaterialUiPickersDate,\n ) => {\n const formatted = moment(v).format('YYYY-MM-DD');\n if (simple) {\n onChange(formatted);\n return;\n }\n if (\n !(value && value.start)\n || (value.start && value.end)\n || (value.start && (moment(formatted).isBefore(moment(value.start))))\n ) {\n onChange({ start: formatted, end: null });\n return;\n }\n onChange({ start: value.start, end: formatted });\n };\n\n const handleOnClear = (\n e: React.MouseEvent,\n ) => {\n e.stopPropagation();\n e.preventDefault();\n onClear();\n };\n\n const renderLabel = () => {\n if (simple && value) {\n return moment(value).format('DD MMM YYYY');\n }\n if (!simple && value && value.start && value.end) {\n return `${moment(value.start).format('DD MMM YYYY')} - ${moment(value.end).format('DD MMM YYYY')}`;\n }\n return 'Select';\n };\n\n const renderSelectedDay = (\n day: MaterialUiPickersDate,\n selectedDay: MaterialUiPickersDate,\n dayInCurrentMonth: boolean,\n dayComponent: JSX.Element,\n ) => {\n if (simple) {\n return dayComponent;\n }\n\n const dateClone = day ? day.toDate() : 0;\n const date = moment(dateClone).format('YYYY-MM-DD');\n const start = value && value.start ? moment(value.start).format('YYYY-MM-DD') : null;\n const end = value && value.end ? moment(value.end).format('YYYY-MM-DD') : null;\n\n const dayIsBetween = (\n value\n && value.start\n && value.end\n && moment(dateClone).isBetween(moment(value.start), moment(value.end))\n );\n const isFirstDay = (date === start);\n const isLastDay = (date === end);\n const lastDayOfWeek = moment(moment(dateClone).endOf('week')).format('YYYY-MM-DD');\n const isLastDayOfWeek = moment(moment(dateClone).format('YYYY-MM-DD')).isSame(lastDayOfWeek);\n\n const wrapperClassName = `\n ${dayInCurrentMonth && value && value.start && isLastDay ? classes.endDateWrapper : classes.dayWrapper}\n ${isLastDayOfWeek ? classes.endDateWeekWrapper : ''}\n ${dayInCurrentMonth && dayIsBetween ? classes.highlight : ''}\n ${dayInCurrentMonth && isFirstDay ? classes.firstHighlight : ''}\n ${dayInCurrentMonth && isLastDay ? classes.endHighlight : ''}\n `;\n const dayClassName = `\n ${classes.day}\n ${(dayInCurrentMonth && isFirstDay) || (dayInCurrentMonth && isLastDay) ? classes.highlightDay : ''}\n ${!dayInCurrentMonth ? classes.nonCurrentMonthDay : ''}\n `;\n\n return (\n
    \n \n \n {format(dateClone, 'd')}\n \n \n
    \n );\n };\n\n const haveValue = (simple && value) || (!simple && value && value.start && value.end);\n return (\n
    \n \n { label }\n \n renderLabel()}\n required={required}\n error={!!error}\n helperText={error}\n value={value}\n renderDay={(\n day, selectedDate, dayInCurrentMonth, dayComponent,\n ) => renderSelectedDay(day, selectedDate, dayInCurrentMonth, dayComponent)}\n onChange={handleOnChangeDate}\n InputProps={{\n className: `${classes.input} ${haveValue ? '' : classes.placeholder}`,\n endAdornment: (\n <>\n {\n !disableClearable && (\n \n \n \n )\n }\n \n \"date\"\n \n \n ),\n }}\n PopoverProps={{\n anchorEl,\n }}\n {...rest}\n />\n
    \n );\n}\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontColors } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n form: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n padding: theme.spacing(3),\n },\n gridContainer: {\n flex: 1,\n },\n buttonClearAll: {\n color: fontColors.subBody,\n },\n buttonWrapper: {\n '& > button:not(:first-child)': {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(13),\n [theme.breakpoints.down('xs')]: {\n marginLeft: theme.spacing(1),\n marginRight: theme.spacing(6),\n },\n },\n },\n}));\n","import React from 'react';\n\nimport { Button, Grid } from '@material-ui/core';\n\nimport Drawer from '../Drawer';\nimport { DrawerProps } from '../Drawer/types';\nimport useStyles from './styles';\n\nexport interface FilterDrawerProps extends DrawerProps {\n onClear?: () => void;\n onSubmit?: () => void;\n}\n\nconst FilterDrawer = ({\n children,\n onClose,\n onClear,\n onSubmit,\n title = 'Filter',\n ...other\n}: FilterDrawerProps) => {\n const classes = useStyles();\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n onSubmit?.();\n };\n\n return (\n \n \n \n {React.Children.map(children, (child) => (\n \n {child}\n \n ))}\n \n \n \n
    \n \n \n Apply\n \n
    \n
    \n \n \n );\n};\n\nexport default FilterDrawer;\n","import { useState } from 'react';\nimport AutocompleteInput from '../AutocompleteInput';\nimport { AutocompleteOption } from '../AutocompleteInput/types';\n\nimport DatePicker from '../DatePicker';\nimport FilterDrawer, { FilterDrawerProps } from '../FilterDrawer';\n\nexport interface FilterDrawerControlledProps extends Omit {\n fields: FilterDrawerControlledField[];\n onSubmit: (values: any) => void;\n}\n\nexport interface FilterDrawerControlledField {\n name: string;\n label: string;\n value: any;\n type: 'daterange' | 'autocomplete';\n options?: any[];\n disabled?: boolean;\n loading?: boolean;\n onChange?: (value: any) => void;\n}\n\nconst FilterDrawerControlled = ({\n fields,\n onClear,\n onSubmit,\n ...other\n}: FilterDrawerControlledProps) => {\n const [values, setValues] = useState(fields.reduce((res, field) => ({\n ...res,\n [field.name]: field.value,\n }), {}));\n\n const handleClear = () => {\n setValues({});\n onClear?.();\n };\n\n const renderDaterangeInput = (field: FilterDrawerControlledField) => (\n setValues((prevValues) => ({\n ...prevValues,\n [field.name]: v,\n }))}\n onClear={() => setValues((prevValues) => ({\n ...prevValues,\n [field.name]: null,\n }))}\n />\n );\n\n const renderAutocompleteInput = (field: FilterDrawerControlledField) => (\n {\n field.onChange?.(value);\n setValues((prevValues) => ({\n ...prevValues,\n [field.name]: value,\n }));\n }}\n keySelector={(option: AutocompleteOption) => option.value}\n labelSelector={(option: AutocompleteOption) => option.label}\n />\n );\n\n return (\n onSubmit?.(values)}\n >\n {fields.map((field) => {\n switch (field.type) {\n case 'daterange':\n return renderDaterangeInput(field);\n case 'autocomplete':\n return renderAutocompleteInput(field);\n default:\n return undefined;\n }\n })}\n \n );\n};\n\nexport default FilterDrawerControlled;\n","import {\n useState,\n useEffect,\n} from 'react';\nimport { debounce } from 'lodash';\nimport {\n TextField as MuiTextField,\n} from '@material-ui/core';\nimport { TextFieldLabel } from '..';\nimport { TextFieldProps } from './types';\n\n// This is to reduce the formik rendering on each change\nconst DebouncedTextFieldInput = ({\n children,\n label,\n required = false,\n TextFieldLabelProps,\n InputProps,\n value,\n onChange,\n ...MuiTextFieldProps\n}: TextFieldProps) => {\n const [innerValue, setInnerValue] = useState('');\n\n const debounceCallBack = debounce((e, callBack) => {\n callBack();\n }, 1000);\n\n const handleOnChange = (e: React.ChangeEvent) => {\n e.persist();\n const newValue = e.target.value;\n setInnerValue(newValue);\n if (onChange) {\n debounceCallBack(e, () => {\n onChange(e);\n });\n }\n };\n\n useEffect(() => {\n if (value) {\n setInnerValue(value as string);\n } else {\n setInnerValue('');\n }\n }, [value]);\n\n return (\n <>\n {label && (\n \n {label}\n \n )}\n \n {children}\n \n \n );\n};\n\nexport default DebouncedTextFieldInput;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontVariants } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n backdrop: {\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n transition: 'backgroundColor 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',\n },\n header: {\n ...fontVariants.subtitle1,\n color: theme.palette.font.header,\n textTransform: 'uppercase',\n padding: '1.3rem 1.15rem 0.86rem 1.15rem',\n },\n item: {\n ...fontVariants.body2,\n color: theme.palette.font.header,\n minWidth: '6.25rem',\n '&:hover': {\n backgroundColor: `${theme.palette.tertiary.mediumGrey}`,\n },\n },\n}));\n","import {\n useState,\n} from 'react';\nimport {\n Menu,\n MenuItem,\n} from '@material-ui/core';\nimport {\n DropdownMenuProps,\n OptionProps,\n} from './types';\nimport useStyles from './styles';\n\nconst DropdownMenu = (\n props: DropdownMenuProps,\n) => {\n const {\n anchorOrigin,\n transformOrigin,\n children,\n options,\n headerNode,\n backdrop,\n onOpenCallback,\n } = props;\n const classes = useStyles();\n\n const [anchorEl, setAnchorEl] = useState(null);\n\n const handleOpen = (\n event: any,\n ) => {\n event.stopPropagation();\n setAnchorEl(event.currentTarget);\n if (onOpenCallback) {\n onOpenCallback();\n }\n };\n\n const handleClose = (\n event: any,\n ) => {\n event.stopPropagation();\n setAnchorEl(null);\n };\n\n const handleClickOption = (\n event: any,\n option: OptionProps,\n ) => {\n option.onClick(event);\n handleClose(event);\n };\n\n const renderMenuItem = (\n option: OptionProps,\n ) => {\n if (option.hide) {\n return null;\n }\n return (\n handleClickOption(e, option)}\n >\n { option.children }\n \n );\n };\n\n return (\n <>\n {typeof children === 'function' ? children({ isOpen: Boolean(anchorEl), open: handleOpen, close: handleClose }) : children}\n \n { headerNode }\n {\n options.map((option: OptionProps) => (\n renderMenuItem(option)\n ))\n }\n \n \n );\n};\n\nDropdownMenu.defaultProps = {\n backdrop: false,\n anchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n transformOrigin: { vertical: 'top', horizontal: 'right' },\n headerNode: null,\n};\n\nexport default DropdownMenu;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { fontColors, tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n content: {\n flexGrow: 1,\n padding: '1rem',\n [theme.breakpoints.up('sm')]: {\n padding: '1rem 1.5rem',\n },\n },\n section: {\n width: '100%',\n padding: '1.68rem 0',\n '&:first-child': {\n paddingTop: 0,\n '& > h6: first-child': {\n marginBottom: '1.5rem',\n },\n '& > div:not(:first-child) > h6': {\n marginTop: '1rem',\n },\n },\n '&:not(:first-child)': {\n borderTop: `1px solid ${tertiaryColors.mediumGrey}`,\n },\n '& > h6:not(:first-child):not(:nth-child(2))': {\n marginTop: '0.86rem',\n },\n '& > h6:not(:first-child)': {\n marginTop: '0.5rem',\n marginBottom: '4px',\n },\n },\n footer: {\n padding: '1rem',\n minHeight: '80px',\n },\n secondaryButtons: {\n '& > button': {\n padding: '0 1rem',\n color: fontColors.subBody,\n textTransform: 'inherit',\n },\n '& > button:not(:first-child)': {\n marginLeft: '1rem',\n },\n },\n primaryButtons: {\n '& button + button': {\n marginLeft: '1rem',\n },\n },\n}));\n","import { makeStyles } from '@material-ui/core/styles';\n\nexport default makeStyles({\n loading: {\n zIndex: 11,\n position: 'absolute',\n height: '100%',\n backgroundColor: 'rgba(255,255,255,0.85)',\n },\n fullHeight: {\n height: '100vh',\n },\n});\n","import {\n CircularProgress,\n Grid,\n} from '@material-ui/core';\nimport { LoadingContentOverlayProps } from './types';\nimport useStyles from './styles';\n\nconst LoadingContentOverlay = (\n props: LoadingContentOverlayProps,\n) => {\n const {\n isLoading,\n fullHeight,\n } = props;\n const classes = useStyles();\n\n if (isLoading) {\n return (\n \n \n \n );\n }\n return null;\n};\n\nLoadingContentOverlay.defaultProps = {\n fullHeight: false,\n};\n\nexport default LoadingContentOverlay;\n","import { makeStyles } from '@material-ui/core/styles';\n\nexport default makeStyles((theme) => ({\n pages: {\n flex: '1',\n },\n container: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n padding: 0,\n height: '40px',\n '& li': {\n display: 'flex',\n margin: '0 0.5rem',\n '& a': {\n outline: 'none',\n border: 'none',\n },\n },\n [theme.breakpoints.down('xs')]: {\n margin: 0,\n },\n },\n link: {\n transition: 'all 0.25s',\n borderRadius: '4px',\n cursor: 'pointer',\n fontSize: '0.86rem',\n width: '2.15rem',\n height: '2.15rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: theme.palette.font.header,\n [theme.breakpoints.down('xs')]: {\n width: '1rem',\n },\n },\n breakLink: {\n padding: '0.75rem',\n cursor: 'pointer',\n },\n activeLink: {\n background: theme.palette.tertiary.mediumGrey,\n },\n disabledLink: {\n background: 'none',\n cursor: 'default',\n },\n pageAmountButton: {\n padding: '0.5rem 1rem',\n '&:hover': {\n background: theme.palette.tertiary.mediumGrey,\n color: theme.palette.font.header,\n },\n },\n hideNumbers: {\n '& > li:not(.previous):not(.next)': {\n display: 'none',\n },\n },\n hideAll: {\n '& > a': {\n cursor: 'default',\n color: theme.palette.tertiary.grey,\n },\n },\n}));\n","import { useState } from 'react';\nimport ReactPaginate from 'react-paginate';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport {\n Typography,\n Button,\n Grid,\n useMediaQuery,\n} from '@material-ui/core';\nimport { PaginationProps } from './types';\nimport DropdownMenu from '../DropdownMenu';\nimport useStyles from './styles';\n\nconst amounts = [10, 30, 50];\n\nconst Pagination = (\n props: PaginationProps,\n) => {\n const {\n total,\n variant,\n onChangePage,\n onChangeCount,\n anchorOrigin,\n transformOrigin,\n } = props;\n\n const [limit, setLimit] = useState(10);\n const [page, setPage] = useState(1);\n\n const classes = useStyles();\n\n const isMobile = useMediaQuery((theme: any) => theme.breakpoints.down('sm'));\n\n const getFromTo = (\n v: number,\n ) => ({\n from: (v - 1) * limit + 1,\n to: v * limit,\n });\n\n const handleOnCountChange = (\n amount: number,\n ) => {\n setLimit(amount);\n const selectedPage = page;\n const newPageCount = Math.ceil(total / amount);\n if (selectedPage > newPageCount) {\n setPage(newPageCount);\n }\n onChangeCount({\n limit: amount,\n page: newPageCount,\n });\n };\n\n const handleOnPageChange = ({ selected }: {\n selected: number\n }) => {\n const v = selected + 1;\n setPage(v);\n onChangePage({\n limit,\n page: v,\n });\n };\n\n const renderMenuItem = (\n amount: number,\n ) => (\n \n \n {`Show ${amount}`}\n \n \n );\n\n const renderCounts = () => {\n const { from, to } = getFromTo(page);\n const labelCounts = `${from} - ${to > total ? total : to} of ${total}`;\n if (variant === 'simple') {\n return (\n \n {labelCounts}\n \n );\n }\n\n const options = amounts.map((v) => ({\n name: v,\n children: renderMenuItem(v),\n onClick: () => handleOnCountChange(v),\n }));\n return (\n \n {({ open }) => (\n \n )}\n \n );\n };\n\n return (\n <>\n {\n total ? (\n \n \n { renderCounts() }\n \n \n }\n nextLabel={}\n />\n \n \n ) : null\n }\n \n );\n};\n\nPagination.defaultProps = {\n anchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n transformOrigin: { vertical: 'top', horizontal: 'right' },\n variant: 'detailed',\n};\n\nexport default Pagination;\n","import { makeStyles } from '@material-ui/core/styles';\n\nexport default makeStyles(() => ({\n root: {\n maxWidth: '300px',\n '& > div:first-child': {\n padding: '1rem',\n },\n '& $list + $list': {\n marginTop: '1.5rem',\n },\n },\n list: {\n maxHeight: '250px',\n width: '300px',\n overflow: 'auto',\n paddingBottom: '1rem',\n '& > span': {\n padding: '0 1rem',\n },\n },\n listItem: {\n padding: '0rem 1rem',\n },\n label: {\n maxWidth: '75%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n icon: {\n height: '1.5rem',\n width: '1.5rem',\n filter: 'invert(40%) sepia(5%) saturate(1448%) hue-rotate(163deg) brightness(94%) contrast(85%)',\n },\n}));\n","import React, { useState } from 'react';\nimport _ from 'lodash';\nimport {\n Checkbox,\n List,\n ListItem,\n Popover,\n Radio,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport { SearchIcon } from '../../assets/icons';\nimport { PopoverSearchableListProps } from './types';\nimport useStyles from './styles';\n\nconst PopoverSearchableList = (\n props: PopoverSearchableListProps,\n) => {\n const classes = useStyles();\n const {\n single,\n data,\n options,\n onClickOption,\n children,\n } = props;\n\n const [anchorEl, setAnchorEl] = useState(null);\n const [search, setSearch] = useState('');\n\n const debounceCallBack = _.debounce((e, callBack) => {\n callBack();\n }, 200);\n\n const handleSearch = (\n e: React.ChangeEvent,\n ) => {\n e.persist();\n debounceCallBack(e, () => {\n setSearch(e.target.value);\n });\n };\n\n const handleOpen = (e: any) => {\n e.stopPropagation();\n setAnchorEl(e.currentTarget);\n };\n\n const handleClose = (e: any) => {\n e.stopPropagation();\n setSearch('');\n setAnchorEl(null);\n };\n\n const handleSelect = (\n e: React.MouseEvent,\n value: string,\n ) => {\n let newValues:any = data || (single ? '' : []);\n if (single) {\n if (newValues !== value) {\n newValues = value;\n }\n } else if (_.isArray(newValues)) {\n const index = newValues.indexOf(value);\n const isChecked = index > -1;\n if (!isChecked) {\n newValues.push(value);\n } else {\n newValues.splice(index, 1);\n }\n }\n onClickOption(e, newValues);\n };\n\n const renderListItem = (\n option: {\n value: string,\n label: string,\n disabled?: boolean,\n },\n ) => {\n if (single) {\n return (\n handleSelect(e, option.value)}\n >\n \n \n { option.label }\n \n \n );\n }\n\n let isChecked = false;\n\n if (data && option.value) {\n const index = data.indexOf(option.value);\n isChecked = index > -1;\n }\n return (\n handleSelect(e, option.value)}\n >\n \n \n { option.label }\n \n \n );\n };\n\n const renderList = () => {\n let newOptions = options || [];\n if (search) {\n newOptions = newOptions.filter((option) => (\n option.label.toLowerCase().includes(search.trim().toLowerCase())\n ));\n }\n return (\n \n {\n newOptions.length > 0\n ? newOptions.map((option) => renderListItem(option))\n : (\n \n \n No result found\n \n \n )\n }\n \n );\n };\n\n return (\n <>\n {typeof children === 'function' ? children({ isOpen: Boolean(anchorEl), open: handleOpen, close: handleClose }) : children}\n \n
    \n ,\n }}\n onChange={handleSearch}\n size=\"small\"\n value={undefined}\n />\n { renderList() }\n
    \n \n \n );\n};\n\nexport default PopoverSearchableList;\n","import { makeStyles } from '@material-ui/core/styles';\nimport { tertiaryColors } from '../../styles/variables';\n\nexport default makeStyles(() => ({\n root: {\n '& .MuiOutlinedInput-input': {\n maxHeight: '2.5rem',\n },\n },\n adornment: {\n color: tertiaryColors.grey,\n },\n searchIcon: {\n height: '1.5rem',\n width: '1.5rem',\n filter: 'invert(40%) sepia(5%) saturate(1448%) hue-rotate(163deg) brightness(94%) contrast(85%)',\n },\n clearIcon: {\n width: '1rem',\n height: '1rem',\n },\n}));\n","import React, {\n useState,\n useEffect,\n} from 'react';\nimport {\n TextField,\n InputAdornment,\n IconButton,\n} from '@material-ui/core';\nimport { Close } from '@material-ui/icons';\nimport { SearchIcon } from '../../assets/icons';\nimport { SearchInputProps } from './types';\nimport useStyles from './styles';\nimport { TextFieldLabel } from '..';\n\nconst SearchInput = ({\n onSubmit,\n onClear,\n data,\n label,\n required = false,\n TextFieldLabelProps,\n ...rest\n}: SearchInputProps) => {\n const classes = useStyles();\n\n const [inputValue, setInputValue] = useState(data);\n\n useEffect(() => {\n if (data) {\n setInputValue(data);\n }\n }, [data]);\n\n const handleOnChange = (e: React.ChangeEvent) => {\n e.preventDefault();\n setInputValue(e.target.value);\n onSubmit(e, e.target.value);\n };\n\n const handleOnClear = (\n e: React.MouseEvent,\n ) => {\n e.stopPropagation();\n e.preventDefault();\n setInputValue('');\n onClear(e);\n };\n\n const renderSearchIcon = (\n \n \"search\"\n \n );\n\n const renderDeleteIcon = () => {\n if (inputValue) {\n return (\n \n \n \n \n \n );\n }\n return null;\n };\n\n return (\n <>\n {label && (\n \n {label}\n \n )}\n \n \n );\n};\n\nexport default SearchInput;\n","import { makeStyles } from '@material-ui/core';\nimport { fontColors, fontVariants } from '../../styles/variables';\n\nexport default makeStyles((theme) => ({\n subLabel: {\n paddingLeft: 12,\n },\n root: {\n ...fontVariants.h6,\n textTransform: 'initial',\n paddingTop: 0,\n paddingBottom: theme.spacing(1.5),\n paddingRight: theme.spacing(4),\n minHeight: 0,\n minWidth: 0,\n },\n textColorPrimary: {\n color: fontColors.subBody,\n },\n}));\n","import { Tab as MuiTab, Typography } from '@material-ui/core';\nimport { TabProps } from './types';\nimport useStyles from './styles';\n\nconst Tab = ({ children, subLabel, ...MuiTabProps }: TabProps) => {\n const classes = useStyles();\n return (\n
    \n \n {subLabel}\n \n \n {children}\n \n
    \n );\n};\n\nexport default Tab;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\nimport { fontColors, fontSize } from '../../styles/variables';\n\nexport default makeStyles((theme) => (({\n infoIcon: {\n fontSize: fontSize['15px'],\n color: fontColors.body,\n marginLeft: theme.spacing(1),\n },\n})));\n","import {\n Box,\n TextField as MuiTextField,\n Tooltip,\n} from '@material-ui/core';\nimport { InfoOutlined as InfoOutlinedIcon } from '@material-ui/icons';\nimport { TextFieldLabel } from '..';\nimport { TextFieldProps } from './types';\nimport useStyles from './styles';\n\nconst TextFieldInput = ({\n children,\n label,\n infoText,\n required = false,\n TextFieldLabelProps,\n InputProps,\n ...MuiTextFieldProps\n}: TextFieldProps) => {\n const classes = useStyles();\n\n return (\n <>\n {label && (\n \n \n {label}\n \n {\n infoText && (\n \n \n \n )\n }\n \n )}\n \n {children}\n \n \n );\n};\n\nexport default TextFieldInput;\n","import {\n makeStyles,\n} from '@material-ui/core/styles';\n\nexport default makeStyles((theme) => ({\n required: {\n '&::after': {\n content: '\" * \"',\n color: theme.palette.error.main,\n },\n },\n}));\n","import React from 'react';\nimport clsx from 'clsx';\nimport { Typography } from '@material-ui/core';\nimport { TextFieldLabelProps } from './types';\nimport useStyles from './styles';\n\nconst TextFieldLabel = ({\n children,\n required,\n className,\n ...TypographyProps\n}: TextFieldLabelProps): React.ReactElement => {\n const classes = useStyles();\n return (\n \n {children}\n \n );\n};\n\nexport default TextFieldLabel;\n","import { makeStyles } from '@material-ui/core';\nimport { fontColors } from '../../styles/variables';\n\nexport default makeStyles(() => ({\n wrapper: {\n '& > div:first-child': {\n borderRadius: '4px 0 0 4px',\n height: '40px',\n },\n '& > div:not(:first-child) > div': {\n borderRadius: '0 4px 4px 0',\n '& > fieldset': {\n borderLeft: 'none',\n },\n },\n },\n paper: {\n maxHeight: '250px',\n },\n flag: {\n marginRight: '0.5rem',\n },\n placeholder: {\n color: fontColors.subBody,\n },\n}));\n","import {\n ComponentType,\n useEffect,\n} from 'react';\nimport {\n Redirect,\n Route,\n RouteComponentProps,\n} from 'react-router-dom';\nimport { useAuth } from '../hooks';\nimport LoadingPage from '../pages/LoadingPage';\n\nexport interface RouteProps {\n component: ComponentType;\n exact?: boolean;\n path: string | string[];\n}\n\nconst Authenticate = ({\n component: C,\n props,\n}: {\n component: ComponentType,\n props: RouteComponentProps,\n}) => {\n const {\n authenticated,\n loading,\n authenticate,\n } = useAuth();\n\n useEffect(() => {\n if (!authenticated && loading) {\n authenticate();\n }\n }, [authenticated]);\n\n if (loading) return ;\n if (authenticated) {\n return ;\n }\n return ;\n};\n\nconst RouteAuthenticated = ({\n component: C,\n ...rest\n}: RouteProps) => (\n (\n \n )}\n />\n);\n\nexport default RouteAuthenticated;\n","const routes = {\n workflowList: (type: string): string => `/workflow/${type}`,\n caseManagementList: (type: string): string => `/workflow/${type}/case_management`,\n newWorkflow: (type: string): string => `/workflow/${type}/new`,\n readWorkflow: (type: string, id: string): string => `/workflow/${type}/${id}`,\n newAutomation: (type: string, workflowID: string): string => `/automation/${type}/${workflowID}`,\n readAutomation: (type: string, workflowID: string, id: string): string => `/automation/${type}/${workflowID}/${id}`,\n notFound: '/not_found',\n accessDenied: '/access_denied',\n error: '/error',\n};\n\nexport default routes;\n","/* eslint-disable import/no-cycle */\nimport {\n lazy,\n Suspense,\n} from 'react';\nimport {\n Route,\n Redirect,\n Switch,\n} from 'react-router-dom';\nimport { AppSnackbar } from '../components';\nimport LoadingPage from '../pages/LoadingPage';\nimport RouteAuthenticated from './RouteAuthenticated';\nimport routes from './routes';\n\nexport { routes };\n\nconst List = lazy(() => import('../pages/List'));\nconst ListCaseManagement = lazy(() => import('../pages/ListCaseManagement'));\nconst Workflow = lazy(() => import('../pages/Workflow'));\nconst NewAutomation = lazy(() => import('../pages/NewAutomation'));\nconst AccessDenied = lazy(() => import('../pages/AccessDenied'));\nconst NotFound = lazy(() => import('../pages/NotFound'));\nconst Error = lazy(() => import('../pages/ErrorPage'));\n\nexport default function Routes() {\n return (\n <>\n \n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n","const config = {\n app: {\n stage: process.env.REACT_APP_RELEASE_STAGE,\n },\n cognito: {\n appClientId: process.env.REACT_APP_COGNITO_APP_CLIENT_ID,\n cookieDomain: process.env.REACT_APP_COGNITO_COOKIE_DOMAIN,\n cookieSecure: process.env.REACT_APP_COGNITO_COOKIE_SECURE,\n identityPoolId: process.env.REACT_APP_COGNITO_IDENTITY_POOL_ID,\n region: process.env.REACT_APP_COGNITO_REGION,\n userPoolId: process.env.REACT_APP_COGNITO_USER_POOL_ID,\n },\n api: {\n workflowApiUrl: process.env.REACT_APP_WORKFLOW_API_URL,\n userApiUrl: process.env.REACT_APP_USER_API_URL,\n leadCampaignApiUrl: process.env.REACT_APP_LEAD_CAMPAIGN_API_URL,\n leadFormApiUrl: process.env.REACT_APP_LEAD_FORM_API_URL,\n creditControlApiUrl: process.env.REACT_APP_CREDIT_CONTROL_GRAPHQL_API_URL,\n creditControlRESTApiUrl: process.env.REACT_APP_CREDIT_CONTROL_SERVICE_ENDPOINT,\n leadUsersApiUrl: process.env.REACT_APP_LEAD_USERS_API_URL,\n leadCallApiUrl: process.env.REACT_APP_LEAD_CALL_API_URL,\n },\n};\n\nexport default config;\n","import {\n createContext,\n ReactNode,\n useContext,\n useState,\n} from 'react';\nimport { Color } from '@material-ui/lab/Alert';\n\ninterface AlertContext {\n /**\n * Severity state. Will set alert colour.\n */\n severity: Color;\n\n /**\n * Message state. Will show as message in alert.\n */\n message: string;\n\n /**\n * Indicator to indicate if alert is shown or hidden\n */\n alert: boolean;\n\n /**\n * Helper method to set alert message & severity via `AlertMessage`.\n * If `show=true`, alert will auto prompt.\n */\n setAlert: (message: AlertMessage, show?: boolean) => void;\n\n /**\n * Helper method to set `alert` to `true`.\n */\n showAlert: () => void;\n\n /**\n * Helper method to set `alert` to `false`.\n */\n hideAlert: () => void;\n}\n\nexport interface AlertMessage {\n severity: Color;\n message: string;\n}\n\nconst alertContext = createContext({\n severity: 'info',\n message: '',\n alert: false,\n setAlert: () => { },\n showAlert: () => { },\n hideAlert: () => { },\n});\n\nexport function useProvideAlert(): AlertContext {\n const [severity, setSeverity] = useState('info');\n const [message, setMessage] = useState('');\n const [alert, setShowAlert] = useState(false);\n\n const showAlert = () => {\n setShowAlert(true);\n };\n\n const setAlert = (m: AlertMessage, show?: boolean) => {\n setSeverity(m.severity);\n setMessage(m.message);\n if (show) {\n showAlert();\n }\n };\n\n const hideAlert = () => {\n setShowAlert(false);\n };\n\n return {\n severity,\n message,\n alert,\n setAlert,\n showAlert,\n hideAlert,\n };\n}\n\nexport const useAlert = () => useContext(alertContext);\n\nexport function ProvideAlert({\n children,\n}: {\n children: ReactNode,\n}) {\n const alert = useProvideAlert();\n return (\n \n {children}\n \n );\n}\n","import Bugsnag from '@bugsnag/js';\nimport {\n CognitoUser,\n CognitoUserSession,\n} from 'amazon-cognito-identity-js';\nimport { Auth } from 'aws-amplify';\nimport {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { getUserRole } from '../constants';\n\nexport interface App {\n appID: string;\n webURL?: string;\n hasCallAccess?: boolean;\n}\n\ninterface CompanyData {\n apps?: App[];\n}\ninterface User {\n id: string,\n name: string,\n groups: string[],\n role: string,\n companyID: string,\n companyBranchID: string,\n company: CompanyData,\n}\n\ninterface AuthContext {\n authenticated: boolean;\n loading: boolean;\n user: User;\n\n /**\n * Authenticate user's Cognito session.\n * Returns the status of authentication. Auto redirects to\n * access denied screen when not authenticated - `redirect` defaults to `true`.\n */\n authenticate(): Promise;\n}\n\nconst authContext = createContext({\n authenticated: false,\n loading: true,\n user: {\n id: '',\n name: '',\n groups: [],\n role: '',\n companyID: '',\n companyBranchID: '',\n company: {\n apps: [],\n },\n },\n authenticate: () => Promise.resolve(false),\n});\n\nexport function useAuthProvider(): AuthContext {\n const [authenticated, setAuthenticated] = useState(false);\n const [loading, setLoading] = useState(true);\n const [user, setUser] = useState({\n id: '',\n name: '',\n groups: [],\n role: '',\n companyID: '',\n companyBranchID: '',\n company: {\n apps: [],\n },\n });\n\n useEffect(() => {\n const getMsgFromParent = (event: any) => {\n let data: CompanyData = {\n apps: [],\n };\n\n if (event?.data?.apps) {\n data = {\n ...data,\n apps: event.data.apps,\n } as CompanyData;\n }\n\n setUser((prev) => ({\n ...prev,\n company: {\n ...data,\n },\n } as any));\n };\n\n if (authenticated && window.addEventListener) {\n window.addEventListener('message', getMsgFromParent, false);\n }\n\n return () => {\n window.removeEventListener('message', getMsgFromParent);\n };\n }, [authenticated]);\n\n const authenticate = async (): Promise => {\n setLoading(true);\n let session: CognitoUserSession | null = null;\n try {\n const authUser: CognitoUser = await Auth.currentAuthenticatedUser();\n session = authUser.getSignInUserSession();\n } catch (err) {\n setAuthenticated(false);\n setLoading(false);\n return false;\n }\n\n if (session && session.isValid()) {\n const payload = session.getIdToken().decodePayload();\n const {\n sub,\n name,\n email,\n 'cognito:groups': groups,\n 'custom:company_id': companyID,\n 'custom:company_branch_id': companyBranchID,\n } = payload;\n\n const role = getUserRole(groups || []);\n // Get user's psql id\n setUser((prev) => ({\n ...prev,\n id: sub || '',\n name: name || '',\n groups,\n role,\n companyID: companyID || '',\n companyBranchID: companyBranchID || '',\n }));\n Bugsnag.addMetadata('user', {\n user_id: sub,\n name,\n email,\n company_id: companyID,\n });\n setAuthenticated(true);\n setLoading(false);\n return true;\n }\n\n setAuthenticated(false);\n setLoading(false);\n return false;\n };\n\n return {\n authenticated,\n loading,\n user,\n authenticate,\n };\n}\n\nexport const useAuth = () => useContext(authContext);\n\ninterface AuthProviderProps {\n children: ReactNode,\n}\n\nexport function AuthProvider({ children }: AuthProviderProps) {\n const auth = useAuthProvider();\n return (\n \n {children}\n \n );\n}\n","import { useCallback, useState } from 'react';\n\n// TODO: deprecate and use useToggleState instead\n\nexport function useLoader() {\n const [loaders, setLoaders] = useState({\n initialLoad: true,\n loading: false,\n });\n\n const toggleLoadingState = useCallback((name, bool) => {\n setLoaders((s) => ({\n ...s,\n [name]: bool,\n }));\n }, []);\n\n return {\n loaders,\n setLoaders,\n toggleLoadingState,\n };\n}\n","import { useState } from 'react';\n\ninterface ToggleState {\n [key: string]: boolean\n}\n\nexport function useToggleState(toggleStates: T) {\n const [activeStates, setActiveStates] = useState(toggleStates);\n\n const toggleState = (name: keyof T, state?: boolean) => {\n setActiveStates((prev) => ({\n ...prev,\n [name]: state || !prev[name],\n }));\n };\n\n return {\n activeStates,\n setActiveStates,\n toggleState,\n };\n}\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({\n getCLS,\n getFID,\n getFCP,\n getLCP,\n getTTFB,\n }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import {\n API_NAME_WORKFLOW,\n API_NAME_USER,\n API_NAME_CREDIT_CONTROL,\n} from '../constants';\nimport config from './config';\n\nconst {\n cookieDomain,\n cookieSecure,\n identityPoolId,\n region,\n userPoolId,\n appClientId,\n} = config.cognito;\n\nconst {\n workflowApiUrl,\n userApiUrl,\n creditControlRESTApiUrl,\n} = config.api;\n\nconst amplifyConfig = {\n Auth: {\n cookieStorage: {\n domain: cookieDomain,\n secure: cookieSecure,\n },\n identityPoolId,\n mandatorySignIn: true,\n region,\n userPoolId,\n userPoolWebClientId: appClientId,\n },\n API: {\n endpoints: [\n {\n name: API_NAME_WORKFLOW,\n endpoint: workflowApiUrl,\n region,\n },\n {\n name: API_NAME_USER,\n endpoint: userApiUrl,\n region,\n },\n {\n name: API_NAME_CREDIT_CONTROL,\n endpoint: creditControlRESTApiUrl,\n region,\n },\n ],\n },\n};\n\nexport default amplifyConfig;\n","import { createTheme } from '@material-ui/core/styles';\nimport {\n fontSize,\n fontFamily,\n fontWeight,\n primaryColors,\n secondaryColors,\n tertiaryColors,\n fontColors,\n fontVariants,\n} from './variables';\n\nconst defaultTheme = createTheme();\n\nconst globalTheme = (createTheme as any)({\n shadows: Array(25).fill('none'),\n palette: {\n primary: primaryColors,\n secondary: secondaryColors,\n tertiary: tertiaryColors,\n font: fontColors,\n text: {\n primary: fontColors.header,\n },\n error: {\n main: tertiaryColors.red,\n dark: defaultTheme.palette.error.dark,\n light: tertiaryColors.alertRed,\n },\n },\n\n typography: {\n fontFamily: fontFamily.openSans,\n ...fontVariants,\n },\n\n overrides: {\n MuiTypography: {\n colorTextPrimary: {\n color: fontColors.header,\n },\n colorTextSecondary: {\n color: fontColors.body,\n },\n },\n\n MuiButton: {\n root: {\n minWidth: '70px',\n height: '35px',\n '&:disabled': {\n '& img': {\n opacity: '0.5',\n },\n },\n },\n label: {\n textTransform: 'none',\n '&:disabled': {\n backgroundColor: tertiaryColors.mediumGrey,\n },\n },\n sizeSmall: {\n '& $label': {\n fontWeight: fontWeight.regular,\n fontSize: fontSize['12px'],\n },\n minWidth: '3.5rem',\n height: '1.875rem',\n },\n sizeLarge: {\n '& $label': {\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['16px'],\n },\n minWidth: '6.5rem',\n height: '2.5rem',\n },\n containedSecondary: {\n '& $label': {\n fontWeight: fontWeight.semiBold,\n },\n '&:hover': {\n backgroundColor: secondaryColors.light,\n },\n '&:active': {\n backgroundColor: secondaryColors.dark,\n },\n '&:focus': {\n backgroundColor: secondaryColors.dark,\n },\n '&:disabled': {\n backgroundColor: tertiaryColors.mediumGrey,\n color: tertiaryColors.grey,\n },\n },\n },\n\n MuiChip: {\n root: {\n color: fontColors.body,\n backgroundColor: tertiaryColors.mediumGrey,\n },\n clickable: {\n '&:hover': {\n backgroundColor: tertiaryColors.darkGrey,\n },\n },\n },\n\n MuiCheckbox: {\n root: {\n '& > span:first-child svg': {\n width: '18px',\n height: '18px',\n },\n },\n colorSecondary: {\n color: tertiaryColors.grey,\n '&$checked': {\n color: tertiaryColors.green,\n },\n '&$disabled': {\n color: tertiaryColors.darkGrey,\n },\n },\n },\n\n MuiTableRow: {\n hover: {\n '&$hover:hover': {\n backgroundColor: tertiaryColors.lightGrey,\n },\n },\n },\n\n MuiTableCell: {\n root: {\n padding: '0.5rem',\n borderBottom: `1px solid ${tertiaryColors.mediumGrey}`,\n },\n head: {\n ...fontVariants.subtitle1,\n borderBottom: `1px solid ${tertiaryColors.grey}`,\n whiteSpace: 'noWrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n maxWidth: '18rem',\n },\n stickyHeader: {\n backgroundColor: defaultTheme.palette.common.white,\n },\n body: {\n ...fontVariants.body1,\n color: fontColors.body,\n },\n },\n\n MuiSwitch: {\n root: {\n width: 30,\n height: 15,\n padding: 0,\n margin: defaultTheme.spacing(1),\n },\n colorSecondary: {\n '&$thumb': {\n backgroundColor: tertiaryColors.grey,\n },\n '&$checked': {\n color: defaultTheme.palette.common.white,\n '& + $track': {\n backgroundColor: tertiaryColors.green,\n },\n '&$disabled': {\n color: defaultTheme.palette.common.white,\n '& + $track': {\n backgroundColor: tertiaryColors.mediumGrey,\n },\n },\n },\n '&$disabled': {\n color: defaultTheme.palette.common.white,\n '& + $track': {\n backgroundColor: tertiaryColors.mediumGrey,\n },\n },\n },\n switchBase: {\n padding: 0,\n color: defaultTheme.palette.common.white,\n border: `1px solid ${tertiaryColors.mediumGrey}`,\n '&$checked': {\n transform: 'translateX(15px)',\n border: `1px solid ${primaryColors.main}`,\n '&$disabled': {\n border: `1px solid ${tertiaryColors.mediumGrey}`,\n },\n '& + $track': {\n opacity: 1,\n },\n },\n '&$disabled + $track': {\n opacity: 1,\n },\n },\n track: {\n borderRadius: 26 / 2,\n opacity: 1,\n transition: defaultTheme.transitions.create(['background-color', 'border', 'transform']),\n backgroundColor: tertiaryColors.grey,\n },\n thumb: {\n width: 13,\n height: 13,\n },\n },\n\n MuiTooltip: {\n tooltipPlacementBottom: {\n backgroundColor: fontColors.body,\n margin: '0.5rem 0 0 0',\n [defaultTheme.breakpoints.down('md')]: {\n margin: '0.5rem 0 0 0',\n },\n },\n },\n\n MuiPickersBasePicker: {\n pickerView: {\n width: '355px',\n maxWidth: '355px',\n '& .MuiPickersMonthSelection-container': {\n width: 'unset',\n },\n [defaultTheme.breakpoints.down('xs')]: {\n width: 'unset',\n minWidth: 'unset',\n },\n },\n },\n\n MuiPickersCalendar: {\n transitionContainer: {\n minHeight: '180px',\n },\n },\n\n MuiPickersCalendarHeader: {\n switchHeader: {\n padding: '0 30px',\n '& > button:first-child': {\n paddingLeft: 0,\n },\n '& > button:last-child': {\n paddingRight: 0,\n },\n '& p': {\n fontSize: '12px',\n },\n },\n daysHeader: {\n '& $dayLabel': {\n color: fontColors.subBody,\n fontWeight: fontWeight.bold,\n },\n },\n transitionContainer: {\n '& > p': {\n color: fontColors.header,\n fontWeight: fontWeight.semiBold,\n },\n },\n },\n\n MuiPaper: {\n root: {\n border: `1px solid ${tertiaryColors.grey}`,\n },\n },\n\n MuiOutlinedInput: {\n root: {\n '&$notchedOutline': {\n borderColor: tertiaryColors.grey,\n },\n '&:hover:not($disabled):not($focused):not($error) $notchedOutline': {\n border: `1px solid ${primaryColors.main}`,\n },\n '&$focused:not($disabled):not($error) $notchedOutline': {\n border: `1px solid ${primaryColors.main}`,\n },\n '&$disabled $notchedOutline': {\n borderColor: tertiaryColors.mediumGrey,\n },\n '&$disabled': {\n backgroundColor: tertiaryColors.mediumGrey,\n '& img, & svg': {\n opacity: 0.5,\n },\n },\n },\n input: {\n border: '1px solid transparent',\n boxSizing: 'border-box',\n height: '40px',\n padding: '0.7rem 1rem',\n },\n },\n\n MuiRadio: {\n root: {\n '& .MuiSvgIcon-root': {\n height: '18px',\n width: '18px',\n },\n },\n colorSecondary: {\n color: tertiaryColors.grey,\n '&$disabled': {\n color: tertiaryColors.mediumGrey,\n },\n '&$checked': {\n color: tertiaryColors.green,\n '&:hover': {\n backgroundColor: 'transparent',\n },\n },\n },\n },\n\n MuiTabs: {\n flexContainer: {\n borderBottom: `1px solid ${tertiaryColors.darkGrey}`,\n },\n indicator: {\n backgroundColor: primaryColors.main,\n },\n },\n\n MuiFormHelperText: {\n root: {\n '&.Mui-error': {\n margin: 0,\n },\n },\n },\n\n MuiSvgIcon: {\n colorDisabled: {\n color: tertiaryColors.darkGrey,\n },\n colorError: {\n color: tertiaryColors.peach,\n },\n },\n\n MuiInputBase: {\n root: {\n '&:not(.Mui-disabled)': {\n backgroundColor: 'white',\n },\n },\n },\n\n },\n\n props: {\n MuiTab: {\n disableRipple: true,\n disableFocusRipple: true,\n },\n },\n});\n\nexport default globalTheme;\n","import Routes from '../../routes';\n\nconst App = () => (\n \n);\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Amplify, Auth } from 'aws-amplify';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport {\n createHttpLink,\n ApolloClient,\n InMemoryCache,\n ApolloProvider,\n} from '@apollo/client';\nimport { setContext } from '@apollo/client/link/context';\nimport { CssBaseline, ThemeProvider } from '@material-ui/core';\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\nimport MomentUtils from '@date-io/moment';\nimport Bugsnag from '@bugsnag/js';\nimport BugsnagPluginReact from '@bugsnag/plugin-react';\nimport reportWebVitals from './reportWebVitals';\nimport amplifyConfig from './config/amplifyConfig';\nimport config from './config/config';\nimport { AuthProvider, ProvideAlert } from './hooks';\nimport globalTheme from './styles/globalTheme';\nimport App from './pages/App';\nimport 'flag-icons/css/flag-icons.min.css';\n\nimport './index.css';\n\nAmplify.configure(amplifyConfig);\nBugsnag.start({\n apiKey: '050f53ac0f2cefa1a9684fd9eda996f9',\n releaseStage: config.app.stage,\n plugins: [new BugsnagPluginReact(React)],\n});\n\nconst httpLink = (endpoint: string) => createHttpLink({\n uri: endpoint,\n});\n\nconst authMiddleware = setContext(async (_, { headers }) => {\n const token = await Auth.currentSession();\n return {\n headers: {\n ...headers,\n authorization: token.getIdToken().getJwtToken() || null,\n },\n };\n});\n\nconst generateClient = (endpoint: string) => new ApolloClient({\n link: authMiddleware.concat(httpLink(endpoint)),\n cache: new InMemoryCache(),\n});\n\nexport const defaultClient = generateClient('graphql');\nexport const clientLeadCampaign = generateClient(config.api.leadCampaignApiUrl || '');\nexport const clientLeadForm = generateClient(config.api.leadFormApiUrl || '');\nexport const clientCreditControl = generateClient(config.api.creditControlApiUrl || '');\nexport const clientLeadUsers = generateClient(config.api.leadUsersApiUrl || '');\nexport const clientLeadCall = generateClient(config.api.leadCallApiUrl || '');\n\nconst ErrorBoundary = Bugsnag.getPlugin('react')!.createErrorBoundary(React);\n\nclass LocalizedUtils extends MomentUtils {\n getWeekdays() {\n return [0, 1, 2, 3, 4, 5, 6].map((dayOfWeek) => this.moment().weekday(dayOfWeek).format('dd')[0]);\n }\n}\n\n// FIXME: StrictMode currently will throw \"findDOMNode is deprecated\" error\n// for some material-ui components and will only be fixed in v5\nReactDOM.render(\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ,\n document.getElementById('root'),\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n","import {\n isFunction,\n has,\n get,\n} from 'lodash';\nimport { RenderPropsProps } from '../types';\n\nexport function getSelectorValue(\n data: T,\n selector?: RenderPropsProps<[T], string | number | undefined>,\n) {\n if (selector) {\n if (isFunction(selector)) {\n return selector(data);\n }\n if (has(data, selector)) {\n return get(data, selector);\n }\n }\n return data;\n}\n","import { parseErrorMessage } from './parse';\n\nexport const getErrorMessage = (err: any, errorFieldName?: string) => {\n const errorCode = err?.response?.status;\n const errorMsgFromRes = err?.response?.data?.error_message ?? err?.response?.data?.message;\n let errorMsg = '';\n\n // if is backend / server error: return default message\n if (errorCode >= 500) {\n errorMsg = err?.message;\n }\n\n // if is front end 400 error: display the correct message\n if (errorMsgFromRes) {\n errorMsg = parseErrorMessage(errorMsgFromRes, errorFieldName);\n }\n\n // if there is no error message\n if (!errorMsg) {\n errorMsg = 'An error occurred';\n }\n\n return errorMsg;\n};\n","export function humanizeString(\n str: string,\n delimiter: string = ' ',\n toKey: boolean = false,\n) {\n if (str) {\n if (!toKey) {\n const newString = str.charAt(0).toUpperCase() + str.slice(1);\n return newString.replace(/_/g, delimiter);\n }\n const newString = str.toLowerCase();\n return newString.replace(/ /g, delimiter);\n }\n return '';\n}\n\nexport function convertArrayToString(\n array?: string[],\n) {\n if (array && Array.isArray(array) && array?.length > 0) {\n return array.join(',');\n }\n return '';\n}\n\nexport function convertStringToArray(\n str?: string,\n delimiter: string = ',',\n) {\n if (str && typeof str === 'string') {\n return str.split(delimiter);\n }\n return [];\n}\n","import config from '../config/config';\n\nexport const isDev = config?.app?.stage && config.app.stage === 'dev';\nexport const isStaging = config?.app?.stage && config.app.stage === 'staging';\nexport const isProduction = config?.app?.stage && config.app.stage === 'prod';\nexport const isDemo = config?.app?.stage && config.app.stage === 'demo';\n","export default __webpack_public_path__ + \"static/media/alert.8b54a26a.svg\";","export default __webpack_public_path__ + \"static/media/automation_action.9521aac4.svg\";","export default __webpack_public_path__ + \"static/media/back_arrow.56fd18e5.svg\";","export default __webpack_public_path__ + \"static/media/call.4ac63733.svg\";","export default __webpack_public_path__ + \"static/media/calendar.406537ad.svg\";","export default __webpack_public_path__ + \"static/media/delete.f2d75026.svg\";","export default __webpack_public_path__ + \"static/media/checkmark_filled.389d5695.svg\";","export default __webpack_public_path__ + \"static/media/drag.8f065dfc.svg\";","export default __webpack_public_path__ + \"static/media/dollar.6efafc2c.svg\";","export default __webpack_public_path__ + \"static/media/edit.e8c48308.svg\";","export default __webpack_public_path__ + \"static/media/email_workflow.37aed093.svg\";","export default __webpack_public_path__ + \"static/media/lock.c52dc52f.svg\";","export default __webpack_public_path__ + \"static/media/link.fd046b8e.svg\";","export default __webpack_public_path__ + \"static/media/light_bulb.6a77c993.svg\";","export default __webpack_public_path__ + \"static/media/merge_workflow.b4c6c35c.svg\";","export default __webpack_public_path__ + \"static/media/reminder.efa6bb06.svg\";","export default __webpack_public_path__ + \"static/media/search.28f05516.svg\";","export default __webpack_public_path__ + \"static/media/search_large.6168751f.svg\";","export default __webpack_public_path__ + \"static/media/sms_blast.b5867432.svg\";","export default __webpack_public_path__ + \"static/media/stars.cb6ad4ef.svg\";","export default __webpack_public_path__ + \"static/media/tag.f19dff87.svg\";","export default __webpack_public_path__ + \"static/media/time.563d3407.svg\";","export default __webpack_public_path__ + \"static/media/world_wide_web.6fb46c67.svg\";","export const primaryColors = {\n main: '#49b3b1',\n dark: '#2c8483',\n light: '#32c8c5',\n contrastText: '#ffffff',\n};\n\nexport const secondaryColors = {\n main: '#0094b3',\n dark: '#016e8d',\n light: '#00bbe0',\n contrastText: '#ffffff',\n};\n\nexport const tertiaryColors = {\n grey: '#dbddde',\n greyOne: '#969ca4',\n dimGrey: '#99a7b0',\n lightGrey: '#f8f9f9',\n lighterGrey: '#586976',\n mediumGrey: '#f4f5f7',\n darkGrey: '#e7eaed',\n whiteSmoke: '#f4f4f4',\n stone: '#9caac1',\n\n cyprus: '#06363c',\n\n dimGreen: '#e5faf2',\n green: '#5bc699',\n lightGreen: '#ecf7ee',\n darkGreen: '#50b793',\n\n blue: '#3da0e4',\n lightBlue: '#edf7fd',\n pastelBlue: '#d9edfa',\n\n red: '#ee0000',\n alertRed: '#fc7a71',\n alertYellow: '#fdc74c',\n\n mustard: '#fff6d1',\n amber: '#f2b42a',\n marigold: '#ffcb00',\n\n lightPink: '#ffeded',\n peach: '#ff796e',\n lightOrange: '#fff6d1',\n orange: '#f79a3e',\n\n lavender: '#7282D7',\n};\n\nexport const fontColors = {\n header: '#00233b',\n body: '#596975',\n subBody: '#969ca4',\n};\n\nexport const fontWeight = {\n regular: 400,\n medium: 500,\n semiBold: 600,\n bold: 700,\n};\n\nexport const fontFamily = {\n openSans: '\"Open Sans\", serif',\n montserrat: '\"Montserrat\", serif',\n};\n\nexport const fontSize = {\n '10px': '0.625rem',\n '12px': '0.75rem',\n '14px': '0.875rem',\n '15px': '0.9375rem',\n '16px': '1rem',\n '17px': '1.0625rem',\n '18px': '1.125rem',\n '19px': '1.1875rem',\n '20px': '1.25rem',\n '21px': '1.3125rem',\n '22px': '1.375rem',\n '24px': '1.5rem',\n '32px': '2.5rem',\n};\n\nexport const fontVariants = {\n h1: {\n fontFamily: fontFamily.montserrat,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['24px'],\n },\n h2: {\n fontFamily: fontFamily.montserrat,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['22px'],\n },\n h3: {\n fontFamily: fontFamily.montserrat,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['21px'],\n },\n h4: {\n fontFamily: fontFamily.montserrat,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['19px'],\n },\n h5: {\n fontFamily: fontFamily.montserrat,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['17px'],\n },\n h6: {\n fontFamily: fontFamily.montserrat,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['15px'],\n },\n body1: {\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.regular,\n fontSize: fontSize['14px'],\n },\n body2: {\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.regular,\n fontSize: fontSize['12px'],\n },\n subtitle1: {\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['14px'],\n },\n subtitle2: {\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.semiBold,\n fontSize: fontSize['12px'],\n },\n caption: {\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.regular,\n fontSize: fontSize['10px'],\n },\n overline: {\n fontFamily: fontFamily.openSans,\n fontWeight: fontWeight.bold,\n fontSize: fontSize['10px'],\n },\n};\n","import {\n array, object, string,\n} from 'yup';\nimport { callActionObjectValidationSchema } from '../../../../components/ConfigureCallDrawer/formData';\nimport {\n AutomationFormAction,\n AutomationFormCondition,\n AutomationFormValues,\n AutomationSuggestionType,\n DropdownOption,\n WorkflowAutomationCondition,\n} from '../../../../types';\nimport { AnswerpointAutocompleteOption, CampaignAutocompleteOption } from './types';\n\nexport const leadActions = [\n {\n name: 'default_automation',\n types: [\n { label: 'Email assignee when lead is assigned', value: 'default_notify_lead_email' },\n { label: 'Email assignee when opportunity is assigned', value: 'default_notify_opportunity_email' },\n ],\n },\n {\n name: 'assignment_email',\n types: [\n { label: 'Email others on new lead', value: 'notify_lead_email' },\n { label: 'Email others on new opportunity', value: 'notify_opportunity_email' },\n ],\n },\n {\n name: 'reminder_email',\n types: [\n { label: 'Email reminder when lead is inactive', value: 'remind_lead_email' },\n { label: 'Email reminder when opportunity is inactive', value: 'remind_opportunity_email' },\n ],\n },\n {\n name: 'call',\n types: [\n { label: 'Call assignee then lead from submission', value: 'notify_lead_call' },\n { label: 'Call assignee then customer with opportunity from submission', value: 'notify_customer_call' },\n ],\n },\n {\n name: 'merge_duplicate_records',\n types: [\n { label: 'Merge duplicated leads with existing leads', value: 'merge_duplicate_leads' },\n { label: 'Merge duplicated leads to existing customer with new opportunities', value: 'merge_duplicate_leads_to_customer' },\n ],\n },\n];\n\nexport const initialConditionInput: AutomationFormCondition = {\n workflowTypeID: '',\n workflowID: '',\n workflowAutomationID: '',\n subject: '',\n field: '',\n operator: '',\n value: '',\n valueType: '',\n};\n\nexport const initialEmaillActionInput: AutomationFormAction = {\n workflowTypeID: '',\n workflowID: '',\n workflowAutomationID: '',\n workflowAutomationActionTypeID: '',\n sendEmailOn: '* * * * *',\n sendEmailSubject: '',\n sendEmailRecipients: '',\n sendEmailTemplate: '',\n};\n\nexport const initialCallActionInput: AutomationFormAction = {\n workflowTypeID: '',\n workflowID: '',\n workflowAutomationID: '',\n workflowAutomationActionTypeID: '',\n callLeadOn: '* * * * *',\n callLeadAssigneeAttempts: 3,\n callLeadAssigneeAttemptInterval: 10,\n callLeadAssigneeWeekdayDays: '',\n callLeadAssigneeWeekdayStartTime: '',\n callLeadAssigneeWeekdayEndTime: '',\n callLeadAssigneeWeekendDays: '',\n callLeadAssigneeWeekendStartTime: '',\n callLeadAssigneeWeekendEndTime: '',\n callLeadAssigneeCaller: 'assignee',\n callLeadAssigneeRecord: false,\n};\n\nexport const initialMergeDuplicateActionInput: AutomationFormAction = {\n triggerMergeOn: '* * * * *',\n};\n\nexport const initialValues: AutomationFormValues = {\n name: '',\n enabled: true,\n workflowTypeID: '',\n workflowID: '',\n rulesetLinking: 'AND',\n conditions: [initialConditionInput],\n actions: [],\n};\n\nexport const notifyActionObjectValidationSchema = {\n workflowAutomationActionTypeID: string().required(),\n sendEmailOn: string().required(),\n sendEmailSubject: string().required(),\n sendEmailTemplate: string().required(),\n};\n\nexport const getValidationSchema = (suggestionType: AutomationSuggestionType) => {\n switch (suggestionType) {\n case 'call':\n return callActionObjectValidationSchema;\n case 'assignment_email':\n case 'reminder_email':\n return notifyActionObjectValidationSchema;\n default:\n return { workflowAutomationActionTypeID: string().required() };\n }\n};\n\nexport const validationSchema = (\n disabled: boolean,\n suggestionType: AutomationSuggestionType,\n) => object().shape(\n disabled\n ? {}\n : {\n conditions: array()\n .of(\n object().shape({\n subject: string().required('Condition subject is required'),\n field: string().required('Condition field is required'),\n operator: string().required('Condition operator is required.'),\n value: string().required('Condition value is required.'),\n }),\n ),\n actions: array()\n .of(\n object().shape(\n getValidationSchema(suggestionType),\n [['callLeadAssigneeWeekdayDays', 'callLeadAssigneeWeekendDays']],\n ),\n ),\n },\n);\n\nexport const fixedConditions = (\n automation: AutomationFormValues,\n workflowID: string,\n suggestionType?: string | null,\n) => {\n let conditions:WorkflowAutomationCondition[] = [];\n switch (suggestionType) {\n case 'assignment_email':\n conditions = [\n {\n id: 'default-condition-1',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'created_at',\n operator: '==',\n value: 'now',\n },\n ];\n break;\n case 'reminder_email':\n conditions = [\n {\n id: 'default-condition-1',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'sales_activity',\n operator: '!=',\n value: 'updated',\n },\n {\n id: 'default-condition-2',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'assigned_to',\n operator: 'exists',\n },\n ];\n break;\n case 'call':\n conditions = [\n {\n id: 'default-condition-1',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'created_at',\n operator: '==',\n value: 'now',\n },\n {\n id: 'default-condition-3',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'mobile',\n operator: 'exists',\n },\n {\n id: 'default-condition-4',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'submission_source',\n operator: 'exists',\n },\n ];\n break;\n case 'merge_duplicate_records':\n conditions = [\n {\n id: 'default-condition-1',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'created_at',\n operator: '==',\n value: 'now',\n },\n {\n id: 'default-condition-2',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'submission_source',\n operator: 'exists',\n },\n {\n id: 'default-condition-3',\n workflowAutomationID: 'default-automation-id',\n workflowTypeID: automation.workflowTypeID,\n workflowID,\n subject: 'lead_record',\n field: 'mobile',\n operator: '==',\n value: 'exact_match',\n },\n ];\n break;\n default:\n break;\n }\n\n return conditions;\n};\n\n// Automation field condition options //\n\nexport const subjectTypeOptions = (type: string) => {\n let options:DropdownOption[] = [];\n\n switch (type) {\n case 'lead':\n options = [\n { label: 'Campaign field', value: 'lead_campaign' },\n { label: 'Project field', value: 'lead_project' },\n { label: 'Form field', value: 'lead_form' },\n { label: 'Sales field', value: 'lead_record' },\n ];\n break;\n default:\n break;\n }\n\n return options;\n};\n\nexport const fieldTypeOptions = (\n fixed: boolean,\n type: string,\n suggestionType?: string | null,\n workflowTypeID?: string,\n subject?: string,\n) => {\n let options:DropdownOption[] = [];\n\n if (subject) {\n switch (type) {\n case 'lead':\n switch (subject) {\n case 'lead_campaign':\n case 'lead_form':\n options = [\n { label: 'Name', value: 'id' },\n ];\n break;\n case 'lead_project':\n options = [\n { label: 'Name', value: 'ids' },\n ];\n break;\n case 'lead_record':\n if (workflowTypeID && ['lead_notification', 'lead_automation'].includes(workflowTypeID) && fixed) {\n options = [\n { label: 'Added on', value: 'created_at' },\n { label: 'Assigned on', value: 'assigned_at' },\n { label: 'Assignee', value: 'assigned_to' },\n { label: 'Imported on', value: 'imported_at' },\n { label: 'Mobile number', value: 'mobile' },\n { label: 'Sales activity', value: 'sales_activity' },\n { label: 'Submission source', value: 'submission_source' },\n ];\n } else if (suggestionType) {\n if (suggestionType === 'reminder_email') {\n options = [\n { label: 'Last activity', value: 'last_activity' },\n { label: 'Source', value: 'source' },\n ];\n } else if (suggestionType === 'call') {\n options = [\n { label: 'Assignee with dialer', value: 'assignee_ids' },\n { label: 'Source', value: 'source' },\n ];\n } else if (suggestionType === 'merge_duplicate_records') {\n options = [\n { label: 'Email', value: 'email' },\n { label: 'MyKad (NRIC)', value: 'nric' },\n { label: 'Source', value: 'source' },\n { label: 'Business unit', value: 'company_branch_id' },\n ];\n } else {\n options = [\n { label: 'Source', value: 'source' },\n ];\n }\n }\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n }\n\n return options;\n};\n\nexport const operatorTypeOptions = (\n type: string,\n field?: string,\n workflowTypeID?: string,\n suggestionType?: string | null,\n) => {\n let options:DropdownOption[] = [];\n\n switch (type) {\n case 'lead':\n if (field) {\n if (workflowTypeID\n && workflowTypeID === 'lead_automation'\n && suggestionType\n && suggestionType === 'merge_duplicate_records') {\n switch (field) {\n case 'mobile':\n case 'email':\n case 'nric':\n options = [{ label: 'is', value: '==' }];\n break;\n case 'submission_source':\n options = [\n { label: 'exists', value: 'exists' },\n { label: 'does not exists', value: 'notexists' },\n ];\n break;\n default:\n options = [\n { label: 'is', value: '==' },\n { label: 'is not', value: '!=' },\n ];\n break;\n }\n } else {\n switch (field) {\n case 'last_activity':\n options = [\n { label: 'is greater than', value: '>' },\n ];\n break;\n case 'imported_at':\n case 'assigned_to':\n case 'mobile':\n case 'submission_source':\n options = [\n { label: 'exists', value: 'exists' },\n { label: 'does not exists', value: 'notexists' },\n ];\n break;\n default:\n options = [\n { label: 'is', value: '==' },\n { label: 'is not', value: '!=' },\n ];\n break;\n }\n }\n }\n break;\n default:\n break;\n }\n\n return options;\n};\n\nexport const valueTypeOptions = (\n type: string,\n subject?: string,\n field?: string,\n) => {\n let options:DropdownOption[]\n | CampaignAutocompleteOption[]\n | AnswerpointAutocompleteOption[] = [];\n\n if (subject && field) {\n switch (type) {\n case 'lead':\n switch (subject) {\n case 'lead_record':\n switch (field) {\n case 'assigned_at':\n case 'created_at':\n options = [\n { label: 'now', value: 'now' },\n ];\n break;\n case 'sales_activity':\n options = [\n { label: 'updated', value: 'updated' },\n ];\n break;\n case 'last_activity':\n options = [\n { label: '30 minutes', value: '30m' },\n { label: '2 hours', value: '2h' },\n { label: '4 hours', value: '4h' },\n { label: '12 hours', value: '12h' },\n { label: '24 hours', value: '24h' },\n { label: '48 hours', value: '48h' },\n ];\n break;\n case 'source':\n options = [\n { label: 'Billboard/poster', value: 'billboard_poster' },\n { label: 'Event', value: 'event' },\n { label: 'Facebook', value: 'facebook' },\n { label: 'Listing portals', value: 'listing_portals' },\n { label: 'Instagram', value: 'instagram' },\n { label: 'iProperty', value: 'iproperty' },\n { label: 'Referral', value: 'referral' },\n { label: 'Showroom', value: 'showroom' },\n { label: 'Showroom for buyer', value: 'srb' },\n { label: 'Walk-in', value: 'walk_in' },\n { label: 'Website', value: 'website' },\n ];\n break;\n case 'mobile':\n case 'email':\n case 'nric':\n case 'company_branch_id':\n options = [{ label: 'exact match', value: 'exact_match' }];\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n }\n\n return options;\n};\n"],"sourceRoot":""}