@tap-payments/auth-jsconnect 2.1.43-test → 2.1.45-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 +8 -5
  2. package/build/api/account.d.ts +5 -0
  3. package/build/api/account.js +9 -1
  4. package/build/api/auth.d.ts +8 -4
  5. package/build/api/auth.js +18 -2
  6. package/build/api/index.d.ts +6 -2
  7. package/build/api/lead.d.ts +1 -0
  8. package/build/api/lead.js +10 -1
  9. package/build/assets/locales/ar.json +2 -0
  10. package/build/assets/locales/en.json +2 -0
  11. package/build/components/Lottie/Lottie.d.ts +320 -0
  12. package/build/components/Lottie/Lottie.js +3 -1
  13. package/build/components/Lottie/files/account_creating.json +732 -0
  14. package/build/constants/api.d.ts +3 -0
  15. package/build/constants/api.js +8 -2
  16. package/build/constants/app.d.ts +5 -2
  17. package/build/constants/app.js +60 -4
  18. package/build/features/app/auth/authStore.d.ts +3 -3
  19. package/build/features/app/business/businessStore.d.ts +1 -0
  20. package/build/features/app/connect/connectStore.d.ts +1 -0
  21. package/build/features/app/connect/connectStore.js +6 -5
  22. package/build/features/app/connectExpress/connectExpressStore.d.ts +61 -6
  23. package/build/features/app/connectExpress/connectExpressStore.js +614 -66
  24. package/build/features/connect/screens/Merchant/Merchant.js +11 -8
  25. package/build/features/connect/screens/Merchant/Segments.js +3 -3
  26. package/build/features/connect/screens/Merchant/TeamSize.js +2 -2
  27. package/build/features/connectExpress/ConnectExpress.js +1 -1
  28. package/build/features/connectExpress/screens/CivilID/CivilID.js +3 -3
  29. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.d.ts +5 -0
  30. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +53 -0
  31. package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.d.ts +7 -0
  32. package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +55 -0
  33. package/build/features/connectExpress/screens/CivilIDMissed/index.d.ts +3 -0
  34. package/build/features/connectExpress/screens/CivilIDMissed/index.js +2 -0
  35. package/build/features/connectExpress/screens/CivilIDMissed/validation.d.ts +8 -0
  36. package/build/features/connectExpress/screens/CivilIDMissed/validation.js +4 -0
  37. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +8 -0
  38. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +142 -0
  39. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.d.ts +5 -0
  40. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +77 -0
  41. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +8 -0
  42. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +144 -0
  43. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +7 -0
  44. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +52 -0
  45. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +34 -0
  46. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +94 -0
  47. package/build/features/connectExpress/screens/CollectBusinessInfo/index.d.ts +3 -0
  48. package/build/features/connectExpress/screens/CollectBusinessInfo/index.js +2 -0
  49. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +27 -0
  50. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +79 -0
  51. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.d.ts +5 -0
  52. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +89 -0
  53. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +8 -0
  54. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +113 -0
  55. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +10 -0
  56. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +149 -0
  57. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +6 -0
  58. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +45 -0
  59. package/build/features/connectExpress/screens/CollectIndividualInfo/index.d.ts +3 -0
  60. package/build/features/connectExpress/screens/CollectIndividualInfo/index.js +2 -0
  61. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.d.ts +14 -0
  62. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +31 -0
  63. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.d.ts +5 -0
  64. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +61 -0
  65. package/build/features/connectExpress/screens/CreateAccountLoader/index.d.ts +2 -0
  66. package/build/features/connectExpress/screens/CreateAccountLoader/index.js +2 -0
  67. package/build/features/connectExpress/screens/IdentityOTP/OTP.d.ts +5 -0
  68. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +87 -0
  69. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +5 -0
  70. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +52 -0
  71. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +3 -0
  72. package/build/features/connectExpress/screens/IdentityOTP/index.js +2 -0
  73. package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +8 -0
  74. package/build/features/connectExpress/screens/IdentityOTP/validation.js +4 -0
  75. package/build/features/connectExpress/screens/IdentityVerifyPACI/VerifyPACI.d.ts +5 -0
  76. package/build/features/connectExpress/screens/IdentityVerifyPACI/VerifyPACI.js +34 -0
  77. package/build/features/connectExpress/screens/IdentityVerifyPACI/index.d.ts +3 -0
  78. package/build/features/connectExpress/screens/IdentityVerifyPACI/index.js +2 -0
  79. package/build/features/connectExpress/screens/Mobile/Mobile.js +0 -3
  80. package/build/features/connectExpress/screens/NID/NID.js +7 -6
  81. package/build/features/connectExpress/screens/NIDMissed/DOB.d.ts +6 -0
  82. package/build/features/connectExpress/screens/NIDMissed/DOB.js +47 -0
  83. package/build/features/connectExpress/screens/NIDMissed/IDNumber.d.ts +6 -0
  84. package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +60 -0
  85. package/build/features/connectExpress/screens/NIDMissed/NID.d.ts +5 -0
  86. package/build/features/connectExpress/screens/NIDMissed/NID.js +59 -0
  87. package/build/features/connectExpress/screens/NIDMissed/index.d.ts +3 -0
  88. package/build/features/connectExpress/screens/NIDMissed/index.js +2 -0
  89. package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +11 -0
  90. package/build/features/connectExpress/screens/NIDMissed/validation.js +9 -0
  91. package/build/features/connectExpress/screens/OTP/OTP.js +10 -6
  92. package/build/features/connectExpress/screens/OTP/OTPInput.js +7 -6
  93. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  94. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +119 -0
  95. package/build/features/connectExpress/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  96. package/build/features/connectExpress/screens/SuccessWithFlowButtons/index.js +2 -0
  97. package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.js +7 -68
  98. package/build/features/featuresScreens.js +40 -0
  99. package/build/features/shared/FlowButtons/FlowButtons.d.ts +4 -0
  100. package/build/features/shared/FlowButtons/FlowButtons.js +6 -0
  101. package/build/features/shared/FlowButtons/index.d.ts +2 -0
  102. package/build/features/shared/FlowButtons/index.js +2 -0
  103. package/package.json +1 -1
