@tap-payments/auth-jsconnect 2.3.40-test → 2.3.46-test

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 (103) hide show
  1. package/build/@types/form.d.ts +0 -3
  2. package/build/api/entity.d.ts +0 -1
  3. package/build/api/index.d.ts +0 -3
  4. package/build/api/index.js +1 -3
  5. package/build/assets/locales/ar.json +0 -1
  6. package/build/assets/locales/en.json +0 -1
  7. package/build/components/DatePicker/DatePicker.js +1 -0
  8. package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
  9. package/build/components/RadioGroup/RadioGroup.js +5 -9
  10. package/build/components/RadioGroup/index.d.ts +1 -1
  11. package/build/constants/app.js +4 -10
  12. package/build/features/app/bank/bankStore.d.ts +0 -1
  13. package/build/features/app/bank/bankStore.js +21 -37
  14. package/build/features/app/connectExpress/connectExpressStore.js +12 -8
  15. package/build/features/app/entity/entityStore.d.ts +1 -9
  16. package/build/features/app/entity/entityStore.js +48 -119
  17. package/build/features/app/individual/individualStore.d.ts +0 -2
  18. package/build/features/app/individual/individualStore.js +71 -91
  19. package/build/features/app/tax/taxStore.js +18 -36
  20. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -10
  21. package/build/features/bank/screens/Verify/OTPInput.js +5 -3
  22. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +0 -5
  23. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +5 -5
  24. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +0 -5
  25. package/build/features/brand/screens/BrandActivities/CustomerBase.js +5 -5
  26. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +13 -3
  27. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +12 -2
  28. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +5 -1
  29. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +6 -9
  30. package/build/features/brand/screens/BrandActivities/TAC.d.ts +12 -0
  31. package/build/features/brand/screens/BrandActivities/TAC.js +6 -9
  32. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  33. package/build/features/brand/screens/BrandInfo/BrandInfo.js +2 -2
  34. package/build/features/brand/screens/BrandInfo/Segments.js +9 -1
  35. package/build/features/brand/screens/BrandInfo/TeamSize.js +9 -1
  36. package/build/features/brand/screens/Verify/OTPInput.js +5 -3
  37. package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -5
  38. package/build/features/business/screens/Activities/ActivitiesList.js +5 -5
  39. package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
  40. package/build/features/business/screens/BusinessType/LicenseList.js +1 -1
  41. package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -5
  42. package/build/features/business/screens/Customers/CustomerLocations.js +5 -5
  43. package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -2
  44. package/build/features/business/screens/Customers/ExpectedSalesRange.js +12 -2
  45. package/build/features/business/screens/IDBOD/DOB.js +1 -1
  46. package/build/features/business/screens/Verify/OTPInput.js +5 -3
  47. package/build/features/connect/screens/Merchant/BrandList.js +1 -1
  48. package/build/features/connect/screens/Merchant/Segments.js +6 -1
  49. package/build/features/connect/screens/Merchant/TeamSize.js +6 -1
  50. package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
  51. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +3 -3
  52. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +1 -1
  53. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +12 -0
  54. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +6 -9
  55. package/build/features/connectExpress/screens/NID/TAC.d.ts +12 -0
  56. package/build/features/connectExpress/screens/NID/TAC.js +6 -9
  57. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +0 -5
  58. package/build/features/entity/screens/EntityCapital/ActivityList.js +5 -5
  59. package/build/features/entity/screens/EntityCapital/EntityCapital.js +2 -2
  60. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +0 -5
  61. package/build/features/entity/screens/EntityName/EntityTypeList.js +5 -5
  62. package/build/features/entity/screens/Verify/OTPInput.js +5 -3
  63. package/build/features/featuresScreens.js +0 -5
  64. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +1 -1
  65. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +10 -2
  66. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +9 -1
  67. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +1 -1
  68. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +9 -1
  69. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +9 -1
  70. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +9 -1
  71. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +1 -1
  72. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +1 -1
  73. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +1 -1
  74. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +9 -1
  75. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +9 -6
  76. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +9 -1
  77. package/build/features/individual/screens/Verify/OTPInput.js +5 -3
  78. package/build/features/password/screens/Verify/OTPInput.js +5 -3
  79. package/build/features/shared/Address/Address.js +13 -20
  80. package/build/features/shared/Address/CountryList.js +4 -4
  81. package/build/features/shared/Address/InputSelect.js +1 -1
  82. package/build/features/shared/Button/FlowsButtons.js +14 -19
  83. package/build/features/shared/Input/Input.js +2 -3
  84. package/build/features/shared/OTP/OTP.d.ts +2 -1
  85. package/build/features/shared/OTP/OTP.js +2 -2
  86. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +2 -1
  87. package/build/features/shared/SalesChannels/SalesChannel.js +2 -1
  88. package/build/features/shared/UploadFile/FileUpload.js +5 -5
  89. package/build/features/shared/UploadFile/UploadFile.js +7 -7
  90. package/build/features/shared/UploadMultipleFile/UploadFile.js +5 -5
  91. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -9
  92. package/build/features/tax/screens/Verify/OTPInput.js +5 -3
  93. package/build/utils/error.d.ts +1 -0
  94. package/build/utils/error.js +3 -0
  95. package/build/utils/string.d.ts +1 -1
  96. package/build/utils/string.js +6 -0
  97. package/package.json +1 -1
  98. package/build/api/address.d.ts +0 -4
  99. package/build/api/address.js +0 -12
  100. package/build/features/entity/screens/EntityAddress/EntityAddress.d.ts +0 -5
  101. package/build/features/entity/screens/EntityAddress/EntityAddress.js +0 -42
  102. package/build/features/entity/screens/EntityAddress/index.d.ts +0 -2
  103. package/build/features/entity/screens/EntityAddress/index.js +0 -2
