@tap-payments/auth-jsconnect 2.6.102-test → 2.7.1-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 (51) hide show
  1. package/build/@types/app.d.ts +6 -11
  2. package/build/@types/config.d.ts +92 -0
  3. package/build/@types/config.js +1 -0
  4. package/build/@types/index.d.ts +1 -0
  5. package/build/@types/index.js +1 -0
  6. package/build/@types/theme.d.ts +4 -0
  7. package/build/@types/theme.js +5 -0
  8. package/build/app/settings.d.ts +2 -2
  9. package/build/app/settings.js +27 -21
  10. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
  11. package/build/components/AnimationFlow/AnimationFlow.js +4 -4
  12. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  13. package/build/components/AnimationFlow/BottomSheet.js +2 -2
  14. package/build/components/AnimationFlow/Dialog.d.ts +4 -2
  15. package/build/components/AnimationFlow/Dialog.js +6 -6
  16. package/build/features/app/auth/authStore.d.ts +9 -2
  17. package/build/features/app/auth/authStore.js +23 -4
  18. package/build/features/app/connect/connectStore.d.ts +9 -2
  19. package/build/features/app/connect/connectStore.js +30 -1
  20. package/build/features/app/connectExpress/connectExpressStore.d.ts +9 -2
  21. package/build/features/app/connectExpress/connectExpressStore.js +41 -13
  22. package/build/features/auth/Auth.js +10 -9
  23. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
  24. package/build/features/bank/Bank.js +1 -1
  25. package/build/features/board/Board.js +1 -1
  26. package/build/features/brand/Brand.js +1 -1
  27. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
  28. package/build/features/business/Business.js +1 -1
  29. package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
  30. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  31. package/build/features/connect/Connect.js +10 -8
  32. package/build/features/connectExpress/ConnectExpress.js +11 -9
  33. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
  34. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
  35. package/build/features/entity/Entity.js +1 -1
  36. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
  37. package/build/features/individual/Individual.js +1 -1
  38. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
  39. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
  40. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
  41. package/build/features/password/Password.js +1 -1
  42. package/build/features/shared/Address/CountryList.d.ts +1 -1
  43. package/build/features/shared/Address/InputSelect.d.ts +1 -1
  44. package/build/features/signIn/SignIn.js +1 -1
  45. package/build/features/tax/Tax.js +1 -1
  46. package/build/hooks/useAppConfig.d.ts +3 -3
  47. package/build/hooks/useAppConfig.js +2 -2
  48. package/build/hooks/useAppTheme.js +4 -1
  49. package/build/utils/device.d.ts +2 -0
  50. package/build/utils/device.js +6 -0
  51. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { LanguageMode } from './theme';
2
+ import { CustomerInfo } from './config';
3
+ import { DirectionMode, LanguageMode, DialogEdgeFormat } from './theme';
3
4
  export interface CountryCode {
4
5
  created: number;
5
6
  updated: number;
@@ -218,6 +219,10 @@ export interface LibConfig extends LibCallbacks {
218
219
  businessCountryCode?: string;
219
220
  scope: string;
220
221
  platforms?: Array<string>;
222
+ showPoweredBy?: boolean;
223
+ dialogEdgeFormat?: DialogEdgeFormat;
224
+ direction?: DirectionMode;
225
+ customerInfo?: CustomerInfo;
221
226
  postURL?: string;
222
227
  redirectUrl?: string;
223
228
  data?: Array<string>;
@@ -647,16 +652,6 @@ export declare type VerifyExpressTokenParams = {
647
652
  };
648
653
  lead_id: string;
649
654
  };
650
- export declare type ConfigExpressTokenParams = {
651
- post: {
652
- url: string;
653
- };
654
- lead_id: string;
655
- board: boolean;
656
- platform_redirect_url: string;
657
- data: Array<string>;
658
- };
659
- export declare type ConfigAuthTokenParams = ConfigExpressTokenParams;
660
655
  export declare enum MerchantStatus {
661
656
  DISABLED = "disabled",
662
657
  ENABLED = "enabled"
@@ -0,0 +1,92 @@
1
+ export interface ConfigInfo {
2
+ operator: Operator;
3
+ scope: string;
4
+ data?: string[];
5
+ lead?: Lead;
6
+ board?: Board;
7
+ customer?: CustomerInfo;
8
+ interface?: Interface;
9
+ redirect?: Redirect;
10
+ post?: Redirect;
11
+ connect?: Redirect;
12
+ platforms?: string[];
13
+ }
14
+ interface Redirect {
15
+ url: string;
16
+ }
17
+ interface Interface {
18
+ user_experience?: 'popup' | 'page' | 'content';
19
+ locale?: 'dynamic' | 'ar' | 'en';
20
+ direction?: 'dynamic' | 'rtl' | 'ltr';
21
+ edges?: 'straight' | 'curved';
22
+ theme?: 'dynamic' | 'light' | 'dark';
23
+ powered?: boolean;
24
+ }
25
+ export interface CustomerInfo {
26
+ address: Address[];
27
+ identification: Identification;
28
+ nationality: string;
29
+ phone: Phone[];
30
+ name: Name;
31
+ birth: Birth;
32
+ email: Email[];
33
+ primary: boolean;
34
+ }
35
+ interface Email {
36
+ address: string;
37
+ type: string;
38
+ primary: boolean;
39
+ }
40
+ interface Birth {
41
+ country: string;
42
+ city: string;
43
+ date: string;
44
+ }
45
+ interface Name {
46
+ middle: string;
47
+ last: string;
48
+ lang: string;
49
+ title: string;
50
+ first: string;
51
+ }
52
+ interface Phone {
53
+ country_code: string;
54
+ number: string;
55
+ type: string;
56
+ primary: boolean;
57
+ }
58
+ interface Identification {
59
+ number: string;
60
+ type: string;
61
+ issuer: string;
62
+ }
63
+ interface Address {
64
+ area: string;
65
+ country: string;
66
+ line4: string;
67
+ city: string;
68
+ type: string;
69
+ building: string;
70
+ zip_code: string;
71
+ street: string;
72
+ avenue: string;
73
+ state: string;
74
+ line3: string;
75
+ postal_code: string;
76
+ line2: string;
77
+ line1: string;
78
+ apartment: string;
79
+ }
80
+ interface Board {
81
+ board?: boolean;
82
+ board_maturity?: boolean;
83
+ }
84
+ interface Lead {
85
+ id: string;
86
+ country: string;
87
+ maturity: boolean;
88
+ }
89
+ interface Operator {
90
+ public_key: string;
91
+ }
92
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -3,3 +3,4 @@ export * from './redux';
3
3
  export * from './app';
4
4
  export * from './form';
5
5
  export * from './user';
6
+ export * from './config';
@@ -3,3 +3,4 @@ export * from './redux';
3
3
  export * from './app';
4
4
  export * from './form';
5
5
  export * from './user';
6
+ export * from './config';
@@ -12,3 +12,7 @@ export declare enum DirectionMode {
12
12
  LTR = "ltr"
13
13
  }
14
14
  export declare type ThemContext = Partial<Theme> | ((outerTheme: Theme) => Theme);
15
+ export declare enum DialogEdgeFormat {
16
+ STRAIGHT = "staight",
17
+ CURVED = "curved"
18
+ }
@@ -13,3 +13,8 @@ export var DirectionMode;
13
13
  DirectionMode["RTL"] = "rtl";
14
14
  DirectionMode["LTR"] = "ltr";
15
15
  })(DirectionMode || (DirectionMode = {}));
