@tap-payments/auth-jsconnect 2.0.2 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/build/@types/app.d.ts +5 -0
  2. package/build/@types/form.d.ts +4 -1
  3. package/build/api/auth.d.ts +20 -3
  4. package/build/api/axios.js +8 -9
  5. package/build/api/data.d.ts +1 -0
  6. package/build/api/data.js +9 -2
  7. package/build/api/entity.d.ts +13 -1
  8. package/build/api/entity.js +20 -2
  9. package/build/api/index.d.ts +7 -4
  10. package/build/api/lead.d.ts +3 -1
  11. package/build/api/lead.js +14 -2
  12. package/build/assets/locales/ar.json +4 -1
  13. package/build/assets/locales/en.json +4 -1
  14. package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
  15. package/build/components/AnimationFlow/AnimationFlow.js +2 -2
  16. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  17. package/build/components/AnimationFlow/BottomSheet.js +16 -4
  18. package/build/components/FileInput/DragAndDrop.d.ts +7 -0
  19. package/build/components/FileInput/DragAndDrop.js +39 -0
  20. package/build/components/FileInput/UploadInput.d.ts +7 -0
  21. package/build/components/FileInput/UploadInput.js +38 -0
  22. package/build/components/FileInput/index.d.ts +3 -0
  23. package/build/components/FileInput/index.js +3 -0
  24. package/build/constants/api.d.ts +3 -1
  25. package/build/constants/api.js +7 -3
  26. package/build/constants/app.d.ts +5 -0
  27. package/build/constants/app.js +55 -9
  28. package/build/constants/assets.d.ts +1 -0
  29. package/build/constants/assets.js +1 -0
  30. package/build/constants/validation.d.ts +2 -0
  31. package/build/constants/validation.js +2 -0
  32. package/build/features/app/bank/bankStore.d.ts +1 -0
  33. package/build/features/app/bank/bankStore.js +59 -18
  34. package/build/features/app/business/businessStore.d.ts +3 -5
  35. package/build/features/app/business/businessStore.js +149 -50
  36. package/build/features/app/connect/connectStore.d.ts +5 -10
  37. package/build/features/app/connect/connectStore.js +135 -41
  38. package/build/features/app/individual/individualStore.d.ts +3 -2
  39. package/build/features/app/individual/individualStore.js +50 -37
  40. package/build/features/app/password/passwordStore.d.ts +32 -1
  41. package/build/features/app/password/passwordStore.js +197 -14
  42. package/build/features/app/tax/taxStore.js +19 -12
  43. package/build/features/bank/Bank.js +3 -4
  44. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
  45. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +3 -0
  46. package/build/features/bank/screens/BankDetails/BankStatement.js +38 -0
  47. package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
  48. package/build/features/bank/screens/BankDetails/validation.js +1 -0
  49. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  50. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  51. package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -0
  52. package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -0
  53. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
  54. package/build/features/business/Business.js +3 -4
  55. package/build/features/business/screens/Activities/Activities.js +2 -1
  56. package/build/features/business/screens/Activities/LicenseName.d.ts +5 -0
  57. package/build/features/business/screens/Activities/LicenseName.js +30 -0
  58. package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
  59. package/build/features/business/screens/OTP/OTPInput.js +3 -9
  60. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  61. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  62. package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -0
  63. package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -0
  64. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +24 -17
  65. package/build/features/connect/Connect.js +1 -1
  66. package/build/features/connect/screens/Merchant/BrandList.js +1 -5
  67. package/build/features/connect/screens/Merchant/Merchant.js +10 -8
  68. package/build/features/connect/screens/Merchant/validation.js +4 -2
  69. package/build/features/connect/screens/Mobile/Mobile.js +2 -2
  70. package/build/features/connect/screens/Mobile/MobileNumber.js +1 -1
  71. package/build/features/connect/screens/NID/IDNumber.js +1 -1
  72. package/build/features/connect/screens/NID/NID.js +2 -2
  73. package/build/features/connect/screens/OTP/OTPInput.js +3 -13
  74. package/build/features/featuresScreens.js +20 -5
  75. package/build/features/individual/Individual.js +3 -4
  76. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -1
  77. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
  78. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
  79. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
  80. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
  81. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  82. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  83. package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -0
  84. package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -0
  85. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
  86. package/build/features/password/Password.js +11 -6
  87. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
  88. package/build/features/password/screens/OTP/OTP.d.ts +8 -0
  89. package/build/features/password/screens/OTP/OTP.js +78 -0
  90. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
  91. package/build/features/password/screens/OTP/OTPInput.js +46 -0
  92. package/build/features/password/screens/OTP/index.d.ts +3 -0
  93. package/build/features/password/screens/OTP/index.js +2 -0
  94. package/build/features/password/screens/OTP/validation.d.ts +8 -0
  95. package/build/features/password/screens/OTP/validation.js +4 -0
  96. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  97. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  98. package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -0
  99. package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -0
  100. package/build/features/password/screens/Success/Success.js +8 -2
  101. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +24 -16
  102. package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
  103. package/build/features/password/screens/Verify/OTPInput.js +1 -1
  104. package/build/features/shared/Button/Button.js +1 -1
  105. package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
  106. package/build/features/shared/Button/FlowsButtons.js +90 -6
  107. package/build/features/shared/Button/SuccessButton.js +31 -13
  108. package/build/features/shared/UploadFile/UploadFile.d.ts +21 -0
  109. package/build/features/shared/UploadFile/UploadFile.js +77 -0
  110. package/build/features/shared/UploadFile/index.d.ts +2 -0
  111. package/build/features/shared/UploadFile/index.js +2 -0
  112. package/build/features/tax/Tax.js +3 -4
  113. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  114. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  115. package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -0
  116. package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -0
  117. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
  118. package/build/hooks/useAppTheme.js +3 -2
  119. package/build/index.css +4 -0
  120. package/build/theme/theme.d.ts +1 -1
  121. package/build/theme/theme.js +1 -2
  122. package/build/utils/string.d.ts +1 -0
  123. package/build/utils/string.js +6 -1
  124. package/package.json +2 -1
