@tap-payments/auth-jsconnect 1.0.61 → 1.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/@types/redux.d.ts +1 -0
  2. package/build/assets/locales/ar.json +3 -3
  3. package/build/assets/locales/en.json +3 -3
  4. package/build/constants/assets.d.ts +1 -0
  5. package/build/constants/assets.js +1 -0
  6. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +1 -1
  7. package/build/features/app/bank/bankStore.js +4 -0
  8. package/build/features/app/business/businessStore.d.ts +1 -1
  9. package/build/features/app/business/businessStore.js +46 -37
  10. package/build/features/app/connect/connectStore.js +10 -2
  11. package/build/features/app/individual/individualStore.js +4 -0
  12. package/build/features/app/password/passwordStore.js +6 -0
  13. package/build/features/app/tax/taxStore.js +6 -0
  14. package/build/features/business/Business.js +3 -2
  15. package/build/features/business/screens/Activities/Activities.js +4 -0
  16. package/build/features/business/screens/Activities/ActivitiesList.js +5 -6
  17. package/build/features/business/screens/Activities/SalesChannels.js +4 -5
  18. package/build/features/business/screens/BusinessType/BusinessType.js +1 -6
  19. package/build/features/business/screens/BusinessType/LicenseList.js +17 -12
  20. package/build/features/business/screens/BusinessType/LicenseNumber.js +2 -2
  21. package/build/features/business/screens/Customers/Customers.js +0 -1
  22. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -4
  23. package/build/features/business/screens/Verify/Verify.js +1 -1
  24. package/build/features/password/screens/CreatePassword/CreatePassword.js +0 -1
  25. package/build/features/shared/Button/AbsherButton.js +1 -0
  26. package/build/features/shared/Button/Button.js +1 -1
  27. package/build/features/shared/Button/EmailProvidersButtons.js +5 -2
  28. package/build/features/shared/Button/FlowsButtons.js +11 -6
  29. package/build/features/shared/Button/MobileButton.js +1 -0
  30. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  31. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  export interface SharedState<T> {
2
2
  error: string | null;
3
3
  loading: boolean;
4
+ customLoading?: boolean;
4
5
  data: T;
5
6
  }
6
7
  export interface ActionState<T> {
@@ -215,9 +215,9 @@
215
215
  "select_brand_label": "Brand List",
216
216
  "choose_brand": "Choose Brand",
217
217
  "confirm_enter_iban": "الايبان",
218
- "open_gmail": "Gmail",
219
- "open_outlook": "Outlook",
220
- "open_apple": "Apple",
218
+ "gmail_btn_open_title": "Gmail",
219
+ "outlook_btn_open_title": "Outlook",
220
+ "apple_btn_open_title": "Apple",
221
221
  "choose_any_license": "Choose Licene",
222
222
  "future_work": "Future Work",
223
223
  "add_other_fl": "Add Freelance",
@@ -229,9 +229,9 @@
229
229
  "select_brand_label": "Brand List",
230
230
  "choose_brand": "Choose Brand",
231
231
  "confirm_enter_iban": "IBAN",
232
- "open_gmail": "Gmail",
233
- "open_outlook": "Outlook",
234
- "open_apple": "Apple",
232
+ "gmail_btn_open_title": "Gmail",
233
+ "outlook_btn_open_title": "Outlook",
234
+ "apple_btn_open_title": "Apple",
235
235
  "choose_any_license": "Choose Licene",
236
236
  "future_work": "Future Work",
237
237
  "add_other_fl": "Add Freelance",
@@ -30,6 +30,7 @@ export declare const ICONS_NAMES: {
30
30
  ID_IMAGE: string;
31
31
  MOBILE_IMAGE: string;
32
32
  WHITE_ARROW: string;
33
+ BLACK_ARROW: string;
33
34
  SUCCESS: string;
34
35
  ABSHER_LOGO: string;
35
36
  EMAIL_ICON: string;
@@ -30,6 +30,7 @@ export var ICONS_NAMES = {
30
30
  ID_IMAGE: 'https://villageofwarwick.org/wp-content/uploads/2020/02/ICON99-512-1.png',
31
31
  MOBILE_IMAGE: 'https://image.shutterstock.com/image-vector/smartphone-icon-logo-260nw-767440327.jpg',
32
32
  WHITE_ARROW: 'https://tap-connecet.b-cdn.net/imgs/whiteArrow.svg',
33
+ BLACK_ARROW: 'https://dash.b-cdn.net/icons/menu/arrow_right_icon.svg',
33
34
  SUCCESS: 'https://tap-connecet.b-cdn.net/imgs/success.svg',
34
35
  ABSHER_LOGO: 'https://dash.b-cdn.net/icons/menu/Absher.svg',
35
36
  EMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/email.png',
@@ -36,6 +36,6 @@ var VerifyAndRedirect = function (_a) {
36
36
  }, 300);
37
37
  }
38
38
  }, [data.verify.responseBody]);
39
- return (_jsxs(ScreenContainerStyled, { children: [isLoading && _jsx(Loader, {}), errorMessage && _jsx(Error, { error: errorMessage }), !isLoading && !errorMessage && _jsx(Error, { error: 'verified' })] }));
39
+ return (_jsxs(ScreenContainerStyled, { children: [isLoading && _jsx(Loader, {}), errorMessage && _jsx(Error, { error: errorMessage })] }));
40
40
  };