@@ -0,0 +1,144 @@
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 { useTranslation } from 'react-i18next';
26
+ import { useController, useFormContext } from 'react-hook-form';
27
+ import Box from '@mui/material/Box';
28
+ import { styled } from '@mui/material/styles';
29
+ import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
30
+ import { BusinessType } from '../../../../@types';
31
+ import { isSA } from '../../../../utils';
32
+ import { settingsSelector } from '../../../../app/settings';
33
+ import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
34
+ import SimpleList from '../../../../components/SimpleList';
35
+ import Text from '../../../../components/Text';
36
+ import ExpandIcon from '../../../../components/ExpandIcon';
37
+ import Collapse from '../../../../components/Collapse';
38
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
39
+ import Input from '../../../shared/Input';
40
+ import CheckIcon from '../../../shared/CheckIcon';
41
+ import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
42
+ import LicenseNumber from './LicenseNumber';
43
+ import LicenseType from './LicenseType';
44
+ var InputStyled = styled(Input)(function (_a) {
45
+ var theme = _a.theme;
46
+ return ({
47
+ marginBottom: theme.spacing(2.5),
48
+ '& .MuiInputBase-input': {
49
+ cursor: 'pointer'
50
+ }
51
+ });
52
+ });
53
+ var LicenseContainer = styled(Box)(function () { return ({
54
+ display: 'flex'
55
+ }); });
56
+ var LicenseNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
57
+ var theme = _a.theme, isSelected = _a.isSelected;
58
+ return (__assign(__assign({ display: 'flex', color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
59
+ });
60
+ var LicenseList = function (_a) {
61
+ var rest = __rest(_a, []);
62
+ var _b = useAppSelector(connectExpressSelector), data = _b.data, error = _b.error;
63
+ var settingsData = useAppSelector(settingsSelector).data;
64
+ var businessData = data.businessData, responseData = data.responseData;
65
+ var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
66
+ var t = useTranslation().t;
67
+ var isAr = useLanguage().isAr;
68
+ var dispatch = useAppDispatch();
69
+ var _d = useFormContext(), setValue = _d.setValue, control = _d.control;
70
+ var selectedLicenseControl = useController({ control: control, name: 'selectedLicense' });
71
+ var selectedLicense = businessData.selectedLicense, licenseNumber = businessData.licenseNumber;
72
+ var licenseList = (responseData || { licenseList: [] }).licenseList;
73
+ var country_code = settingsData.businessCountry.iso2;
74
+ var onOpenLicenseList = function (event) {
75
+ var _a;
76
+ setAnchorEl(event.currentTarget);
77
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
78
+ };
79
+ var onCloseLicenseList = function () {
80
+ var _a;
81
+ setAnchorEl(null);
82
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
83
+ };
84
+ var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
85
+ React.useEffect(function () {
86
+ if ((licenseList || []).length > 0)
87
+ setValue('licenseList', licenseList);
88
+ }, [licenseList]);
89
+ React.useEffect(function () {
90
+ if ((licenseList || []).length > 0) {
91
+ if (!!selectedLicense) {
92
+ setValue('selectedLicense', selectedLicense, { shouldValidate: true });
93
+ setValue('licenseNumber', licenseNumber, { shouldValidate: true });
94
+ }
95
+ }
96
+ }, [licenseList, selectedLicense]);
97
+ React.useEffect(function () {
98
+ if (!!country_code) {
99
+ var isNonSA = !isSA(country_code);
100
+ if (isNonSA) {
101
+ var license = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR ? OTHER_CR_LICENSE : OTHER_FL_LICENSE;
102
+ setValue('selectedLicense', license, { shouldValidate: true });
103
+ }
104
+ }
105
+ }, [country_code]);
106
+ var getLicenseNumber = function (item) {
107
+ var _a;
108
+ return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
109
+ };
110
+ var getLicenseName = function (item) {
111
+ var _a, _b;
112
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
113
+ return t('future_work');
114
+ return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
115
+ };
116
+ var isOtherLicense = function (item) {
117
+ var _a, _b;
118
+ return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) === 'other_fl' || ((_b = item === null || item === void 0 ? void 0 : item.license) === null || _b === void 0 ? void 0 : _b.number) === 'other_cr';
119
+ };
120
+ var onSelectItem = function (license) {
121
+ if (error)
122
+ dispatch(clearError());
123
+ selectedLicenseControl.field.onChange(license);
124
+ if (isOtherLicense(license))
125
+ setValue('licenseNumber', '', { shouldValidate: true });
126
+ else
127
+ setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
128
+ onCloseLicenseList();
129
+ };
130
+ var getLicenseFullName = function (item) {
131
+ if (isAr)
132
+ return _jsx("span", { children: "".concat(getLicenseName(item), " - ").concat(getLicenseNumber(item)) });
133
+ return _jsx("span", { children: "".concat(getLicenseNumber(item), " - ").concat(getLicenseName(item)) });
134
+ };
135
+ var show = !anchorEl;
136
+ var selected = selectedLicenseControl.field.value;
137
+ var licenseReadonly = !isOtherLicense(selected);
138
+ var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
139
+ var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
140
+ return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
141
+ return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
142
+ } }) }))] })), _jsx(LicenseType, { show: show && !isSACountry }), _jsx(LicenseNumber, { show: !isSACountry ? isCR : show, readOnly: licenseReadonly })] }));
143
+ };
144
+ export default React.memo(LicenseList);
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ interface LicenseNumberProps {
3
+ show: boolean;
4
+ readOnly: boolean;
5
+ }
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: LicenseNumberProps) => JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,52 @@
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
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import { CR_NUMBER_LENGTH, FL_NUMBER_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
17
+ import { removeAllOtherThanCharsAndNumber, isSA } from '../../../../utils';
18
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
19
+ import ClearIcon from '../../../shared/ClearIcon';
20
+ import CheckIcon from '../../../shared/CheckIcon';
21
+ import Input from '../../../shared/Input';
22
+ import Collapse from '../../../../components/Collapse';
23
+ import { BusinessType } from '../../../../@types';
24
+ import { useAppSelector } from '../../../../hooks';
25
+ import { settingsSelector } from '../../../../app/settings';
26
+ var LicenseNumber = function (_a) {
27
+ var _b;
28
+ var show = _a.show, readOnly = _a.readOnly;
29
+ var t = useTranslation().t;
30
+ var _c = useFormContext(), control = _c.control, watch = _c.watch, getValues = _c.getValues;
31
+ var licenseNumberControl = useController({ control: control, name: 'licenseNumber' });
32
+ var settingsData = useAppSelector(settingsSelector).data;
33
+ var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
34
+ var selectedLicense = !isSACountry ? watch('selectedLicense') : getValues('selectedLicense');
35
+ var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
36
+ var handleFLNumberChange = function (_a) {
37
+ var target = _a.target;
38
+ var value = removeAllOtherThanCharsAndNumber(target.value);
39
+ licenseNumberControl.field.onChange(value);
40
+ };
41
+ var clearLicenseNumber = function () {
42
+ licenseNumberControl.field.onChange('');
43
+ };
44
+ var licenseNumberValue = licenseNumberControl.field.value;
45
+ var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
46
+ var length = !isSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_LENGTH : FL_NUMBER_LENGTH;
47
+ var minLength = !isSACountry ? KW_MIN_LICENSE_LENGTH : length;
48
+ var label = isCR ? 'cr_number' : 'fl_number';
49
+ var showCheckIcon = !isSACountry ? (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) >= minLength : (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length;
50
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: !isSACountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) }) })));
51
+ };
52
+ export default React.memo(LicenseNumber);
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
3
+ children?: React.ReactNode;
4
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
5
+ color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
6
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
7
+ htmlColor?: string | undefined;
8
+ inheritViewBox?: boolean | undefined;
9
+ shapeRendering?: string | undefined;
10
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
+ titleAccess?: string | undefined;
12
+ viewBox?: string | undefined;
13
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
14
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
15
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
16
+ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
17
+ children?: React.ReactNode;
18
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
19
+ color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
20
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
21
+ htmlColor?: string | undefined;
22
+ inheritViewBox?: boolean | undefined;
23
+ shapeRendering?: string | undefined;
24
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
25
+ titleAccess?: string | undefined;
26
+ viewBox?: string | undefined;
27
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
28
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
29
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
+ declare type LicenseTypeProps = {
31
+ show: boolean;
32
+ };
33
+ declare const LicenseType: ({ show }: LicenseTypeProps) => JSX.Element;
34
+ export default LicenseType;
@@ -0,0 +1,94 @@
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
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { styled, alpha } from '@mui/material/styles';
15
+ import InfoIcon from '@mui/icons-material/Info';
16
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
17
+ import Collapse from '../../../../components/Collapse';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { useController, useFormContext } from 'react-hook-form';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { BusinessType } from '../../../../@types';
22
+ import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
23
+ import Text from '../../../../components/Text';
24
+ import RadioGroup from '../../../../components/RadioGroup';
25
+ import RadioLabel from '../../../../components/RadioLabel';
26
+ import Tooltip from '../../../../components/Tooltip';
27
+ import Radio from '../../../../components/Radio';
28
+ import { ScreenContainer } from '../../../shared/Containers';
29
+ import Mandatory from '../../../shared/Mandatory';
30
+ import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
31
+ var LabelTextStyled = styled(Text)(function (_a) {
32
+ var theme = _a.theme;
33
+ return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
34
+ });
35
+ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
36
+ var theme = _a.theme;
37
+ return ({
38
+ marginInlineStart: theme.spacing(0.25)
39
+ });
40
+ });
41
+ var RadioStyled = styled(Radio)(function (_a) {
42
+ var theme = _a.theme;
43
+ return ({
44
+ '& .MuiSvgIcon-root': {
45
+ fontSize: theme.spacing(2.25),
46
+ width: theme.spacing(2.25),
47
+ height: theme.spacing(2.25)
48
+ }
49
+ });
50
+ });
51
+ var LabelStyled = styled('span')(function () { return ({
52
+ display: 'inline-flex',
53
+ alignItems: 'center'
54
+ }); });
55
+ export var InfoIconStyled = styled(InfoIcon)(function (_a) {
56
+ var theme = _a.theme;
57
+ return ({
58
+ width: theme.spacing(2.75),
59
+ height: theme.spacing(2.125),
60
+ cursor: 'pointer',
61
+ color: alpha(theme.palette.text.primary, 0.4),
62
+ display: 'inline-flex'
63
+ });
64
+ });
65
+ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
66
+ var theme = _a.theme;
67
+ return ({
68
+ width: theme.spacing(2.75),
69
+ height: theme.spacing(2.125),
70
+ cursor: 'pointer',
71
+ color: alpha(theme.palette.text.primary, 0.4),
72
+ display: 'inline-flex'
73
+ });
74
+ });
75
+ var LicenseType = function (_a) {
76
+ var show = _a.show;
77
+ var t = useTranslation().t;
78
+ var control = useFormContext().control;
79
+ var error = useAppSelector(connectExpressSelector).error;
80
+ var _b = React.useState(false), isCRHovered = _b[0], setIsCRHovered = _b[1];
81
+ var _c = React.useState(false), isFLHovered = _c[0], setIsFLHovered = _c[1];
82
+ var selectedLicenseControl = useController({ control: control, name: 'selectedLicense' });
83
+ var dispatch = useAppDispatch();
84
+ var handleOnChange = function (_a) {
85
+ var target = _a.target;
86
+ if (error)
87
+ dispatch(clearError());
88
+ selectedLicenseControl.field.onChange(target.value === BusinessType.FL ? OTHER_FL_LICENSE : OTHER_CR_LICENSE);
89
+ };
90
+ var selectedLicenseValue = selectedLicenseControl.field.value;
91
+ var isFL = (selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL;
92
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: isFL ? 9.5 : 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: selectedLicenseValue != null ? ((selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL ? BusinessType.FL : BusinessType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: BusinessType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: BusinessType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
93
+ };
94
+ export default LicenseType;
@@ -0,0 +1,3 @@
1
+ import CollectBusinessInfo, { CollectBusinessInfoProps } from './CollectBusinessInfo';
2
+ export type { CollectBusinessInfoProps };
3
+ export default CollectBusinessInfo;
@@ -0,0 +1,2 @@
1
+ import CollectBusinessInfo from './CollectBusinessInfo';
2
+ export default CollectBusinessInfo;
@@ -0,0 +1,27 @@
1
+ import * as yup from 'yup';
2
+ export declare const BusinessDataSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ selectedLicense: any;
5
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ selectedLicense: any;
9
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
11
+ brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
+ selectedLicense: any;
13
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
+ }>>>;
15
+ export declare const KWBusinessDataSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
16
+ brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
17
+ selectedLicense: any;
18
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
19
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
20
+ brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
21
+ selectedLicense: any;
22
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
23
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
24
+ brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
25
+ selectedLicense: any;
26
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
27
+ }>>>;
@@ -0,0 +1,79 @@
1
+ import * as yup from 'yup';
2
+ import { REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, FL_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH } from '../../../../constants';
3
+ import { BusinessType } from '../../../../@types';
4
+ var objectElements = {
5
+ legal_name: yup.object().shape({
6
+ ar: yup.string(),
7
+ en: yup.string()
8
+ }),
9
+ license: yup.object().shape({
10
+ number: yup.string()
11
+ }),
12
+ type: yup.string()
13
+ };
14
+ export var BusinessDataSchema = yup.object().shape({
15
+ brandName: yup
16
+ .string()
17
+ .test({
18
+ test: function (value) {
19
+ if ((value === null || value === void 0 ? void 0 : value.length) === 0)
20
+ return true;
21
+ if (value && value.length >= 3 && (value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
22
+ return true;
23
+ return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
24
+ }
25
+ })
26
+ .required('enter_brand_name_english_chars_numbers_space'),
27
+ selectedLicense: yup.object().shape(objectElements).required(''),
28
+ licenseNumber: yup
29
+ .string()
30
+ .test({
31
+ test: function (value) {
32
+ var selectedLicense = this.parent.selectedLicense;
33
+ var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
34
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
35
+ if (length === 0)
36
+ return true;
37
+ if (isCR) {
38
+ return length > CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
39
+ }
40
+ return length > FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
41
+ }
42
+ })
43
+ .required('')
44
+ });
45
+ export var KWBusinessDataSchema = yup.object().shape({
46
+ brandName: yup
47
+ .string()
48
+ .test({
49
+ test: function (value) {
50
+ if ((value === null || value === void 0 ? void 0 : value.length) === 0)
51
+ return true;
52
+ if (value && value.length >= 3 && (value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
53
+ return true;
54
+ return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
55
+ }
56
+ })
57
+ .required('enter_brand_name_english_chars_numbers_space'),
58
+ selectedLicense: yup.object().shape(objectElements).required(''),
59
+ licenseNumber: yup
60
+ .string()
61
+ .when('selectedLicense', function (selectedLicense) {
62
+ var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
63
+ if (!isCR) {
64
+ return yup.string().optional();
65
+ }
66
+ return yup
67
+ .string()
68
+ .required('')
69
+ .test({
70
+ test: function (value) {
71
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
72
+ if (length === 0)
73
+ return true;
74
+ return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
75
+ }
76
+ });
77
+ })
78
+ .required('')
79
+ });
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface CollectIndividualInfoProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: CollectIndividualInfoProps) => JSX.Element>;
5
+ export default _default;
@@ -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
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useForm, FormProvider } from 'react-hook-form';
16
+ import { yupResolver } from '@hookform/resolvers/yup';
17
+ import { styled } from '@mui/material/styles';
18
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
19
+ import { AuthForType } from '../../../../@types';
20
+ import { useLanguage } from '../../../../hooks';
21
+ import { isKW } from '../../../../utils';
22
+ import { countriesCode } from '../../../../constants';
23
+ import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
24
+ import Form from '../../../../components/Form';
25
+ import Collapse from '../../../../components/Collapse';
26
+ import Button from '../../../shared/Button';
27
+ import { ScreenContainer } from '../../../shared/Containers';
28
+ import { clearError, connectExpressSelector, resetIndividualScreen, updateLeadIndividualAsync } from '../../../app/connectExpress/connectExpressStore';
29
+ import MobileNumber from './MobileNumber';
30
+ import Email from './Email';
31
+ import Name from './Name';
32
+ import { CollectIndividualInfoValidation } from './validation';
33
+ var FormStyled = styled(Form)(function () { return ({
34
+ display: 'flex',
35
+ flexDirection: 'column',
36
+ minHeight: '240px',
37
+ justifyContent: 'space-between'
38
+ }); });
39
+ var CollectIndividualInfo = function (_a) {
40
+ var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
41
+ var _c = React.useState(false), emailChecking = _c[0], setEmailChecking = _c[1];
42
+ var settingsData = useAppSelector(settingsSelector).data;
43
+ var _d = useAppSelector(connectExpressSelector), data = _d.data, loading = _d.loading, error = _d.error;
44
+ var dispatch = useAppDispatch();
45
+ var t = useTranslation().t;
46
+ var isAr = useLanguage().isAr;
47
+ var individualData = data.individualData, otpData = data.otpData, responseData = data.responseData;
48
+ var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
49
+ var contact = ((responseData === null || responseData === void 0 ? void 0 : responseData.leadData) || {}).contact;
50
+ var countryCode = individualData.countryCode;
51
+ var isEmailAvailable = (responseData || {}).isEmailAvailable;
52
+ var methods = useForm({
53
+ resolver: yupResolver(CollectIndividualInfoValidation),
54
+ defaultValues: individualData,
55
+ mode: 'onChange'
56
+ });
57
+ useSetFromDefaultValues(methods, individualData, true);
58
+ React.useEffect(function () {
59
+ if (countryCode.iso2 !== methods.getValues('countryCode.iso2'))
60
+ methods.setValue('countryCode', countryCode);
61
+ }, [countryCode]);
62
+ var onSubmit = function (formData) {
63
+ dispatch(updateLeadIndividualAsync(formData));
64
+ };
65
+ var onBack = function () {
66
+ var _a;
67
+ dispatch(resetIndividualScreen());
68
+ var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
69
+ var screen = startWithNID ? (isKW(code) ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP') : 'CONNECT_EXPRESS_MOBILE_STEP';
70
+ dispatch(handlePrevScreenStep(screen));
71
+ };
72
+ React.useEffect(function () {
73
+ if (error)
74
+ dispatch(clearError());
75
+ }, [methods.formState.isValid]);
76
+ var handleMenuListClick = function () {
77
+ setListActive(!listActive);
78
+ };
79
+ React.useEffect(function () {
80
+ if (isEmailAvailable === false)
81
+ methods.setError('email', { message: 'tap_js_email_already_exist' });
82
+ }, [responseData]);
83
+ var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
84
+ var isEmailValid = typeof isEmailAvailable === 'undefined' ? isLeadEmailAvailable : isEmailAvailable;
85
+ var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
86
+ var disabled = emailErrChecks || emailChecking || !isEmailValid;
87
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { show: !listActive }), _jsx(MobileNumber, { show: true, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: countriesCode }), _jsx(Email, { show: !listActive, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
88
+ };
89
+ export default React.memo(CollectIndividualInfo);
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export interface EmailProps {
3
+ show: boolean;
4
+ fetchingEmail: (flag: boolean) => void;
5
+ emailChecking: boolean;
6
+ }
7
+ declare const _default: React.MemoExoticComponent<({ show, fetchingEmail, emailChecking }: EmailProps) => JSX.Element>;
8
+ export default _default;