@@ -147,7 +147,7 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
147
147
  });
148
148
  setCountries(filteredCountries);
149
149
  };
150
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', readOnly: !!anchorEl, required: true, onClick: onCloseCountryList, onChange: onPhoneNumberChange, onEnterPressed: function (e) { return loading && e.preventDefault(); }, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: !anchorEl ? error && t(error, { length: requiredLen, number: '05|5' }) : undefined }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
150
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { minHeight: mobileValue ? '133px' : '0px' } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', readOnly: !!anchorEl, required: true, onClick: onCloseCountryList, onChange: onPhoneNumberChange, onEnterPressed: function (e) { return loading && e.preventDefault(); }, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: !anchorEl ? error && t(error, { length: requiredLen, number: '05|5' }) : undefined }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
151
151
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
152
152
  } })] }))] })) })));
153
153
  });
@@ -55,6 +55,6 @@ var IDNumber = React.forwardRef(function (_a, ref) {
55
55
  };
56
56
  var nidValue = nidControl.field.value;
57
57
  var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
58
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_national_id') }) }), _jsx(Input, { dir: 'ltr', type: 'tel', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true })] })) })));
58
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_national_id') }) }), _jsx(Input, { dir: 'ltr', type: 'tel', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: t('national_id_placeholder'), warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true })] })) })));
59
59
  });
60
60
  export default React.memo(IDNumber);
@@ -72,7 +72,7 @@ var NID = function (_a) {
72
72
  handleClearError();
73
73
  }, [methods.formState.isValid]);
74
74
  var onSubmit = function (data) {
75
- dispatch(createNIDAuth(__assign(__assign({}, data), { isResend: false })));
75
+ dispatch(createNIDAuth(data));
76
76
  };
77
77
  var handleCollapseOpenClose = function (flag) {
78
78
  setCollapse(flag);
@@ -85,6 +85,6 @@ var NID = function (_a) {
85
85
  dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
86
86
  };
87
87
  var disabled = !methods.formState.isValid || !!error;
88
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
88
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
89
89
  };
90
90
  export default React.memo(NID);