41
41
  export default React.memo(VerifyAndRedirect);
@@ -166,6 +166,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
166
166
  var initialState = {
167
167
  error: null,
168
168
  loading: false,
169
+ customLoading: false,
169
170
  data: {
170
171
  verify: {
171
172
  token: ''
@@ -198,10 +199,12 @@ export var bankSlice = createSlice({
198
199
  builder
199
200
  .addCase(verifyLeadToken.pending, function (state) {
200
201
  state.error = null;
202
+ state.customLoading = true;
201
203
  })
202
204
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
203
205
  var _a;
204
206
  state.error = null;
207
+ state.customLoading = false;
205
208
  var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
206
209
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
207
210
  if (description) {
@@ -213,6 +216,7 @@ export var bankSlice = createSlice({
213
216
  })
214
217
  .addCase(verifyLeadToken.rejected, function (state, action) {
215
218
  state.error = action.error.message;
219
+ state.customLoading = false;
216
220
  })
217
221
  .addCase(verifyBankLeadOTP.pending, function (state) {
218
222
  state.loading = true;
@@ -29,7 +29,7 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
29
29
  }, {}>;
30
30
  export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<{
31
31
  data: any;
32
- }, void, {}>;
32
+ }, string, {}>;
33
33
  export declare const updateLeadBusinessType: import("@reduxjs/toolkit").AsyncThunk<{
34
34
  data: any;
35
35
  formData: BusinessTypeFormValues;
@@ -91,18 +91,21 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
91
91
  case 1:
92
92
  data = (_a.sent()).data;
93
93
  leadResponse = undefined;
94
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
94
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 4];
95
95
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
96
96
  case 2:
97
97
  leadResponse = _a.sent();
98
+ return [4, thunkApi.dispatch(retrieveEntityList(data === null || data === void 0 ? void 0 : data.id))];
99
+ case 3:
100
+ _a.sent();
98
101
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
99
102
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
100
103
  }
101
104
  if (data.step_name === 'business_info') {
102
105
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
103
106
  }
104
- _a.label = 3;
105
- case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
107
+ _a.label = 4;
108
+ case 4: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
106
109
  }
107
110
  });
108
111
  }); });
@@ -179,17 +182,13 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
179
182
  }
180
183
  });
181
184
  }); });
182
- export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
183
- var business, leadId, data;
184
- var _a;
185
- return __generator(this, function (_b) {
186
- switch (_b.label) {
187
- case 0:
188
- business = thunkApi.getState().business;
189
- leadId = (_a = business.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.id;
190
- return [4, API.leadService.retrieveEntityList(leadId)];
185
+ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
186
+ var data;
187
+ return __generator(this, function (_a) {
188
+ switch (_a.label) {
189
+ case 0: return [4, API.leadService.retrieveEntityList(leadId)];
191
190
  case 1:
192
- data = (_b.sent()).data;
191
+ data = (_a.sent()).data;
193
192
  return [2, { data: data }];
194
193
  }
195
194
  });
@@ -212,11 +211,13 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
212
211
  return [4, API.leadService.updateLead(payload)];
213
212
  case 1:
214
213
  data = (_g.sent()).data;
215
- if (!data.errors) {
216
- thunkApi.dispatch(createAccount());
217
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
218
- }
219
- return [2, { data: data, formData: params }];
214
+ if (!!data.errors) return [3, 3];
215
+ return [4, thunkApi.dispatch(createAccount())];
216
+ case 2:
217
+ _g.sent();
218
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
219
+ _g.label = 3;
220
+ case 3: return [2, { data: data, formData: params }];
220
221
  }
221
222
  });
222
223
  }); });