@@ -22,7 +22,7 @@ import InputText from './InputText';
22
22
  import { Button } from '../Button';
23
23
  export default function Address(_a) {
24
24
  var format = _a.format, countryList = _a.countryList, onAddressChange = _a.onAddressChange, defaultValues = _a.defaultValues, disableCountry = _a.disableCountry, loading = _a.loading, error = _a.error, onBack = _a.onBack, showSubmitButton = _a.showSubmitButton, isEditable = _a.isEditable;
25
- var _b = useForm({ defaultValues: defaultValues, mode: 'onChange' }), watch = _b.watch, control = _b.control, formState = _b.formState, getValues = _b.getValues, handleSubmit = _b.handleSubmit;
25
+ var _b = useForm({ defaultValues: defaultValues, mode: 'onChange' }), watch = _b.watch, control = _b.control, formState = _b.formState, getValues = _b.getValues;
26
26
  var values = getValues();
27
27
  var t = useTranslation().t;
28
28
  var isAr = useLanguage().isAr;
@@ -32,49 +32,42 @@ export default function Address(_a) {
32
32
  }, [values, formState.isValid]);
33
33
  var countryIso2 = useMemo(function () {
34
34
  var _a;
35
- var index = countryList.findIndex(function (item) { return item.iso2 === watch('country'); });
35
+ var index = countryList.findIndex(function (item) { return item.countryId === watch('country'); });
36
36
  return (_a = countryList[index]) === null || _a === void 0 ? void 0 : _a.iso2;
37
37
  }, [watch('country')]);