@@ -17,7 +17,7 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { connectSelector, createMobileAuth, createNIDAuth } from '../../../app/connect/connectStore';
20
+ import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
@@ -33,8 +33,6 @@ var OTPInput = function (_a) {
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
35
  var data = useAppSelector(connectSelector).data;
36
- var mobileData = data.mobileData;
37
- var nidData = data.nidData;
38
36
  var isAbsher = data.otpData.isAbsher;
39
37
  var handleOnOTPChange = function (otp) {
40
38
  otpControl.field.onChange(otp);
@@ -42,20 +40,12 @@ var OTPInput = function (_a) {
42
40
  var handleOnResendOTP = function () {
43
41
  if (otpControl.field.value)
44
42
  setValue('otp', '', { shouldValidate: true });
45
- var params = {
46
- countryCode: mobileData.countryCode,
47
- mobile: mobileData.mobile
48
- };
49
- dispatch(createMobileAuth(__assign(__assign({}, params), { isResend: true })));
43
+ dispatch(resendOTPMobile());
50
44
  };
51
45
  var handleOnResendAbsherOTP = function () {
52
46
  if (otpControl.field.value)
53
47
  setValue('otp', '', { shouldValidate: true });
54
- var params = {
55
- nid: nidData.nid,
56
- dob: nidData.dob
57
- };
58
- dispatch(createNIDAuth(__assign(__assign({}, params), { isResend: true })));
48
+ dispatch(resendOTPNID());
59
49
  };
60
50
  var otpValue = otpControl.field.value;
61
51
  return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: isAbsher ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
@@ -12,22 +12,28 @@ import BusinessTypePage from './business/screens/BusinessType';
12
12
  import ActivitiesPage from './business/screens/Activities';
13
13
  import SuccessPage from './business/screens/Success';
14
14
  import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
15
+ import ResetPasswordSuccessPage from './business/screens/ResetPasswordSuccess';
15
16
  import PasswordVerifyPage from './password/screens/Verify';
16
17
  import CreatePasswordPage from './password/screens/CreatePassword';
18
+ import PasswordOTPPage from './password/screens/OTP';
17
19
  import SuccessPasswordPage from './password/screens/Success';
18
20
  import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
21
+ import PasswordResetPasswordSuccessPage from './password/screens/ResetPasswordSuccess';
19
22
  import IndividualVerifyPage from './individual/screens/Verify';
20
23
  import AdditionalIndividualInfoPage from './individual/screens/AdditionalIndividualInfo';
21
24
  import SuccessOwnerPage from './individual/screens/Success';
22
25
  import IndividualSuccessWithFlowPage from './individual/screens/SuccessWithFlowButtons';
26
+ import IndividualResetPasswordSuccessPage from './individual/screens/ResetPasswordSuccess';
23
27
  import BankVerifyPage from './bank/screens/Verify';
24
28
  import BankDetailsPage from './bank/screens/BankDetails';
25
29
  import BankSuccessPage from './bank/screens/Success';
26
30
  import BankSuccessWithFlowPage from './bank/screens/SuccessWithFlowButtons';
31
+ import BankResetPasswordSuccessPage from './bank/screens/ResetPasswordSuccess';
27
32
  import TaxVerifyPage from './tax/screens/Verify';
28
33
  import TaxDetailsPage from './tax/screens/TaxDetails';
29
34
  import TaxSuccessPage from './tax/screens/Success';
30
35
  import TaxSuccessWithFlowPage from './tax/screens/SuccessWithFlowButtons';
36
+ import TaxResetPasswordSuccessPage from './tax/screens/ResetPasswordSuccess';
31
37
  export var connectFeatureScreens = [
32
38
  {
33
39
  name: 'CONNECT_NID_STEP',
@@ -80,7 +86,8 @@ export var businessFeatureScreens = [
80
86
  element: CustomersPage
81
87
  },
82
88
  { name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage },
83
- { name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP', element: SuccessWithFlowButtonsPage }
89
+ { name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP', element: SuccessWithFlowButtonsPage },
90
+ { name: 'BUSINESS_RESET_PASSWORD_SUCCESS', element: ResetPasswordSuccessPage }
84
91
  ];
85
92
  export var passwordFeatureScreens = [
86
93
  {
@@ -91,6 +98,10 @@ export var passwordFeatureScreens = [
91
98
  name: 'PASSWORD_CREATE_PASSWORD_STEP',
92
99
  element: CreatePasswordPage
93
100
  },
101
+ {
102
+ name: 'PASSWORD_RESET_PASSWORD_OTP_STEP',
103
+ element: PasswordOTPPage
104
+ },
94
105
  {
95
106
  name: 'PASSWORD_SUCCESS_STEP',
96
107
  element: SuccessPasswordPage
@@ -98,7 +109,8 @@ export var passwordFeatureScreens = [
98
109
  {
99
110
  name: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
100
111
  element: PasswordSuccessWithFlowPage
101
- }
112
+ },
113
+ { name: 'PASSWORD_RESET_PASSWORD_SUCCESS', element: PasswordResetPasswordSuccessPage }
102
114
  ];
103
115
  export var individualFeatureScreens = [
104
116
  {
@@ -116,7 +128,8 @@ export var individualFeatureScreens = [
116
128
  {
117
129
  name: 'INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
118
130
  element: IndividualSuccessWithFlowPage
119
- }
131
+ },
132
+ { name: 'INDIVIDUAL_RESET_PASSWORD_SUCCESS', element: IndividualResetPasswordSuccessPage }
120
133
  ];
121
134
  export var bankFeatureScreens = [
122
135
  {
@@ -134,7 +147,8 @@ export var bankFeatureScreens = [
134
147
  {
135
148
  name: 'BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
136
149
  element: BankSuccessWithFlowPage
137
- }
150
+ },
151
+ { name: 'BANK_RESET_PASSWORD_SUCCESS', element: BankResetPasswordSuccessPage }
138
152
  ];
139
153
  export var taxFeatureScreens = [
140
154
  {
@@ -152,5 +166,6 @@ export var taxFeatureScreens = [
152
166
  {
153
167
  name: 'TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
154
168
  element: TaxSuccessWithFlowPage
155
- }
169
+ },
170
+ { name: 'TAX_RESET_PASSWORD_SUCCESS', element: TaxResetPasswordSuccessPage }
156
171
  ];
@@ -36,18 +36,17 @@ var Individual = memo(function (props) {
36
36
  var verifyToken = function () {
37
37
  var token = getParameterByName('token');
38
38
  var lang = getParameterByName('lang');
39
+ if (lang)
40
+ dispatch(handleLanguage(lang));
39
41
  if (!token)
40
42
  throw new Error('Auth token is not found!');
41
- if (!lang)
42
- throw new Error('Language is not found!');
43
- dispatch(handleLanguage(lang));
44
43
  dispatch(verifyLeadToken(token));
45
44
  };
46
45
  useEffect(function () {
47
46
  if (!settingLoading)
48
47
  verifyToken();
49
48
  }, [settingLoading]);
50
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
49
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
51
50
  var Element = _a.element, name = _a.name;
52
51
  var isActive = activeScreen.name === name;
53
52
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -30,11 +30,13 @@ import EmployerName from './EmployerName';
30
30
  import EmployerLocation from './EmployerLocation';
31
31
  import SourceOfIncome from './SourceOfIncome';
32
32
  import { individualSelector, updateIndividualInfo } from '../../../app/individual/individualStore';
33
+ import Occupation from './Occupation';
33
34
  var ListType;
34
35
  (function (ListType) {
35
36
  ListType["SourceOfIncomeList"] = "SourceOfIncomeList";
36
37
  ListType["EmployerLocationList"] = "EmployerLocationList";
37
38
  ListType["MonthlyIncomeList"] = "MonthlyIncomeList";
39
+ ListType["OccupationList"] = "OccupationList";
38
40
  })(ListType || (ListType = {}));
39
41
  var AdditionalIndividualInfo = function (_a) {
40
42
  var t = useTranslation().t;
@@ -75,7 +77,11 @@ var AdditionalIndividualInfo = function (_a) {
75
77
  var isSourceOfIncomeListActive = listActive === ListType.SourceOfIncomeList;
76
78
  var isEmployerLocationListActive = listActive === ListType.EmployerLocationList;
77
79
  var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
78
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive && employerFieldsActive && !isMonthlyIncomeListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
80
+ var isOccupationListActive = listActive === ListType.OccupationList;
81
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive &&
82
+ employerFieldsActive &&
83
+ !isMonthlyIncomeListActive &&
84
+ !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
79
85
  };
80
86
  export default React.memo(AdditionalIndividualInfo);
81
87
  AdditionalIndividualInfo.defaultProps = {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Occupation as OccupationType } from '../../../../@types';
3
+ interface OccupationProps {
4
+ show: boolean;
5
+ onSelectOccupation?: (occupation: OccupationType) => void;
6
+ onListOpen?: () => void;
7
+ onListClose?: () => void;
8
+ }
9
+ declare const Occupation: ({ ...rest }: OccupationProps) => JSX.Element;
10
+ export default Occupation;
@@ -0,0 +1,89 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as React from 'react';
25
+ import Box from '@mui/material/Box';
26
+ import { styled } from '@mui/material/styles';
27
+ import { useTranslation } from 'react-i18next';
28
+ import { useController, useFormContext } from 'react-hook-form';
29
+ import { useAppSelector, useLanguage } from '../../../../hooks';
30
+ import { individualSelector } from '../../../app/individual/individualStore';
31
+ import Text from '../../../../components/Text';
32
+ import Collapse from '../../../../components/Collapse';
33
+ import CheckIcon from '@mui/icons-material/Check';
34
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
35
+ import Input from '../../../shared/Input';
36
+ import ExpandIcon from '../../../../components/ExpandIcon';
37
+ import SimpleList from '../../../../components/SimpleList';
38
+ var Container = styled(Box)(function () { return ({
39
+ display: 'flex'
40
+ }); });
41
+ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
42
+ var theme = _a.theme, isSelected = _a.isSelected;
43
+ return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
44
+ });
45
+ var CheckIconStyled = styled(CheckIcon)(function (_a) {
46
+ var theme = _a.theme;
47
+ return ({
48
+ color: theme.palette.success.main,
49
+ display: 'flex',
50
+ alignItems: 'flex-end'
51
+ });
52
+ });
53
+ var Occupation = function (_a) {
54
+ var _b, _c;
55
+ var rest = __rest(_a, []);
56
+ var _d = React.useState([]), occupationList = _d[0], setOccupationList = _d[1];
57
+ var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
58
+ var t = useTranslation().t;
59
+ var isAr = useLanguage().isAr;
60
+ var data = useAppSelector(individualSelector).data;
61
+ var control = useFormContext().control;
62
+ var occupationsList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.occupationList) || [];
63
+ var occupationControl = useController({ control: control, name: 'occupation' });
64
+ React.useEffect(function () {
65
+ if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
66
+ setOccupationList(occupationsList);
67
+ }
68
+ }, [occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.occupation]);
69
+ var onOpenList = function (event) {
70
+ var _a;
71
+ setAnchorEl(event.currentTarget);
72
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
73
+ };
74
+ var onCloseList = function () {
75
+ var _a;
76
+ setAnchorEl(null);
77
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
78
+ };
79
+ var onSelectItem = function (occupation) {
80
+ onCloseList();
81
+ occupationControl.field.onChange(occupation);
82
+ };
83
+ var occupation = occupationControl.field.value;
84
+ var error = (_c = occupationControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
85
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('occupation_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_occupation'), value: (isAr ? occupation === null || occupation === void 0 ? void 0 : occupation.name_ar : occupation === null || occupation === void 0 ? void 0 : occupation.name_en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name_en', list: occupationList, onSelectItem: onSelectItem, renderItem: function (item) {
86
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) }, { children: isAr ? item.name_ar : item === null || item === void 0 ? void 0 : item.name_en })) }), item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) && _jsx(CheckIconStyled, {})] }));
87
+ } }) }))] })) })));
88
+ };
89
+ export default Occupation;
@@ -2,18 +2,21 @@ import * as yup from 'yup';
2
2
  import { ObjectShape } from 'yup/lib/object';