16
+ export var DialogEdgeFormat;
17
+ (function (DialogEdgeFormat) {
18
+ DialogEdgeFormat["STRAIGHT"] = "staight";
19
+ DialogEdgeFormat["CURVED"] = "curved";
20
+ })(DialogEdgeFormat || (DialogEdgeFormat = {}));
@@ -1,12 +1,12 @@
1
1
  import { RootState } from './store';
2
- import { ActionState, LanguageMode, SharedState, ThemeMode, ScreenStepNavigation, DeviceInfo, LibConfig, CountryCode, MerchantInfo, ConfigExpressTokenParams, BusinessCountryInfo, LocalProps } from '../@types';
2
+ import { ActionState, LanguageMode, SharedState, ThemeMode, ScreenStepNavigation, DeviceInfo, LibConfig, CountryCode, MerchantInfo, BusinessCountryInfo, ConfigInfo, LocalProps } from '../@types';
3
3
  interface SettingParams {
4
4
  disableCountries?: boolean;
5
5
  disableLocale?: boolean;
6
6
  mdn: string;
7
7
  maturity?: 'full' | 'express';
8
8
  configToken?: string;
9
- onVerifyConfigTokenSuccess?: (data: ConfigExpressTokenParams) => Promise<void>;
9
+ onVerifyConfigTokenSuccess?: (data: ConfigInfo, countries: Array<CountryCode>) => Promise<void>;
10
10
  }
11
11
  export declare const fetchAppSettingsSync: import("@reduxjs/toolkit").AsyncThunk<any, SettingParams, {}>;
