@tap-payments/auth-jsconnect 2.0.52-test → 2.0.54-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 (194) hide show
  1. package/build/@types/app.d.ts +4 -15
  2. package/build/@types/app.js +0 -9
  3. package/build/@types/form.d.ts +0 -11
  4. package/build/api/auth.d.ts +1 -14
  5. package/build/api/auth.js +1 -24
  6. package/build/api/axios.js +2 -2
  7. package/build/api/data.d.ts +1 -4
  8. package/build/api/data.js +2 -6
  9. package/build/api/entity.d.ts +0 -2
  10. package/build/api/index.d.ts +1 -5
  11. package/build/app/rootReducer.d.ts +0 -3
  12. package/build/app/rootReducer.js +1 -7
  13. package/build/app/settings.js +2 -8
  14. package/build/app/store.d.ts +1 -7
  15. package/build/assets/locales/ar.json +4 -14
  16. package/build/assets/locales/en.json +4 -14
  17. package/build/components/AnimationFlow/AnimationFlow.d.ts +1 -4
  18. package/build/components/AnimationFlow/AnimationFlow.js +7 -5
  19. package/build/components/AnimationFlow/BottomSheet.js +1 -2
  20. package/build/components/AnimationFlow/Dialog.d.ts +1 -4
  21. package/build/components/AnimationFlow/Dialog.js +4 -9
  22. package/build/components/FileInput/DragAndDrop.d.ts +1 -9
  23. package/build/components/FileInput/DragAndDrop.js +8 -113
  24. package/build/components/ProgressBar/index.d.ts +0 -2
  25. package/build/components/ProgressBar/index.js +0 -2
  26. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -2
  27. package/build/components/SocialMediaGroup/SocialMediaGroup.js +34 -27
  28. package/build/constants/api.d.ts +0 -1
  29. package/build/constants/api.js +2 -5
  30. package/build/constants/app.d.ts +0 -15
  31. package/build/constants/app.js +3 -75
  32. package/build/constants/assets.d.ts +1 -17
  33. package/build/constants/assets.js +6 -22
  34. package/build/constants/validation.d.ts +0 -1
  35. package/build/constants/validation.js +0 -1
  36. package/build/features/app/bank/bankStore.d.ts +0 -4
  37. package/build/features/app/bank/bankStore.js +22 -42
  38. package/build/features/app/business/businessStore.js +12 -16
  39. package/build/features/app/connect/connectStore.d.ts +1 -13
  40. package/build/features/app/connect/connectStore.js +4 -164
  41. package/build/features/app/signIn/signInStore.js +2 -2
  42. package/build/features/bank/Bank.js +4 -10
  43. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
  44. package/build/features/bank/screens/BankDetails/BankStatement.js +8 -33
  45. package/build/features/business/Business.d.ts +1 -1
  46. package/build/features/business/Business.js +5 -12
  47. package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
  48. package/build/features/business/screens/Activities/SalesChannels.js +1 -1
  49. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  50. package/build/features/connect/Connect.d.ts +1 -2
  51. package/build/features/connect/Connect.js +10 -40
  52. package/build/features/connect/screens/Individual/Individual.js +2 -6
  53. package/build/features/connect/screens/Merchant/Merchant.js +11 -35
  54. package/build/features/connect/screens/Merchant/SocialMedia.js +11 -56
  55. package/build/features/connect/screens/Merchant/validation.d.ts +0 -87
  56. package/build/features/connect/screens/Merchant/validation.js +2 -68
  57. package/build/features/connect/screens/Mobile/Mobile.js +4 -7
  58. package/build/features/featuresScreens.d.ts +0 -3
  59. package/build/features/featuresScreens.js +0 -48
  60. package/build/features/individual/Individual.d.ts +1 -1
  61. package/build/features/individual/Individual.js +5 -12
  62. package/build/features/password/Password.d.ts +1 -1
  63. package/build/features/password/Password.js +5 -12
  64. package/build/features/shared/Background/Background.d.ts +5 -7
  65. package/build/features/shared/Background/Background.js +5 -16
  66. package/build/features/shared/Input/Input.d.ts +1 -1
  67. package/build/features/shared/Input/Input.js +2 -2
  68. package/build/features/shared/UploadFile/UploadFile.d.ts +3 -8
  69. package/build/features/shared/UploadFile/UploadFile.js +8 -23
  70. package/build/features/signIn/SignIn.d.ts +1 -1
  71. package/build/features/signIn/SignIn.js +4 -12
  72. package/build/features/tax/Tax.d.ts +1 -1
  73. package/build/features/tax/Tax.js +4 -12
  74. package/build/hooks/index.d.ts +0 -1
  75. package/build/hooks/index.js +0 -1
  76. package/build/hooks/useAppConfig.js +0 -2
  77. package/build/hooks/useAppDispatch.d.ts +0 -3
  78. package/build/hooks/useErrorListener.js +2 -3
  79. package/build/index.d.ts +2 -5
  80. package/build/index.js +2 -11
  81. package/build/utils/device.d.ts +0 -1
  82. package/build/utils/device.js +0 -13
  83. package/build/utils/html.d.ts +0 -1
  84. package/build/utils/html.js +0 -6
  85. package/build/utils/locale.js +1 -1
  86. package/build/utils/rsa.d.ts +2 -2
  87. package/build/utils/rsa.js +1 -1
  88. package/build/utils/string.d.ts +20 -22
  89. package/build/utils/string.js +0 -9
  90. package/package.json +129 -129
  91. package/build/components/Lottie/Lottie.d.ts +0 -878
  92. package/build/components/Lottie/Lottie.js +0 -58
  93. package/build/components/Lottie/files/pulsating_circle_waves.json +0 -236
  94. package/build/components/Lottie/files/success.json +0 -425
  95. package/build/components/Lottie/index.d.ts +0 -3
  96. package/build/components/Lottie/index.js +0 -3
  97. package/build/components/ProgressBar/CircularProgressBar.d.ts +0 -14
  98. package/build/components/ProgressBar/CircularProgressBar.js +0 -48
  99. package/build/features/app/auth/authStore.d.ts +0 -35
  100. package/build/features/app/auth/authStore.js +0 -148
  101. package/build/features/app/entity/entityStore.d.ts +0 -53
  102. package/build/features/app/entity/entityStore.js +0 -461
  103. package/build/features/app/otp/otpStore.d.ts +0 -28
  104. package/build/features/app/otp/otpStore.js +0 -153
  105. package/build/features/auth/Auth.d.ts +0 -10
  106. package/build/features/auth/Auth.js +0 -87
  107. package/build/features/auth/index.d.ts +0 -1
  108. package/build/features/auth/index.js +0 -1
  109. package/build/features/auth/screens/OTP/OTP.d.ts +0 -5
  110. package/build/features/auth/screens/OTP/OTP.js +0 -72
  111. package/build/features/auth/screens/OTP/OTPInput.d.ts +0 -5
  112. package/build/features/auth/screens/OTP/OTPInput.js +0 -44
  113. package/build/features/auth/screens/OTP/index.d.ts +0 -3
  114. package/build/features/auth/screens/OTP/index.js +0 -2
  115. package/build/features/auth/screens/OTP/validation.d.ts +0 -8
  116. package/build/features/auth/screens/OTP/validation.js +0 -4
  117. package/build/features/connect/screens/CivilID/CivilID.d.ts +0 -5
  118. package/build/features/connect/screens/CivilID/CivilID.js +0 -85
  119. package/build/features/connect/screens/CivilID/IDNumber.d.ts +0 -7
  120. package/build/features/connect/screens/CivilID/IDNumber.js +0 -59
  121. package/build/features/connect/screens/CivilID/index.d.ts +0 -3
  122. package/build/features/connect/screens/CivilID/index.js +0 -2
  123. package/build/features/connect/screens/CivilID/validation.d.ts +0 -8
  124. package/build/features/connect/screens/CivilID/validation.js +0 -4
  125. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +0 -5
  126. package/build/features/connect/screens/Merchant/SalesChannels.js +0 -114
  127. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +0 -5
  128. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +0 -169
  129. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +0 -5
  130. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +0 -22
  131. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +0 -5
  132. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +0 -8
  133. package/build/features/connect/screens/VerifyPACI/index.d.ts +0 -3
  134. package/build/features/connect/screens/VerifyPACI/index.js +0 -2
  135. package/build/features/entity/Entity.d.ts +0 -7
  136. package/build/features/entity/Entity.js +0 -70
  137. package/build/features/entity/index.d.ts +0 -1
  138. package/build/features/entity/index.js +0 -1
  139. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +0 -54
  140. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +0 -139
  141. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +0 -5
  142. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +0 -56
  143. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +0 -5
  144. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +0 -17
  145. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +0 -5
  146. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +0 -28
  147. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +0 -6
  148. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +0 -38
  149. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  150. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  151. package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +0 -2
  152. package/build/features/entity/screens/EntityInfoConfirm/index.js +0 -2
  153. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +0 -107
  154. package/build/features/entity/screens/EntityInfoConfirm/validation.js +0 -17
  155. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +0 -5
  156. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +0 -9
  157. package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +0 -3
  158. package/build/features/entity/screens/ResetPasswordSuccess/index.js +0 -2
  159. package/build/features/entity/screens/Success/Success.d.ts +0 -5
  160. package/build/features/entity/screens/Success/Success.js +0 -16
  161. package/build/features/entity/screens/Success/index.d.ts +0 -3
  162. package/build/features/entity/screens/Success/index.js +0 -2
  163. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +0 -3
  164. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +0 -109
  165. package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +0 -2
  166. package/build/features/entity/screens/SuccessWithFlowButtons/index.js +0 -2
  167. package/build/features/entity/screens/Verify/OTPInput.d.ts +0 -7
  168. package/build/features/entity/screens/Verify/OTPInput.js +0 -47
  169. package/build/features/entity/screens/Verify/Verify.d.ts +0 -5
  170. package/build/features/entity/screens/Verify/Verify.js +0 -78
  171. package/build/features/entity/screens/Verify/index.d.ts +0 -2
  172. package/build/features/entity/screens/Verify/index.js +0 -2
  173. package/build/features/entity/screens/Verify/validation.d.ts +0 -8
  174. package/build/features/entity/screens/Verify/validation.js +0 -4
  175. package/build/features/otp/OTP.d.ts +0 -7
  176. package/build/features/otp/OTP.js +0 -58
  177. package/build/features/otp/index.d.ts +0 -0
  178. package/build/features/otp/index.js +0 -1
  179. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  180. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  181. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  182. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  183. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  184. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  185. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  186. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
  187. package/build/features/shared/Dialog/CloseDialog.d.ts +0 -11
  188. package/build/features/shared/Dialog/CloseDialog.js +0 -62
  189. package/build/features/shared/Dialog/DialogContainer.d.ts +0 -8
  190. package/build/features/shared/Dialog/DialogContainer.js +0 -56
  191. package/build/features/shared/Dialog/index.d.ts +0 -4
  192. package/build/features/shared/Dialog/index.js +0 -4
  193. package/build/hooks/useScreen.d.ts +0 -3
  194. package/build/hooks/useScreen.js +0 -14
