@tap-payments/auth-jsconnect 2.4.16 → 2.4.17
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.
- package/build/@types/app.d.ts +4 -10
- package/build/@types/config.d.ts +35 -0
- package/build/@types/config.js +1 -0
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/theme.d.ts +4 -0
- package/build/@types/theme.js +5 -0
- package/build/api/account.d.ts +2 -0
- package/build/api/account.js +1 -1
- package/build/api/entity.d.ts +2 -0
- package/build/app/settings.d.ts +2 -2
- package/build/app/settings.js +22 -20
- package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -3
- package/build/components/AnimationFlow/AnimationFlow.js +4 -4
- package/build/components/AnimationFlow/BottomSheet.d.ts +5 -2
- package/build/components/AnimationFlow/BottomSheet.js +7 -6
- package/build/components/AnimationFlow/Dialog.d.ts +9 -2
- package/build/components/AnimationFlow/Dialog.js +6 -6
- package/build/features/app/connectExpress/connectExpressStore.d.ts +4 -0
- package/build/features/app/connectExpress/connectExpressStore.js +73 -51
- package/build/features/bank/Bank.js +1 -1
- package/build/features/board/Board.js +2 -2
- package/build/features/brand/Brand.js +1 -1
- package/build/features/business/Business.js +1 -1
- package/build/features/connect/Connect.js +6 -6
- package/build/features/connectExpress/ConnectExpress.js +8 -8
- package/build/features/connectExpress/screens/AccountAlreadyCreated/AccountAlreadyCreated.js +14 -2
- package/build/features/entity/Entity.js +1 -1
- package/build/features/individual/Individual.js +1 -1
- package/build/features/password/Password.js +1 -1
- package/build/features/signIn/SignIn.js +1 -1
- package/build/features/tax/Tax.js +1 -1
- package/build/hooks/useAppConfig.d.ts +3 -3
- package/build/hooks/useAppConfig.js +2 -2
- package/build/utils/device.d.ts +2 -0
- package/build/utils/device.js +6 -0
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { PaymentProvider } from './config';
|
|
3
|
+
import { LanguageMode, DialogEdgeFormat } from './theme';
|
|
3
4
|
export interface CountryCode {
|
|
4
5
|
created: number;
|
|
5
6
|
updated: number;
|
|
@@ -217,6 +218,8 @@ export interface LibConfig extends LibCallbacks {
|
|
|
217
218
|
businessCountryCode?: string;
|
|
218
219
|
scope: string;
|
|
219
220
|
platforms?: Array<string>;
|
|
221
|
+
dialogEdgeFormat?: DialogEdgeFormat;
|
|
222
|
+
paymentProvider?: PaymentProvider;
|
|
220
223
|
postURL?: string;
|
|
221
224
|
redirectUrl?: string;
|
|
222
225
|
data?: Array<string>;
|
|
@@ -646,15 +649,6 @@ export type VerifyExpressTokenParams = {
|
|
|
646
649
|
};
|
|
647
650
|
lead_id: string;
|
|
648
651
|
};
|
|
649
|
-
export type ConfigExpressTokenParams = {
|
|
650
|
-
post: {
|
|
651
|
-
url: string;
|
|
652
|
-
};
|
|
653
|
-
lead_id: string;
|
|
654
|
-
board: boolean;
|
|
655
|
-
platform_redirect_url: string;
|
|
656
|
-
data: Array<string>;
|
|
657
|
-
};
|
|
658
652
|
export declare enum MerchantStatus {
|
|
659
653
|
DISABLED = "disabled",
|
|
660
654
|
ENABLED = "enabled"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface ConfigInfo {
|
|
2
|
+
operator: Operator;
|
|
3
|
+
scope: string;
|
|
4
|
+
data?: string[];
|
|
5
|
+
lead?: Lead;
|
|
6
|
+
board?: Board;
|
|
7
|
+
interface?: Interface;
|
|
8
|
+
redirect?: Redirect;
|
|
9
|
+
post?: Redirect;
|
|
10
|
+
connect?: Redirect;
|
|
11
|
+
platforms?: string[];
|
|
12
|
+
payment_provider?: PaymentProvider;
|
|
13
|
+
}
|
|
14
|
+
export interface PaymentProvider {
|
|
15
|
+
technology_id: string;
|
|
16
|
+
settlement_by: string;
|
|
17
|
+
}
|
|
18
|
+
interface Redirect {
|
|
19
|
+
url: string;
|
|
20
|
+
}
|
|
21
|
+
interface Interface {
|
|
22
|
+
locale?: 'dynamic' | 'ar' | 'en';
|
|
23
|
+
edges?: 'straight' | 'curved';
|
|
24
|
+
}
|
|
25
|
+
interface Board {
|
|
26
|
+
display?: boolean;
|
|
27
|
+
editable?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface Lead {
|
|
30
|
+
id: string;
|
|
31
|
+
}
|
|
32
|
+
interface Operator {
|
|
33
|
+
public_key: string;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/@types/index.d.ts
CHANGED
package/build/@types/index.js
CHANGED
package/build/@types/theme.d.ts
CHANGED
package/build/@types/theme.js
CHANGED
|
@@ -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"] = "straight";
|
|
19
|
+
DialogEdgeFormat["CURVED"] = "curved";
|
|
20
|
+
})(DialogEdgeFormat || (DialogEdgeFormat = {}));
|
package/build/api/account.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaymentProvider } from '../@types';
|
|
1
2
|
export type CreateAccountBody = {
|
|
2
3
|
lead_id: string;
|
|
3
4
|
notify: {
|
|
@@ -12,6 +13,7 @@ export type ExpressCreateAccountBody = {
|
|
|
12
13
|
post_url: string;
|
|
13
14
|
lead_id: string;
|
|
14
15
|
platforms?: string[];
|
|
16
|
+
payment_provider?: PaymentProvider;
|
|
15
17
|
};
|
|
16
18
|
declare const accountService: {
|
|
17
19
|
createAccount: (data: CreateAccountBody) => Promise<any>;
|
package/build/api/account.js
CHANGED
package/build/api/entity.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { PaymentProvider } from '../@types';
|
|
2
3
|
export type EntityInfoBody = {
|
|
3
4
|
id: string;
|
|
4
5
|
lead_id?: string;
|
|
@@ -119,6 +120,7 @@ export type MerchantListBody = {
|
|
|
119
120
|
brand_id: string;
|
|
120
121
|
create_if_not_present: boolean;
|
|
121
122
|
platforms?: Array<string>;
|
|
123
|
+
payment_provider?: PaymentProvider;
|
|
122
124
|
};
|
|
123
125
|
export type CreateEntityBody = {
|
|
124
126
|
business_id: string;
|
package/build/app/settings.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { RootState } from './store';
|
|
2
|
-
import { ActionState, LanguageMode, SharedState, ThemeMode, ScreenStepNavigation, DeviceInfo, LibConfig, CountryCode, MerchantInfo,
|
|
2
|
+
import { ActionState, LanguageMode, SharedState, ThemeMode, ScreenStepNavigation, DeviceInfo, LibConfig, CountryCode, MerchantInfo, BusinessCountryInfo, ConfigInfo } 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:
|
|
9
|
+
onVerifyConfigTokenSuccess?: (data: ConfigInfo) => Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
export declare const fetchAppSettingsSync: import("@reduxjs/toolkit").AsyncThunk<any, SettingParams, {
|
|
12
12
|
state?: unknown;
|
package/build/app/settings.js
CHANGED
|
@@ -47,15 +47,15 @@ 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 } 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,
|
|
57
|
-
return __generator(this, function (
|
|
58
|
-
switch (
|
|
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, interfaceData, redirect, post, platforms, payment_provider, _g, locale_1, edges, deviceInfo, isValidOperator, countryCode, businessCountry, ipCountry;
|
|
57
|
+
return __generator(this, function (_h) {
|
|
58
|
+
switch (_h.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
settings = thunkApi.getState().settings;
|
|
61
61
|
_a = settings.data, appConfig = _a.appConfig, language = _a.language;
|
|
@@ -63,10 +63,10 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
63
63
|
disableLocale = params.disableLocale, maturity = params.maturity, disableCountries = params.disableCountries, configToken = params.configToken, onVerifyConfigTokenSuccess = params.onVerifyConfigTokenSuccess;
|
|
64
64
|
return [4, Promise.all([getFingerPrint(), API.firebaseService.getLocale(disableLocale)])];
|
|
65
65
|
case 1:
|
|
66
|
-
_c =
|
|
66
|
+
_c = _h.sent(), visitorId = _c[0].visitorId, locale = _c[1];
|
|
67
67
|
configInfo = appConfig;
|
|
68
68
|
matureData = maturity;
|
|
69
|
-
lang = getParameterByName('lang');
|
|
69
|
+
lang = getParameterByName('lang') || language;
|
|
70
70
|
setAxiosGlobalHeaders({
|
|
71
71
|
bi: visitorId || '',
|
|
72
72
|
mdn: encryptString(params.mdn || window.location.origin),
|
|
@@ -77,24 +77,27 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
77
77
|
} });
|
|
78
78
|
return [4, API.initService.getInitialData(initPayload)];
|
|
79
79
|
case 2:
|
|
80
|
-
_d =
|
|
80
|
+
_d = _h.sent(), country_list = _d.country_list, ip_info = _d.ip_info, merchant = _d.merchant, operator = _d.operator, config = _d.config;
|
|
81
81
|
list = (country_list || { list: [] }).list;
|
|
82
82
|
_e = ip_info || {}, ip = _e.ip, latitude = _e.latitude, longitude = _e.longitude, country_code = _e.country_code;
|
|
83
|
+
countries = sortCountries(list);
|
|
83
84
|
if (config) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
_f = config, operator_1 = _f.operator, scope = _f.scope, data = _f.data, lead = _f.lead, board = _f.board, interfaceData = _f.interface, redirect = _f.redirect, post = _f.post, platforms = _f.platforms, payment_provider = _f.payment_provider;
|
|
86
|
+
_g = interfaceData || {}, locale_1 = _g.locale, edges = _g.edges;
|
|
87
|
+
if (locale_1)
|
|
88
|
+
lang = locale_1 === 'dynamic' ? getUserLanguage() : locale_1;
|
|
89
|
+
configInfo = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), ((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 })), (edges && { dialogEdgeFormat: edges })), (platforms && { platforms: platforms })), (payment_provider && { payment_provider: payment_provider }));
|
|
90
|
+
matureData = 'express';
|
|
88
91
|
thunkApi.dispatch(handleSetAppConfig(configInfo));
|
|
89
|
-
thunkApi.dispatch(handleLanguage(
|
|
90
|
-
if (
|
|
92
|
+
thunkApi.dispatch(handleLanguage(lang));
|
|
93
|
+
if (configInfo.publicKey) {
|
|
91
94
|
if (configToken) {
|
|
92
|
-
setBaseUrl(
|
|
95
|
+
setBaseUrl(configInfo.publicKey);
|
|
93
96
|
}
|
|
94
|
-
thunkApi.dispatch(handlePublicKey(
|
|
97
|
+
thunkApi.dispatch(handlePublicKey(configInfo.publicKey));
|
|
95
98
|
}
|
|
96
|
-
if (typeof
|
|
97
|
-
thunkApi.dispatch(handelBoardMaturity(
|
|
99
|
+
if (typeof (board === null || board === void 0 ? void 0 : board.editable) === 'boolean')
|
|
100
|
+
thunkApi.dispatch(handelBoardMaturity(board.editable));
|
|
98
101
|
onVerifyConfigTokenSuccess === null || onVerifyConfigTokenSuccess === void 0 ? void 0 : onVerifyConfigTokenSuccess(config);
|
|
99
102
|
if (matureData === 'express' && maturity !== matureData && typeof configInfo.onMaturityChanged === 'function') {
|
|
100
103
|
configInfo.onMaturityChanged(matureData);
|
|
@@ -102,7 +105,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
102
105
|
}
|
|
103
106
|
deviceInfo = {
|
|
104
107
|
app: {
|
|
105
|
-
language:
|
|
108
|
+
language: language !== null && language !== void 0 ? language : (lang || 'en'),
|
|
106
109
|
name: configInfo.appInfo.name,
|
|
107
110
|
identifier: configInfo.appInfo.identifier || 'auth-connect',
|
|
108
111
|
version: configInfo.appInfo.version || '2.0.0'
|
|
@@ -133,7 +136,6 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
133
136
|
};
|
|
134
137
|
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
138
|
isValidOperator = operator === 'valid';
|
|
136
|
-
countries = sortCountries(list);
|
|
137
139
|
countryCode = configInfo.businessCountryCode;
|
|
138
140
|
businessCountry = undefined;
|
|
139
141
|
ipCountry = undefined;
|
|
@@ -141,7 +143,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
141
143
|
businessCountry = findCountryByIso2(countries, countryCode);
|
|
142
144
|
if (country_code)
|
|
143
145
|
ipCountry = findCountryByIso2(countries, country_code);
|
|
144
|
-
return [2, __assign(
|
|
146
|
+
return [2, __assign({ countries: countries, businessCountry: businessCountry, locale: locale, deviceInfo: deviceInfo, ipCountry: ipCountry, isValidOperator: isValidOperator, isMaturityExpress: matureData === 'express' }, (merchant && { merchant: merchant }))];
|
|
145
147
|
}
|
|
146
148
|
});
|
|
147
149
|
}); });
|
|
@@ -1,10 +1,10 @@
|
|
|
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;
|
|
6
6
|
isTapOrigin?: boolean;
|
|
7
|
-
type?: 'PUPOP' | 'BOTTOMSHEET';
|
|
7
|
+
type?: 'PUPOP' | 'BOTTOMSHEET' | 'CONTENT';
|
|
8
8
|
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
error?: string | null;
|
|
@@ -16,5 +16,11 @@ export interface AnimationFlowProps {
|
|
|
16
16
|
merchantInfo?: MerchantInfo;
|
|
17
17
|
isMaturityExpress?: boolean;
|
|
18
18
|
showTextLogo?: boolean;
|
|
19
|
+
hideFooter?: boolean;
|
|
20
|
+
hideMerchantLogo?: boolean;
|
|
21
|
+
hideLoaderOverlay?: boolean;
|
|
22
|
+
animationDirection?: 'left' | 'right' | 'up' | 'down';
|
|
23
|
+
loaderColor?: string;
|
|
24
|
+
dialogEdgeFormat?: DialogEdgeFormat;
|
|
19
25
|
}
|
|
20
|
-
export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo }: AnimationFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, hideFooter, hideMerchantLogo, animationDirection, dialogEdgeFormat }: AnimationFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ import BottomSheet from './BottomSheet';
|
|
|
16
16
|
import Loader from './Loader';
|
|
17
17
|
import Error from './Error';
|
|
18
18
|
export default function AnimationFlow(_a) {
|
|
19
|
-
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;
|
|
19
|
+
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, animationDirection = _a.animationDirection, dialogEdgeFormat = _a.dialogEdgeFormat;
|
|
20
20
|
var small = useScreen(breakpoint).small;
|
|
21
21
|
if (loading) {
|
|
22
22
|
return _jsx(Loader, {});
|
|
@@ -25,10 +25,10 @@ export default function AnimationFlow(_a) {
|
|
|
25
25
|
return _jsx(Error, { error: error });
|
|
26
26
|
}
|
|
27
27
|
if (type === 'PUPOP') {
|
|
28
|
-
return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo }, { children: children })));
|
|
28
|
+
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, dialogEdgeFormat: dialogEdgeFormat }, { children: children })));
|
|
29
29
|
}
|
|
30
30
|
if (type === 'BOTTOMSHEET') {
|
|
31
|
-
return (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children })));
|
|
31
|
+
return (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, dialogEdgeFormat: dialogEdgeFormat }, { children: children })));
|
|
32
32
|
}
|
|
33
|
-
return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo }, { children: children })));
|
|
33
|
+
return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo, hideFooter: hideFooter, hideMerchantLogo: hideMerchantLogo, dialogEdgeFormat: dialogEdgeFormat }, { 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, dialogEdgeFormat: dialogEdgeFormat }, { children: children })));
|
|
34
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BottomSheetProps as MainBottomSheetProps } from 'react-spring-bottom-sheet';
|
|
3
3
|
import 'react-spring-bottom-sheet/dist/style.css';
|
|
4
|
-
import { MerchantInfo } from '../../@types';
|
|
4
|
+
import { DialogEdgeFormat, MerchantInfo } from '../../@types';
|
|
5
5
|
export interface BottomSheetProps extends MainBottomSheetProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
open: boolean;
|
|
@@ -9,6 +9,9 @@ export interface BottomSheetProps extends MainBottomSheetProps {
|
|
|
9
9
|
pointerEvents?: 'none' | 'auto';
|
|
10
10
|
isMaturityExpress?: boolean;
|
|
11
11
|
merchantInfo?: MerchantInfo;
|
|
12
|
+
hideFooter?: boolean;
|
|
13
|
+
hideMerchantLogo?: boolean;
|
|
14
|
+
dialogEdgeFormat?: DialogEdgeFormat;
|
|
12
15
|
}
|
|
13
|
-
declare const _default: React.MemoExoticComponent<({ open, children, screenId, pointerEvents, isMaturityExpress, merchantInfo, ...rest }: BottomSheetProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
+
declare const _default: React.MemoExoticComponent<({ open, children, screenId, pointerEvents, isMaturityExpress, merchantInfo, hideMerchantLogo, dialogEdgeFormat, ...rest }: BottomSheetProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
17
|
export default _default;
|
|
@@ -28,6 +28,7 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import 'react-spring-bottom-sheet/dist/style.css';
|
|
29
29
|
import { ICONS_NAMES } from '../../constants';
|
|
30
30
|
import { useLanguage } from '../../hooks';
|
|
31
|
+
import { DialogEdgeFormat } from '../../@types';
|
|
31
32
|
import { CustomFooter, PoweredByFooter } from '../../features/shared/Footer';
|
|
32
33
|
import LogoBadge from '../LogoBadge';
|
|
33
34
|
var LanguageFooterStyled = styled(Box)(function (_a) {
|
|
@@ -42,19 +43,19 @@ var LanguageFooterStyled = styled(Box)(function (_a) {
|
|
|
42
43
|
});
|
|
43
44
|
});
|
|
44
45
|
var BottomSheetStyled = styled(BottomSheet, {
|
|
45
|
-
shouldForwardProp: function (prop) { return !['isMaturityExpress', 'languageBarHeight'].includes(prop.toString()); }
|
|
46
|
+
shouldForwardProp: function (prop) { return !['isMaturityExpress', 'languageBarHeight', 'dialogEdgeFormat'].includes(prop.toString()); }
|
|
46
47
|
})(function (_a) {
|
|
47
|
-
var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress, languageBarHeight = _a.languageBarHeight;
|
|
48
|
+
var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress, languageBarHeight = _a.languageBarHeight, dialogEdgeFormat = _a.dialogEdgeFormat;
|
|
48
49
|
return ({
|
|
49
50
|
'[data-rsbs-header]:before': __assign({ width: '75px', height: '5px' }, (isMaturityExpress && { width: '0px', height: '0px' })),
|
|
50
51
|
'[data-rsbs-backdrop]': {
|
|
51
52
|
backgroundColor: 'transparent'
|
|
52
53
|
},
|
|
53
54
|
'[data-rsbs-header]': __assign({ paddingBottom: theme.spacing(6), position: 'absolute', width: '100vw' }, (isMaturityExpress && { display: 'none' })),
|
|
54
|
-
'[data-rsbs-overlay]': __assign({ backgroundColor: theme.palette.background.paper, zIndex: 9999, maxHeight: "calc(100vh - ".concat(languageBarHeight, "px)") }, (isMaturityExpress && {
|
|
55
|
+
'[data-rsbs-overlay]': __assign(__assign({ backgroundColor: theme.palette.background.paper, zIndex: 9999, maxHeight: "calc(100vh - ".concat(languageBarHeight, "px)"), borderTopLeftRadius: theme.spacing(1.5), borderTopRightRadius: theme.spacing(1.5) }, (isMaturityExpress && {
|
|
55
56
|
marginBottom: theme.spacing(5.625),
|
|
56
57
|
paddingTop: theme.spacing(5)
|
|
57
|
-
})),
|
|
58
|
+
})), (dialogEdgeFormat === DialogEdgeFormat.STRAIGHT && { borderTopLeftRadius: theme.spacing(0), borderTopRightRadius: theme.spacing(0) })),
|
|
58
59
|
'[data-rsbs-scroll]': {
|
|
59
60
|
'&::-webkit-scrollbar': {
|
|
60
61
|
width: '0px'
|
|
@@ -75,7 +76,7 @@ var FooterStyled = styled(Box)(function (_a) {
|
|
|
75
76
|
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
77
|
});
|
|
77
78
|
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, rest = __rest(_a, ["open", "children", "screenId", "pointerEvents", "isMaturityExpress", "merchantInfo"]);
|
|
79
|
+
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, hideMerchantLogo = _a.hideMerchantLogo, dialogEdgeFormat = _a.dialogEdgeFormat, rest = __rest(_a, ["open", "children", "screenId", "pointerEvents", "isMaturityExpress", "merchantInfo", "hideMerchantLogo", "dialogEdgeFormat"]);
|
|
79
80
|
var sheetRef = React.useRef(null);
|
|
80
81
|
var isAr = useLanguage().isAr;
|
|
81
82
|
var logo = (merchantInfo || {}).logo;
|
|
@@ -102,7 +103,7 @@ var BottomSheetComponent = function (_a) {
|
|
|
102
103
|
}, 500);
|
|
103
104
|
}
|
|
104
105
|
}, [screenId]);
|
|
105
|
-
return (_jsxs(BottomSheetStyled, __assign({ languageBarHeight: getLanguageBarHeight(), sibling: _jsx(LanguageFooterStyled, { children: _jsx(CustomFooter, {}) }), isMaturityExpress: isMaturityExpress, sx: { pointerEvents: pointerEvents }, ref: sheetRef, open: open, snapPoints: function (_a) {
|
|
106
|
+
return (_jsxs(BottomSheetStyled, __assign({ languageBarHeight: getLanguageBarHeight(), dialogEdgeFormat: dialogEdgeFormat, sibling: _jsx(LanguageFooterStyled, { children: _jsx(CustomFooter, {}) }), isMaturityExpress: isMaturityExpress, sx: { pointerEvents: pointerEvents }, ref: sheetRef, open: open, snapPoints: function (_a) {
|
|
106
107
|
var maxHeight = _a.maxHeight;
|
|
107
108
|
return [getMinHeight(maxHeight), maxHeight * 0.95];
|
|
108
109
|
} }, rest, { children: [isMaturityExpress && _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 }) }))] })));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DialogProps as MUIDialogProps } from '@mui/material/Dialog';
|
|
3
|
-
import {
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { DialogEdgeFormat, MerchantInfo } from '../../@types';
|
|
4
5
|
export interface DialogProps extends MUIDialogProps {
|
|
5
6
|
open: boolean;
|
|
6
7
|
isTapOrigin?: boolean;
|
|
@@ -13,6 +14,12 @@ export interface DialogProps extends MUIDialogProps {
|
|
|
13
14
|
merchantInfo?: MerchantInfo;
|
|
14
15
|
isMaturityExpress?: boolean;
|
|
15
16
|
showTextLogo?: boolean;
|
|
17
|
+
hideFooter?: boolean;
|
|
18
|
+
hideMerchantLogo?: boolean;
|
|
19
|
+
animationDirection?: 'left' | 'right' | 'up' | 'down';
|
|
20
|
+
showAsContent?: boolean;
|
|
21
|
+
sx?: SxProps<Theme>;
|
|
22
|
+
dialogEdgeFormat?: DialogEdgeFormat;
|
|
16
23
|
}
|
|
17
|
-
declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, ...rest }: DialogProps) => import("react/jsx-runtime").JSX.Element>;
|
|
24
|
+
declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, hideFooter, dialogEdgeFormat, hideMerchantLogo, animationDirection, ...rest }: DialogProps) => import("react/jsx-runtime").JSX.Element>;
|
|
18
25
|
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, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress", "showTextLogo"]);
|
|
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, dialogEdgeFormat = _a.dialogEdgeFormat, hideMerchantLogo = _a.hideMerchantLogo, animationDirection = _a.animationDirection, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress", "showTextLogo", "hideFooter", "dialogEdgeFormat", "hideMerchantLogo", "animationDirection"]);
|
|
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 });
|
|
@@ -122,13 +124,11 @@ var Dialog = function (_a) {
|
|
|
122
124
|
return (_jsxs(MuiDialog, __assign({ id: DIALOG_ID, PaperProps: {
|
|
123
125
|
elevation: 0
|
|
124
126
|
}, sx: {
|
|
125
|
-
'& .MuiDialog-paper': {
|
|
126
|
-
overflowY: 'visible'
|
|
127
|
-
},
|
|
127
|
+
'& .MuiDialog-paper': __assign({ overflowY: 'visible' }, (dialogEdgeFormat === DialogEdgeFormat.STRAIGHT && { borderRadius: theme.spacing(0) })),
|
|
128
128
|
'&.MuiDialog-root': {
|
|
129
129
|
marginBottom: isMaturityExpress ? '60px' : '0px'
|
|
130
130
|
},
|
|
131
131
|
pointerEvents: pointerEvents
|
|
132
|
-
}, hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_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, {}) : _jsx(CustomFooter, {}), _jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) }))] })));
|
|
132
|
+
}, hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_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, {}) })))] })));
|
|
133
133
|
};
|
|
134
134
|
export default React.memo(Dialog);
|
|
@@ -281,6 +281,10 @@ export declare const createAccountAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
281
281
|
boardInfo: any;
|
|
282
282
|
boardData: any;
|
|
283
283
|
account: any;
|
|
284
|
+
} | {
|
|
285
|
+
account: any;
|
|
286
|
+
boardInfo?: undefined;
|
|
287
|
+
boardData?: undefined;
|
|
284
288
|
} | undefined, void, {
|
|
285
289
|
state?: unknown;
|
|
286
290
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -81,17 +81,17 @@ export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateB
|
|
|
81
81
|
});
|
|
82
82
|
}); });
|
|
83
83
|
export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, _c, boardInfo, boardData, error_1;
|
|
85
|
-
var _d, _e, _f, _g, _h
|
|
86
|
-
return __generator(this, function (
|
|
87
|
-
switch (
|
|
84
|
+
var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, screen_1, _c, boardInfo, boardData, error_1;
|
|
85
|
+
var _d, _e, _f, _g, _h;
|
|
86
|
+
return __generator(this, function (_j) {
|
|
87
|
+
switch (_j.label) {
|
|
88
88
|
case 0:
|
|
89
89
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
90
90
|
countryCode = settings.data.businessCountry;
|
|
91
91
|
showBoard = connectExpress.data.showBoard;
|
|
92
92
|
return [4, API.leadService.retrieveLeadIdentity(leadId)];
|
|
93
93
|
case 1:
|
|
94
|
-
data =
|
|
94
|
+
data = _j.sent();
|
|
95
95
|
_b = data || {}, country_code = _b.country_code, contact = _b.contact;
|
|
96
96
|
if (country_code)
|
|
97
97
|
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
@@ -99,7 +99,7 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
99
99
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
100
100
|
countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
|
|
101
101
|
status = data.status, board_id = data.board_id, board_info_id = data.board_info_id;
|
|
102
|
-
if (!
|
|
102
|
+
if (!country_code && !((_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2)) {
|
|
103
103
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
|
|
104
104
|
return [2, { data: data, countryCode: countryCode }];
|
|
105
105
|
}
|
|
@@ -108,22 +108,27 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
108
108
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
109
109
|
return [2, { data: data, countryCode: countryCode }];
|
|
110
110
|
}
|
|
111
|
-
if (!isRegistered &&
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
111
|
+
if (!isRegistered && country_code) {
|
|
112
|
+
screen_1 = 'CONNECT_EXPRESS_NID_STEP';
|
|
113
|
+
if (!isSA(data.country_code))
|
|
114
|
+
screen_1 = 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
115
|
+
thunkApi.dispatch(handleCurrentActiveScreen(screen_1));
|
|
115
116
|
return [2, { data: data, countryCode: countryCode }];
|
|
116
117
|
}
|
|
117
|
-
if (!isRegistered && (
|
|
118
|
+
if (!isRegistered && !isSA(settings.data.businessCountry.iso2)) {
|
|
118
119
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
119
120
|
return [2, { data: data, countryCode: countryCode }];
|
|
120
121
|
}
|
|
121
|
-
if (
|
|
122
|
-
thunkApi.dispatch(
|
|
122
|
+
if (!isRegistered && isSA(settings.data.businessCountry.iso2)) {
|
|
123
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_NID_STEP'));
|
|
124
|
+
return [2, { data: data, countryCode: countryCode }];
|
|
125
|
+
}
|
|
126
|
+
if ((_e = data === null || data === void 0 ? void 0 : data.identification) === null || _e === void 0 ? void 0 : _e.authentication_id) {
|
|
127
|
+
thunkApi.dispatch(storeAuthId((_f = data === null || data === void 0 ? void 0 : data.identification) === null || _f === void 0 ? void 0 : _f.authentication_id));
|
|
123
128
|
}
|
|
124
129
|
if (isRegistered && !showBoard) {
|
|
125
|
-
(
|
|
126
|
-
thunkApi.dispatch(
|
|
130
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, data);
|
|
131
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
127
132
|
return [2, { data: data, countryCode: countryCode }];
|
|
128
133
|
}
|
|
129
134
|
if (isRegistered && !(board_id && board_info_id)) {
|
|
@@ -131,19 +136,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
131
136
|
return [2, { data: data, countryCode: countryCode }];
|
|
132
137
|
}
|
|
133
138
|
if (!(isRegistered && board_id && board_info_id)) return [3, 5];
|
|
134
|
-
|
|
139
|
+
_j.label = 2;
|
|
135
140
|
case 2:
|
|
136
|
-
|
|
141
|
+
_j.trys.push([2, 4, , 5]);
|
|
137
142
|
return [4, Promise.all([
|
|
138
143
|
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
139
144
|
API.boardService.retrieveBoardDetails(board_id)
|
|
140
145
|
])];
|
|
141
146
|
case 3:
|
|
142
|
-
_c =
|
|
147
|
+
_c = _j.sent(), boardInfo = _c[0], boardData = _c[1];
|
|
143
148
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
|
|
144
149
|
return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
|
|
145
150
|
case 4:
|
|
146
|
-
error_1 =
|
|
151
|
+
error_1 = _j.sent();
|
|
147
152
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
148
153
|
return [2, { data: data, countryCode: countryCode }];
|
|
149
154
|
case 5: return [2, { data: data, countryCode: countryCode }];
|
|
@@ -216,20 +221,24 @@ export var retrieveAuthenticationListAsync = createAsyncThunk('connectExpress/re
|
|
|
216
221
|
export var getMerchantListAsync = createAsyncThunk('connectExpress/getMerchantListAsync', function (_a, thunkApi) {
|
|
217
222
|
var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo;
|
|
218
223
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
219
|
-
var settings, payload, merchants, list;
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
var _b, settings, connectExpress, platforms, payment_provider, payload, merchants, list;
|
|
225
|
+
var _c, _d, _e, _f, _g, _h;
|
|
226
|
+
return __generator(this, function (_j) {
|
|
227
|
+
switch (_j.label) {
|
|
222
228
|
case 0:
|
|
223
|
-
|
|
229
|
+
_b = thunkApi.getState(), settings = _b.settings, connectExpress = _b.connectExpress;
|
|
230
|
+
platforms = (_e = (_d = (_c = connectExpress.data.responseData) === null || _c === void 0 ? void 0 : _c.leadData) === null || _d === void 0 ? void 0 : _d.platforms) !== null && _e !== void 0 ? _e : settings.data.appConfig.platforms;
|
|
231
|
+
payment_provider = (_h = (_g = (_f = connectExpress.data.responseData) === null || _f === void 0 ? void 0 : _f.leadResponse) === null || _g === void 0 ? void 0 : _g.payment_provider) !== null && _h !== void 0 ? _h : settings.data.appConfig.paymentProvider;
|
|
224
232
|
payload = {
|
|
225
233
|
business_entity_id: (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) || '',
|
|
226
234
|
brand_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id) || '',
|
|
227
235
|
create_if_not_present: true,
|
|
228
|
-
platforms:
|
|
236
|
+
platforms: platforms,
|
|
237
|
+
payment_provider: payment_provider
|
|
229
238
|
};
|
|
230
239
|
return [4, API.entityService.getMerchantListUsingEntityId(payload)];
|
|
231
240
|
case 1:
|
|
232
|
-
merchants = (
|
|
241
|
+
merchants = (_j.sent()).merchants;
|
|
233
242
|
list = merchants || [];
|
|
234
243
|
if ((list === null || list === void 0 ? void 0 : list.length) > 1) {
|
|
235
244
|
thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP'));
|
|
@@ -408,7 +417,7 @@ export var createCivilIdAuthAsync = createAsyncThunk('connectExpress/createCivil
|
|
|
408
417
|
});
|
|
409
418
|
}); });
|
|
410
419
|
export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
411
|
-
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi,
|
|
420
|
+
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, payload, data, authId, urlQueryStart, _e, brandList, entityList, isKuwait, next;
|
|
412
421
|
var _f, _g;
|
|
413
422
|
return __generator(this, function (_h) {
|
|
414
423
|
switch (_h.label) {
|
|
@@ -421,7 +430,8 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
421
430
|
_d = settings.data.appConfig, scope = _d.scope, redirectUrl = _d.redirectUrl, authData = _d.data;
|
|
422
431
|
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
423
432
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
424
|
-
|
|
433
|
+
isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
|
|
434
|
+
authDataHasValue = authData === null || authData === void 0 ? void 0 : authData.length;
|
|
425
435
|
payload = {
|
|
426
436
|
auth_token: auth_token,
|
|
427
437
|
lead_id: leadId,
|
|
@@ -440,7 +450,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
440
450
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
441
451
|
authId = data.auth.id;
|
|
442
452
|
thunkApi.dispatch(storeAuthId(authId));
|
|
443
|
-
if (isScopeAuthentication && !data.new_user &&
|
|
453
|
+
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
444
454
|
if (settings.data.appConfig.mode === 'popup') {
|
|
445
455
|
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
446
456
|
thunkApi.dispatch(handleOpen(false));
|
|
@@ -452,7 +462,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
452
462
|
return [2, data];
|
|
453
463
|
}
|
|
454
464
|
}
|
|
455
|
-
if (!(isScopeAuthentication && !data.new_user &&
|
|
465
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 3];
|
|
456
466
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
457
467
|
case 2:
|
|
458
468
|
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
@@ -474,7 +484,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
474
484
|
});
|
|
475
485
|
}); });
|
|
476
486
|
export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
477
|
-
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi,
|
|
487
|
+
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, payload, data, authId, urlQueryStart, _e, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
478
488
|
var _f, _g;
|
|
479
489
|
return __generator(this, function (_h) {
|
|
480
490
|
switch (_h.label) {
|
|
@@ -487,7 +497,8 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
|
|
|
487
497
|
_d = settings.data.appConfig, scope = _d.scope, redirectUrl = _d.redirectUrl, authData = _d.data;
|
|
488
498
|
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
489
499
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
490
|
-
|
|
500
|
+
isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
|
|
501
|
+
authDataHasValue = authData === null || authData === void 0 ? void 0 : authData.length;
|
|
491
502
|
payload = {
|
|
492
503
|
auth_token: auth_token,
|
|
493
504
|
lead_id: leadId,
|
|
@@ -506,7 +517,7 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
|
|
|
506
517
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
507
518
|
authId = data.auth.id;
|
|
508
519
|
thunkApi.dispatch(storeAuthId(authId));
|
|
509
|
-
if (isScopeAuthentication && !data.new_user &&
|
|
520
|
+
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
510
521
|
if (settings.data.appConfig.mode === 'popup') {
|
|
511
522
|
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
512
523
|
thunkApi.dispatch(handleOpen(false));
|
|
@@ -518,7 +529,7 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
|
|
|
518
529
|
return [2, data];
|
|
519
530
|
}
|
|
520
531
|
}
|
|
521
|
-
if (!(isScopeAuthentication && !data.new_user &&
|
|
532
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 3];
|
|
522
533
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
523
534
|
case 2:
|
|
524
535
|
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
@@ -544,7 +555,7 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
|
|
|
544
555
|
});
|
|
545
556
|
}); });
|
|
546
557
|
export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
547
|
-
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi,
|
|
558
|
+
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
548
559
|
var _d, _e, _f;
|
|
549
560
|
return __generator(this, function (_g) {
|
|
550
561
|
switch (_g.label) {
|
|
@@ -554,7 +565,8 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
554
565
|
_b = settings.data.appConfig, scope = _b.scope, redirectUrl = _b.redirectUrl, authConfigData = _b.data;
|
|
555
566
|
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
556
567
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
557
|
-
|
|
568
|
+
isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
|
|
569
|
+
authDataHasValue = authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length;
|
|
558
570
|
expiry = (authData === null || authData === void 0 ? void 0 : authData.expiry) || 120;
|
|
559
571
|
interval = 3;
|
|
560
572
|
maxCalls = Math.floor(expiry / interval);
|
|
@@ -572,7 +584,7 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
572
584
|
if (!isSuccess) return [3, 6];
|
|
573
585
|
authId = data.auth.id;
|
|
574
586
|
thunkApi.dispatch(storeAuthId(authId));
|
|
575
|
-
if (isScopeAuthentication && !data.new_user &&
|
|
587
|
+
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
576
588
|
if (settings.data.appConfig.mode === 'popup') {
|
|
577
589
|
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
578
590
|
thunkApi.dispatch(handleOpen(false));
|
|
@@ -584,7 +596,7 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
584
596
|
return [2, data];
|
|
585
597
|
}
|
|
586
598
|
}
|
|
587
|
-
if (!(isScopeAuthentication && !data.new_user &&
|
|
599
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 4];
|
|
588
600
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
589
601
|
case 3:
|
|
590
602
|
_c = _g.sent(), brandList = _c.brandList, entityList = _c.entityList;
|
|
@@ -859,40 +871,50 @@ export var checkBrandNameAvailabilityAsync = createAsyncThunk('connectExpress/ch
|
|
|
859
871
|
});
|
|
860
872
|
});
|
|
861
873
|
export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAsync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
862
|
-
var _a, connectExpress, settings, _b, responseData, showBoard, _c, postURL, scope, body, data, leadData, board_id, board_info_id, _d, boardInfo, boardData;
|
|
863
|
-
var _e, _f, _g, _h, _j, _k, _l, _m;
|
|
864
|
-
return __generator(this, function (
|
|
865
|
-
switch (
|
|
874
|
+
var _a, connectExpress, settings, _b, responseData, showBoard, _c, postURL, scope, redirectUrl, mode, platforms, payment_provider, authId, bi, body, data, leadData, board_id, board_info_id, _d, boardInfo, boardData, urlQueryStart;
|
|
875
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
876
|
+
return __generator(this, function (_u) {
|
|
877
|
+
switch (_u.label) {
|
|
866
878
|
case 0:
|
|
867
879
|
_a = thunkApi.getState(), connectExpress = _a.connectExpress, settings = _a.settings;
|
|
868
880
|
_b = connectExpress.data, responseData = _b.responseData, showBoard = _b.showBoard;
|
|
869
|
-
_c = settings.data.appConfig, postURL = _c.postURL, scope = _c.scope;
|
|
881
|
+
_c = settings.data.appConfig, postURL = _c.postURL, scope = _c.scope, redirectUrl = _c.redirectUrl, mode = _c.mode;
|
|
882
|
+
platforms = (_f = (_e = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _e === void 0 ? void 0 : _e.platforms) !== null && _f !== void 0 ? _f : settings.data.appConfig.platforms;
|
|
883
|
+
payment_provider = (_h = (_g = responseData === null || responseData === void 0 ? void 0 : responseData.leadResponse) === null || _g === void 0 ? void 0 : _g.payment_provider) !== null && _h !== void 0 ? _h : settings.data.appConfig.paymentProvider;
|
|
884
|
+
authId = (_k = (_j = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _j === void 0 ? void 0 : _j.auth) === null || _k === void 0 ? void 0 : _k.id;
|
|
885
|
+
bi = settings.data.deviceInfo.browser.browser_id;
|
|
870
886
|
body = {
|
|
871
887
|
lead_id: responseData === null || responseData === void 0 ? void 0 : responseData.leadData.id,
|
|
872
888
|
post_url: scope === SCOPE_AUTH ? '' : postURL || '',
|
|
873
|
-
platforms:
|
|
889
|
+
platforms: platforms,
|
|
890
|
+
payment_provider: payment_provider
|
|
874
891
|
};
|
|
875
892
|
return [4, API.accountService.expressCreateAccount(body)];
|
|
876
893
|
case 1:
|
|
877
|
-
data =
|
|
878
|
-
(
|
|
879
|
-
(
|
|
880
|
-
(
|
|
894
|
+
data = _u.sent();
|
|
895
|
+
(_m = (_l = settings.data.appConfig).onCreated) === null || _m === void 0 ? void 0 : _m.call(_l, data);
|
|
896
|
+
(_p = (_o = settings.data.appConfig).onFlowCompleted) === null || _p === void 0 ? void 0 : _p.call(_o, data);
|
|
897
|
+
(_r = (_q = settings.data.appConfig).onStepCompleted) === null || _r === void 0 ? void 0 : _r.call(_q, settings.data.activeScreen.name, data);
|
|
881
898
|
if (!showBoard) return [3, 4];
|
|
882
899
|
return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
883
900
|
case 2:
|
|
884
|
-
leadData = (
|
|
885
|
-
board_id = (
|
|
886
|
-
board_info_id = (
|
|
901
|
+
leadData = (_u.sent()).data;
|
|
902
|
+
board_id = (_s = data.board_id) !== null && _s !== void 0 ? _s : leadData.board_id;
|
|
903
|
+
board_info_id = (_t = data.board_info_id) !== null && _t !== void 0 ? _t : leadData.board_info_id;
|
|
887
904
|
return [4, Promise.all([
|
|
888
905
|
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
889
906
|
API.boardService.retrieveBoardDetails(board_id)
|
|
890
907
|
])];
|
|
891
908
|
case 3:
|
|
892
|
-
_d =
|
|
909
|
+
_d = _u.sent(), boardInfo = _d[0], boardData = _d[1];
|
|
893
910
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
894
911
|
return [2, { boardInfo: boardInfo, boardData: boardData, account: data }];
|
|
895
912
|
case 4:
|
|
913
|
+
if (redirectUrl && mode === 'page') {
|
|
914
|
+
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
915
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
916
|
+
return [2, { account: data }];
|
|
917
|
+
}
|
|
896
918
|
thunkApi.dispatch(handleOpen(false));
|
|
897
919
|
return [2];
|
|
898
920
|
}
|
|
@@ -58,7 +58,7 @@ var Bank = memo(function (_a) {
|
|
|
58
58
|
settingLoading: configToken ? internalLoading : settingLoading
|
|
59
59
|
});
|
|
60
60
|
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
61
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: bankFeatureScreens.map(function (_a, index) {
|
|
61
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: bankFeatureScreens.map(function (_a, index) {
|
|
62
62
|
var Element = _a.element, name = _a.name;
|
|
63
63
|
var isActive = activeScreen.name === name;
|
|
64
64
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -29,7 +29,7 @@ import AnimationFlow from '../../components/AnimationFlow';
|
|
|
29
29
|
import { store } from '../../app/store';
|
|
30
30
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
31
31
|
import Collapse from '../../components/Collapse';
|
|
32
|
-
import { findOrCreateElementAndInject, sendPageView } from '../../utils';
|
|
32
|
+
import { findOrCreateElementAndInject, isTapDomain, sendPageView } from '../../utils';
|
|
33
33
|
import { FeatureContainer } from '../shared/Containers';
|
|
34
34
|
import { BOARD_SCREENS_NAVIGATION } from '../../constants';
|
|
35
35
|
import { boardFeatureScreens } from '../featuresScreens';
|
|
@@ -56,7 +56,7 @@ var Board = memo(function (_a) {
|
|
|
56
56
|
}
|
|
57
57
|
}, [data.isValidOperator, settingLoading]);
|
|
58
58
|
var initialLoading = settingLoading || customLoading;
|
|
59
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !
|
|
59
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapDomain(props.merchantDomain), dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: boardFeatureScreens.map(function (_a, index) {
|
|
60
60
|
var Element = _a.element, name = _a.name;
|
|
61
61
|
var isActive = activeScreen.name === name;
|
|
62
62
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -58,7 +58,7 @@ var Brand = memo(function (_a) {
|
|
|
58
58
|
settingLoading: configToken ? internalLoading : settingLoading
|
|
59
59
|
});
|
|
60
60
|
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
61
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: brandFeatureScreens.map(function (_a, index) {
|
|
61
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: brandFeatureScreens.map(function (_a, index) {
|
|
62
62
|
var Element = _a.element, name = _a.name;
|
|
63
63
|
var isActive = activeScreen.name === name;
|
|
64
64
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -49,7 +49,7 @@ var Business = memo(function (props) {
|
|
|
49
49
|
if (!settingLoading && open)
|
|
50
50
|
verifyToken();
|
|
51
51
|
}, [settingLoading]);
|
|
52
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: businessFeatureScreens.map(function (_a, index) {
|
|
52
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: businessFeatureScreens.map(function (_a, index) {
|
|
53
53
|
var Element = _a.element, name = _a.name;
|
|
54
54
|
var isActive = activeScreen.name === name;
|
|
55
55
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -68,12 +68,12 @@ var Connect = memo(function (props) {
|
|
|
68
68
|
var _b = useAppSelector(connectSelector), connectError = _b.error, loading = _b.loading, customLoading = _b.customLoading, connectData = _b.data;
|
|
69
69
|
var leadId = connectData.leadId;
|
|
70
70
|
var onVerifyConfigTokenSuccess = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
var id;
|
|
71
|
+
var lead, id;
|
|
72
72
|
return __generator(this, function (_a) {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
lead = (data || {}).lead;
|
|
74
|
+
id = (lead === null || lead === void 0 ? void 0 : lead.id) || leadId;
|
|
75
|
+
if (id)
|
|
75
76
|
dispatch(storeLeadId(id));
|
|
76
|
-
}
|
|
77
77
|
return [2];
|
|
78
78
|
});
|
|
79
79
|
}); };
|
|
@@ -99,7 +99,7 @@ var Connect = memo(function (props) {
|
|
|
99
99
|
dispatch(handleCurrentActiveScreen('CONNECT_OPERATOR_ERROR_STEP'));
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
if (leadId) {
|
|
102
|
+
if (leadId && !data.isMaturityExpress) {
|
|
103
103
|
dispatch(retrieveLead({ leadId: leadId, isRedirect: true }));
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
@@ -134,7 +134,7 @@ var Connect = memo(function (props) {
|
|
|
134
134
|
var handleDialogClose = function () {
|
|
135
135
|
dispatch(handleOpen(false));
|
|
136
136
|
};
|
|
137
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: false, showTextLogo: activeScreen.name !== 'CONNECT_BUSINESS_COUNTRY_STEP' }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: false }, { children: connectFeatureScreens.map(function (_a, index) {
|
|
137
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: false, showTextLogo: activeScreen.name !== 'CONNECT_BUSINESS_COUNTRY_STEP', dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: false }, { children: connectFeatureScreens.map(function (_a, index) {
|
|
138
138
|
var Element = _a.element, name = _a.name;
|
|
139
139
|
var isActive = activeScreen.name === name;
|
|
140
140
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -78,15 +78,15 @@ var ConnectExpress = memo(function (_a) {
|
|
|
78
78
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
79
79
|
var _c = useAppSelector(connectExpressSelector), connectExpressError = _c.error, loading = _c.loading, customLoading = _c.customLoading, connectData = _c.data;
|
|
80
80
|
var onVerifyConfigTokenSuccess = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
-
var _a,
|
|
81
|
+
var _a, lead, board;
|
|
82
82
|
return __generator(this, function (_b) {
|
|
83
|
-
_a = data || {},
|
|
84
|
-
if (
|
|
83
|
+
_a = data || {}, lead = _a.lead, board = _a.board;
|
|
84
|
+
if (lead === null || lead === void 0 ? void 0 : lead.id) {
|
|
85
85
|
dispatch(setIsLeadIdPassed(true));
|
|
86
|
-
dispatch(setLeadId(
|
|
86
|
+
dispatch(setLeadId(lead.id));
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
89
|
-
dispatch(setShowBoard(
|
|
88
|
+
if (showBoard === false || (board === null || board === void 0 ? void 0 : board.display) === false)
|
|
89
|
+
dispatch(setShowBoard(false));
|
|
90
90
|
return [2];
|
|
91
91
|
});
|
|
92
92
|
}); };
|
|
@@ -95,7 +95,7 @@ var ConnectExpress = memo(function (_a) {
|
|
|
95
95
|
useStepStartedListener();
|
|
96
96
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant;
|
|
97
97
|
React.useEffect(function () {
|
|
98
|
-
if (typeof showBoard === 'boolean')
|
|
98
|
+
if (typeof showBoard === 'boolean' && !configToken)
|
|
99
99
|
dispatch(setShowBoard(showBoard));
|
|
100
100
|
sendPageView({
|
|
101
101
|
title: 'Connect Express'
|
|
@@ -133,7 +133,7 @@ var ConnectExpress = memo(function (_a) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}, [data.isValidOperator, settingLoading]);
|
|
136
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapOrigin }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: true }, { children: connectExpressFeatureScreens.map(function (_a, index) {
|
|
136
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapOrigin, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: true }, { children: connectExpressFeatureScreens.map(function (_a, index) {
|
|
137
137
|
var Element = _a.element, name = _a.name;
|
|
138
138
|
var isActive = activeScreen.name === name;
|
|
139
139
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
package/build/features/connectExpress/screens/AccountAlreadyCreated/AccountAlreadyCreated.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
4
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
5
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
6
|
-
import { handleOpen } from '../../../../app/settings';
|
|
6
|
+
import { handleOpen, settingsSelector } from '../../../../app/settings';
|
|
7
|
+
import { connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
|
|
7
8
|
var AccountAlreadyCreated = function (_a) {
|
|
8
9
|
var t = useTranslation().t;
|
|
9
10
|
var dispatch = useAppDispatch();
|
|
11
|
+
var data = useAppSelector(settingsSelector).data;
|
|
12
|
+
var expressData = useAppSelector(connectExpressSelector).data;
|
|
10
13
|
var onSuccess = function () {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
var _d = data.appConfig, mode = _d.mode, redirectUrl = _d.redirectUrl;
|
|
16
|
+
var authId = (_c = (_b = (_a = expressData === null || expressData === void 0 ? void 0 : expressData.responseData) === null || _a === void 0 ? void 0 : _a.authData) === null || _b === void 0 ? void 0 : _b.auth) === null || _c === void 0 ? void 0 : _c.id;
|
|
17
|
+
var bi = data.deviceInfo.browser.browser_id;
|
|
11
18
|
dispatch(handleOpen(false));
|
|
19
|
+
if (redirectUrl && mode === 'page') {
|
|
20
|
+
var urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
21
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
22
|
+
return { account: data };
|
|
23
|
+
}
|
|
12
24
|
};
|
|
13
25
|
return (_jsx(SuccessScreen, { title: t('express_account_already_created_title'), description: t('express_account_already_created_description'), onSuccess: onSuccess, successTitle: t('express_account_already_created_close_button') }));
|
|
14
26
|
};
|
|
@@ -58,7 +58,7 @@ var Entity = memo(function (_a) {
|
|
|
58
58
|
});
|
|
59
59
|
}, []);
|
|
60
60
|
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
61
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: entityFeatureScreens.map(function (_a, index) {
|
|
61
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: entityFeatureScreens.map(function (_a, index) {
|
|
62
62
|
var Element = _a.element, name = _a.name;
|
|
63
63
|
var isActive = activeScreen.name === name;
|
|
64
64
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -58,7 +58,7 @@ var Individual = memo(function (_a) {
|
|
|
58
58
|
});
|
|
59
59
|
}, []);
|
|
60
60
|
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
61
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: individualFeatureScreens.map(function (_a, index) {
|
|
61
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: individualFeatureScreens.map(function (_a, index) {
|
|
62
62
|
var Element = _a.element, name = _a.name;
|
|
63
63
|
var isActive = activeScreen.name === name;
|
|
64
64
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -68,7 +68,7 @@ var Password = memo(function (_a) {
|
|
|
68
68
|
if (!settingLoading && open)
|
|
69
69
|
verifyToken();
|
|
70
70
|
}, [settingLoading]);
|
|
71
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
71
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
72
72
|
var Element = _a.element, name = _a.name;
|
|
73
73
|
var isActive = activeScreen.name === name;
|
|
74
74
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -32,7 +32,7 @@ var SignIn = memo(function (props) {
|
|
|
32
32
|
useErrorListener(signInError || error);
|
|
33
33
|
useStepStartedListener();
|
|
34
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress;
|
|
35
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: signInFeatureScreens.map(function (_a, index) {
|
|
35
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: signInFeatureScreens.map(function (_a, index) {
|
|
36
36
|
var Element = _a.element, name = _a.name;
|
|
37
37
|
var isActive = activeScreen.name === name;
|
|
38
38
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -58,7 +58,7 @@ var Tax = memo(function (_a) {
|
|
|
58
58
|
settingLoading: configToken ? internalLoading : settingLoading
|
|
59
59
|
});
|
|
60
60
|
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
61
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: taxFeatureScreens.map(function (_a, index) {
|
|
61
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: taxFeatureScreens.map(function (_a, index) {
|
|
62
62
|
var Element = _a.element, name = _a.name;
|
|
63
63
|
var isActive = activeScreen.name === name;
|
|
64
64
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigInfo, LibConfig, ScreenStepNavigation } from '../@types';
|
|
2
2
|
interface AppConfigProps extends LibConfig {
|
|
3
3
|
navigation: ScreenStepNavigation[];
|
|
4
4
|
disableCountries?: boolean;
|
|
@@ -6,7 +6,7 @@ interface AppConfigProps extends LibConfig {
|
|
|
6
6
|
disableSettingFetching?: boolean;
|
|
7
7
|
maturity?: 'full' | 'express';
|
|
8
8
|
configToken?: string;
|
|
9
|
-
onVerifyConfigTokenSuccess?: (data:
|
|
9
|
+
onVerifyConfigTokenSuccess?: (data: ConfigInfo) => Promise<void>;
|
|
10
10
|
}
|
|
11
|
-
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, disableSettingFetching, maturity, boardMaturity, configToken, onVerifyConfigTokenSuccess, ...rest }: AppConfigProps) => void;
|
|
11
|
+
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, disableSettingFetching, maturity, boardMaturity, configToken, onVerifyConfigTokenSuccess, scope, mode, ...rest }: AppConfigProps) => void;
|
|
12
12
|
export {};
|
|
@@ -26,12 +26,12 @@ import { useAppDispatch } from './useAppDispatch';
|
|
|
26
26
|
import { useAppSelector } from './useAppSelector';
|
|
27
27
|
import { isTapDomain, removeRequestHeaders, setBaseUrl } from '../utils';
|
|
28
28
|
export var useAppConfig = function (_a) {
|
|
29
|
-
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, disableSettingFetching = _a.disableSettingFetching, maturity = _a.maturity, boardMaturity = _a.boardMaturity, configToken = _a.configToken, onVerifyConfigTokenSuccess = _a.onVerifyConfigTokenSuccess, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale", "disableSettingFetching", "maturity", "boardMaturity", "configToken", "onVerifyConfigTokenSuccess"]);
|
|
29
|
+
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, disableSettingFetching = _a.disableSettingFetching, maturity = _a.maturity, boardMaturity = _a.boardMaturity, configToken = _a.configToken, onVerifyConfigTokenSuccess = _a.onVerifyConfigTokenSuccess, scope = _a.scope, mode = _a.mode, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale", "disableSettingFetching", "maturity", "boardMaturity", "configToken", "onVerifyConfigTokenSuccess", "scope", "mode"]);
|
|
30
30
|
var dispatch = useAppDispatch();
|
|
31
31
|
var data = useAppSelector(settingsSelector).data;
|
|
32
32
|
var setAppConfig = function () {
|
|
33
33
|
if (!disableSettingFetching) {
|
|
34
|
-
dispatch(handleSetAppConfig(__assign({ appInfo: appInfo, publicKey: publicKey }, rest)));
|
|
34
|
+
dispatch(handleSetAppConfig(__assign({ appInfo: appInfo, publicKey: publicKey, scope: scope === null || scope === void 0 ? void 0 : scope.toLowerCase(), mode: mode !== null && mode !== void 0 ? mode : 'page' }, rest)));
|
|
35
35
|
}
|
|
36
36
|
dispatch(handleActiveFlowScreens(navigation));
|
|
37
37
|
};
|
package/build/utils/device.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ import { GetResult } from '@fingerprintjs/fingerprintjs';
|
|
|
3
3
|
export declare const getBrowserInfo: () => DeviceDetectorResult;
|
|
4
4
|
export declare const getFingerPrint: () => Promise<GetResult>;
|
|
5
5
|
export declare const mobileOS: () => 'Windows Phone' | 'Android' | 'iOS' | 'unknown';
|
|
6
|
+
export declare function getUserLanguage(): string;
|
|
7
|
+
export declare const userTextDirection: string;
|
package/build/utils/device.js
CHANGED
|
@@ -24,3 +24,9 @@ export var mobileOS = function () {
|
|
|
24
24
|
}
|
|
25
25
|
return 'unknown';
|
|
26
26
|
};
|
|
27
|
+
export function getUserLanguage() {
|
|
28
|
+
if (!navigator.language || (navigator.language !== 'ar' && navigator.language !== 'en'))
|
|
29
|
+
return 'en';
|
|
30
|
+
return navigator.language.substring(0, 2);
|
|
31
|
+
}
|
|
32
|
+
export var userTextDirection = document.documentElement.dir;
|