12
12
  export declare const onCloseComplete: import("@reduxjs/toolkit").AsyncThunk<void, {
@@ -47,15 +47,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
- import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, getParameterByName, setBaseUrl } from '../utils';
50
+ import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, getParameterByName, setBaseUrl, getUserLanguage, userTextDirection } from '../utils';
51
51
  import { BUSINESS_COUNTRIES, DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
52
52
  import i18n from '../i18n';
53
53
  import { updateLocale } from '../utils/locale';
54
54
  import API, { getAxiosHeaders, setAxiosGlobalHeaders } from '../api';
55
55
  export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
- var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, country_code, domain, language_1, country, scope, public_key, mature, board_maturity, post, platform_redirect_url, data, lead_id, platforms, deviceInfo, isValidOperator, countries, countryCode, businessCountry, ipCountry;
57
- return __generator(this, function (_f) {
58
- switch (_f.label) {
56
+ var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, country_code, countries, _f, operator_1, scope, data, lead, board, customer, interfaceData, redirect, post, platforms, _g, user_experience, locale_1, powered, edges, direction, deviceInfo, isValidOperator, countryCode, businessCountry, ipCountry;
57
+ var _h;
58
+ return __generator(this, function (_j) {
59
+ switch (_j.label) {
59
60
  case 0:
60
61
  settings = thunkApi.getState().settings;
61
62
  _a = settings.data, appConfig = _a.appConfig, language = _a.language;
@@ -63,10 +64,10 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
63
64
  disableLocale = params.disableLocale, maturity = params.maturity, disableCountries = params.disableCountries, configToken = params.configToken, onVerifyConfigTokenSuccess = params.onVerifyConfigTokenSuccess;
64
65
  return [4, Promise.all([getFingerPrint(), API.firebaseService.getLocale(disableLocale)])];
65
66
  case 1:
66
- _c = _f.sent(), visitorId = _c[0].visitorId, locale = _c[1];
67
+ _c = _j.sent(), visitorId = _c[0].visitorId, locale = _c[1];
67
68
  configInfo = appConfig;
68
69
  matureData = maturity;
69
- lang = getParameterByName('lang');
70
+ lang = getParameterByName('lang') || language;
70
71
  setAxiosGlobalHeaders({
71
72
  bi: visitorId || '',
72
73
  mdn: encryptString(params.mdn || window.location.origin),
@@ -77,32 +78,38 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
77
78
  } });
78
79
  return [4, API.initService.getInitialData(initPayload)];
79
80
  case 2:
80
- _d = _f.sent(), country_list = _d.country_list, ip_info = _d.ip_info, merchant = _d.merchant, operator = _d.operator, config = _d.config;
81
+ _d = _j.sent(), country_list = _d.country_list, ip_info = _d.ip_info, merchant = _d.merchant, operator = _d.operator, config = _d.config;
81
82
  list = (country_list || { list: [] }).list;
82
83
  _e = ip_info || {}, ip = _e.ip, latitude = _e.latitude, longitude = _e.longitude, country_code = _e.country_code;
84
+ countries = sortCountries(list);
83
85
  if (config) {
84
- domain = config.domain, language_1 = config.language, country = config.country, scope = config.scope, public_key = config.public_key, mature = config.maturity, board_maturity = config.board_maturity, post = config.post, platform_redirect_url = config.platform_redirect_url, data = config.data, lead_id = config.lead_id, platforms = config.platforms;
85
- configInfo = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), (domain && { merchantDomain: domain })), (language_1 && { language: language_1 })), (country && { businessCountryCode: country })), (scope && { scope: scope })), (public_key && { publicKey: public_key })), ((post === null || post === void 0 ? void 0 : post.url) && { postURL: post === null || post === void 0 ? void 0 : post.url })), (platform_redirect_url && { redirectUrl: platform_redirect_url })), (data && { data: data })), (lead_id && { leadId: lead_id })), (platforms && { platforms: platforms }));
86
- if (typeof mature === 'boolean')
87
- matureData = mature ? 'full' : 'express';
86
+ _f = config, operator_1 = _f.operator, scope = _f.scope, data = _f.data, lead = _f.lead, board = _f.board, customer = _f.customer, interfaceData = _f.interface, redirect = _f.redirect, post = _f.post, platforms = _f.platforms;
87
+ _g = interfaceData || {}, user_experience = _g.user_experience, locale_1 = _g.locale, powered = _g.powered, edges = _g.edges, direction = _g.direction;
88
+ if (locale_1)
89
+ lang = locale_1 === 'dynamic' ? getUserLanguage() : locale_1;
90
+ configInfo = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), ((lead === null || lead === void 0 ? void 0 : lead.country) && { businessCountryCode: lead.country })), ((lead === null || lead === void 0 ? void 0 : lead.id) && { leadId: lead.id })), (scope && { scope: scope.toLowerCase() })), ((operator_1 === null || operator_1 === void 0 ? void 0 : operator_1.public_key) && { publicKey: operator_1.public_key })), ((post === null || post === void 0 ? void 0 : post.url) && { postURL: post.url })), ((redirect === null || redirect === void 0 ? void 0 : redirect.url) && { redirectUrl: redirect.url })), (data && { data: data })), (user_experience && { mode: user_experience })), { showPoweredBy: powered }), (edges && { dialogEdgeFormat: edges })), (direction && { direction: (direction === 'dynamic' ? userTextDirection : direction) })), (customer && { customerInfo: customer })), (platforms && { platforms: platforms }));
91
+ if (typeof (lead === null || lead === void 0 ? void 0 : lead.maturity) === 'boolean') {
92
+ matureData = lead.maturity ? 'full' : 'express';
93
+ configInfo.showPoweredBy = matureData === 'express';
94
+ }
88
95
  thunkApi.dispatch(handleSetAppConfig(configInfo));
89
- thunkApi.dispatch(handleLanguage(language_1 || lang));
90
- if (public_key) {
96
+ thunkApi.dispatch(handleLanguage(lang));
97
+ if (configInfo.publicKey) {
91
98
  if (configToken) {
92
- setBaseUrl(public_key);
99
+ setBaseUrl(configInfo.publicKey);
93
100
  }
94
- thunkApi.dispatch(handlePublicKey(public_key));
101
+ thunkApi.dispatch(handlePublicKey(configInfo.publicKey));
95
102
  }
96
- if (typeof board_maturity === 'boolean')
97
- thunkApi.dispatch(handelBoardMaturity(board_maturity));
98
- onVerifyConfigTokenSuccess === null || onVerifyConfigTokenSuccess === void 0 ? void 0 : onVerifyConfigTokenSuccess(config);
103
+ if (typeof (board === null || board === void 0 ? void 0 : board.board_maturity) === 'boolean')
104
+ thunkApi.dispatch(handelBoardMaturity(board.board_maturity));
105
+ onVerifyConfigTokenSuccess === null || onVerifyConfigTokenSuccess === void 0 ? void 0 : onVerifyConfigTokenSuccess(config, countries);
99
106
  if (matureData === 'express' && maturity !== matureData && typeof configInfo.onMaturityChanged === 'function') {
100
107
  configInfo.onMaturityChanged(matureData);
101
108
  }
102
109
  }