@@ -19,8 +19,8 @@ import AnimationFlow from '../../components/AnimationFlow';
19
19
  import { store } from '../../app/store';
20
20
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
21
21
  import Collapse from '../../components/Collapse';
22
- import { getParameterByName, reactElement, removeElement } from '../../utils';
23
- import { BUSINESS_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
22
+ import { getParameterByName, reactElement } from '../../utils';
23
+ import { BUSINESS_SCREENS_NAVIGATION } from '../../constants';
24
24
  import { businessFeatureScreens } from '../featuresScreens';
25
25
  import CustomFooter from '../shared/Footer';
26
26
  import Background from '../shared/Background';
@@ -46,7 +46,7 @@ var Business = memo(function (props) {
46
46
  if (!settingLoading)
47
47
  verifyToken();
48
48
  }, [settingLoading]);
49
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
49
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
50
50
  var Element = _a.element, name = _a.name;
51
51
  var isActive = activeScreen.name === name;
52
52
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -58,13 +58,6 @@ export function BusinessLib(props) {
58
58
  export function renderBusinessLib(config, elementId) {
59
59
  reactElement(elementId).render(_jsx(BusinessLib, __assign({}, config)));
60
60
  }
61
- export function unmountBusinessLib(elementId, unmountTimeout) {
62
- if (unmountTimeout === void 0) { unmountTimeout = 1000; }
63
- var element = document.getElementById(elementId);
64
- setTimeout(function () {
65
- var _a;
66
- ((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
67
- removeElement(DIALOG_ID);
68
- reactElement(elementId).unmount();
69
- }, unmountTimeout);
61
+ export function unmountBusinessLib(elementId) {
62
+ reactElement(elementId).unmount();
70
63
  }
@@ -20,7 +20,7 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
20
20
  export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
21
21
  children?: React.ReactNode;
22
22
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
23
- color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
23
+ color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
24
24
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
25
25
  htmlColor?: string | undefined;
26
26
  inheritViewBox?: boolean | undefined;
@@ -107,6 +107,6 @@ var SalesChannels = function () {
107
107
  if (channelsChecked)
108
108
  return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
109
109
  };
110
- return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name.ar : channel.name.en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
110
+ return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name_ar : channel.name_en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
111
111
  };
112
112
  export default SalesChannels;
@@ -35,7 +35,7 @@ export declare const NameContainer: import("@emotion/styled").StyledComponent<im
35
35
  export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
36
36
  children?: React.ReactNode;
37
37
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
38
- color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
38
+ color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
39
39
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
40
40
  htmlColor?: string | undefined;
41
41
  inheritViewBox?: boolean | undefined;
@@ -49,7 +49,7 @@ export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<
49
49
  export declare const RemainingCheck: import("@emotion/styled").StyledComponent<{
50
50
  children?: React.ReactNode;
51
51
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
52
- color?: "inherit" | "disabled" | "error" | "success" | "info" | "primary" | "secondary" | "action" | "warning" | undefined;
52
+ color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
53
53
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
54
54
  htmlColor?: string | undefined;
55
55
  inheritViewBox?: boolean | undefined;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { LibConfig } from '../../@types';
3
3
  export interface ConnectLibProps extends LibConfig {
4
- onClose?: () => void;
5
4
  }
6
5
  export declare function ConnectLib(props: ConnectLibProps): JSX.Element;
7
6
  export declare function renderConnectLib(config: ConnectLibProps, elementId: string): void;
8
- export declare function unmountConnectLib(elementId: string, unmountTimeout?: number): void;
7
+ export declare function unmountConnectLib(elementId: string): void;
@@ -9,53 +9,30 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
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
12
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import React, { memo } from 'react';
13
+ import { memo } from 'react';
25
14
  import { FeatureContainer } from '../shared/Containers';
26
- import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useAppDispatch } from '../../hooks';
27
- import { handleCurrentActiveScreen, settingsSelector, handleOpen } from '../../app/settings';
15
+ import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
16
+ import { settingsSelector } from '../../app/settings';
28
17
  import AnimationFlow from '../../components/AnimationFlow';
29
18
  import { store } from '../../app/store';
30
19
  import { connectSelector } from '../app/connect/connectStore';
31
20
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
32
21
  import Collapse from '../../components/Collapse';
33
- import { reactElement, removeElement, isKW } from '../../utils';
34
- import { CONNECT_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
22
+ import { reactElement } from '../../utils';
23
+ import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
35
24
  import { connectFeatureScreens } from '../featuresScreens';
36
25
  import CustomFooter from '../shared/Footer';
37
26
  import Background from '../shared/Background';
38
- var Connect = memo(function (_a) {
39
- var onClose = _a.onClose, props = __rest(_a, ["onClose"]);
27
+ var Connect = memo(function (props) {
40
28
  var theme = useAppTheme().theme;
41
- var dispatch = useAppDispatch();
42
- var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
29
+ var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
43
30
  var connectError = useAppSelector(connectSelector).error;
44
31
  useAppConfig(__assign({ navigation: CONNECT_SCREENS_NAVIGATION }, props));
45
32
  useErrorListener(connectError || error);
46
33
  useStepStartedListener();
47
34
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
48
- React.useEffect(function () {
49
- var _a;
50
- if (!settingLoading) {
51
- if (isKW((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2))
52
- dispatch(handleCurrentActiveScreen('CONNECT_CIVIL_ID_STEP'));
53
- }
54
- }, [settingLoading]);
55
- var handleDialogClose = function () {
56
- dispatch(handleOpen(false));
57
- };
58
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ onClose: onClose, onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
35
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
59
36
  var Element = _a.element, name = _a.name;
60
37
  var isActive = activeScreen.name === name;
61
38
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -67,13 +44,6 @@ export function ConnectLib(props) {
67
44
  export function renderConnectLib(config, elementId) {
68
45
  reactElement(elementId).render(_jsx(ConnectLib, __assign({}, config)));
69
46
  }
70
- export function unmountConnectLib(elementId, unmountTimeout) {
71
- if (unmountTimeout === void 0) { unmountTimeout = 1000; }
72
- var element = document.getElementById(elementId);
73
- setTimeout(function () {
74
- var _a;
75
- ((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
76
- removeElement(DIALOG_ID);
77
- reactElement(elementId).unmount();
78
- }, unmountTimeout);
47
+ export function unmountConnectLib(elementId) {
48
+ reactElement(elementId).unmount();
79
49
  }
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
18
18
  import { useForm, FormProvider } from 'react-hook-form';
19
19
  import { yupResolver } from '@hookform/resolvers/yup';
20
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
21
+ import { handlePrevScreenStep } from '../../../../app/settings';
22
22
  import { IndividualValidation, IndividualMobileValidation } from './validation';
23
23
  import Form from '../../../../components/Form';
24
24
  import Button from '../../../shared/Button';
@@ -28,7 +28,6 @@ import { useLanguage } from '../../../../hooks';
28
28
  import MobileNumber from './MobileNumber';
29
29
  import { countriesCode } from '../../../../constants';
30
30
  import Collapse from '../../../../components/Collapse';
31
- import { isKW } from '../../../../utils';
32
31
  var FormStyled = styled(Form)(function () { return ({
33
32
  display: 'flex',
34
33
  flexDirection: 'column'
@@ -37,7 +36,6 @@ var Individual = function (_a) {
37
36
  var _b, _c, _d;
38
37
  var _e = React.useState(false), listActive = _e[0], setListActive = _e[1];
39
38
  var _f = React.useState(false), emailChecking = _f[0], setEmailChecking = _f[1];
40
- var settingsData = useAppSelector(settingsSelector).data;
41
39
  var _g = useAppSelector(connectSelector), data = _g.data, loading = _g.loading, error = _g.error;
42
40
  var dispatch = useAppDispatch();
43
41
  var t = useTranslation().t;
@@ -53,10 +51,8 @@ var Individual = function (_a) {
53
51
  dispatch(updateLeadIndividual(formData));
54
52
  };
55
53
  var onBack = function () {
56
- var _a;
57
54
  dispatch(resetIndividualScreen());
58
- var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
59
- dispatch(handlePrevScreenStep(isKW(code) ? 'CONNECT_CIVIL_ID_STEP' : isAbsher ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
55
+ dispatch(handlePrevScreenStep(isAbsher ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
60
56
  };
61
57
  React.useEffect(function () {
62
58
  if (error)
@@ -16,32 +16,28 @@ import { useTranslation } from 'react-i18next';
16
16
  import Collapse from '@mui/material/Collapse';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
19
+ import { handlePrevScreenStep } from '../../../../app/settings';
20
20
  import Form from '../../../../components/Form';
21
21
  import { INSTAGRAM_URL, TWITTER_URL } from '../../../../constants';
22
22
  import { ScreenContainer } from '../../../shared/Containers';
23
23
  import Button from '../../../shared/Button';
24
24
  import { clearError, connectSelector, updateLeadBrand } from '../../../app/connect/connectStore';
25
25
  import { useLanguage } from '../../../../hooks';
26
- import { isKW } from '../../../../utils';
27
26
  import { MerchantValidationSchema, ValidationOptions } from './validation';
28
27
  import BrandName from './BrandName';
29
28
  import SocialMedia from './SocialMedia';
30
29
  import TAC from './TAC';
31
30
  import BrandList from './BrandList';
32
- import SalesChannels from './SalesChannels';
33
31
  var Merchant = function (_a) {
34
- var _b, _c;
35
- var _d = React.useState(false), brandNameChecking = _d[0], setBrandNameChecking = _d[1];
36
- var _e = React.useState(ValidationOptions.NEW_USER), userType = _e[0], setUserType = _e[1];
37
- var _f = React.useState(false), listActive = _f[0], setListActive = _f[1];
38
- var _g = useAppSelector(connectSelector), data = _g.data, loading = _g.loading, error = _g.error;
39
- var settingsData = useAppSelector(settingsSelector).data;
32
+ var _b, _c, _d;
33
+ var _e = React.useState(false), brandNameChecking = _e[0], setBrandNameChecking = _e[1];
34
+ var _f = React.useState(ValidationOptions.NEW_USER), userType = _f[0], setUserType = _f[1];
35
+ var _g = React.useState(false), listActive = _g[0], setListActive = _g[1];
36
+ var _h = useAppSelector(connectSelector), data = _h.data, loading = _h.loading, error = _h.error;
40
37
  var isNewUser = (_b = data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.new_user;
41
38
  var isAbsher = data.otpData.isAbsher;
42
- var _h = data.brandData.responseBody || {}, brands = _h.brands, channelList = _h.channelList;
43
- var brandList = brands || [];
44
- var _j = data.brandData, brandName = _j.brandName, links = _j.links, selectedBrandItem = _j.selectedBrandItem, termAndConditionChecked = _j.termAndConditionChecked, responseBody = _j.responseBody, salesChannels = _j.salesChannels;
39
+ var brandList = ((_c = data.brandData.responseBody) === null || _c === void 0 ? void 0 : _c.brands) || [];
40
+ var _j = data.brandData, brandName = _j.brandName, links = _j.links, selectedBrandItem = _j.selectedBrandItem, termAndConditionChecked = _j.termAndConditionChecked, responseBody = _j.responseBody;
45
41
  var methods = useForm({
46
42
  resolver: yupResolver(MerchantValidationSchema(userType)),
47
43
  defaultValues: {
@@ -60,13 +56,11 @@ var Merchant = function (_a) {
60
56
  dispatch(updateLeadBrand(formData));
61
57
  };
62
58
  var onBack = function () {
63
- var _a;
64
59
  if (isNewUser) {
65
60
  dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
66
61
  return;
67
62
  }
68
- var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
69
- dispatch(handlePrevScreenStep(isKW(code) ? 'CONNECT_CIVIL_ID_STEP' : isAbsher ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
63
+ dispatch(handlePrevScreenStep(isAbsher ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
70
64
  };
71
65
  React.useEffect(function () {
72
66
  if (error)
@@ -88,7 +82,6 @@ var Merchant = function (_a) {
88
82
  var sites = { website: '', twitter: '', instagram: '' };
89
83
  methods.setValue('brandName', '', { shouldValidate: true });
90
84
  methods.setValue('links', sites);
91
- methods.setValue('salesChannels', []);
92
85
  }, 100);
93
86
  }
94
87
  if (isNewUser === false && (brandList === null || brandList === void 0 ? void 0 : brandList.length) > 0 && (formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.id) !== 'other') {
@@ -99,35 +92,18 @@ var Merchant = function (_a) {
99
92
  var website = (_e = formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.website) === null || _e === void 0 ? void 0 : _e.replaceAll(/(https|http):\/\//g, '');
100
93
  var sites_1 = __assign(__assign({}, links), { website: website, twitter: twitter, instagram: instagram });
101
94
  setTimeout(function () { return methods.setValue('links', sites_1, { shouldValidate: true }); }, 100);
102
- var selectedChannels = (!!(channelList === null || channelList === void 0 ? void 0 : channelList[0]) && [channelList === null || channelList === void 0 ? void 0 : channelList[0]]) || [];
103
- var _f = formDataSelectedBrand || {}, websiteUrl = _f.website, social = _f.social;
104
- var isHasWebsite = (websiteUrl === null || websiteUrl === void 0 ? void 0 : websiteUrl.length) > 0;
105
- var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
106
- var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
107
- var websiteData = channelList === null || channelList === void 0 ? void 0 : channelList.find(function (c) { return c.name.en.toLocaleLowerCase() === 'website'; });
108
- var socialData = channelList === null || channelList === void 0 ? void 0 : channelList.find(function (c) { return c.name.en === 'social media'; });
109
- if (isHasWebsite && (isHasTwitter || isHasInstagram))
110
- selectedChannels = [websiteData, socialData];
111
- else if (isHasTwitter || isHasInstagram)
112
- selectedChannels = [socialData];
113
- else if (isHasWebsite)
114
- selectedChannels = [websiteData];
115
- methods.setValue('salesChannels', selectedChannels);
116
95
  }
117
96
  }, [formDataSelectedBrand, isNewUser]);
118
97
  React.useEffect(function () {
119
98
  if (!(formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.id) && (selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.id))
120
99
  methods.setValue('selectedBrandItem', selectedBrandItem, { shouldValidate: true });
121
100
  }, [selectedBrandItem]);
122
- React.useEffect(function () {
123
- methods.setValue('salesChannels', salesChannels);
124
- }, [salesChannels]);
125
101
  var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
126
- var disabled = brandErrChecks || brandNameChecking || ((_c = data.brandData.responseBody) === null || _c === void 0 ? void 0 : _c.response_code) === '5';
102
+ var disabled = brandErrChecks || brandNameChecking || ((_d = data.brandData.responseBody) === null || _d === void 0 ? void 0 : _d.response_code) === '5';
127
103
  var isBrandListAvailable = userType !== ValidationOptions.NEW_USER && brandList.length > 0;
128
104
  var askingForBrandInfo = userType === ValidationOptions.NEW_USER ||
129
105
  brandList.length === 0 ||
130
106
  userType === ValidationOptions.EXISTING_USER_WITH_OTHER_BRAND;
131
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: isBrandListAvailable, list: brandList, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(BrandName, { show: !listActive && askingForBrandInfo, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(SalesChannels, {}) })), _jsx(SocialMedia, { show: !listActive, isNewUser: isNewUser }), _jsx(TAC, { show: !listActive && askingForBrandInfo }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
107
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: isBrandListAvailable, list: brandList, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(BrandName, { show: !listActive && askingForBrandInfo, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(SocialMedia, { show: !listActive, isNewUser: isNewUser }), _jsx(TAC, { show: !listActive && askingForBrandInfo }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
132
108
  };
133
109
  export default React.memo(Merchant);
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
@@ -37,7 +37,8 @@ var InputStyled = styled(Input)(function (_a) {
37
37
  padding: theme.spacing(0, 2, 0, 0),
38
38
  paddingInlineEnd: theme.spacing(2),
39
39
  input: {
40
- paddingInlineStart: theme.spacing(0)
40
+ paddingInlineStart: theme.spacing(0),
41
+ textTransform: 'lowercase'
41
42
  }
42
43
  });
43
44
  });
@@ -57,26 +58,23 @@ var ClearIconStyled = styled(ClearIcon)(function (_a) {
57
58
  });
58
59
  });
59
60
  var SocialMedia = function (_a) {
60
- var _b, _c, _d, _e, _f, _g, _h, _j;
61
+ var _b, _c, _d, _e;
61
62
  var show = _a.show, sx = _a.sx, isNewUser = _a.isNewUser;
62
- var _k = React.useState(SocialMediaTypes.WEB), socialMediaType = _k[0], setSocialMediaType = _k[1];
63
- var _l = React.useState([SocialMediaTypes.WEB]), selectedSocialMediaTypes = _l[0], setSelectedSocialMediaTypes = _l[1];
63
+ var _f = React.useState(SocialMediaTypes.WEB), socialMediaType = _f[0], setSocialMediaType = _f[1];
64
64
  var t = useTranslation().t;
65
- var _m = useFormContext(), control = _m.control, setValue = _m.setValue, watch = _m.watch;
65
+ var _g = useFormContext(), control = _g.control, setValue = _g.setValue, watch = _g.watch;
66
66
  var linksControl = useController({ control: control, name: 'links' });
67
67
  var links = linksControl.field.value;
68
68
  var brandName = watch('brandName');
69
- var selectedChannels = watch('salesChannels');
70
69
  var data = useAppSelector(connectSelector).data;
71
70
  var brandList = ((_b = data.brandData.responseBody) === null || _b === void 0 ? void 0 : _b.brands) || [];
72
71
  var handleChange = function (_a) {
73
72
  var _b;
74
73
  var target = _a.target;
75
- linksControl.field.onChange(__assign(__assign({}, links), (_b = {}, _b[socialMediaType.replace(' ', '_')] = target.value, _b)));
74
+ linksControl.field.onChange(__assign(__assign({}, links), (_b = {}, _b[socialMediaType] = target.value, _b)));
76
75
  };
77
- var handleClear = function (e) {
76
+ var handleClear = function () {
78
77
  var _a;
79
- e.stopPropagation();
80
78
  linksControl.field.onChange(__assign(__assign({}, links), (_a = {}, _a[socialMediaType] = '', _a)));
81
79
  };
82
80
  var handleBlueWebsite = function () {
@@ -105,58 +103,15 @@ var SocialMedia = function (_a) {
105
103
  setValue('links', __assign(__assign({}, links), { website: website }));
106
104
  }
107
105
  }, [brandName]);
108
- React.useEffect(function () {
109
- var _a, _b;
110
- if ((selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.length) > 0) {
111
- setSelectedSocialMediaTypes(selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.map(function (_a) {
112
- var name = _a.name;
113
- return name.en.toLocaleLowerCase();
114
- }));
115
- var hasSelectedMediaTypeAvailable = !!(selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.find(function (_a) {
116
- var name = _a.name;
117
- if (socialMediaType === SocialMediaTypes.TWITTER || socialMediaType === SocialMediaTypes.INSTAGRAM)
118
- return name.en.toLocaleLowerCase() === SocialMediaTypes.SOCIAL;
119
- if (socialMediaType === SocialMediaTypes.APPLE_STORE || socialMediaType === SocialMediaTypes.PLAY_STORE)
120
- return name.en.toLocaleLowerCase() === SocialMediaTypes.APP;
121
- return name.en.toLocaleLowerCase() === socialMediaType;
122
- }));
123
- if (!hasSelectedMediaTypeAvailable) {
124
- var type = (_b = (_a = selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels[0]) === null || _a === void 0 ? void 0 : _a.name.en) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
125
- if (type === SocialMediaTypes.SOCIAL)
126
- setSocialMediaType(SocialMediaTypes.TWITTER);
127
- else if (type === SocialMediaTypes.APP)
128
- setSocialMediaType(SocialMediaTypes.APPLE_STORE);
129
- else
130
- setSocialMediaType(type);
131
- }
132
- }
133
- }, [selectedChannels]);
134
106
  var websiteValue = links.website || '';
135
107
  var twitterValue = links.twitter || '';
136
108
  var instagramValue = links.instagram || '';
137
- var appleStoreValue = links.apple_store || '';
138
- var playStoreValue = links.play_store || '';
139
- var callCenterValue = links.call_center || '';
140
- var physicalStoreValue = links.physical_store || '';
141
109
  var errors = linksControl.fieldState.error;
142
110
  var websiteError = (_c = errors === null || errors === void 0 ? void 0 : errors.website) === null || _c === void 0 ? void 0 : _c.message;
143
111
  var twitterError = (_d = errors === null || errors === void 0 ? void 0 : errors.twitter) === null || _d === void 0 ? void 0 : _d.message;
144
112
  var instagramError = (_e = errors === null || errors === void 0 ? void 0 : errors.instagram) === null || _e === void 0 ? void 0 : _e.message;
145
- var appleStoreError = (_f = errors === null || errors === void 0 ? void 0 : errors.apple_store) === null || _f === void 0 ? void 0 : _f.message;
146
- var playStoreError = (_g = errors === null || errors === void 0 ? void 0 : errors.play_store) === null || _g === void 0 ? void 0 : _g.message;
147
- var callCenterError = (_h = errors === null || errors === void 0 ? void 0 : errors.call_center) === null || _h === void 0 ? void 0 : _h.message;
148
- var physicalStoreError = (_j = errors === null || errors === void 0 ? void 0 : errors.physical_store) === null || _j === void 0 ? void 0 : _j.message;
149
- var hasWebsite = !!(selectedSocialMediaTypes === null || selectedSocialMediaTypes === void 0 ? void 0 : selectedSocialMediaTypes.find(function (s) { return s === SocialMediaTypes.WEB; }));
150
- var hasSocial = !!(selectedSocialMediaTypes === null || selectedSocialMediaTypes === void 0 ? void 0 : selectedSocialMediaTypes.find(function (s) {
151
- return s === SocialMediaTypes.TWITTER || s === SocialMediaTypes.INSTAGRAM || s === SocialMediaTypes.SOCIAL;
152
- }));
153
- var hasApp = !!(selectedSocialMediaTypes === null || selectedSocialMediaTypes === void 0 ? void 0 : selectedSocialMediaTypes.find(function (s) {
154
- return s === SocialMediaTypes.APPLE_STORE || s === SocialMediaTypes.PLAY_STORE || s === SocialMediaTypes.APP;
155
- }));
156
- var hasCallCenter = !!(selectedSocialMediaTypes === null || selectedSocialMediaTypes === void 0 ? void 0 : selectedSocialMediaTypes.find(function (s) { return s === SocialMediaTypes.CALL_CENTER; }));
157
- var hasPhysicalStore = !!(selectedSocialMediaTypes === null || selectedSocialMediaTypes === void 0 ? void 0 : selectedSocialMediaTypes.find(function (s) { return s === SocialMediaTypes.PHYSICAL_STORE; }));
158
- return (_jsx(ScreenContainer, __assign({ sx: { mb: show && (selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.length) === 0 ? 3 : 0 } }, { children: _jsx(Collapse, __assign({ in: show && (selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.length) > 0, sx: { mb: (selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.length) === 0 ? 3 : 0 } }, { children: _jsxs(ScreenContainer, __assign({ sx: __assign({ mt: 3, mb: 3, direction: 'ltr' }, sx) }, { children: [_jsx(SocialMediaGroupStyled, { defaultValue: socialMediaType, showSocialMediaTypes: selectedSocialMediaTypes, exclusive: true, onChange: function (e, value) {
159
- setSocialMediaType(value);
160
- } }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB && hasWebsite, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, onBlur: function () { return handleBlueWebsite(); }, startAdornment: _jsx(TextStyled, {}), placeholder: t('signup_website_placeholder'), warningType: 'alert', warningMessage: websiteError && t(websiteError), endAdornment: !websiteError && websiteValue ? _jsx(CheckIcon, {}) : websiteValue && _jsx(_Fragment, {}) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.APPLE_STORE && hasApp, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: appleStoreValue, startAdornment: _jsx(TextStyled, {}), placeholder: t('apple_store_placeholder'), warningType: 'alert', warningMessage: appleStoreError && t(appleStoreError), endAdornment: !appleStoreError && appleStoreValue ? (_jsx(CheckIcon, {})) : (appleStoreValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.PLAY_STORE && hasApp, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: playStoreValue, startAdornment: _jsx(TextStyled, {}), placeholder: t('play_store_placeholder'), warningType: 'alert', warningMessage: playStoreError && t(playStoreError), endAdornment: !playStoreError && playStoreValue ? (_jsx(CheckIcon, {})) : (playStoreValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.PHYSICAL_STORE && hasPhysicalStore, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: physicalStoreValue, startAdornment: _jsx(TextStyled, {}), placeholder: t('physical_store_placeholder'), warningType: 'alert', warningMessage: physicalStoreError && t(physicalStoreError), endAdornment: !physicalStoreError && physicalStoreValue ? (_jsx(CheckIcon, {})) : (physicalStoreValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.TWITTER && hasSocial, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: twitterValue, startAdornment: _jsx(TextStyled, {}), placeholder: t('signup_twitter_placeholder'), warningType: 'alert', warningMessage: twitterError && t(twitterError), endAdornment: !twitterError && twitterValue ? (_jsx(CheckIcon, {})) : (twitterValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.INSTAGRAM && hasSocial, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: instagramValue, startAdornment: _jsx(TextStyled, {}), placeholder: t('signup_instagram_placeholder'), warningType: 'alert', warningMessage: instagramError && t(instagramError), endAdornment: !instagramError && instagramValue ? (_jsx(CheckIcon, {})) : (instagramValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.CALL_CENTER && hasCallCenter, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: callCenterValue, startAdornment: _jsx(TextStyled, {}), placeholder: t('call_center_placeholder'), warningType: 'alert', warningMessage: callCenterError && t(callCenterError), endAdornment: !callCenterError && callCenterValue ? (_jsx(CheckIcon, {})) : (callCenterValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) }))] })) })) })));
113
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: __assign({ mt: 3, mb: 3, direction: 'ltr' }, sx) }, { children: [_jsx(SocialMediaGroupStyled, { defaultValue: socialMediaType, exclusive: true, onChange: function (e, value) {
114
+ setSocialMediaType(value);
115
+ } }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, onBlur: function () { return handleBlueWebsite(); }, startAdornment: _jsx(TextStyled, { children: "https://" }), placeholder: t('signup_website_placeholder'), warningType: 'alert', warningMessage: websiteError && t(websiteError), endAdornment: !websiteError && websiteValue ? _jsx(CheckIcon, {}) : websiteValue && _jsx(ClearIconStyled, { onClick: handleClear }) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.TWITTER, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: twitterValue, startAdornment: _jsx(TextStyled, { children: "@" }), placeholder: t('signup_twitter_placeholder'), warningType: 'alert', warningMessage: twitterError && t(twitterError), endAdornment: !twitterError && twitterValue ? _jsx(CheckIcon, {}) : twitterValue && _jsx(ClearIconStyled, { onClick: handleClear }) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.INSTAGRAM, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: instagramValue, startAdornment: _jsx(TextStyled, { children: "@" }), placeholder: t('signup_instagram_placeholder'), warningType: 'alert', warningMessage: instagramError && t(instagramError), endAdornment: !instagramError && instagramValue ? (_jsx(CheckIcon, {})) : (instagramValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) }))] })) })));
161
116
  };
162
117
  export default React.memo(SocialMedia);
@@ -7,136 +7,49 @@ export declare enum ValidationOptions {
7
7
  export declare const MerchantValidationSchema: (userType: ValidationOptions) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
8
8
  brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
9
9
  termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
10
- salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
11
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
12
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
13
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
16
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
18
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
19
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
20
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
21
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
22
- }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
23
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
24
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
25
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
26
- }>>[] | undefined>;
27
10
  links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
28
11
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
29
12
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
30
13
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
31
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
32
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
33
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
34
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
35
14
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
36
15
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
37
16
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
38
17
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
39
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
40
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
41
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
42
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
43
18
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
44
19
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
45
20
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
46
21
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
47
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
48
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
49
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
50
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
51
22
  }>>>;
52
23
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
53
24
  brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
54
25
  termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
55
- salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
56
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
57
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
58
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
59
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
60
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
61
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
62
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
63
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
64
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
65
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
66
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
67
- }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
68
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
69
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
70
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
71
- }>>[] | undefined>;
72
26
  links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
73
27
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
74
28
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
75
29
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
76
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
77
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
78
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
79
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
80
30
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
81
31
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
82
32
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
83
33
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
84
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
85
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
86
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
87
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
88
34
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
89
35
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
90
36
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
91
37
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
92
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
93
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
94
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
95
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
96
38
  }>>>;
97
39
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
98
40
  brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
99
41
  termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
100
- salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
101
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
102
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
103
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
104
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
105
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
106
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
107
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
108
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
109
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
110
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
111
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
112
- }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
113
- id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
114
- name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
115
- name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
116
- }>>[] | undefined>;
117
42
  links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
118
43
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
119
44
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
120
45
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
121
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
122
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
123
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
124
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
125
46
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
126
47
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
127
48
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
128
49
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
129
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
130
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
131
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
132
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
133
50
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
134
51
  website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
135
52
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
136
53
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
137
- apple_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
138
- play_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
139
- call_center: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
140
- physical_store: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
141
54
  }>>>;
142
55
  }>>>;