@@ -366,6 +367,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
366
367
  var initialState = {
367
368
  error: null,
368
369
  loading: false,
370
+ customLoading: false,
369
371
  data: {
370
372
  businessCountry: defaultCountry,
371
373
  countries: [],
@@ -416,23 +418,28 @@ export var businessSlice = createSlice({
416
418
  builder
417
419
  .addCase(getCountries.fulfilled, function (state, action) {
418
420
  state.error = null;
421
+ state.customLoading = false;
419
422
  var _a = action.payload, businessCountry = _a.businessCountry, countries = _a.countries;
420
423
  state.data.countries = countries;
421
424
  state.data.businessCountry = businessCountry || defaultCountry;
422
425
  })
423
426
  .addCase(getCountries.pending, function (state) {
424
427
  state.error = null;
428
+ state.customLoading = true;
425
429
  })
426
430
  .addCase(getCountries.rejected, function (state, action) {
427
431
  state.error = action.error.message;
432
+ state.customLoading = false;
428
433
  })
429
434
  .addCase(verifyLeadToken.pending, function (state) {
430
435
  state.error = null;
436
+ state.customLoading = true;
431
437
  })
432
438
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
433
- var _a, _b, _c, _d, _e;
439
+ var _a;
434
440
  state.error = null;
435
- var _f = action.payload, data = _f.data, token = _f.token, leadData = _f.leadData;
441
+ state.customLoading = false;
442
+ var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
436
443
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
437
444
  if (description) {
438
445
  state.error = description;
@@ -441,16 +448,10 @@ export var businessSlice = createSlice({
441
448
  state.data.verify.responseBody = __assign(__assign({}, data), leadData);
442
449
  state.data.verify.token = token;
443
450
  state.data.otpData.isNID = false;
444
- if (!!((_c = (_b = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _b === void 0 ? void 0 : _b.license) === null || _c === void 0 ? void 0 : _c.issuing_date)) {
445
- state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_e = (_d = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _d === void 0 ? void 0 : _d.license) === null || _e === void 0 ? void 0 : _e.issuing_date).format('YYYY-MM-DD'));
446
- }
447
- var activities = (leadData === null || leadData === void 0 ? void 0 : leadData.entity_activities) || [];
448
- var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
449
- if (!!selectedActivity)
450
- state.data.activitiesData.activities = [selectedActivity];
451
451
  })
452
452
  .addCase(verifyLeadToken.rejected, function (state, action) {
453
453
  state.error = action.error.message;
454
+ state.customLoading = false;
454
455
  })
455
456
  .addCase(verifyLeadOTP.pending, function (state) {
456
457
  state.loading = true;
@@ -474,13 +475,17 @@ export var businessSlice = createSlice({
474
475
  state.error = action.error.message;
475
476
  })
476
477
  .addCase(updateLeadIdentity.pending, function (state, action) {
477
- var _a;
478
- state.loading = ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend) ? false : true;
478
+ var _a, _b;
479
+ if ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend)
480
+ state.customLoading = true;
481
+ if ((_b = action.meta.arg) === null || _b === void 0 ? void 0 : _b.isResend)
482
+ state.loading = true;
479
483
  state.error = null;
480
484
  })
481
485
  .addCase(updateLeadIdentity.fulfilled, function (state, action) {
482
486
  var _a;
483
487
  state.loading = false;
488
+ state.customLoading = false;
484
489
  state.error = null;
485
490
  var _b = action.payload, data = _b.data, formData = _b.formData;
486
491
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -495,14 +500,17 @@ export var businessSlice = createSlice({
495
500
  })
496
501
  .addCase(updateLeadIdentity.rejected, function (state, action) {
497
502
  state.loading = false;
503
+ state.customLoading = false;
498
504
  state.error = action.error.message;
499
505
  })
500
506
  .addCase(retrieveEntityList.pending, function (state) {
501
507
  state.error = null;
508
+ state.customLoading = true;
502
509
  })
503
510
  .addCase(retrieveEntityList.fulfilled, function (state, action) {
504
511
  var _a, _b;
505
512
  state.error = null;
513
+ state.customLoading = false;
506
514
  var data = action.payload.data;
507
515
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
508
516
  var licenseList = [];
@@ -528,31 +536,32 @@ export var businessSlice = createSlice({
528
536
  })
529
537
  .addCase(retrieveEntityList.rejected, function (state, action) {
530
538
  state.error = action.error.message;
539
+ state.customLoading = false;
531
540
  })
532
541
  .addCase(updateLeadBusinessType.pending, function (state) {
533
542
  state.loading = true;
534
543
  state.error = null;
535
544
  })
536
545
  .addCase(updateLeadBusinessType.fulfilled, function (state, action) {
537
- var _a, _b, _c, _d, _e;
538
- state.loading = true;
546
+ var _a, _b, _c, _d;
547
+ state.loading = false;
539
548
  state.error = null;
540
- var _f = action.payload, data = _f.data, formData = _f.formData;
549
+ var _e = action.payload, data = _e.data, formData = _e.formData;
541
550
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
542
551
  if (description) {
543
552
  state.error = description;
544
553
  return;
545
554
  }
546
555
  state.data.businessTypeData = __assign(__assign({}, state.data.businessTypeData), formData);
547
- if (!!((_c = (_b = data === null || data === void 0 ? void 0 : data.entity) === null || _b === void 0 ? void 0 : _b.license) === null || _c === void 0 ? void 0 : _c.issuing_date)) {
548
- state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_e = (_d = data === null || data === void 0 ? void 0 : data.entity) === null || _d === void 0 ? void 0 : _d.license) === null || _e === void 0 ? void 0 : _e.issuing_date).format('YYYY-MM-DD'));
556
+ var entity = data.entity, entity_activities = data.entity_activities;
557
+ if (!!((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date)) {
558
+ state.data.activitiesData.operationStartDate = convertNumbers2English(moment((_d = (_c = data === null || data === void 0 ? void 0 : data.entity) === null || _c === void 0 ? void 0 : _c.license) === null || _d === void 0 ? void 0 : _d.issuing_date).format('YYYY-MM-DD'));
549
559
  }
550
- var activities = (data === null || data === void 0 ? void 0 : data.entity_activities) || [];
560
+ var activities = entity_activities || [];
551
561
  var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
552
562
  if (!!selectedActivity)
553
563
  state.data.activitiesData.activities = [selectedActivity];
554
- var licenseList = (state.data.businessTypeData.responseBody || { licenseList: [] }).licenseList;
555
- state.data.businessTypeData.responseBody = __assign(__assign({ licenseList: licenseList }, data), { activities: activities });
564
+ state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities });
556
565
  })
557
566
  .addCase(updateLeadBusinessType.rejected, function (state, action) {
558
567
  state.loading = false;
@@ -368,6 +368,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
368
368
  var initialState = {
369
369
  error: null,
370
370
  loading: false,
371
+ customLoading: false,
371
372
  data: {
372
373
  businessCountry: defaultCountry,
373
374
  countries: [],
@@ -432,6 +433,7 @@ export var connectSlice = createSlice({
432
433
  builder
433
434
  .addCase(getCountries.fulfilled, function (state, action) {
434
435
  state.error = null;
436
+ state.customLoading = false;
435
437
  var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
436
438
  state.data.countries = countries;
437
439
  state.data.businessCountry = businessCountry || defaultCountry;
@@ -439,13 +441,16 @@ export var connectSlice = createSlice({
439
441
  })
440
442
  .addCase(getCountries.pending, function (state) {
441
443
  state.error = null;
444
+ state.customLoading = true;
442
445
  })
443
446
  .addCase(getCountries.rejected, function (state, action) {
444
447
  state.error = action.error.message;
448
+ state.customLoading = false;
445
449
  })
446
450
  .addCase(createMobileAuth.fulfilled, function (state, action) {
447
451
  var _a;
448
452
  state.loading = false;
453
+ state.customLoading = false;
449
454
  state.error = null;
450
455
  var _b = action.payload, formData = _b.formData, response = _b.response;
451
456
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -458,12 +463,15 @@ export var connectSlice = createSlice({
458
463
  state.data.otpData.isAbsher = false;
459
464
  })
460
465
  .addCase(createMobileAuth.pending, function (state, action) {
461
- var _a;
462
- state.loading = ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend) ? false : true;
466
+ if (action.meta.arg.isResend)
467
+ state.customLoading = true;
468
+ if (!action.meta.arg.isResend)
469
+ state.loading = true;
463
470
  state.error = null;
464
471
  })
465
472
  .addCase(createMobileAuth.rejected, function (state, action) {
466
473
  state.loading = false;
474
+ state.customLoading = false;
467
475
  state.error = action.error.message;
468
476
  })
469
477
  .addCase(createNIDAuth.fulfilled, function (state, action) {
@@ -164,6 +164,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
164
164
  var initialState = {
165
165
  error: null,
166
166
  loading: false,
167
+ customLoading: false,
167
168
  data: {
168
169
  verify: {
169
170
  token: ''
@@ -199,10 +200,12 @@ export var individualSlice = createSlice({
199
200
  builder
200
201
  .addCase(verifyLeadToken.pending, function (state) {
201
202
  state.error = null;
203
+ state.customLoading = true;
202
204
  })
203
205
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
204
206
  var _a;
205
207
  state.error = null;
208
+ state.customLoading = false;
206
209
  var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
207
210
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
208
211
  if (description) {
@@ -214,6 +217,7 @@ export var individualSlice = createSlice({
214
217
  })
215
218
  .addCase(verifyLeadToken.rejected, function (state, action) {
216
219
  state.error = action.error.message;
220
+ state.customLoading = false;
217
221
  })
218
222
  .addCase(verifyLeadOTP.pending, function (state) {
219
223
  state.loading = true;
@@ -158,6 +158,7 @@ export var passwordSlice = createSlice({
158
158
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
159
159
  var _a;
160
160
  state.error = null;
161
+ state.customLoading = false;
161
162
  var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
162
163
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
163
164
  if (description) {
@@ -166,9 +167,14 @@ export var passwordSlice = createSlice({
166
167
  }
167
168
  state.data.verify.responseBody = __assign(__assign({}, data), leadData);
168
169
  state.data.verify.token = token;
170
+ })
171
+ .addCase(verifyLeadToken.pending, function (state, action) {
172
+ state.customLoading = true;
173
+ state.error = null;
169
174
  })
170
175
  .addCase(verifyLeadToken.rejected, function (state, action) {
171
176
  state.error = action.error.message;
177
+ state.customLoading = false;
172
178
  })
173
179
  .addCase(verifyPasswordLeadOTP.pending, function (state) {
174
180
  state.loading = true;
@@ -190,6 +190,7 @@ export var taxSlice = createSlice({
190
190
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
191
191
  var _a;
192
192
  state.error = null;
193
+ state.customLoading = false;
193
194
  var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
194
195
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
195
196
  if (description) {
@@ -198,9 +199,14 @@ export var taxSlice = createSlice({
198
199
  }
199
200
  state.data.verify.responseBody = __assign(__assign({}, data), leadData);
200
201
  state.data.verify.token = token;
202
+ })
203
+ .addCase(verifyLeadToken.pending, function (state, action) {
204
+ state.error = null;
205
+ state.customLoading = true;
201
206
  })
202
207
  .addCase(verifyLeadToken.rejected, function (state, action) {
203
208
  state.error = action.error.message;
209
+ state.customLoading = false;
204
210
  })
205
211
  .addCase(verifyTaxLeadOTP.pending, function (state) {
206
212
  state.loading = true;
@@ -14,7 +14,7 @@ import React, { memo, useEffect } from 'react';
14
14
  import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
15
15
  import { settingsSelector } from '../../app/settings';
16
16
  import { FeatureContainer } from '../shared/Containers';
17
- import { getCountries, verifyLeadToken } from '../app/business/businessStore';
17
+ import { businessSelector, getCountries, verifyLeadToken } from '../app/business/businessStore';
18
18
  import AnimationFlow from '../../components/AnimationFlow';
19
19
  import { store } from '../../app/store';
20
20
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
@@ -28,6 +28,7 @@ var Business = memo(function (props) {
28
28
  var theme = useAppTheme().theme;
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
+ var customLoading = useAppSelector(businessSelector).customLoading;
31
32
  var loading = useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props)).loading;
32
33
  useErrorListener();
33
34
  var activeScreen = data.activeScreen;
@@ -44,7 +45,7 @@ var Business = memo(function (props) {
44
45
  useEffect(function () {
45
46
  dispatch(getCountries());
46
47
  }, []);
47
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
48
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
48
49
  var Element = _a.element, name = _a.name;
49
50
  var isActive = activeScreen.name === name;
50
51
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -61,6 +61,10 @@ var Activities = function () {
61
61
  var activities = activitiesData.activities;
62
62
  methods.setValue('activities', activities);
63
63
  }, [activitiesData === null || activitiesData === void 0 ? void 0 : activitiesData.activities]);
64
+ React.useEffect(function () {
65
+ if (activitiesData.operationStartDate)
66
+ methods.setValue('operationStartDate', activitiesData.operationStartDate, { shouldValidate: true });
67
+ }, [activitiesData.operationStartDate]);
64
68
  React.useEffect(function () {
65
69
  if (error)
66
70
  dispatch(clearError());
@@ -83,19 +83,18 @@ var ActivitiesList = function (_a) {
83
83
  var t = useTranslation().t;
84
84
  var isAr = useLanguage().isAr;
85
85
  var control = useFormContext().control;
86
+ var data = useSelector(businessSelector).data;
86
87
  var activitiesControl = useController({ name: 'activities', control: control });
87
88
  var controlValue = activitiesControl.field.value;
88
- var data = useSelector(businessSelector).data;
89
89
  var businessTypeData = data.businessTypeData;
90
- var response = businessTypeData.responseBody;
90
+ var activities = (businessTypeData.responseBody || {}).activities;
91
91
  var businessType = (_b = businessTypeData.selectedLicense) === null || _b === void 0 ? void 0 : _b.type;
92
92
  var isCR = businessType === BusinessType.CR;
93
93
  React.useEffect(function () {
94
- var _a;
95
- if (((_a = response === null || response === void 0 ? void 0 : response.activities) === null || _a === void 0 ? void 0 : _a.length) > 0) {
96
- setActivitiesMenuList(response === null || response === void 0 ? void 0 : response.activities);
94
+ if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0) {
95
+ setActivitiesMenuList(activities);
97
96
  }
98
- }, []);
97
+ }, [activities]);
99
98
  var onOpenList = function (event) {
100
99
  var _a;
101
100
  setAnchorEl(event.currentTarget);
@@ -84,13 +84,12 @@ var SalesChannels = function () {
84
84
  var channelsChecked = channelsControl.field.value;
85
85
  var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
86
86
  var data = useSelector(businessSelector).data;
87
- var response = data.businessTypeData.responseBody;
87
+ var channelList = (data.businessTypeData.responseBody || {}).channelList;
88
88
  React.useEffect(function () {
89
- var _a;
90
- if (((_a = response === null || response === void 0 ? void 0 : response.channelList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
91
- setChannelsMenuList(response === null || response === void 0 ? void 0 : response.channelList);
89
+ if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
90
+ setChannelsMenuList(channelList);
92
91
  }
93
- }, [response === null || response === void 0 ? void 0 : response.channelList]);
92
+ }, [channelList]);
94
93
  var handleSalesChannelChange = function (event, checked) {
95
94
  var selected = channelsMenuList.find(function (channel) { return channel.id.toString() === event.target.id; });
96
95
  var isExists = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (selected === null || selected === void 0 ? void 0 : selected.id); });
@@ -21,13 +21,12 @@ import Form from '../../../../components/Form';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import { useLanguage } from '../../../../hooks';
23
23
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
24
- import { businessSelector, clearError, retrieveEntityList, updateLeadBusinessType } from '../../../app/business/businessStore';
24
+ import { businessSelector, clearError, updateLeadBusinessType } from '../../../app/business/businessStore';
25
25
  import Button from '../../../shared/Button';
26
26
  import { LicenseValidationSchema } from './validation';
27
27
  import LicenseList from './LicenseList';
28
28
  var BusinessType = function (_a) {
29
29
  var _b = useSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
30
- var businessTypeData = data.businessTypeData;
31
30
  var t = useTranslation().t;
32
31
  var isAr = useLanguage().isAr;
33
32
  var dispatch = useAppDispatch();
@@ -37,10 +36,6 @@ var BusinessType = function (_a) {
37
36
  defaultValues: data.businessTypeData,
38
37
  mode: 'onChange'
39
38
  });
40
- React.useEffect(function () {
41
- if (!(businessTypeData === null || businessTypeData === void 0 ? void 0 : businessTypeData.responseBody))
42
- dispatch(retrieveEntityList());
43
- }, []);
44
39
  React.useEffect(function () {
45
40
  if (error)
46
41
  dispatch(clearError());
@@ -52,7 +52,7 @@ var LicenseContainer = styled(Box)(function () { return ({
52
52
  }); });
53
53
  var LicenseNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
54
54
  var theme = _a.theme, isSelected = _a.isSelected;
55
- return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
55
+ return (__assign(__assign({ display: 'flex', color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
56
56
  });
57
57
  var LicenseList = function (_a) {
58
58
  var rest = __rest(_a, []);
@@ -64,7 +64,7 @@ var LicenseList = function (_a) {
64
64
  var dispatch = useAppDispatch();
65
65
  var _d = useFormContext(), setValue = _d.setValue, control = _d.control;
66
66
  var selectedLicenseControl = useController({ control: control, name: 'selectedLicense' });
67
- var responseBody = businessTypeData.responseBody, selectedLicense = businessTypeData.selectedLicense;
67
+ var responseBody = businessTypeData.responseBody, selectedLicense = businessTypeData.selectedLicense, licenseNumber = businessTypeData.licenseNumber;
68
68
  var licenseList = (responseBody || { licenseList: [] }).licenseList;
69
69
  var onOpenLicenseList = function (event) {
70
70
  var _a;
@@ -77,12 +77,14 @@ var LicenseList = function (_a) {
77
77
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
78
78
  };
79
79
  React.useEffect(function () {
80
- var list = licenseList || [];
81
- if (list.length > 0) {
82
- setValue('licenseList', list);
80
+ if (licenseList.length > 0)
81
+ setValue('licenseList', licenseList);
82
+ }, [licenseList]);
83
+ React.useEffect(function () {
84
+ if (licenseList.length > 0) {
83
85
  if (!!selectedLicense) {
84
86
  setValue('selectedLicense', selectedLicense, { shouldValidate: true });
85
- setValue('licenseNumber', getLicenseNumber(selectedLicense), { shouldValidate: true });
87
+ setValue('licenseNumber', licenseNumber, { shouldValidate: true });
86
88
  }
87
89
  }
88
90
  }, [licenseList, selectedLicense]);
@@ -93,7 +95,7 @@ var LicenseList = function (_a) {
93
95
  var getLicenseName = function (item) {
94
96
  var _a, _b;
95
97
  if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
96
- return 'future_work';
98
+ return t('future_work');
97
99
  return (isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '';
98
100
  };
99
101
  var isOtherLicense = function (item) {
@@ -110,15 +112,18 @@ var LicenseList = function (_a) {
110
112
  setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
111
113
  onCloseLicenseList();
112
114
  };
115
+ var getLicenseFullName = function (item) {
116
+ if (isAr)
117
+ return (_jsxs(_Fragment, { children: [_jsx("span", { children: getLicenseName(item) }), _jsx("span", { children: ' - ' }), _jsx("span", { children: getLicenseNumber(item) })] }));
118
+ return (_jsxs(_Fragment, { children: [_jsx("span", { children: getLicenseNumber(item) }), _jsx("span", { children: ' - ' }), _jsx("span", { children: getLicenseName(item) })] }));
119
+ };
113
120
  var showLicenseNumber = !anchorEl;
114
121
  var selected = selectedLicenseControl.field.value;
115
122
  var licenseReadonly = !isOtherLicense(selected);
116
123
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
117
- var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : t(getLicenseNumber(selected));
118
- return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
119
- return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item)
120
- ? t(getLicenseName(item))
121
- : getLicenseNumber(item) + ' - ' + getLicenseName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
124
+ var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
125
+ return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? getLicenseName(selected) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
126
+ return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
122
127
  } }) })), _jsx(LicenseNumber, { show: showLicenseNumber, readOnly: licenseReadonly })] }));
123
128
  };
124
129
  export default React.memo(LicenseList);
@@ -14,7 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { CR_NUMBER_LENGTH, FL_NUMBER_LENGTH } from '../../../../constants';
17
- import { removeAllCharsFromNumber, removeAllOtherThanCharsAndNumber } from '../../../../utils';
17
+ import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
18
18
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
19
19
  import ClearIcon from '../../../shared/ClearIcon';
20
20
  import CheckIcon from '../../../shared/CheckIcon';
@@ -31,7 +31,7 @@ var LicenseNumber = function (_a) {
31
31
  var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
32
32
  var handleFLNumberChange = function (_a) {
33
33
  var target = _a.target;
34
- var value = isCR ? removeAllCharsFromNumber(target.value) : removeAllOtherThanCharsAndNumber(target.value);
34
+ var value = removeAllOtherThanCharsAndNumber(target.value);
35
35
  licenseNumberControl.field.onChange(value);
36
36
  };
37
37
  var clearLicenseNumber = function () {
@@ -52,7 +52,6 @@ var Customers = function (_a) {
52
52
  mode: 'onChange'
53
53
  });
54
54
  var onSubmit = function (data) {
55
- console.log('data', data);
56
55
  dispatch(updateCustomersInfo(__assign({}, data)));
57
56
  };
58
57
  var onBack = function () {
@@ -55,22 +55,22 @@ var SuccessWithFlowButtons = function () {
55
55
  var t = useTranslation().t;
56
56
  return (_jsxs(ContainerStyled, { children: [_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [t('ide_successfully_verified_message'), " "] }) }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: [
57
57
  {
58
- title: t('tax_flow_completed'),
58
+ title: t('tax_flow_pending'),
59
59
  href: '#',
60
60
  src: ICONS_NAMES.TAX_ICON
61
61
  },
62
62
  {
63
- title: t('individual_flow_completed'),
63
+ title: t('individual_flow_pending'),
64
64
  href: '#',
65
65
  src: ICONS_NAMES.INDIVIDUAL_ICON
66
66
  },
67
67
  {
68
- title: t('bank_flow_completed'),
68
+ title: t('bank_flow_pending'),
69
69
  href: '#',
70
70
  src: ICONS_NAMES.BANK_ICON
71
71
  },
72
72
  {
73
- title: t('password_flow_completed'),
73
+ title: t('password_flow_pending'),
74
74
  href: '#',
75
75
  src: ICONS_NAMES.PASSWORD_ICON
76
76
  }
@@ -59,7 +59,7 @@ var VerifyNumber = function (_a) {
59
59
  var t = useTranslation().t;
60
60
  var isAr = useLanguage().isAr;
61
61
  React.useEffect(function () {
62
- if (error)
62
+ if (error && methods.formState.isValid)
63
63
  dispatch(clearError());
64
64
  return function () {
65
65
  dispatch(resetOTPScreen());
@@ -43,7 +43,6 @@ var CreatePassword = function (_a) {
43
43
  var isAr = useLanguage().isAr;
44
44
  var dispatch = useAppDispatch();
45
45
  var onSubmit = function (data) {
46
- console.log('data', data);
47
46
  dispatch(handleNextScreenStep());
48
47
  };
49
48
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: true, isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') }))] })) })) }));
@@ -44,6 +44,7 @@ var ButtonStyled = styled(Button, { shouldForwardProp: function (prop) { return
44
44
  var theme = _a.theme, hideIcon = _a.hideIcon;
45
45
  return ({
46
46
  paddingInlineStart: theme.spacing(0.75),
47
+ textTransform: 'none',
47
48
  backgroundColor: theme.palette.common.white,
48
49
  border: "1px solid ".concat(hideIcon ? theme.palette.primary.main : theme.palette.primary.light),
49
50
  color: hideIcon ? theme.palette.primary.main : theme.palette.primary.light,
@@ -63,7 +63,7 @@ var ButtonStyled = styled(Button, {
63
63
  shouldForwardProp: function (prop) { return prop !== 'isBack' && prop !== 'isLoading'; }
64
64
  })(function (_a) {
65
65
  var theme = _a.theme, isBack = _a.isBack, isLoading = _a.isLoading;
66
- return (__assign({ paddingInlineStart: theme.spacing(2.5), marginInlineStart: isBack ? theme.spacing(-5) : theme.spacing(0), paddingLeft: isLoading ? 8 : 'auto', paddingRight: isLoading ? 8 : 'auto', transition: theme.transitions.create(['width', 'padding'], {
66
+ return (__assign({ paddingInlineStart: theme.spacing(2.5), marginInlineStart: isBack ? theme.spacing(-5) : theme.spacing(0), paddingLeft: isLoading ? 8 : 'auto', paddingRight: isLoading ? 8 : 'auto', textTransform: 'none', transition: theme.transitions.create(['width', 'padding'], {
67
67
  easing: theme.transitions.easing.easeInOut,
68
68
  duration: theme.transitions.duration.complex * 2
69
69
  }) }, (isLoading && {
@@ -34,6 +34,7 @@ var GMailButtonStyled = styled(Button)(function (_a) {
34
34
  var theme = _a.theme;
35
35
  return ({
36
36
  width: '100%',
37
+ textTransform: 'none',
37
38
  paddingInlineStart: theme.spacing(0.75),
38
39
  marginBottom: theme.spacing(1.875),
39
40
  backgroundColor: theme.palette.common.white,
@@ -53,8 +54,8 @@ var OutlookButtonStyled = styled(Button)(function (_a) {
53
54
  var theme = _a.theme;
54
55
  return ({
55
56
  width: '100%',
57
+ textTransform: 'none',
56
58
  paddingInlineStart: theme.spacing(0.75),
57
- marginBottom: theme.spacing(1.875),
58
59
  backgroundColor: theme.palette.common.white,
59
60
  border: "1px solid ".concat(theme.palette.primary.main),
60
61
  color: theme.palette.primary.main,
@@ -72,9 +73,11 @@ var AppleButtonStyled = styled(Button)(function (_a) {
72
73
  var theme = _a.theme;
73
74
  return ({
74
75
  width: '100%',
76
+ textTransform: 'none',
75
77
  paddingInlineStart: theme.spacing(0.75),
76
78
  backgroundColor: theme.palette.common.white,
77
79
  border: "1px solid ".concat(theme.palette.primary.main),
80
+ marginBottom: theme.spacing(1.875),
78
81
  color: theme.palette.primary.main,
79
82
  '&:hover': {
80
83
  backgroundColor: theme.palette.primary.main,
@@ -88,5 +91,5 @@ var AppleButtonStyled = styled(Button)(function (_a) {
88
91
  });
89
92
  export default function EmailProvidersButtons(_a) {
90
93
  var gmail = _a.gmail, outlook = _a.outlook, apple = _a.apple;
91
- return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank' }, { children: _jsx(GMailButtonStyled, __assign({ startIcon: _jsx(Image, { src: ICONS_NAMES.GMAIL_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank' }, { children: _jsx(OutlookButtonStyled, __assign({ startIcon: _jsx(Image, { src: ICONS_NAMES.OUTLOOK_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) })), _jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank' }, { children: _jsx(AppleButtonStyled, __assign({ startIcon: _jsx(Image, { src: ICONS_NAMES.APPLE_MAIL_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) }))] }));
94
+ return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank' }, { children: _jsx(GMailButtonStyled, __assign({ startIcon: _jsx(Image, { src: ICONS_NAMES.GMAIL_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), _jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank' }, { children: _jsx(AppleButtonStyled, __assign({ startIcon: _jsx(Image, { src: ICONS_NAMES.APPLE_MAIL_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) })), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank' }, { children: _jsx(OutlookButtonStyled, __assign({ startIcon: _jsx(Image, { src: ICONS_NAMES.OUTLOOK_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) }))] }));
92
95
  }
@@ -10,17 +10,20 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import React from 'react';
13
14
  import Button from '../../../components/Button';
14
15
  import { alpha, styled } from '@mui/material/styles';
15
16
  import Box from '@mui/material/Box';
16
17
  import Link from '@mui/material/Link';
17
- var Image = styled('img')(function (_a) {
18
- var theme = _a.theme;
18
+ import { ICONS_NAMES } from '../../../constants';
19
+ var Image = styled('img', { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
20
+ var theme = _a.theme, isAr = _a.isAr;
19
21
  return ({
20
22
  width: theme.spacing(3),
21
23
  height: theme.spacing(3),
22
24
  fontSize: theme.spacing(3),
23
- marginInlineStart: theme.spacing(1)
25
+ marginInlineStart: theme.spacing(1),
26
+ transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
24
27
  });
25
28
  });
26
29
  var ButtonBoxStyled = styled(Box)(function (_a) {
@@ -33,6 +36,7 @@ var ButtonStyled = styled(Button)(function (_a) {
33
36
  var theme = _a.theme;
34
37
  return ({
35
38
  width: '100%',
39
+ textTransform: 'none',
36
40
  paddingInlineStart: theme.spacing(0.75),
37
41
  backgroundColor: theme.palette.common.white,
38
42
  border: "1px solid ".concat(theme.palette.primary.main),
@@ -49,9 +53,10 @@ var ButtonStyled = styled(Button)(function (_a) {
49
53
  });
50
54
  export default function FlowsButtons(_a) {
51
55
  var buttons = _a.buttons;
52
- return (_jsx(ButtonBoxStyled, { children: buttons.map(function (_a, index) {
56
+ var _b = React.useState(), index = _b[0], setIndex = _b[1];
57
+ return (_jsx(ButtonBoxStyled, { children: buttons.map(function (_a, idx) {
53
58
  var title = _a.title, href = _a.href, src = _a.src;
54
- var isLast = index === buttons.length - 1;
55
- return (_jsx(Link, __assign({ href: href, underline: 'none', target: '_blank' }, { children: _jsx(ButtonStyled, __assign({ sx: { mb: isLast ? 0 : 1.8 }, startIcon: _jsx(Image, { src: src, alt: title }), type: 'button' }, { children: title })) }), index));
59
+ var isLast = idx === buttons.length - 1;
60
+ return (_jsx(Link, __assign({ underline: 'none' }, { children: _jsx(ButtonStyled, __assign({ onMouseEnter: function () { return setIndex(idx); }, onMouseLeave: function () { return setIndex(undefined); }, sx: { mb: isLast ? 0 : 1.8 }, endIcon: _jsx(Image, { src: index === idx ? ICONS_NAMES.WHITE_ARROW : ICONS_NAMES.BLACK_ARROW }), startIcon: _jsx(Image, { src: src, alt: title }), type: 'button' }, { children: title })) }), idx));
56
61
  }) }));
57
62
  }
@@ -42,6 +42,7 @@ var ButtonStyled = styled(Button)(function (_a) {
42
42
  var theme = _a.theme;
43
43
  return ({
44
44
  paddingInlineStart: theme.spacing(0.75),
45
+ textTransform: 'none',
45
46
  backgroundColor: theme.palette.common.white,
46
47
  border: "1px solid ".concat(theme.palette.primary.main),
47
48
  color: theme.palette.primary.main,
@@ -67,6 +67,6 @@ var ThankYou = function (_a) {
67
67
  var title = _a.title, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle;
68
68
  var t = useTranslation().t;
69
69
  var isAr = useLanguage().isAr;
70
- return (_jsxs(ContainerStyled, { children: [title && (_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [title, " "] }) })), _jsx(IconStyled, { src: ICONS_NAMES.EMAIL_ICON, alt: 'loading...' }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('open_gmail'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('open_outlook'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('open_apple'), href: 'https://www.icloud.com/mail/' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(AbsherButton, __assign({ hideIcon: true, isAr: isAr, onClick: onSuccess }, { children: t(successTitle || 'open_mail_box') })) }))] }));
70
+ return (_jsxs(ContainerStyled, { children: [title && (_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [title, " "] }) })), _jsx(IconStyled, { src: ICONS_NAMES.EMAIL_ICON, alt: 'loading...' }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'https://www.icloud.com/mail/' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(AbsherButton, __assign({ hideIcon: true, isAr: isAr, onClick: onSuccess }, { children: t(successTitle || 'open_mail_box') })) }))] }));
71
71
  };
72
72
  export default React.memo(ThankYou);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",