103
110
  deviceInfo = {
104
111
  app: {
105
- language: configInfo.language || 'en',
112
+ language: language !== null && language !== void 0 ? language : (lang || 'en'),
106
113
  name: configInfo.appInfo.name,
107
114
  identifier: configInfo.appInfo.identifier || 'auth-connect',
108
115
  version: configInfo.appInfo.version || '2.0.0'
@@ -133,7 +140,6 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
133
140
  };
134
141
  setAxiosGlobalHeaders(__assign(__assign(__assign({}, getRequestHeaders(deviceInfo)), { authorization: encryptString(configInfo.publicKey), mdn: encryptString(params.mdn || window.location.origin), cu: window.location.href }), (matureData && { maturity: matureData })));
135
142
  isValidOperator = operator === 'valid';
136
- countries = sortCountries(list);
137
143
  countryCode = configInfo.businessCountryCode;
138
144
  businessCountry = undefined;
139
145
  ipCountry = undefined;
@@ -141,7 +147,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
141
147
  businessCountry = findCountryByIso2(countries, countryCode);
142
148
  if (country_code)
143
149
  ipCountry = findCountryByIso2(countries, country_code);
144
- return [2, __assign(__assign({ countries: countries, businessCountry: businessCountry, locale: locale, deviceInfo: deviceInfo, ipCountry: ipCountry, isValidOperator: isValidOperator, isMaturityExpress: matureData === 'express' }, (config && { boardMaturity: config.board_maturity })), (merchant && { merchant: merchant }))];
150
+ return [2, __assign(__assign({ countries: countries, businessCountry: businessCountry, locale: locale, deviceInfo: deviceInfo, ipCountry: ipCountry, isValidOperator: isValidOperator, isMaturityExpress: matureData === 'express' }, (config && { boardMaturity: (_h = config === null || config === void 0 ? void 0 : config.board) === null || _h === void 0 ? void 0 : _h.board_maturity })), (merchant && { merchant: merchant }))];
145
151
  }
146
152
  });
147
153
  }); });
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { MerchantInfo } from '../../@types';
2
+ import { DialogEdgeFormat, MerchantInfo } from '../../@types';
3
3
  export interface AnimationFlowProps {
4
4
  open: boolean;
5
5
  children: React.ReactNode;
@@ -21,5 +21,7 @@ export interface AnimationFlowProps {
21
21
  hideLoaderOverlay?: boolean;
22
22
  animationDirection?: 'left' | 'right' | 'up' | 'down';
23
23
  loaderColor?: string;
24
+ showPoweredBy?: boolean;
25
+ dialogEdgeFormat?: DialogEdgeFormat;
24
26
  }
25
- export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, hideFooter, hideMerchantLogo, hideLoaderOverlay, animationDirection, loaderColor }: AnimationFlowProps): JSX.Element;
27
+ export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, hideFooter, hideMerchantLogo, hideLoaderOverlay, animationDirection, loaderColor, showPoweredBy, dialogEdgeFormat }: AnimationFlowProps): JSX.Element;
@@ -24,7 +24,7 @@ var BoxStyled = styled(Box)(function () { return ({
24
24
  alignItems: 'center'
25
25
  }); });
26
26
  export default function AnimationFlow(_a) {
27
- var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId, animationType = _a.animationType, onClose = _a.onClose, onConfirm = _a.onConfirm, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo, hideFooter = _a.hideFooter, hideMerchantLogo = _a.hideMerchantLogo, hideLoaderOverlay = _a.hideLoaderOverlay, animationDirection = _a.animationDirection, loaderColor = _a.loaderColor;
27
+ var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId, animationType = _a.animationType, onClose = _a.onClose, onConfirm = _a.onConfirm, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo, hideFooter = _a.hideFooter, hideMerchantLogo = _a.hideMerchantLogo, hideLoaderOverlay = _a.hideLoaderOverlay, animationDirection = _a.animationDirection, loaderColor = _a.loaderColor, showPoweredBy = _a.showPoweredBy, dialogEdgeFormat = _a.dialogEdgeFormat;
28
28
  var small = useScreen(breakpoint).small;
29
29
  if (loading) {
30
30
  return _jsx(Loader, { color: loaderColor, hideLoaderOverlay: type === 'CONTENT' ? true : hideLoaderOverlay });
@@ -36,10 +36,10 @@ export default function AnimationFlow(_a) {
36
36
  return (_jsx(Fade, __assign({ in: true }, { children: _jsx(BoxStyled, { children: children }) })));
37
37
  }
38
38
  if (type === 'PUPOP') {
39
- return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, animationDirection: animationDirection }, { children: children })));
39
+ return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, animationDirection: animationDirection, showPoweredBy: showPoweredBy, dialogEdgeFormat: dialogEdgeFormat }, { children: children })));
40
40
  }