3
3
  import { CountryCode } from '../../../../@types';
4
4
  export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
5
+ occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
5
6
  sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
6
7
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
7
8
  employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
8
9
  isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
9
10
  isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
10
11
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
12
+ occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
11
13
  sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
12
14
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
13
15
  employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
14
16
  isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
15
17
  isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
16
18
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
19
+ occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
17
20
  sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
18
21
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
19
22
  employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
@@ -1,5 +1,6 @@
1
1
  import * as yup from 'yup';
2
2
  export var IndividualInfoValidationSchema = yup.object().shape({
3
+ occupation: yup.object().required('alert_choose_occupation'),
3
4
  sourceIncome: yup.object().required('choose_any_source_of_income'),
4
5
  monthlyIncome: yup.object().optional(),
5
6
  employerLocation: yup.object().when('sourceIncome', function (sourceIncome) {
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -10,18 +10,19 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect, useState } from 'react';
13
+ import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
- import { ICONS_NAMES } from '../../../../constants';
17
+ import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { individualSelector } from '../../../app/individual/individualStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
24
24
  import AcceptancePayouts from '../../../shared/AcceptancePayouts';
25
+ import { settingsSelector } from '../../../../app/settings';
25
26
  var TitleStyled = styled(Text)(function (_a) {
26
27
  var _b;
27
28
  var theme = _a.theme;
@@ -46,39 +47,45 @@ var SuccessWithFlowButtons = function () {
46
47
  var _a, _b, _c;
47
48
  var t = useTranslation().t;
48
49
  var isAr = useLanguage().isAr;
49
- var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
50
- var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
51
50
  var data = useAppSelector(individualSelector).data;
52
- var _f = data.verify.responseBody || {}, flows = _f.flows, nameObj = _f.name, entity = _f.entity, brand = _f.brand, bank = _f.bank_account;
53
- var _g = useState([]), buttons = _g[0], setButtons = _g[1];
51
+ var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
+ var _e = useState([]), buttons = _e[0], setButtons = _e[1];
54
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
55
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
56
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
57
56
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
58
57
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
59
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
62
+ var settings = useAppSelector(settingsSelector);
63
+ var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
64
+ var email = (contact || { email: '' }).email;
65
+ var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
60
66
  var reMapFlowData = function (flows) {
61
67
  if (flows === void 0) { flows = []; }
62
68
  var images = ICONS_NAMES;
63
- var mappedFlows = flows.map(function (_a) {
69
+ var mappedFlows = flows
70
+ .filter(function (item) { return item.name; })
71
+ .map(function (_a) {
64
72
  var name = _a.name, url = _a.url, status = _a.status;
65
73
  var type = status === 'initiated' ? 'pending' : 'completed';
66
74
  var title = t("".concat(name, "_flow_").concat(type), {
67
- individual_name: username.toLowerCase(),
75
+ individual_name: username.toLowerCase() + maskedId,
68
76
  business_type: brandName,
69
77
  license_number: t('masking_symbols') + showLastFour(licenseNumber),
70
78
  bank_name: bankName,
71
79
  iban: t('masking_symbols') + iban,
72
80
  tax_id: t('masking_symbols') + showLastFour(taxID)
73
81
  });
74
- if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
75
- setIsAcceptance(true);
76
82
  var isCompleted = status === 'completed' && name !== 'password';
77
83
  var isIndividual = name === 'individual';
78
84
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
79
85
  var hoverSrc = "".concat(name, "_white_icon");
80
86
  return {
81
87
  name: name,
88
+ status: status,
82
89
  title: title,
83
90
  href: url,
84
91
  src: images[src],
@@ -88,14 +95,15 @@ var SuccessWithFlowButtons = function () {
88
95
  };
89
96
  });
90
97
  setButtons(mappedFlows);
91
- var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
92
- if (isAllCompleted)
93
- setIsPayout(true);
94
98
  };
95
99
  useEffect(function () {
96
100
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
97
101
  reMapFlowData(flows);
98
102
  }, [flows, isAr]);
99
- return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, flowName: data.flowName }) })] }));
103
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
104
+ flowName: data.flowName,
105
+ email: email,
106
+ emailUrl: url
107
+ } }) })] }));
100
108
  };