38
- var getName = function (item) {
39
- return (isAr ? item.name.ar : item.name.en) || '';
40
- };
41
- var getRequiredValue = function (item) {
42
- return "".concat(getName(item), " ").concat(t('is_required'));
43
- };
44
- var onSubmit = function (values) {
45
- console.log(values);
46
- onAddressChange(values, formState.isValid);
47
- };
48
- return (_jsxs(Box, __assign({ component: 'form', onSubmit: handleSubmit(onSubmit) }, { children: [format.map(function (item) {
38
+ return (_jsxs(Box, __assign({ component: 'form' }, { children: [format.map(function (item) {
49
39
  var isCountry = item.code === 'country';
50
40
  var isSelect = item.type === 'select';
51
41
  if (isCountry) {
52
42
  return (_jsx(Controller, { render: function (_a) {
53
43
  var _b;
54
44
  var field = _a.field, fieldState = _a.fieldState;
55
- return (_jsx(CountryListComponent, { label: getName(item), placeholder: getName(item), list: countryList, onSelect: function (value) {
45
+ return (_jsx(CountryListComponent, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), list: countryList, onSelect: function (value) {
56
46
  console.log('value', value);
57
47
  field.onChange(value);
58
48
  }, value: field.value, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, disabled: isEditable ? !!disableCountry : false, isRequired: item.required }));
59
49
  }, rules: {
60
- required: item.required && getRequiredValue(item)
50
+ required: item.required && "address_".concat(item.code, "_required")
61
51
  }, control: control, name: item.code }, item.code));
62
52
  }
63
53
  if (isSelect) {
64
54
  return (_jsx(Controller, { render: function (_a) {
65
55
  var _b;
66
56
  var field = _a.field, fieldState = _a.fieldState;
67
- return (_jsx(InputSelect, { label: getName(item), placeholder: getName(item), countryIso2: countryIso2, fetchURL: item.retrieve_uri, onSelect: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, value: field.value || '', disabled: isEditable ? !countryIso2 : false }));
57
+ return (_jsx(InputSelect, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), countryIso2: countryIso2, fetchURL: item.retrieve_uri, onSelect: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, value: field.value || '', disabled: isEditable ? !countryIso2 : false }));
68
58
  }, rules: {
69
- required: item.required && getRequiredValue(item)
59
+ required: item.required && "address_".concat(item.code, "_required")
70
60
  }, control: control, name: item.code }, item.code));
71
61
  }
72
62
  return (_jsx(Controller, { render: function (_a) {
73
63
  var _b;
74
64
  var field = _a.field, fieldState = _a.fieldState;
75
- return (_jsx(InputText, { label: getName(item), placeholder: getName(item), onChange: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, disabled: !isEditable, value: field.value || '' }));
65
+ return (_jsx(InputText, { label: "address_".concat(item.code, "_label"), placeholder: "address_".concat(item.code, "_placeholder"), onChange: function (value) { return field.onChange(value); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, isRequired: item.required, disabled: !isEditable, value: field.value || '' }));
76
66
  }, rules: {
77
- required: item.required && getRequiredValue(item)
67
+ required: item.required && "address_".concat(item.code, "_required")
78
68
  }, control: control, name: item.code }, item.code));
79
- }), _jsx(Collapse, __assign({ in: showSubmitButton }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, isAr: isAr, disabled: !formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })));
69
+ }), _jsx(Collapse, __assign({ in: showSubmitButton }, { children: _jsx(Button, __assign({ onClick: function (e) {
70
+ e.preventDefault();
71
+ onAddressChange(values, formState.isValid);
72
+ }, onBackClicked: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, isAr: isAr, disabled: !formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })));
80
73
  }
@@ -72,17 +72,17 @@ function CountryList(_a) {
72
72
  };
73
73
  var handleValueChange = function (value) {
74
74
  setAnchorEl(null);
75
- onSelect(value.iso2);
75
+ onSelect(value.countryId);
76
76
  };
77
77
  var nameValue = React.useMemo(function () {
78
- var item = list.find(function (item) { return item.iso2 === value; });
78
+ var item = list.find(function (item) { return item.countryId === value; });
79
79
  if (!item)
80
80
  return '';
81
81
  return isAr ? item.name.arabic : item.name.english;
82
82
  }, [isAr, list, value]);
83
- return (_jsxs(Box, { children: [_jsx(LabelContainerStyled, { children: _jsxs(InputLabelStyled, { children: [t(label), " ", isRequired && _jsx(MandatoryStyled, { children: "*" })] }) }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, value: nameValue, placeholder: placeholder, onClick: handleListOpenClose, endAdornment: !disabled && _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchValuePath: ['name.english', 'name.arabic'], searchKeyPath: 'name.english', list: list, onSelectItem: handleValueChange, renderItem: function (item) {
83
+ return (_jsxs(Box, { children: [_jsx(LabelContainerStyled, { children: _jsxs(InputLabelStyled, { children: [t(label), " ", isRequired && _jsx(MandatoryStyled, { children: "*" })] }) }), _jsxs(Box, { children: [_jsx(InputStyled, { value: nameValue, placeholder: placeholder, onClick: handleListOpenClose, endAdornment: !disabled && _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchValuePath: ['name.english', 'name.arabic'], searchKeyPath: 'name.english', list: list, onSelectItem: handleValueChange, renderItem: function (item) {
84
84
  var _a, _b;
85
- var isChecked = item.iso2 === value;
85
+ var isChecked = item.countryId === value;
86
86
  return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: isChecked }, { children: isAr ? (_a = item.name) === null || _a === void 0 ? void 0 : _a.arabic : (_b = item.name) === null || _b === void 0 ? void 0 : _b.english })) })), isChecked && _jsx(CheckIconStyled, {})] }));
87
87
  } }) })), _jsx(Collapse, __assign({ in: !!error && !anchorEl, timeout: 400 }, { children: _jsx(Warning, __assign({ warningType: 'hint' }, { children: t(error || '') })) }))] })] }));
88
88
  }
@@ -141,7 +141,7 @@ function InputSelect(_a) {
141
141
  return React.useMemo(function () {
142
142
  if (data.length === 0 && countryIso2)
143
143
  return (_jsx(InputText, { label: label, onChange: function (value) { return onSelect(value); }, placeholder: placeholder, isRequired: isRequired, value: value, error: error }, 'input-text'));
144
- return (_jsxs(Box, { children: [_jsx(LabelContainerStyled, { children: _jsxs(InputLabelStyled, { children: [t(label), " ", isRequired && _jsx(MandatoryStyled, { children: "*" })] }) }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, value: nameValue, placeholder: placeholder, onClick: handleListOpenClose, endAdornment: loading ? _jsx(CircularProgress, { size: 25, thickness: 5 }) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchValuePath: ['name.en', 'name.ar'], searchKeyPath: 'name.en', list: data, onSelectItem: function (item) {
144
+ return (_jsxs(Box, { children: [_jsx(LabelContainerStyled, { children: _jsxs(InputLabelStyled, { children: [t(label), " ", isRequired && _jsx(MandatoryStyled, { children: "*" })] }) }), _jsxs(Box, { children: [_jsx(InputStyled, { value: nameValue, placeholder: placeholder, onClick: handleListOpenClose, endAdornment: loading ? _jsx(CircularProgress, { size: 25, thickness: 5 }) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchValuePath: ['name.en', 'name.ar'], searchKeyPath: 'name.en', list: data, onSelectItem: function (item) {
145
145
  onSelect(item.id);
146
146
  setAnchorEl(null);
147
147
  }, renderItem: function (item) {
@@ -79,36 +79,31 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
79
79
  _b);
80
80
  });
81
81
  var ButtonStyled = styled(Button, {
82
- shouldForwardProp: function (prop) { return prop !== 'isCompleted'; }
82
+ shouldForwardProp: function (prop) { return prop !== 'isCompleted' && prop !== 'hasUrl'; }
83
83
  })(function (_a) {
84
84
  var _b;
85
- var theme = _a.theme, isCompleted = _a.isCompleted;
85
+ var theme = _a.theme, isCompleted = _a.isCompleted, hasUrl = _a.hasUrl;
86
86
  return ({
87
87
  '&.MuiButton-outlined': __assign(__assign({}, (isCompleted && {
88
88
  paddingInlineEnd: theme.spacing(1.625),
89
89
  color: theme.palette.success.main,
90
90
  border: "1px solid ".concat(theme.palette.success.main)
91
- })), (_b = { '&:hover': __assign({}, (isCompleted && {
92
- backgroundColor: theme.palette.common.white,
93
- border: "1px solid ".concat(theme.palette.success.main),
94
- color: theme.palette.success.main,
95
- cursor: 'initial',
96
- img: {
91
+ })), (_b = { '&:hover': __assign({}, (isCompleted && __assign({ backgroundColor: hasUrl ? theme.palette.success.main : theme.palette.common.white, border: "1px solid ".concat(theme.palette.success.main), color: hasUrl ? theme.palette.common.white : theme.palette.success.main, cursor: hasUrl ? 'pointer' : 'initial', img: {
97
92
  filter: 'none'
93
+ } }, (hasUrl && {
94
+ svg: {
95
+ filter: 'brightness(3)'
98
96
  }
99
- })) }, _b[theme.breakpoints.down('sm')] = {
97
+ })))) }, _b[theme.breakpoints.down('sm')] = {
100
98
  '&:hover': __assign({ backgroundColor: theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), img: {
101
99
  filter: 'none'
102
- }, color: theme.palette.primary.main }, (isCompleted && {
103
- backgroundColor: theme.palette.common.white,
104
- border: "1px solid ".concat(theme.palette.success.main),
105
- paddingInlineEnd: theme.spacing(1.625),
106
- color: theme.palette.success.main,
107
- cursor: 'initial',
108
- img: {
100
+ }, color: theme.palette.primary.main }, (isCompleted && __assign({ backgroundColor: hasUrl ? theme.palette.success.main : theme.palette.common.white, border: "1px solid ".concat(theme.palette.success.main), paddingInlineEnd: theme.spacing(1.625), color: hasUrl ? theme.palette.common.white : theme.palette.success.main, cursor: hasUrl ? 'pointer' : 'initial', img: {
109
101
  filter: 'none'
102
+ } }, (hasUrl && {
103
+ svg: {
104
+ filter: 'brightness(3)'
110
105
  }
111
- }))
106
+ }))))
112
107
  }, _b['&:disabled'] = {
113
108
  backgroundColor: theme.palette.common.white,
114
109
  color: alpha(theme.palette.primary.main, 0.3)
@@ -153,7 +148,7 @@ export default function FlowsButtons(_a) {
153
148
  var _b = useState(false), loading = _b[0], setLoading = _b[1];
154
149
  var isAr = useLanguage().isAr;
155
150
  var onRedirect = function (item) {
156
- if (item.isCompleted)
151
+ if (!item.href)
157
152
  return;
158
153
  if (flowName === item.name && item.name !== 'password') {
159
154
  dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser)));
@@ -221,6 +216,6 @@ export default function FlowsButtons(_a) {
221
216
  onResetPassword();
222
217
  else
223
218
  onRedirect({ title: title, href: href, src: src, hoverSrc: hoverSrc, isCompleted: isCompleted, name: name, status: status, token: token });
224
- } }, { children: _jsx(ButtonStyled, __assign({ variant: 'outlined', disabled: isResetPassword(name, status) && loading, isCompleted: isCompleted, sx: __assign({ mb: isLast ? 2.5 : 1.8 }, sx), endIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isCompleted ? (_jsx(CheckIconStyled, {})) : (_jsx(Image, { sx: { height: 15, transform: isAr ? 'scale(-1)' : 'scale(1)' }, src: ICONS_NAMES.Arrow_filled_right_icon })), startIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isBrand(name) ? (_jsx(_Fragment, { children: _jsx(BrandImage, { children: _jsx(BrandNameStyled, { children: brandName }) }) })) : (_jsx(Image, { src: src, alt: title })), type: 'button' }, { children: title })) }), idx));
219
+ } }, { children: _jsx(ButtonStyled, __assign({ variant: 'outlined', disabled: isResetPassword(name, status) && loading, isCompleted: isCompleted, hasUrl: !!href, sx: __assign({ mb: isLast ? 2.5 : 1.8 }, sx), endIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isCompleted ? (_jsx(CheckIconStyled, {})) : (_jsx(Image, { sx: { height: 15, transform: isAr ? 'scale(-1)' : 'scale(1)' }, src: ICONS_NAMES.Arrow_filled_right_icon })), startIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isBrand(name) ? (_jsx(_Fragment, { children: _jsx(BrandImage, { children: _jsx(BrandNameStyled, { children: brandName }) }) })) : (_jsx(Image, { src: src, alt: title })), type: 'button' }, { children: title })) }), idx));
225
220
  }) }));
226
221
  }
@@ -37,9 +37,8 @@ export var InputStyled = styled(Input)(function (_a) {
37
37
  }, '&.MuiInputBase-adornedStart': {
38
38
  paddingInlineStart: theme.spacing(2.5)
39
39
  } }, (readOnly && {
40
- '& .MuiInputBase-input': {
41
- cursor: 'pointer'
42
- }
40
+ cursor: 'default',
41
+ opacity: '0.6'
43
42
  })));
44
43
  });
45
44
  var LabelContainerStyled = styled(Box)(function (_a) {
@@ -5,6 +5,7 @@ interface OTPProps extends OTPFieldProps {
5
5
  onResetClick?: () => void;
6
6
  timeEndLabel?: string;
7
7
  loading?: boolean;
8
+ hasError?: boolean;
8
9
  }
9
- declare const _default: React.MemoExoticComponent<({ timeEndLabel, loading, timerInSeconds, onResetClick, ...props }: OTPProps) => JSX.Element>;
10
+ declare const _default: React.MemoExoticComponent<({ timeEndLabel, loading, timerInSeconds, onResetClick, hasError, ...props }: OTPProps) => JSX.Element>;
10
11
  export default _default;
@@ -80,7 +80,7 @@ var LoaderBoxStyled = styled(OTPBox)(function (_a) {
80
80
  });
81
81
  });
82
82
  var OTPInput = function (_a) {
83
- var timeEndLabel = _a.timeEndLabel, loading = _a.loading, timerInSeconds = _a.timerInSeconds, onResetClick = _a.onResetClick, props = __rest(_a, ["timeEndLabel", "loading", "timerInSeconds", "onResetClick"]);
83
+ var timeEndLabel = _a.timeEndLabel, loading = _a.loading, timerInSeconds = _a.timerInSeconds, onResetClick = _a.onResetClick, hasError = _a.hasError, props = __rest(_a, ["timeEndLabel", "loading", "timerInSeconds", "onResetClick", "hasError"]);
84
84
  var otpRef = React.useRef(null);
85
85
  var width = useContainerDimensions(otpRef).width;
86
86
  React.useEffect(function () {
@@ -88,6 +88,6 @@ var OTPInput = function (_a) {
88
88
  if (el)
89
89
  el.className = 'middle-input-element';
90
90
  }, [props.value]);
91
- return (_jsxs(_Fragment, { children: [_jsx(OTPBox, __assign({ id: 'otp-container', ref: otpRef }, { children: _jsx(OTPStyled, __assign({}, props, { parentWidth: width })) })), typeof timerInSeconds != 'undefined' && (_jsx(BoxStyled, { children: loading ? (_jsx(LoaderBoxStyled, { children: _jsx(CircularProgress, { size: 20, thickness: 5 }) })) : (_jsx(OTPTimer, { timeEndLabel: timeEndLabel || '', timeInSeconds: timerInSeconds, onResetClick: onResetClick })) }))] }));
91
+ return (_jsxs(_Fragment, { children: [_jsx(OTPBox, __assign({ id: 'otp-container', ref: otpRef }, { children: _jsx(OTPStyled, __assign({}, props, { parentWidth: width })) })), typeof timerInSeconds != 'undefined' && (_jsx(BoxStyled, { children: loading ? (_jsx(LoaderBoxStyled, { children: _jsx(CircularProgress, { size: 20, thickness: 5 }) })) : hasError ? (_jsx(_Fragment, {})) : (_jsx(OTPTimer, { timeEndLabel: timeEndLabel || '', timeInSeconds: timerInSeconds, onResetClick: onResetClick })) }))] }));
92
92
  };
93
93
  export default React.memo(OTPInput);
@@ -31,10 +31,11 @@ var SocialMediaGroupStyled = styled(SocialMediaGroup)(function (_a) {
31
31
  });
32
32
  });
33
33
  var InputStyled = styled(Input)(function (_a) {
34
- var theme = _a.theme;
34
+ var theme = _a.theme, readOnly = _a.readOnly;
35
35
  return ({
36
36
  padding: theme.spacing(0, 2, 0, 0),
37
37
  paddingInlineEnd: theme.spacing(2),
38
+ opacity: readOnly ? 0.6 : 1,
38
39
  input: {
39
40
  paddingInlineStart: theme.spacing(0)
40
41
  }
@@ -50,10 +50,11 @@ var TextStyled = styled(Text)(function (_a) {
50
50
  return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
51
51
  });
52
52
  var CheckBoxStyled = styled(CheckBox)(function (_a) {
53
- var theme = _a.theme;
53
+ var theme = _a.theme, disabled = _a.disabled;
54
54
  return ({
55
55
  paddingInline: '15px',
56
56
  marginInlineEnd: theme.spacing(-1),
57
+ opacity: disabled ? 0.6 : 1,
57
58
  '& .MuiSvgIcon-root': {
58
59
  fontSize: 30
59
60
  },
@@ -60,9 +60,9 @@ import { maskFileName } from '../../../utils';
60
60
  import API from '../../../api';
61
61
  import { DeleteFileStatus, FileStatus, ICONS_NAMES, MAX_FILE_SIZE_FOUR_MB, VALID_FILE_FORMATS, FileRemoveType } from '../../../constants';
62
62
  import CheckIcon from '../../shared/CheckIcon';
63
- var BoxStyled = styled(Box)(function (_a) {
64
- var theme = _a.theme;
65
- return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
63
+ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
64
+ var theme = _a.theme, readOnly = _a.readOnly;
65
+ return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
66
66
  });
67
67
  var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['uploading', 'readOnly'].includes(prop.toString()); } })(function (_a) {
68
68
  var theme = _a.theme, uploading = _a.uploading, readOnly = _a.readOnly;
@@ -253,12 +253,12 @@ var FileUpload = function (_a) {
253
253
  }, [name]);
254
254
  var canDownloadFile = fileId && status !== FileStatus.DOWNLOADING;
255
255
  var canDeleteFile = status !== FileStatus.UPLOADING && status !== FileStatus.DOWNLOADING;
256
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(Box, __assign({ sx: { pointerEvents: isSubmitting ? 'none' : 'auto' } }, { children: _jsxs(InputContainerStyled, __assign({ sx: __assign({ borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }, sx) }, { children: [_jsxs(BoxStyled, { children: [_jsxs(Box, __assign({ sx: {
256
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(Box, __assign({ sx: { pointerEvents: isSubmitting ? 'none' : 'auto' } }, { children: _jsxs(InputContainerStyled, __assign({ sx: __assign({ borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }, sx) }, { children: [_jsxs(BoxStyled, __assign({ readOnly: readOnly }, { children: [_jsxs(Box, __assign({ sx: {
257
257
  display: 'flex',
258
258
  flexDirection: 'column',
259
259
  padding: theme.spacing(1.5, 0, 1.5),
260
260
  width: '100%'
261
- } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: name && maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] }), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || status === FileStatus.DOWNLOADING, onClick: function () {
261
+ } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: name && maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] })), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || status === FileStatus.DOWNLOADING, onClick: function () {
262
262
  if (readOnly)
263
263
  return;
264
264
  canDeleteFile && handleDeleteFile();
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import React from 'react';
14
- import { styled } from '@mui/material/styles';
14
+ import { styled, alpha } from '@mui/material/styles';
15
15
  import { ScreenContainer } from '../../shared/Containers';
16
16
  import Box from '@mui/material/Box';
17
17
  import { InputLabelStyled } from '../../shared/Input/Input';
@@ -38,13 +38,13 @@ var LabelContainerStyled = styled(Box)(function (_a) {
38
38
  padding: theme.spacing(0, 2.5, 1.25, 2.5)
39
39
  });
40
40
  });
41
- var BoxStyled = styled(Box)(function (_a) {
42
- var theme = _a.theme;
43
- return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
41
+ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
42
+ var theme = _a.theme, readOnly = _a.readOnly;
43
+ return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
44
44
  });
45
- var UploadBoxStyled = styled(Box)(function (_a) {
46
- var theme = _a.theme;
47
- return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
45
+ var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
46
+ var theme = _a.theme, readOnly = _a.readOnly;
47
+ return (__assign(__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }), (readOnly && { background: alpha(theme.palette.primary.main, 0.5), cursor: 'default' })));
48
48
  });
49
49
  var ClearIconStyled = styled(ClearIcon)(function (_a) {
50
50
  var theme = _a.theme;
@@ -60,9 +60,9 @@ import { maskFileName } from '../../../utils';
60
60
  import API from '../../../api';
61
61
  import { DeleteFileStatus, FileStatus, ICONS_NAMES, MAX_FILE_SIZE_FOUR_MB, VALID_FILE_FORMATS } from '../../../constants';
62
62
  import CheckIcon from '../../shared/CheckIcon';
63
- var BoxStyled = styled(Box)(function (_a) {
64
- var theme = _a.theme;
65
- return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
63
+ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
64
+ var theme = _a.theme, readOnly = _a.readOnly;
65
+ return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
66
66
  });
67
67
  var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['uploading', 'readOnly'].includes(prop.toString()); } })(function (_a) {
68
68
  var theme = _a.theme, uploading = _a.uploading, readOnly = _a.readOnly;
@@ -259,12 +259,12 @@ var UploadFile = function (_a) {
259
259
  }, []);
260
260
  var canDownloadFile = uploadedFile.fileId && status !== FileStatus.DOWNLOADING;
261
261
  var canDeleteFile = !isAnyFileDoingDeleteUploadDownload;
262
- return (_jsx(Box, __assign({ sx: { pointerEvents: isSubmitting ? 'none' : 'auto' } }, { children: _jsxs(InputContainerStyled, __assign({ sx: __assign({ borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }, sx) }, { children: [_jsxs(BoxStyled, { children: [_jsxs(Box, __assign({ sx: {
262
+ return (_jsx(Box, __assign({ sx: { pointerEvents: isSubmitting ? 'none' : 'auto' } }, { children: _jsxs(InputContainerStyled, __assign({ sx: __assign({ borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }, sx) }, { children: [_jsxs(BoxStyled, __assign({ readOnly: readOnly }, { children: [_jsxs(Box, __assign({ sx: {
263
263
  display: 'flex',
264
264
  flexDirection: 'column',
265
265
  padding: theme.spacing(1.5, 0, 1.5),
266
266
  width: '100%'
267
- } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] }), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || (!!isAnyFileDoingDeleteUploadDownload && deleteStatus !== DeleteFileStatus.DELETING), onClick: function () {
267
+ } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] })), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || (!!isAnyFileDoingDeleteUploadDownload && deleteStatus !== DeleteFileStatus.DELETING), onClick: function () {
268
268
  if (readOnly)
269
269
  return;
270
270
  canDeleteFile && handleDeleteFile(index);
@@ -19,14 +19,11 @@ import CheckBox from '../../../../components/CheckBox';
19
19
  import Text from '../../../../components/Text';
20
20
  import Warning from '../../../../components/Warning';
21
21
  import Collapse from '../../../../components/Collapse';
22
- var ConfirmContainerStyled = styled(Box)(function (_a) {
23
- var theme = _a.theme;
24
- return ({
25
- display: 'flex',
26
- flexDirection: 'row',
27
- alignItems: 'center',
28
- padding: theme.spacing(0, 2.5, 0, 2.5)
29
- });
22
+ var ConfirmContainerStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
23
+ var theme = _a.theme, readOnly = _a.readOnly;
24
+ return (__assign({ display: 'flex', flexDirection: 'row', alignItems: 'center', padding: theme.spacing(0, 2.5, 0, 2.5) }, (readOnly && {
25
+ opacity: '0.6'
26
+ })));
30
27
  });
31
28
  var TextStyled = styled(Text)(function (_a) {
32
29
  var theme = _a.theme;
@@ -64,6 +61,6 @@ var ConfirmPolicy = function (_a) {
64
61
  return;
65
62
  confirmControl.field.onChange(checked);
66
63
  };
67
- return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('tax_confirm_information') })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
64
+ return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('tax_confirm_information') })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
68
65
  };
69
66
  export default ConfirmPolicy;
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
14
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
15
15
  import Box from '@mui/material/Box/Box';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import OTPField from '../../../shared/OTP';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
- import { resendOTP } from '../../../app/tax/taxStore';
21
+ import { isTokenExpired } from '../../../../utils';
22
+ import { resendOTP, taxSelector } from '../../../app/tax/taxStore';
22
23
  var BoxStyled = styled(Box)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return ({
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
33
34
  var t = useTranslation().t;
34
35
  var otpControl = useController({ name: 'otp', control: control });
35
36
  var dispatch = useAppDispatch();
37
+ var error = useAppSelector(taxSelector).error;
36
38
  var handleOnOTPChange = function (otp) {
37
39
  otpControl.field.onChange(otp);
38
40
  };
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
42
44
  dispatch(resendOTP());
43
45
  };
44
46
  var otpValue = otpControl.field.value;
45
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
48
  };
47
49
  export default React.memo(OTPInput);
@@ -1 +1,2 @@
1
1
  export declare const isNetworkError: (error: string | null) => boolean;
2
+ export declare const isTokenExpired: (error: string | null) => boolean;
@@ -1,3 +1,6 @@
1
1
  export var isNetworkError = function (error) {
2
2
  return ['network error', 'network request failed'].includes((error || '').trim().toLowerCase());
3
3
  };
4
+ export var isTokenExpired = function (error) {
5
+ return ['token expired'].includes((error || '').trim().toLowerCase());
6
+ };
@@ -42,7 +42,7 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
42
42
  };
43
43
  export declare const removeRequestHeaders: () => void;
44
44
  export declare const getBaseUrl: () => string;
45
- export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP";
45
+ export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
46
46
  export declare const getEighteenYearsAgo: () => string;
47
47
  export declare const isKW: (flag: string) => boolean;
48
48
  export declare const isSA: (flag: string) => boolean;
@@ -188,6 +188,12 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser) {
188
188
  if (flow === FlowsTypes.TAX) {
189
189
  return 'TAX_TAX_DETAILS_STEP';
190
190
  }
191
+ if (flow === FlowsTypes.BRAND) {
192
+ return 'BRAND_INFO_STEP';
193
+ }
194
+ if (flow === FlowsTypes.ENTITY) {
195
+ return 'ENTITY_NAME_STEP';
196
+ }
191
197
  return '';
192
198
  };
193
199
  export var getEighteenYearsAgo = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.3.40-test",
3
+ "version": "2.3.46-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -1,4 +0,0 @@
1
- declare const addressService: {
2
- retrieveAddressFormat: (countryCode: string) => Promise<any>;
3
- };
4
- export { addressService };
@@ -1,12 +0,0 @@
1
- import { httpClient } from './axios';
2
- import { ENDPOINT_PATHS } from '../constants';
3
- var retrieveAddressFormat = function (countryCode) {
4
- return httpClient({
5
- method: 'get',
6
- url: "".concat(ENDPOINT_PATHS.ADDRESS_PATH, "/").concat(countryCode)
7
- });
8
- };
9
- var addressService = {
10
- retrieveAddressFormat: retrieveAddressFormat
11
- };
12
- export { addressService };
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export interface EntityAddressProps {
3
- }
4
- declare const EntityAddress: ({}: EntityAddressProps) => JSX.Element;
5
- export default EntityAddress;
@@ -1,42 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { useTranslation } from 'react-i18next';
14
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
15
- import { entitySelector, updateEntityAddress } from '../../../app/entity/entityStore';
16
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
17
- import { ScreenContainer } from '../../../shared/Containers';
18
- import Address from '../../../shared/Address';
19
- var EntityAddress = function (_a) {
20
- var settings = useAppSelector(settingsSelector).data;
21
- var _b = useAppSelector(entitySelector), data = _b.data, loading = _b.loading, error = _b.error;
22
- var t = useTranslation().t;
23
- var dispatch = useAppDispatch();
24
- var _c = data.verify.responseBody || {}, addressFormat = _c.addressFormat, entity = _c.entity;
25
- var billingAddress = data.entityAddressData.billingAddress;
26
- var isNonEditable = false;
27
- var countries = settings.countries;
28
- var onAddressChange = function (_a, isValid) {
29
- var country = _a.country, address = __rest(_a, ["country"]);
30
- if (isValid) {
31
- var data_1 = {
32
- billingAddress: address
33
- };
34
- dispatch(updateEntityAddress(data_1));
35
- }
36
- };
37
- var onBack = function () {
38
- dispatch(handlePrevScreenStep());
39
- };
40
- return (_jsx(ScreenContainer, { children: _jsx(Address, { defaultValues: billingAddress, countryList: countries, format: addressFormat || [], disableCountry: true, onAddressChange: onAddressChange, isEditable: !isNonEditable, showSubmitButton: true, loading: loading, error: t(error || ''), onBack: function () { return onBack(); } }) }));
41
- };
42
- export default EntityAddress;
@@ -1,2 +0,0 @@
1
- import EntityAddress from './EntityAddress';
2
- export default EntityAddress;
@@ -1,2 +0,0 @@
1
- import EntityAddress from './EntityAddress';
2
- export default EntityAddress;