41
41
  if (type === 'BOTTOMSHEET') {
42
- return (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo }, { children: children })));
42
+ return (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, showPoweredBy: showPoweredBy }, { children: children })));
43
43
  }
44
- return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, animationDirection: animationDirection }, { children: children })));
44
+ return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, showPoweredBy: showPoweredBy }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, animationDirection: animationDirection, showPoweredBy: showPoweredBy, dialogEdgeFormat: dialogEdgeFormat }, { children: children })));
45
45
  }
@@ -11,6 +11,7 @@ export interface BottomSheetProps extends MainBottomSheetProps {
11
11
  merchantInfo?: MerchantInfo;
12
12
  hideFooter?: boolean;
13
13
  hideMerchantLogo?: boolean;
14
+ showPoweredBy?: boolean;
14
15
  }
15
- declare const _default: React.MemoExoticComponent<({ open, children, screenId, pointerEvents, isMaturityExpress, merchantInfo, hideFooter, hideMerchantLogo, ...rest }: BottomSheetProps) => JSX.Element>;
16
+ declare const _default: React.MemoExoticComponent<({ open, children, screenId, pointerEvents, isMaturityExpress, merchantInfo, hideFooter, hideMerchantLogo, showPoweredBy, ...rest }: BottomSheetProps) => JSX.Element>;
16
17
  export default _default;
@@ -75,7 +75,7 @@ var FooterStyled = styled(Box)(function (_a) {
75
75
  return (__assign(__assign({ bottom: theme.spacing(-5.625), position: 'fixed', height: theme.spacing(5.625), display: 'flex' }, theme.typography.caption), { justifyContent: 'center', alignItems: 'center', width: '100vw', background: '#E6E7E9', borderTop: '1px solid rgba(156, 160, 169, 0.3)' }));
76
76
  });
77
77
  var BottomSheetComponent = function (_a) {
78
- var open = _a.open, children = _a.children, screenId = _a.screenId, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, isMaturityExpress = _a.isMaturityExpress, merchantInfo = _a.merchantInfo, hideFooter = _a.hideFooter, hideMerchantLogo = _a.hideMerchantLogo, rest = __rest(_a, ["open", "children", "screenId", "pointerEvents", "isMaturityExpress", "merchantInfo", "hideFooter", "hideMerchantLogo"]);
78
+ var open = _a.open, children = _a.children, screenId = _a.screenId, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, isMaturityExpress = _a.isMaturityExpress, merchantInfo = _a.merchantInfo, hideFooter = _a.hideFooter, hideMerchantLogo = _a.hideMerchantLogo, showPoweredBy = _a.showPoweredBy, rest = __rest(_a, ["open", "children", "screenId", "pointerEvents", "isMaturityExpress", "merchantInfo", "hideFooter", "hideMerchantLogo", "showPoweredBy"]);
79
79
  var sheetRef = React.useRef(null);
80
80
  var isAr = useLanguage().isAr;
81
81
  var logo = (merchantInfo || {}).logo;
@@ -105,6 +105,6 @@ var BottomSheetComponent = function (_a) {
105
105
  return (_jsxs(BottomSheetStyled, __assign({ languageBarHeight: getLanguageBarHeight(), sibling: hideFooter ? (_jsx(_Fragment, {})) : (_jsx(LanguageFooterStyled, { children: _jsx(CustomFooter, {}) })), isMaturityExpress: isMaturityExpress, sx: { pointerEvents: pointerEvents }, ref: sheetRef, open: open, snapPoints: function (_a) {
106
106
  var maxHeight = _a.maxHeight;
107
107
  return [getMinHeight(maxHeight), maxHeight * 0.95];
108
- } }, rest, { children: [isMaturityExpress && !hideMerchantLogo && (_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON })), children, isMaturityExpress && (_jsx(FooterStyled, { children: _jsx(PoweredByFooter, { id: 'bottom-sheet-powered_by_footer', sx: { margin: '0px' }, textSx: { color: 'rgba(63, 66, 77, 0.6)' }, icon: isAr ? ICONS_NAMES.LOGO_WITH_NAME_DARK_AR_ICON : ICONS_NAMES.LOGO_WITH_NAME_DARK_EN_ICON }) }))] })));
108
+ } }, rest, { children: [isMaturityExpress && !hideMerchantLogo && (_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON })), children, showPoweredBy && (_jsx(FooterStyled, { children: _jsx(PoweredByFooter, { id: 'bottom-sheet-powered_by_footer', sx: { margin: '0px' }, textSx: { color: 'rgba(63, 66, 77, 0.6)' }, icon: isAr ? ICONS_NAMES.LOGO_WITH_NAME_DARK_AR_ICON : ICONS_NAMES.LOGO_WITH_NAME_DARK_EN_ICON }) }))] })));
109
109
  };
110
110
  export default React.memo(BottomSheetComponent);
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DialogProps as MUIDialogProps } from '@mui/material/Dialog';
3
3
  import { SxProps, Theme } from '@mui/material/styles';