101
109
  export default memo(SuccessWithFlowButtons);
@@ -19,9 +19,9 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
19
  import Collapse from '../../components/Collapse';
20
20
  import { FeatureContainer } from '../shared/Containers';
21
21
  import { getParameterByName, reactElement } from '../../utils';
22
- import { PASSWORD_SCREENS_NAVIGATION } from '../../constants';
22
+ import { PASSWORD_OPERATION_TYPE, PASSWORD_SCREENS_NAVIGATION } from '../../constants';
23
23
  import { passwordFeatureScreens } from '../featuresScreens';
24
- import { passwordSelector, verifyLeadToken } from '../app/password/passwordStore';
24
+ import { passwordSelector, verifyLeadToken, verifyOperationToken } from '../app/password/passwordStore';
25
25
  import CustomFooter from '../shared/Footer';
26
26
  import Background from '../shared/Background';
27
27
  var Password = memo(function (props) {
@@ -36,18 +36,23 @@ var Password = memo(function (props) {
36
36
  var verifyToken = function () {
37
37
  var token = getParameterByName('token');
38
38
  var lang = getParameterByName('lang');
39
+ var operationType = getParameterByName('operation_type');
40
+ var leadId = getParameterByName('lead_id') || '';
41
+ if (lang)
42
+ dispatch(handleLanguage(lang));
39
43
  if (!token)
40
44
  throw new Error('Auth token is not found!');
41
- if (!lang)
42
- throw new Error('Language is not found!');
43
- dispatch(handleLanguage(lang));
45
+ if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
46
+ dispatch(verifyOperationToken({ token: token, leadId: leadId }));
47
+ return;
48
+ }
44
49
  dispatch(verifyLeadToken(token));
45
50
  };
46
51
  useEffect(function () {
47
52
  if (!settingLoading)
48
53
  verifyToken();
49
54
  }, [settingLoading]);
50
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
55
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
51
56
  var Element = _a.element, name = _a.name;
52
57
  var isActive = activeScreen.name === name;
53
58
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -17,14 +17,15 @@ import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import Box from '@mui/material/Box';
18
18
  import { styled } from '@mui/material/styles';
19
19
  import { useAppDispatch } from '../../../../hooks';
20
- import { handleCurrentActiveScreen } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../../app/settings';
21
21
  import Form from '../../../../components/Form';
22
22
  import { useLanguage } from '../../../../hooks';
23
+ import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
23
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
24
25
  import Button from '../../../shared/Button';
25
26
  import { PasswordValidation } from './validation';
26
27
  import Password from './Password';
27
- import { createPassword, passwordSelector } from '../../../app/password/passwordStore';
28
+ import { createPassword, passwordSelector, storePasswordScreen } from '../../../app/password/passwordStore';
28
29
  import { useSelector } from 'react-redux';
29
30
  var InputsContainerStyled = styled(Box)(function (_a) {
30
31
  var theme = _a.theme;
@@ -37,12 +38,18 @@ var CreatePassword = function (_a) {
37
38
  var isAr = useLanguage().isAr;
38
39
  var dispatch = useAppDispatch();
39
40
  var _b = useSelector(passwordSelector), data = _b.data, loading = _b.loading, error = _b.error;
41
+ var operationType = data.verify.operationType;
40
42
  var methods = useForm({
41
43
  resolver: yupResolver(PasswordValidation),
42
44
  defaultValues: data.passwordData,
43
45
  mode: 'onChange'
44
46
  });
45
47
  var onSubmit = function (data) {
48
+ if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
49
+ dispatch(storePasswordScreen(data));
50
+ dispatch(handleNextScreenStep('PASSWORD_RESET_PASSWORD_OTP_STEP'));
51
+ return;
52
+ }
46
53
  dispatch(createPassword(data));
47
54
  };
48
55
  var onBack = function () {
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<{
5
+ ({}: OTPProps): JSX.Element;
6
+ defaultProps: {};
7
+ }>;
8
+ export default _default;