@tap-payments/auth-jsconnect 2.3.3-test → 2.3.5-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.
@@ -9,6 +9,6 @@ export declare type UploadFileBody = {
9
9
  declare const fileService: {
10
10
  uploadFile: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
11
11
  uploadFileInfo: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<any>;
12
- downloadFile: (id: string, name: string, config?: AxiosRequestConfig) => Promise<void>;
12
+ downloadFile: (id: string, name: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
13
13
  };
14
14
  export { fileService };
package/build/api/file.js CHANGED
@@ -26,6 +26,7 @@ var downloadFile = function (id, name, config) {
26
26
  document.body.appendChild(link);
27
27
  link.click();
28
28
  window.URL.revokeObjectURL(url);
29
+ return response;
29
30
  });
30
31
  };
31
32
  var fileService = {
@@ -133,7 +133,7 @@ declare const API: {
133
133
  fileService: {
134
134
  uploadFile: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
135
135
  uploadFileInfo: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
136
- downloadFile: (id: string, name: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<void>;
136
+ downloadFile: (id: string, name: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
137
137
  };
138
138
  documentService: {
139
139
  updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
@@ -1,6 +1,6 @@
1
+ import { CancelToken } from 'axios';
1
2
  import { RootState } from '../../../app/store';
2
3
  import { ActionState, BankFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
- import { CancelToken } from 'axios';
4
4
  interface VerifyLeadTokenProps {
5
5
  token: string;
6
6
  isInternally?: boolean;
@@ -180,10 +180,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBankEntityInfo', fun
180
180
  });
181
181
  }); });
182
182
  export var createBankAccount = createAsyncThunk('createBankAccount', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
183
- var _a, settings, bank, iban, beneficiaryName, bankName, bankStatementId, confirmPolicy, bank_account, isIBANEditable, isBeneficiaryNameEditable, isBankNameEditable, isBankStatementIdEditable, requestBody, data;
184
- var _b, _c, _d, _e, _f, _g, _h;
185
- return __generator(this, function (_j) {
186
- switch (_j.label) {
183
+ var _a, settings, bank, iban, beneficiaryName, bankName, bankStatementId, confirmPolicy, bank_account, isIBANEditable, isBeneficiaryNameEditable, isBankNameEditable, isBankStatementIdEditable, documentResponse, hasDocument, documentId, documentBody, requestBody, data;
184
+ var _b, _c, _d, _e, _f, _g, _h, _j;
185
+ return __generator(this, function (_k) {
186
+ switch (_k.label) {
187
187
  case 0:
188
188
  _a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
189
189
  iban = params.iban, beneficiaryName = params.beneficiaryName, bankName = params.bankName, bankStatementId = params.bankStatementId, confirmPolicy = params.confirmPolicy;
@@ -192,14 +192,27 @@ export var createBankAccount = createAsyncThunk('createBankAccount', function (p
192
192
  isBeneficiaryNameEditable = true;
193
193
  isBankNameEditable = true;
194
194
  isBankStatementIdEditable = true;
195
+ documentResponse = undefined;
196
+ hasDocument = isBankStatementIdEditable && (bankStatementId || []).length > 0;
197
+ documentId = (_b = bank_account === null || bank_account === void 0 ? void 0 : bank_account.document) === null || _b === void 0 ? void 0 : _b.id;
198
+ if (!(documentId && hasDocument)) return [3, 2];
199
+ documentBody = {
200
+ id: documentId,
201
+ files: bankStatementId || []
202
+ };
203
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
204
+ case 1:
205
+ documentResponse = _k.sent();
206
+ _k.label = 2;
207
+ case 2:
195
208
  requestBody = {
196
- wallet_id: (_f = (_e = (_d = (_c = (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.entity) === null || _d === void 0 ? void 0 : _d.merchant) === null || _e === void 0 ? void 0 : _e.wallet) === null || _f === void 0 ? void 0 : _f.id,
209
+ wallet_id: (_g = (_f = (_e = (_d = (_c = bank.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.business) === null || _d === void 0 ? void 0 : _d.entity) === null || _e === void 0 ? void 0 : _e.merchant) === null || _f === void 0 ? void 0 : _f.wallet) === null || _g === void 0 ? void 0 : _g.id,
197
210
  bank_account: {
198
211
  iban: isIBANEditable ? iban : undefined,
199
212
  beneficiary_name: isBeneficiaryNameEditable ? beneficiaryName : undefined,
200
213
  bank_name: isBankNameEditable ? bankName : undefined,
201
214
  is_acknowledged: confirmPolicy,
202
- document: isBankStatementIdEditable && (bankStatementId || []).length > 0
215
+ document: !documentId && hasDocument
203
216
  ? {
204
217
  type: 'bank_statement',
205
218
  files: bankStatementId || []
@@ -210,11 +223,12 @@ export var createBankAccount = createAsyncThunk('createBankAccount', function (p
210
223
  encryption_contract: ['bank_account.iban', 'bank_account.beneficiary_name', 'bank_account.bank_name']
211
224
  };
212
225
  return [4, API.entityService.createBankAccount(requestBody)];
213
- case 1:
214
- data = (_j.sent()).data;
226
+ case 3:
227
+ data = (_k.sent()).data;
215
228
  if (!data.errors) {
229
+ data.documentData = documentResponse;
216
230
  thunkApi.dispatch(handleNextScreenStep());
217
- (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, requestBody);
231
+ (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
218
232
  }
219
233
  return [2, { data: data, formData: params }];
220
234
  }
@@ -45,13 +45,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
+ var __rest = (this && this.__rest) || function (s, e) {
49
+ var t = {};
50
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ };
48
59
  var _a;
49
60
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
61
  import API from '../../../api';
51
62
  import { FlowsTypes } from '../../../@types';
52
63
  import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
53
64
  import { BRAND_STEP_NAMES } from '../../../constants';
54
- import { findInArrayOrSubArray, isKW, isTwitter, isWebsite, sleep } from '../../../utils';
65
+ import { isKW, isTwitter, isWebsite, sleep } from '../../../utils';
55
66
  export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (_a, thunkApi) {
56
67
  var token = _a.token, isInternally = _a.isInternally;
57
68
  return __awaiter(void 0, void 0, void 0, function () {
@@ -340,7 +351,7 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
340
351
  }); });
341
352
  customerBaseId = (expectedCustomer === null || expectedCustomer === void 0 ? void 0 : expectedCustomer.id) && { id: expectedCustomer.id, period: 'monthly' };
342
353
  salesId = (expectedSale === null || expectedSale === void 0 ? void 0 : expectedSale.id) && { id: expectedSale.id, period: 'monthly' };
343
- customerBase = (customerBaseId || customerLocation.length) && __assign(__assign({}, (customerBaseId && { id: expectedCustomer.id, period: 'monthly' })), (customerLocation.length && { location: customerLocation }));
354
+ customerBase = (customerBaseId || customerLocation.length) && __assign(__assign({}, (customerBaseId && { id: expectedCustomer.id, period: 'monthly' })), (customerLocation.length && { locations: customerLocation }));
344
355
  if (customerBase)
345
356
  requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { customer_base: customerBase }) });
346
357
  if (salesId && isSalesRangeEditable) {
@@ -400,12 +411,14 @@ export var updateBoardSuccess = createAsyncThunk('updateBoardBrandSuccess', func
400
411
  step_name: BRAND_STEP_NAMES.BRAND_SUCCESS,
401
412
  id: id
402
413
  };
403
- data = {};
404
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
414
+ return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
405
415
  case 1:
416
+ data = _g.sent();
417
+ return [4, API.boardService.retrieveBoardInfoStatus(id)];
418
+ case 2:
406
419
  boardInfoData = _g.sent();
407
420
  return [4, thunkApi.dispatch(retrieveBoardDetails(id)).unwrap()];
408
- case 2:
421
+ case 3:
409
422
  _g.sent();
410
423
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
411
424
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
@@ -580,13 +593,13 @@ export var brandSlice = createSlice({
580
593
  state.data.brandData = formData;
581
594
  state.data.brandActivities.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
582
595
  var _b = operations || {}, customer_base = _b.customer_base, sales = _b.sales;
583
- var _c = state.data.brandActivities.responseBody || {}, customerBases = _c.customerBases, expectedSales = _c.expectedSales, expectedCustomerSales = _c.expectedCustomerSales;
584
- var findCustomerBase = findInArrayOrSubArray(expectedCustomerSales, customer_base === null || customer_base === void 0 ? void 0 : customer_base.id);
585
- var findSale = findInArrayOrSubArray(expectedSales, sales === null || sales === void 0 ? void 0 : sales.id);
586
- if (!!findSale)
587
- state.data.brandActivities.expectedSale = findSale;
588
- if (!!findCustomerBase)
589
- state.data.brandActivities.expectedCustomer = findCustomerBase;
596
+ var _c = customer_base || {}, locations = _c.locations, customerBase = __rest(_c, ["locations"]);
597
+ if (locations && locations.length)
598
+ state.data.brandActivities.customerLocations = locations;
599
+ if (!!sales)
600
+ state.data.brandActivities.expectedSale = sales;
601
+ if (!!customerBase)
602
+ state.data.brandActivities.expectedCustomer = customerBase;
590
603
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { activities: data === null || data === void 0 ? void 0 : data.brand_activities });
591
604
  })
592
605
  .addCase(updateBrandActivities.rejected, function (state, action) {
@@ -68,14 +68,14 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
68
68
  var _a;
69
69
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
70
70
  import API from '../../../api';
71
- import { FlowsTypes, IndividualGender, IndividualType } from '../../../@types';
71
+ import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
72
72
  import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
73
73
  import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
74
- import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getEighteenYearsAgo, getUserNameObject, getUserName, sleep, isValidEmail } from '../../../utils';
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getEighteenYearsAgo, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
78
- var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, payload_1, info, hasIndividualCompleted, birthCountry;
78
+ var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, data_1, info, hasIndividualCompleted, birthCountry;
79
79
  var _c, _d, _e, _f, _g, _h, _j, _k;
80
80
  return __generator(this, function (_l) {
81
81
  switch (_l.label) {
@@ -112,10 +112,10 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
112
112
  notification = (boardInfoData || {}).notification;
113
113
  _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
114
114
  if (!(id && type)) return [3, 5];
115
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
115
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
116
116
  case 4:
117
- payload_1 = (_l.sent()).payload;
118
- individualData = payload_1.data || {};
117
+ data_1 = (_l.sent()).data;
118
+ individualData = data_1 || {};
119
119
  _l.label = 5;
120
120
  case 5:
121
121
  if (!board_id) return [3, 8];
@@ -238,7 +238,7 @@ export var addDetailsAsync = createAsyncThunk('individual/addDetailsAsync', func
238
238
  });
239
239
  }); });
240
240
  export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsByEmail', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
241
- var individual, _a, merchant_id, board_id, user, collectInfo, id, type, _b, resEmail, resPhone, isPhoneAndEmailAvailable, email, mobile, countryCode, hasContact, individualData, hasPhone, requestBody, data_1, payload, data;
241
+ var individual, _a, merchant_id, board_id, user, collectInfo, id, type, _b, resEmail, resPhone, isPhoneAndEmailAvailable, email, mobile, countryCode, hasContact, individualData, hasPhone, requestBody, data_2, payload, data;
242
242
  var _c;
243
243
  return __generator(this, function (_d) {
244
244
  switch (_d.label) {
@@ -269,16 +269,16 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
269
269
  };
270
270
  return [4, API.individualService.updateIndividual(requestBody)];
271
271
  case 1:
272
- data_1 = _d.sent();
273
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.user;
272
+ data_2 = _d.sent();
273
+ individualData = data_2 === null || data_2 === void 0 ? void 0 : data_2.user;
274
274
  if (type === IndividualType.SHARE_HOLDER)
275
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.shareholder;
275
+ individualData = data_2 === null || data_2 === void 0 ? void 0 : data_2.shareholder;
276
276
  else if (type === IndividualType.BOARD_MEMBER)
277
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.board_member;
277
+ individualData = data_2 === null || data_2 === void 0 ? void 0 : data_2.board_member;
278
278
  else if (type === IndividualType.BUYER)
279
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.buyer;
279
+ individualData = data_2 === null || data_2 === void 0 ? void 0 : data_2.buyer;
280
280
  else if (type === IndividualType.CUSTOMER)
281
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.customer;
281
+ individualData = data_2 === null || data_2 === void 0 ? void 0 : data_2.customer;
282
282
  _d.label = 2;
283
283
  case 2:
284
284
  payload = {
@@ -405,7 +405,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
405
405
  });
406
406
  }); });
407
407
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
408
- var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type, payload_2, info, hasIndividualCompleted, birthCountry;
408
+ var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type, data_3, info, hasIndividualCompleted, birthCountry;
409
409
  var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
410
410
  return __generator(this, function (_q) {
411
411
  switch (_q.label) {
@@ -444,10 +444,10 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
444
444
  notification = (boardInfoData || {}).notification;
445
445
  _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
446
446
  if (!(id && type)) return [3, 7];
447
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
447
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
448
448
  case 6:
449
- payload_2 = (_q.sent()).payload;
450
- individualData = payload_2.data || {};
449
+ data_3 = (_q.sent()).data;
450
+ individualData = data_3 || {};
451
451
  _q.label = 7;
452
452
  case 7:
453
453
  if (countryCode)
@@ -626,7 +626,7 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
626
626
  });
627
627
  }); });
628
628
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
629
- var _a, settings, individual, _b, notification, user, _c, id, type, civilID, signatureFileId, businessCountry, documentsList, isSendSignatureFile, documentBody, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationEditable, isSourceIncomeEditable, isPEPEditable, isInfluencerEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data;
629
+ var _a, settings, individual, _b, notification, user, _c, id, type, civilID, signatureFileId, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationEditable, isSourceIncomeEditable, isPEPEditable, isInfluencerEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data;
630
630
  var _d, _e;
631
631
  return __generator(this, function (_f) {
632
632
  switch (_f.label) {
@@ -636,23 +636,47 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
636
636
  _c = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
637
637
  civilID = params.civilID, signatureFileId = params.signatureFileId;
638
638
  businessCountry = settings.data.businessCountry;
639
- documentsList = [];
639
+ hasCivilIdDocument = (civilID || []).length > 0;
640
+ hasSignatureDocument = (signatureFileId || []).length > 0;
640
641
  isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
641
- if ((civilID || []).length > 0)
642
+ civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
643
+ signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
644
+ if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 2];
645
+ documentBody = {
646
+ id: civilIdDocument.id,
647
+ images: civilID
648
+ };
649
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
650
+ case 1:
651
+ _f.sent();
652
+ _f.label = 2;
653
+ case 2:
654
+ if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 4];
655
+ documentBody = {
656
+ id: signatureDocument.id,
657
+ images: signatureFileId
658
+ };
659
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
660
+ case 3:
661
+ _f.sent();
662
+ _f.label = 4;
663
+ case 4:
664
+ documentsList = [];
665
+ if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
642
666
  documentsList.push({ type: 'Civil ID File', images: civilID });
643
- if (isSendSignatureFile && (signatureFileId || []).length > 0)
667
+ if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
644
668
  documentsList.push({ type: 'Signature File', images: signatureFileId });
669
+ if (!(documentsList.length > 0)) return [3, 6];
645
670
  documentBody = {
646
671
  individual_type_id: id || '',
647
672
  country: businessCountry.iso2,
648
673
  documents: documentsList
649
674
  };
650
- if (!(documentsList.length > 0)) return [3, 2];
651
675
  return [4, API.documentService.updateDocumentInfo(documentBody)];
652
- case 1:
676
+ case 5:
653
677
  _f.sent();
654
- _f.label = 2;
655
- case 2:
678
+ _f.label = 6;
679
+ case 6:
656
680
  occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
657
681
  isOccupationEditable = true;
658
682
  isSourceIncomeEditable = true;
@@ -661,8 +685,8 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
661
685
  isSharesAvailable = shareCount || shareValue;
662
686
  pepInfo = isPEPEditable ? isPEP : undefined;
663
687
  influencerInfo = isInfluencerEditable ? isInfluencer : undefined;
664
- occupationInfo = isOccupationEditable ? { id: occupation.id } : undefined;
665
- sourceIncomeInfo = isSourceIncomeEditable ? [{ id: sourceIncome.id }] : undefined;
688
+ occupationInfo = isOccupationEditable ? (occupation === null || occupation === void 0 ? void 0 : occupation.id) && { id: occupation.id } : undefined;
689
+ sourceIncomeInfo = isSourceIncomeEditable ? (sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) && [{ id: sourceIncome.id }] : undefined;
666
690
  monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) && { id: monthlyIncome.id };
667
691
  userPayload = {
668
692
  occupation: occupationInfo,
@@ -699,7 +723,7 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
699
723
  payload = {};
700
724
  requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
701
725
  return [4, API.individualService.updateIndividual(requestBody)];
702
- case 3:
726
+ case 7:
703
727
  data = (_f.sent()).data;
704
728
  thunkApi.dispatch(handleNextScreenStep());
705
729
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
@@ -26,7 +26,7 @@ var CollectPhoneEmail = function (_a) {
26
26
  var _c = React.useState(false), emailChecking = _c[0], setEmailChecking = _c[1];
27
27
  var isEmailAvailable = isValidEmail(email);
28
28
  var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
29
- return (_jsxs(Box, __assign({ sx: { mb: 0 } }, { children: [_jsx(MobileNumber, { sx: { mb: isEmailAvailable ? 0 : 3 }, show: !isPhoneAvailable, countries: countries, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Email, { show: !listActive && !isEmailAvailable, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking })] })));
29
+ return (_jsxs(Box, __assign({ sx: { mt: 1.5 } }, { children: [_jsx(MobileNumber, { sx: { mb: isEmailAvailable ? 0 : 3 }, show: !isPhoneAvailable, countries: countries, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Email, { show: !listActive && !isEmailAvailable, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking })] })));
30
30
  };
31
31
  export default React.memo(CollectPhoneEmail);
32
32
  CollectPhoneEmail.defaultProps = {};
@@ -35,7 +35,7 @@ import Text from '../../../../components/Text';
35
35
  import CheckIcon from '../../../shared/CheckIcon';
36
36
  import { ScreenContainer } from '../../../shared/Containers';
37
37
  import { addDetailsAsync, individualSelector, requestDetailsByEmail, resetIndividualData } from '../../../app/individual/individualStore';
38
- import ListButton from '../../../shared/Button/ListButton';
38
+ import IndividualActionButtons from '../../../../features/shared/Button/IndividualActionButtons';
39
39
  import { IndividualCollectInfoValidationSchema } from './validation';
40
40
  import CollectPhoneEmail from './CollectPhoneEmail';
41
41
  var ScreenContainerStyled = styled(ScreenContainer)(function (_a) {
@@ -88,7 +88,7 @@ var UserList = function (_a) {
88
88
  var _l = data.individualCollectData, email = _l.email, mobile = _l.mobile, responseBody = _l.responseBody;
89
89
  var is_available = (responseBody || {}).is_available;
90
90
  var verify = data.verify;
91
- var userList = (verify.responseBody || {}).userList;
91
+ var _m = verify.responseBody || {}, userList = _m.userList, notification = _m.notification;
92
92
  var methods = useForm({
93
93
  resolver: yupResolver(IndividualCollectInfoValidationSchema(activeUser)),
94
94
  defaultValues: {
@@ -156,6 +156,10 @@ var UserList = function (_a) {
156
156
  var isActiveUser = function (user) {
157
157
  return (activeUser === null || activeUser === void 0 ? void 0 : activeUser.id) === user.id;
158
158
  };
159
+ var isSameUserRequestedBefore = function (user) {
160
+ var _a;
161
+ return (user === null || user === void 0 ? void 0 : user.id) === ((_a = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _a === void 0 ? void 0 : _a.id);
162
+ };
159
163
  var isPhoneAndEmailAvailable = function (user) {
160
164
  var _a = (user === null || user === void 0 ? void 0 : user.contact) || { email: '' }, resEmail = _a.email, phone = _a.phone;
161
165
  return !!(isValidEmail(resEmail) && (phone === null || phone === void 0 ? void 0 : phone.country_code) && (phone === null || phone === void 0 ? void 0 : phone.number));
@@ -181,7 +185,7 @@ var UserList = function (_a) {
181
185
  return (_jsx(ScreenContainerStyled, { children: usersMenuList.map(function (user, index) {
182
186
  return (_jsxs(Box, __assign({ sx: index !== usersMenuList.length - 1 ? { borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) } : {} }, { children: [_jsxs(TextBoxStyled, __assign({ sx: {
183
187
  cursor: emailChecking ? 'default' : 'pointer'
184
- }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsxs(TextStyled, { children: [_jsx("span", { children: getName(user) || '' }), _jsx(RoleTextStyled, { children: getUserRole(user) || '' })] }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(ListButton, { isAr: isAr, addDetails: {
188
+ }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsxs(TextStyled, { children: [_jsx("span", { children: getName(user) || '' }), _jsx(RoleTextStyled, { children: getUserRole(user) || '' })] }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(IndividualActionButtons, { isAr: isAr, addDetails: {
185
189
  title: t('add_details'),
186
190
  onClick: onAddDetails,
187
191
  loading: isActiveUser(user) && loading && type === IndividualRequestType.ADD
@@ -191,6 +195,7 @@ var UserList = function (_a) {
191
195
  isRequested: (user === null || user === void 0 ? void 0 : user.isRequestedEmail) || false,
192
196
  disabled: showCollectForm ? disabled : false,
193
197
  onClick: onRequestEmail,
198
+ show: !isSameUserRequestedBefore(user),
194
199
  loading: isActiveUser(user) && loading && type === IndividualRequestType.REQUEST_EMAIL
195
200
  } }) }))] }), index));
196
201
  }) }));
@@ -4,15 +4,16 @@ declare type buttonProps = {
4
4
  title: string;
5
5
  loading: boolean;
6
6
  disabled?: boolean;
7
- children?: React.ReactNode;
8
7
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
9
8
  };
10
- interface ListButtonProps extends ButtonProps {
9
+ interface IndividualActionButtonsProps extends ButtonProps {
11
10
  isAr: boolean;
12
11
  requestEmail: buttonProps & {
13
12
  isRequested: boolean;
13
+ show: boolean;
14
+ children?: React.ReactNode;
14
15
  };
15
16
  addDetails: buttonProps;
16
17
  }
17
- export default function ListButton({ isAr, requestEmail, addDetails }: ListButtonProps): JSX.Element;
18
+ export default function IndividualActionButtons({ isAr, requestEmail, addDetails }: IndividualActionButtonsProps): JSX.Element;
18
19
  export {};
@@ -0,0 +1,132 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import { useTranslation } from 'react-i18next';
14
+ import { styled, useTheme } from '@mui/material/styles';
15
+ import Box from '@mui/material/Box';
16
+ import { ICONS_NAMES } from '../../../constants';
17
+ import Loader from '../../../components/Loader';
18
+ import Button from '../../../components/Button';
19
+ import Icon from '../../../components/Icon';
20
+ import CheckIcon from '../CheckIcon';
21
+ import Collapse from '../../../components/Collapse';
22
+ var ArrowIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
23
+ var theme = _a.theme, isAr = _a.isAr;
24
+ return ({
25
+ width: theme.spacing(2),
26
+ height: theme.spacing(2),
27
+ transform: isAr ? 'scaleX(-1)' : 'scaleX(1)',
28
+ marginInlineEnd: theme.spacing(-0.375),
29
+ verticalAlign: 'middle'
30
+ });
31
+ });
32
+ var CheckIconStyled = styled(CheckIcon)(function (_a) {
33
+ var theme = _a.theme;
34
+ return ({
35
+ width: theme.spacing(2),
36
+ height: theme.spacing(2),
37
+ verticalAlign: 'middle'
38
+ });
39
+ });
40
+ var ButtonBoxStyled = styled(Box)(function (_a) {
41
+ var theme = _a.theme;
42
+ return ({
43
+ margin: theme.spacing(0, 2.5, 2.5, 2.5),
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ justifyContent: 'center',
47
+ flexDirection: 'column'
48
+ });
49
+ });
50
+ var ButtonStyled = styled(Button, {
51
+ shouldForwardProp: function (prop) { return prop !== 'isLoading'; }
52
+ })(function (_a) {
53
+ var theme = _a.theme, isLoading = _a.isLoading;
54
+ return (__assign({ paddingLeft: isLoading ? 0 : 'auto', paddingRight: isLoading ? 0 : 'auto', textTransform: 'none', transition: theme.transitions.create(['width', 'padding'], {
55
+ easing: theme.transitions.easing.easeInOut,
56
+ duration: theme.transitions.duration.complex * 2
57
+ }) }, (isLoading && {
58
+ minWidth: 0,
59
+ width: theme.spacing(6),
60
+ borderRadius: 30
61
+ })));
62
+ });
63
+ var Image = styled('img')(function (_a) {
64
+ var theme = _a.theme;
65
+ return ({
66
+ width: theme.spacing(3),
67
+ height: theme.spacing(3),
68
+ fontSize: theme.spacing(3),
69
+ marginInlineStart: theme.spacing(1),
70
+ verticalAlign: 'middle'
71
+ });
72
+ });
73
+ var TextStyled = styled('span')(function () { return ({
74
+ whiteSpace: 'pre',
75
+ overflow: 'auto'
76
+ }); });
77
+ var LoaderStyled = styled(Loader)(function (_a) {
78
+ var theme = _a.theme;
79
+ return ({
80
+ width: theme.spacing(3.75),
81
+ height: theme.spacing(3.75)
82
+ });
83
+ });
84
+ var RequestEmailButtonStyled = styled(ButtonStyled, {
85
+ shouldForwardProp: function (prop) { return prop !== 'isRequested' && prop !== 'disabled'; }
86
+ })(function (_a) {
87
+ var theme = _a.theme, isRequested = _a.isRequested, disabled = _a.disabled, isLoading = _a.isLoading;
88
+ return ({
89
+ marginTop: theme.spacing(1.5),
90
+ opacity: !isRequested && disabled ? 0.5 : 1,
91
+ '&.MuiButton-outlined': isRequested && !isLoading
92
+ ? {
93
+ backgroundColor: theme.palette.common.white,
94
+ border: "1px solid ".concat(theme.palette.success.main),
95
+ color: theme.palette.success.main,
96
+ '&:hover': {
97
+ cursor: 'pointer',
98
+ backgroundColor: theme.palette.success.main,
99
+ color: theme.palette.common.white,
100
+ img: {
101
+ filter: 'brightness(0) invert(1)'
102
+ },
103
+ svg: {
104
+ filter: 'brightness(0) invert(1)'
105
+ }
106
+ }
107
+ }
108
+ : disabled
109
+ ? {
110
+ '&:hover': {
111
+ cursor: 'default',
112
+ backgroundColor: theme.palette.common.white,
113
+ color: theme.palette.primary.main,
114
+ img: {
115
+ filter: 'none'
116
+ },
117
+ svg: {
118
+ filter: 'none'
119
+ }
120
+ }
121
+ }
122
+ : undefined
123
+ });
124
+ });
125
+ export default function IndividualActionButtons(_a) {
126
+ var isAr = _a.isAr, requestEmail = _a.requestEmail, addDetails = _a.addDetails;
127
+ var t = useTranslation().t;
128
+ var theme = useTheme();
129
+ var isRequestedAndNotLoading = requestEmail.isRequested && !requestEmail.loading;
130
+ var requestEmailLoaderColor = isRequestedAndNotLoading ? theme.palette.success.main : theme.palette.primary.main;
131
+ return (_jsxs(ButtonBoxStyled, { children: [_jsxs(ButtonStyled, __assign({ isLoading: addDetails.loading, type: 'button', variant: 'outlined', onClick: addDetails.onClick, startIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(Image, { src: ICONS_NAMES.ADD_DETAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: addDetails.loading }, { children: _jsx(LoaderStyled, { innerColor: theme.palette.primary.main, outerColor: theme.palette.primary.main, size: 15, toggleAnimation: addDetails.loading }) })), _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(TextStyled, { children: t(addDetails.title) }) }))] })), requestEmail.show && (_jsxs(_Fragment, { children: [requestEmail.children, _jsxs(RequestEmailButtonStyled, __assign({ isRequested: requestEmail.isRequested, isLoading: requestEmail.loading, variant: 'outlined', disabled: requestEmail.disabled, type: 'button', onClick: requestEmail.onClick, startIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(Image, { src: isRequestedAndNotLoading ? ICONS_NAMES.REQUEST_EMAIL_GREEN : ICONS_NAMES.REQUEST_EMAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: isRequestedAndNotLoading ? _jsx(CheckIconStyled, {}) : _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: requestEmail.loading }, { children: _jsx(LoaderStyled, { innerColor: requestEmailLoaderColor, outerColor: requestEmailLoaderColor, size: 15, toggleAnimation: requestEmail.loading }) })), _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(TextStyled, { children: t(requestEmail.title) }) }))] }))] }))] }));
132
+ }
@@ -4,6 +4,6 @@ import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
5
  import FlowsButtons from './FlowsButtons';
6
6
  import SuccessButton from './SuccessButton';
7
- import ListButton from './ListButton';
7
+ import ListButton from './IndividualActionButtons';
8
8
  export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
9
9
  export default Button;
@@ -4,6 +4,6 @@ import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
5
  import FlowsButtons from './FlowsButtons';
6
6
  import SuccessButton from './SuccessButton';
7
- import ListButton from './ListButton';
7
+ import ListButton from './IndividualActionButtons';
8
8
  export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
9
9
  export default Button;
@@ -190,7 +190,7 @@ var UploadFile = function (_a) {
190
190
  });
191
191
  }); };
192
192
  var downloadFile = function () { return __awaiter(void 0, void 0, void 0, function () {
193
- var onDownloadProgress, _a;
193
+ var onDownloadProgress, data, _a;
194
194
  return __generator(this, function (_b) {
195
195
  switch (_b.label) {
196
196
  case 0:
@@ -204,9 +204,11 @@ var UploadFile = function (_a) {
204
204
  _b.trys.push([1, 3, , 4]);
205
205
  return [4, API.fileService.downloadFile(uploadedFile.fileId, uploadedFile.name, { onDownloadProgress: onDownloadProgress })];
206
206
  case 2:
207
- _b.sent();
208
- uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS });
209
- onSuccess(index, uploadedFile);
207
+ data = (_b.sent()).data;
208
+ if (data) {
209
+ uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS });
210
+ onSuccess(index, uploadedFile);
211
+ }
210
212
  return [3, 4];
211
213
  case 3:
212
214
  _a = _b.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.3.3-test",
3
+ "version": "2.3.5-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -1,125 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useTranslation } from 'react-i18next';
14
- import { styled, useTheme } from '@mui/material/styles';
15
- import Box from '@mui/material/Box';
16
- import { ICONS_NAMES } from '../../../constants';
17
- import Loader from '../../../components/Loader';
18
- import Button from '../../../components/Button';
19
- import Icon from '../../../components/Icon';
20
- import CheckIcon from '../CheckIcon';
21
- import Collapse from '../../../components/Collapse';
22
- var ArrowIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
23
- var theme = _a.theme, isAr = _a.isAr;
24
- return ({
25
- width: theme.spacing(2),
26
- height: theme.spacing(2),
27
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)',
28
- marginInlineEnd: theme.spacing(-0.375),
29
- verticalAlign: 'middle'
30
- });
31
- });
32
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
33
- var theme = _a.theme;
34
- return ({
35
- width: theme.spacing(2),
36
- height: theme.spacing(2),
37
- verticalAlign: 'middle'
38
- });
39
- });
40
- var ButtonBoxStyled = styled(Box)(function (_a) {
41
- var theme = _a.theme;
42
- return ({
43
- margin: theme.spacing(0, 2.5, 2.5, 2.5),
44
- display: 'flex',
45
- alignItems: 'center',
46
- justifyContent: 'center',
47
- flexDirection: 'column'
48
- });
49
- });
50
- var ButtonStyled = styled(Button, {
51
- shouldForwardProp: function (prop) { return prop !== 'isLoading'; }
52
- })(function (_a) {
53
- var theme = _a.theme, isLoading = _a.isLoading;
54
- return (__assign({ paddingLeft: isLoading ? 0 : 'auto', paddingRight: isLoading ? 0 : 'auto', textTransform: 'none', transition: theme.transitions.create(['width', 'padding'], {
55
- easing: theme.transitions.easing.easeInOut,
56
- duration: theme.transitions.duration.complex * 2
57
- }) }, (isLoading && {
58
- minWidth: 0,
59
- width: theme.spacing(6),
60
- borderRadius: 30
61
- })));
62
- });
63
- var Image = styled('img')(function (_a) {
64
- var theme = _a.theme;
65
- return ({
66
- width: theme.spacing(3),
67
- height: theme.spacing(3),
68
- fontSize: theme.spacing(3),
69
- marginInlineStart: theme.spacing(1),
70
- verticalAlign: 'middle'
71
- });
72
- });
73
- var TextStyled = styled('span')(function () { return ({
74
- whiteSpace: 'pre',
75
- overflow: 'auto'
76
- }); });
77
- export default function ListButton(_a) {
78
- var isAr = _a.isAr, requestEmail = _a.requestEmail, addDetails = _a.addDetails;
79
- var t = useTranslation().t;
80
- var theme = useTheme();
81
- var requestEmailLoaderColor = requestEmail.isRequested && !requestEmail.loading ? theme.palette.success.main : theme.palette.primary.main;
82
- return (_jsxs(ButtonBoxStyled, { children: [addDetails.children, _jsxs(ButtonStyled, __assign({ isLoading: addDetails.loading, sx: { mb: 1.5 }, type: 'button', variant: 'outlined', onClick: addDetails.onClick, startIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(Image, { src: ICONS_NAMES.ADD_DETAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: addDetails.loading }, { children: _jsx(Loader, { style: {
83
- width: theme.spacing(3.75),
84
- height: theme.spacing(3.75)
85
- }, innerColor: theme.palette.primary.main, outerColor: theme.palette.primary.main, size: 15, toggleAnimation: addDetails.loading }) })), _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(TextStyled, { children: t(addDetails.title) }) }))] })), requestEmail.children, _jsxs(ButtonStyled, __assign({ isLoading: requestEmail.loading, variant: 'outlined', type: 'button', sx: requestEmail.isRequested && !requestEmail.loading
86
- ? {
87
- '&.MuiButton-outlined': {
88
- backgroundColor: theme.palette.common.white,
89
- border: "1px solid ".concat(theme.palette.success.main),
90
- color: theme.palette.success.main,
91
- '&:hover': {
92
- cursor: 'pointer',
93
- backgroundColor: theme.palette.success.main,
94
- color: theme.palette.common.white,
95
- img: {
96
- filter: 'brightness(0) invert(1)'
97
- },
98
- svg: {
99
- filter: 'brightness(0) invert(1)'
100
- }
101
- }
102
- }
103
- }
104
- : {
105
- opacity: requestEmail.disabled ? 0.5 : 1,
106
- '&.MuiButton-outlined': requestEmail.disabled
107
- ? {
108
- '&:hover': {
109
- cursor: 'default',
110
- backgroundColor: theme.palette.common.white,
111
- color: theme.palette.primary.main,
112
- img: {
113
- filter: 'none'
114
- },
115
- svg: {
116
- filter: 'none'
117
- }
118
- }
119
- }
120
- : {}
121
- }, onClick: requestEmail.onClick, startIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(Image, { src: requestEmail.isRequested && !requestEmail.loading ? ICONS_NAMES.REQUEST_EMAIL_GREEN : ICONS_NAMES.REQUEST_EMAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: requestEmail.isRequested && !requestEmail.loading ? _jsx(CheckIconStyled, {}) : _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: requestEmail.loading }, { children: _jsx(Loader, { style: {
122
- width: theme.spacing(3.75),
123
- height: theme.spacing(3.75)
124
- }, innerColor: requestEmailLoaderColor, outerColor: requestEmailLoaderColor, size: 15, toggleAnimation: requestEmail.loading }) })), _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(TextStyled, { children: t(requestEmail.title) }) }))] }))] }));
125
- }