4
- import { MerchantInfo } from '../../@types';
4
+ import { DialogEdgeFormat, MerchantInfo } from '../../@types';
5
5
  export interface DialogProps extends MUIDialogProps {
6
6
  open: boolean;
7
7
  isTapOrigin?: boolean;
@@ -19,6 +19,8 @@ export interface DialogProps extends MUIDialogProps {
19
19
  animationDirection?: 'left' | 'right' | 'up' | 'down';
20
20
  showAsContent?: boolean;
21
21
  sx?: SxProps<Theme>;
22
+ showPoweredBy?: boolean;
23
+ dialogEdgeFormat?: DialogEdgeFormat;
22
24
  }
23
- declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, hideFooter, hideMerchantLogo, animationDirection, sx, ...rest }: DialogProps) => JSX.Element>;
25
+ declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, hideFooter, hideMerchantLogo, animationDirection, sx, showPoweredBy, dialogEdgeFormat, ...rest }: DialogProps) => JSX.Element>;
24
26
  export default _default;
@@ -26,9 +26,10 @@ import MuiDialog from '@mui/material/Dialog';
26
26
  import DialogContent from '@mui/material/DialogContent';
27
27
  import Paper from '@mui/material/Paper';
28
28
  import Box from '@mui/material/Box';
29
- import { styled } from '@mui/material/styles';
29
+ import { styled, useTheme } from '@mui/material/styles';
30
30
  import { DIALOG_ID, ICONS_NAMES } from '../../constants';
31
31
  import { useLanguage } from '../../hooks';
32
+ import { DialogEdgeFormat } from '../../@types';
32
33
  import DialogContainer from '../../features/shared/Dialog';
33
34
  import { CustomFooter, PoweredByFooter } from '../../features/shared/Footer';
34
35
  import Slide from '../Slide';
@@ -104,8 +105,9 @@ var LanguageFooterStyled = styled(Box, { shouldForwardProp: function (prop) { re
104
105
  });
105
106
  });
106
107
  var Dialog = function (_a) {
107
- var open = _a.open, children = _a.children, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, _b = _a.animationType, animationType = _b === void 0 ? 'slide' : _b, onClose = _a.onClose, onConfirm = _a.onConfirm, _c = _a.pointerEvents, pointerEvents = _c === void 0 ? 'auto' : _c, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo, hideFooter = _a.hideFooter, hideMerchantLogo = _a.hideMerchantLogo, _d = _a.animationDirection, animationDirection = _d === void 0 ? 'up' : _d, sx = _a.sx, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress", "showTextLogo", "hideFooter", "hideMerchantLogo", "animationDirection", "sx"]);
108
+ var open = _a.open, children = _a.children, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, _b = _a.animationType, animationType = _b === void 0 ? 'slide' : _b, onClose = _a.onClose, onConfirm = _a.onConfirm, _c = _a.pointerEvents, pointerEvents = _c === void 0 ? 'auto' : _c, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo, hideFooter = _a.hideFooter, hideMerchantLogo = _a.hideMerchantLogo, _d = _a.animationDirection, animationDirection = _d === void 0 ? 'up' : _d, sx = _a.sx, showPoweredBy = _a.showPoweredBy, dialogEdgeFormat = _a.dialogEdgeFormat, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress", "showTextLogo", "hideFooter", "hideMerchantLogo", "animationDirection", "sx", "showPoweredBy", "dialogEdgeFormat"]);
108
109
  var isAr = useLanguage().isAr;
110
+ var theme = useTheme();
109
111
  var animation = {};
110
112
  if (animationType === 'slide') {
111
113
  Object.assign(animation, { TransitionComponent: Transition });
@@ -121,10 +123,8 @@ var Dialog = function (_a) {
121
123
  }, []);
122
124
  return (_jsxs(MuiDialog, __assign({ id: DIALOG_ID, PaperProps: {
123
125
  elevation: 0
124
- }, sx: __assign({ '& .MuiDialog-paper': {
125
- overflowY: 'visible'
126
- }, '&.MuiDialog-root': {
126
+ }, sx: __assign({ '& .MuiDialog-paper': __assign({ overflowY: 'visible' }, (dialogEdgeFormat === DialogEdgeFormat.STRAIGHT && { borderRadius: theme.spacing(0) })), '&.MuiDialog-root': {
127
127
  marginBottom: isMaturityExpress ? '60px' : '0px'
128
- }, pointerEvents: pointerEvents }, sx), hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, (animationDirection && { TransitionProps: { direction: animationDirection } }), { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [!hideMerchantLogo && _jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON }), !isMaturityExpress && showTextLogo && (_jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }))] })), children] })) })), isMaturityExpress ? _jsx(PoweredByFooter, {}) : !hideFooter && _jsx(CustomFooter, {}), !hideFooter && (_jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) })))] })));
128
+ }, pointerEvents: pointerEvents }, sx), hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, (animationDirection && { TransitionProps: { direction: animationDirection } }), { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [!hideMerchantLogo && _jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON }), !isMaturityExpress && showTextLogo && (_jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }))] })), children] })) })), showPoweredBy ? _jsx(PoweredByFooter, {}) : !hideFooter && _jsx(CustomFooter, {}), !hideFooter && (_jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) })))] })));
129
129
  };
130
130
  export default React.memo(Dialog);
@@ -1,5 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActionState, AuthForType, AuthMerchantFormValues, AuthenticationListFormValues, CivilFormValues, CountryCode, FlowsTypes, MobileFormValues, NIDFormValues, OTPFormValues, SharedState } from '../../../@types';
2
+ import { ActionState, AuthForType, AuthMerchantFormValues, AuthenticationListFormValues, CivilFormValues, CountryCode, CustomerInfo, FlowsTypes, MobileFormValues, NIDFormValues, OTPFormValues, SharedState } from '../../../@types';
3
3
  export declare const updateBusinessCountry: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
4
4
  export declare const retrieveLeadIdentityByIdAsync: import("@reduxjs/toolkit").AsyncThunk<{
5
5
  data: any;
@@ -75,8 +75,15 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
75
75
  resetStore: (state: AuthState) => void;
76
76
  resetOTPValue: (state: AuthState) => void;
77
77
  resetAuthenticationScreen: (state: AuthState) => void;
78
+ storeCustomerInfo: (state: AuthState, action: ActionState<{
79
+ customer: CustomerInfo;
80
+ countries: Array<CountryCode>;
81
+ }>) => void;
78
82
  }, "auth/store">;
79
- export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setMobileCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetAuthenticationScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
83
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setMobileCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetAuthenticationScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeCustomerInfo: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
84
+ customer: CustomerInfo;
85
+ countries: Array<CountryCode>;
86
+ }, string>;
80
87
  declare const _default: import("redux").Reducer<AuthState, import("redux").AnyAction>;
81
88
  export default _default;
82
89
  export declare const authSelector: (state: RootState) => AuthState;
@@ -546,15 +546,15 @@ export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thun
546
546
  });
547
547
  });
548
548
  export var onSignUp = createAsyncThunk('auth/onSignUp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
549
- var _a, auth, settings, authResponse, _b, appConfig, businessCountry, isMaturityExpress, publicKey, boardMaturity, merchantDomain, language, scope, postURL, body, data, redirectUrl;
549
+ var _a, auth, settings, authResponse, _b, appConfig, businessCountry, isMaturityExpress, language, publicKey, boardMaturity, merchantDomain, scope, postURL, body, data, redirectUrl;
550
550
  var _c, _d, _e, _f;
551
551
  return __generator(this, function (_g) {
552
552
  switch (_g.label) {
553
553
  case 0:
554
554
  _a = thunkApi.getState(), auth = _a.auth, settings = _a.settings;
555
555
  authResponse = ((_c = auth.data.responseData) !== null && _c !== void 0 ? _c : {}).authResponse;
556
- _b = settings.data, appConfig = _b.appConfig, businessCountry = _b.businessCountry, isMaturityExpress = _b.isMaturityExpress;
557
- publicKey = appConfig.publicKey, boardMaturity = appConfig.boardMaturity, merchantDomain = appConfig.merchantDomain, language = appConfig.language, scope = appConfig.scope, postURL = appConfig.postURL;
556
+ _b = settings.data, appConfig = _b.appConfig, businessCountry = _b.businessCountry, isMaturityExpress = _b.isMaturityExpress, language = _b.language;
557
+ publicKey = appConfig.publicKey, boardMaturity = appConfig.boardMaturity, merchantDomain = appConfig.merchantDomain, scope = appConfig.scope, postURL = appConfig.postURL;
558
558
  body = __assign({ board: true, public_key: publicKey, board_maturity: boardMaturity, domain: merchantDomain, language: language, country: businessCountry.iso2, scope: scope, lead_id: authResponse === null || authResponse === void 0 ? void 0 : authResponse.lead_id, maturity: !isMaturityExpress }, (postURL && {
559
559
  post: {
560
560
  url: postURL
@@ -629,6 +629,25 @@ export var authSlice = createSlice({
629
629
  },
630
630
  resetAuthenticationScreen: function (state) {
631
631
  state.data.authenticationData = __assign(__assign({}, state.data.authenticationData), initialState.data.authenticationData);
632
+ },
633
+ storeCustomerInfo: function (state, action) {
634
+ var _a;
635
+ var _b = action.payload, customer = _b.customer, countries = _b.countries;
636
+ var address = customer.address, identification = customer.identification, nationality = customer.nationality, phone = customer.phone, name = customer.name, birth = customer.birth, email = customer.email, primary = customer.primary;
637
+ var _c = identification || {}, number = _c.number, type = _c.type;
638
+ var _d = (phone || [])[0], mobile = _d.number, country_code = _d.country_code;
639
+ var countryInfo = (_a = findCountryByIddPrefix(countries, country_code)) !== null && _a !== void 0 ? _a : defaultCountry;
640
+ state.data.nidData = {
641
+ nid: number,
642
+ dob: birth === null || birth === void 0 ? void 0 : birth.date
643
+ };
644
+ state.data.civilIdData = {
645
+ civilId: number
646
+ };
647
+ state.data.mobileData = {
648
+ mobile: mobile,
649
+ countryCode: countryInfo
650
+ };
632
651
  }
633
652
  },
634
653
  extraReducers: function (builder) {
@@ -861,6 +880,6 @@ export var authSlice = createSlice({
861
880
  });
862
881
  }
863
882
  });
864
- export var clearError = (_a = authSlice.actions, _a.clearError), resetStore = _a.resetStore, setMobileCountryCode = _a.setMobileCountryCode, setLeadId = _a.setLeadId, resetOTPValue = _a.resetOTPValue, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen;
883
+ export var clearError = (_a = authSlice.actions, _a.clearError), resetStore = _a.resetStore, setMobileCountryCode = _a.setMobileCountryCode, setLeadId = _a.setLeadId, resetOTPValue = _a.resetOTPValue, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen, storeCustomerInfo = _a.storeCustomerInfo;
865
884
  export default authSlice.reducer;
866
885
  export var authSelector = function (state) { return state.auth; };
@@ -1,5 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActionState, AuthForType, CivilFormValues, CountryCode, FlowsTypes, IndividualFormValues, MobileFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, BrandFormValues, BrandSegmentFormValues } from '../../../@types';
2
+ import { ActionState, AuthForType, CivilFormValues, CountryCode, FlowsTypes, IndividualFormValues, MobileFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, BrandFormValues, BrandSegmentFormValues, CustomerInfo } from '../../../@types';
3
3
  import { CancelToken } from 'axios';
4
4
  export declare const updateBusinessCountry: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
5
5
  export declare const createMobileAuth: import("@reduxjs/toolkit").AsyncThunk<{
@@ -103,6 +103,10 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState
103
103
  storeLeadId: (state: ConnectState, action: ActionState<string>) => void;
104
104
  storeIsStartFromBusinessCountry: (state: ConnectState, action: ActionState<boolean>) => void;
105
105
  stopLoader: (state: ConnectState) => void;
106
+ storeCustomerInfo: (state: ConnectState, action: ActionState<{
107
+ customer: CustomerInfo;
108
+ countries: Array<CountryCode>;
109
+ }>) => void;
106
110
  resetMobileScreen: (state: ConnectState, action: ActionState<CountryCode>) => void;
107
111
  resetNIDScreen: (state: ConnectState) => void;
108
112
  resetCivilScreen: (state: ConnectState) => void;
@@ -112,7 +116,10 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState
112
116
  setDefaultCountryCode: (state: ConnectState, action: ActionState<CountryCode>) => void;
113
117
  resetStore: (state: ConnectState) => void;
114
118
  }, "connect/store">;
115
- export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
119
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, storeCustomerInfo: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
120
+ customer: CustomerInfo;
121
+ countries: Array<CountryCode>;
122
+ }, string>;
116
123
  declare const _default: import("redux").Reducer<ConnectState, import("redux").AnyAction>;
117
124
  export default _default;
118
125
  export declare const connectSelector: (state: RootState) => ConnectState;
@@ -741,6 +741,35 @@ export var connectSlice = createSlice({
741
741
  stopLoader: function (state) {
742
742
  state.loading = false;
743
743
  },
744
+ storeCustomerInfo: function (state, action) {
745
+ var _a, _b, _c;
746
+ var _d = action.payload, customer = _d.customer, countries = _d.countries;
747
+ var address = customer.address, identification = customer.identification, nationality = customer.nationality, phone = customer.phone, name = customer.name, birth = customer.birth, email = customer.email, primary = customer.primary;
748
+ var _e = identification || {}, number = _e.number, type = _e.type;
749
+ var _f = (phone || [])[0], mobile = _f.number, country_code = _f.country_code;
750
+ var countryInfo = (_a = findCountryByIddPrefix(countries, country_code)) !== null && _a !== void 0 ? _a : defaultCountry;
751
+ state.data.nidData = {
752
+ nid: number,
753
+ type: type,
754
+ dob: birth === null || birth === void 0 ? void 0 : birth.date
755
+ };
756
+ state.data.civilIdData = {
757
+ civilId: number
758
+ };
759
+ state.data.mobileData = {
760
+ mobile: mobile,
761
+ countryCode: countryInfo
762
+ };
763
+ var data = state.data.individualData;
764
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
765
+ if (!!fullName) {
766
+ var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
767
+ data.name = capitalizedName;
768
+ }
769
+ if ((_b = email === null || email === void 0 ? void 0 : email[0]) === null || _b === void 0 ? void 0 : _b.address)
770
+ data.email = (_c = email === null || email === void 0 ? void 0 : email[0]) === null || _c === void 0 ? void 0 : _c.address;
771
+ state.data.individualData = __assign(__assign({}, data), { mobile: mobile, countryCode: countryInfo });
772
+ },
744
773
  resetMobileScreen: function (state, action) {
745
774
  state.data.mobileData = __assign(__assign(__assign({}, state.data.mobileData), initialState.data.mobileData), { countryCode: action.payload });
746
775
  },
@@ -1092,6 +1121,6 @@ export var connectSlice = createSlice({
1092
1121
  });
1093
1122
  }
1094
1123
  });
1095
- export var clearError = (_a = connectSlice.actions, _a.clearError), storeLeadId = _a.storeLeadId, stopLoader = _a.stopLoader, resetMobileScreen = _a.resetMobileScreen, resetOTPScreen = _a.resetOTPScreen, resetIndividualScreen = _a.resetIndividualScreen, resetMerchantScreen = _a.resetMerchantScreen, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry;
1124
+ export var clearError = (_a = connectSlice.actions, _a.clearError), storeLeadId = _a.storeLeadId, stopLoader = _a.stopLoader, resetMobileScreen = _a.resetMobileScreen, resetOTPScreen = _a.resetOTPScreen, resetIndividualScreen = _a.resetIndividualScreen, resetMerchantScreen = _a.resetMerchantScreen, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, storeCustomerInfo = _a.storeCustomerInfo;
1096
1125
  export default connectSlice.reducer;
1097
1126
  export var connectSelector = function (state) { return state.connect; };