@tap-payments/auth-jsconnect 2.0.35-test → 2.0.35

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 (299) hide show
  1. package/build/@types/app.d.ts +52 -21
  2. package/build/@types/app.js +10 -3
  3. package/build/@types/form.d.ts +18 -10
  4. package/build/api/auth.d.ts +24 -2
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +53 -5
  14. package/build/api/entity.js +39 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +44 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +1 -1
  23. package/build/app/rootReducer.js +2 -2
  24. package/build/app/settings.d.ts +8 -2
  25. package/build/app/settings.js +29 -12
  26. package/build/app/store.d.ts +3 -3
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +5 -1
  34. package/build/components/AnimationFlow/Dialog.js +11 -5
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  41. package/build/components/FileInput/DragAndDrop.js +108 -8
  42. package/build/components/Lottie/Lottie.d.ts +878 -0
  43. package/build/components/Lottie/Lottie.js +58 -0
  44. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  45. package/build/components/Lottie/files/success.json +425 -0
  46. package/build/components/Lottie/index.d.ts +3 -0
  47. package/build/components/Lottie/index.js +3 -0
  48. package/build/components/OTPField/OTPField.d.ts +2 -1
  49. package/build/components/OTPField/OTPField.js +2 -2
  50. package/build/components/OTPTimer/OTPTimer.js +1 -1
  51. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  52. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  53. package/build/components/ProgressBar/index.d.ts +2 -0
  54. package/build/components/ProgressBar/index.js +2 -0
  55. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  56. package/build/components/RadioLabel/RadioLabel.js +2 -2
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  59. package/build/constants/api.d.ts +6 -0
  60. package/build/constants/api.js +14 -1
  61. package/build/constants/app.d.ts +7 -5
  62. package/build/constants/app.js +56 -23
  63. package/build/constants/assets.d.ts +14 -0
  64. package/build/constants/assets.js +16 -2
  65. package/build/constants/dummy.d.ts +1 -1
  66. package/build/constants/dummy.js +2 -2
  67. package/build/constants/validation.d.ts +8 -0
  68. package/build/constants/validation.js +9 -1
  69. package/build/features/app/auth/authStore.d.ts +47 -0
  70. package/build/features/app/auth/authStore.js +260 -0
  71. package/build/features/app/bank/bankStore.d.ts +16 -0
  72. package/build/features/app/bank/bankStore.js +86 -39
  73. package/build/features/app/business/businessStore.d.ts +22 -3
  74. package/build/features/app/business/businessStore.js +432 -291
  75. package/build/features/app/connect/connectStore.d.ts +33 -31
  76. package/build/features/app/connect/connectStore.js +394 -308
  77. package/build/features/app/entity/entityStore.d.ts +30 -5
  78. package/build/features/app/entity/entityStore.js +258 -47
  79. package/build/features/app/individual/individualStore.d.ts +17 -0
  80. package/build/features/app/individual/individualStore.js +170 -84
  81. package/build/features/app/password/passwordStore.js +1 -1
  82. package/build/features/app/tax/taxStore.js +18 -14
  83. package/build/features/auth/Auth.d.ts +10 -0
  84. package/build/features/auth/Auth.js +87 -0
  85. package/build/features/auth/index.d.ts +1 -0
  86. package/build/features/auth/index.js +1 -0
  87. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  88. package/build/features/auth/screens/NID/DOB.js +47 -0
  89. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  90. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  91. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  92. package/build/features/auth/screens/NID/NID.js +68 -0
  93. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  94. package/build/features/auth/screens/NID/TAC.js +87 -0
  95. package/build/features/auth/screens/NID/index.d.ts +3 -0
  96. package/build/features/auth/screens/NID/index.js +2 -0
  97. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  98. package/build/features/auth/screens/NID/validation.js +19 -0
  99. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  100. package/build/features/auth/screens/OTP/OTP.js +76 -0
  101. package/build/features/{otp/screens/OTPVerify/Verify.d.ts → auth/screens/OTP/OTPInput.d.ts} +0 -0
  102. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/OTPInput.js +11 -7
  103. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  104. package/build/features/auth/screens/OTP/index.js +2 -0
  105. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.d.ts +0 -0
  106. package/build/features/{otp/screens/OTPVerify → auth/screens/OTP}/validation.js +0 -0
  107. package/build/features/bank/Bank.js +12 -6
  108. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  109. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  110. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  111. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  112. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  113. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  114. package/build/features/business/Business.d.ts +1 -1
  115. package/build/features/business/Business.js +14 -7
  116. package/build/features/business/screens/Activities/Activities.js +16 -17
  117. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  118. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  119. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  120. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  121. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  122. package/build/features/business/screens/Activities/validation.js +0 -9
  123. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  124. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  126. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  127. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  128. package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
  129. package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
  130. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  131. package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
  132. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  133. package/build/features/business/screens/BusinessType/validation.js +50 -1
  134. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  135. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  136. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  137. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  138. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  139. package/build/features/business/screens/CivilID/index.js +2 -0
  140. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  141. package/build/features/business/screens/CivilID/validation.js +4 -0
  142. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  143. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  144. package/build/features/business/screens/Customers/Customers.js +15 -9
  145. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  146. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  147. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  148. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  149. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  150. package/build/features/business/screens/OTP/OTP.js +15 -2
  151. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -7
  152. package/build/features/business/screens/Verify/Verify.js +4 -4
  153. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  154. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  155. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  156. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  157. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  158. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  159. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  160. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  161. package/build/features/connect/Connect.d.ts +2 -1
  162. package/build/features/connect/Connect.js +47 -12
  163. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  164. package/build/features/connect/screens/CivilID/CivilID.js +99 -0
  165. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  166. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  167. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  168. package/build/features/connect/screens/CivilID/index.js +2 -0
  169. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  170. package/build/features/connect/screens/CivilID/validation.js +4 -0
  171. package/build/features/connect/screens/Individual/Email.js +11 -3
  172. package/build/features/connect/screens/Individual/Individual.js +41 -27
  173. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  174. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  175. package/build/features/connect/screens/Merchant/Merchant.js +41 -64
  176. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
  177. package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
  178. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  179. package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
  180. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  181. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  182. package/build/features/connect/screens/Merchant/validation.js +108 -173
  183. package/build/features/connect/screens/Mobile/Mobile.js +30 -12
  184. package/build/features/connect/screens/NID/NID.js +2 -1
  185. package/build/features/connect/screens/OTP/OTP.js +20 -6
  186. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  188. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  189. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  190. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  191. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  192. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  193. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  194. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  195. package/build/features/entity/Entity.d.ts +1 -1
  196. package/build/features/entity/Entity.js +16 -9
  197. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +55 -0
  198. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +149 -0
  199. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  200. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  201. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +71 -2
  202. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  203. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +32 -0
  204. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  205. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +49 -0
  206. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  207. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +33 -0
  208. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +68 -0
  209. package/build/features/entity/screens/EntityInfoConfirm/validation.js +24 -0
  210. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -5
  211. package/build/features/entity/screens/Verify/Verify.js +18 -5
  212. package/build/features/featuresScreens.d.ts +1 -1
  213. package/build/features/featuresScreens.js +31 -6
  214. package/build/features/individual/Individual.d.ts +1 -1
  215. package/build/features/individual/Individual.js +14 -7
  216. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  217. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  218. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  219. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  220. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  221. package/build/features/individual/screens/Verify/Verify.js +18 -5
  222. package/build/features/password/Password.d.ts +1 -1
  223. package/build/features/password/Password.js +14 -7
  224. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  225. package/build/features/password/screens/OTP/OTP.js +15 -2
  226. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -9
  227. package/build/features/password/screens/Verify/Verify.js +16 -3
  228. package/build/features/shared/Background/Background.d.ts +6 -5
  229. package/build/features/shared/Background/Background.js +16 -5
  230. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  231. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  232. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  233. package/build/features/shared/Button/MobileButton.js +2 -2
  234. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  235. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  236. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  237. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  238. package/build/features/shared/Dialog/index.d.ts +4 -0
  239. package/build/features/shared/Dialog/index.js +4 -0
  240. package/build/features/shared/Input/Input.d.ts +1 -1
  241. package/build/features/shared/Input/Input.js +2 -2
  242. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  243. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  244. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  245. package/build/features/signIn/SignIn.d.ts +1 -1
  246. package/build/features/signIn/SignIn.js +14 -6
  247. package/build/features/signIn/screens/Email/Email.js +4 -2
  248. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  249. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  250. package/build/features/signIn/screens/Password/Password.js +15 -2
  251. package/build/features/tax/Tax.d.ts +1 -1
  252. package/build/features/tax/Tax.js +16 -8
  253. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -7
  254. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  255. package/build/features/tax/screens/Verify/Verify.js +16 -3
  256. package/build/hooks/index.d.ts +2 -0
  257. package/build/hooks/index.js +2 -0
  258. package/build/hooks/useAppConfig.d.ts +3 -1
  259. package/build/hooks/useAppConfig.js +4 -2
  260. package/build/hooks/useAppDispatch.d.ts +1 -1
  261. package/build/hooks/useErrorListener.js +0 -6
  262. package/build/hooks/useScreen.d.ts +3 -0
  263. package/build/hooks/useScreen.js +14 -0
  264. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  265. package/build/hooks/useSetFromDefaultValues.js +24 -0
  266. package/build/index.d.ts +3 -3
  267. package/build/index.js +5 -5
  268. package/build/utils/array.d.ts +13 -1
  269. package/build/utils/array.js +26 -0
  270. package/build/utils/common.d.ts +1 -0
  271. package/build/utils/common.js +3 -0
  272. package/build/utils/device.d.ts +1 -0
  273. package/build/utils/device.js +13 -0
  274. package/build/utils/html.d.ts +1 -0
  275. package/build/utils/html.js +6 -0
  276. package/build/utils/index.d.ts +1 -0
  277. package/build/utils/index.js +1 -0
  278. package/build/utils/locale.js +1 -1
  279. package/build/utils/object.d.ts +1 -0
  280. package/build/utils/object.js +12 -0
  281. package/build/utils/rsa.d.ts +2 -2
  282. package/build/utils/rsa.js +1 -1
  283. package/build/utils/string.d.ts +33 -20
  284. package/build/utils/string.js +71 -1
  285. package/build/utils/validation.d.ts +2 -0
  286. package/build/utils/validation.js +6 -0
  287. package/package.json +5 -4
  288. package/build/features/app/otp/otpStore.d.ts +0 -28
  289. package/build/features/app/otp/otpStore.js +0 -153
  290. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  291. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  292. package/build/features/otp/OTP.d.ts +0 -7
  293. package/build/features/otp/OTP.js +0 -58
  294. package/build/features/otp/index.d.ts +0 -0
  295. package/build/features/otp/index.js +0 -1
  296. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  297. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  298. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  299. package/build/features/otp/screens/OTPVerify/index.js +0 -2
@@ -1,6 +1,75 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
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
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
24
  import { ScreenContainer } from '../../../shared/Containers';
25
+ import LicenseName from './LicenseName';
26
+ import * as React from 'react';
27
+ import LicenseNumber from './LicenseNumber';
28
+ import ActivitiesList from './ActivitiesList';
29
+ import { useAppDispatch, useAppSelector, useLanguage, useSetFromDefaultValues } from '../../../../hooks';
30
+ import { entitySelector, updateEntity } from '../../../app/entity/entityStore';
31
+ import { FormProvider, useForm } from 'react-hook-form';
32
+ import { yupResolver } from '@hookform/resolvers/yup';
33
+ import { handlePrevScreenStep } from '../../../../app/settings';
34
+ import { styled } from '@mui/system';
35
+ import { EntityInfoValidationSchema } from './validation';
36
+ import Form from '../../../../components/Form';
37
+ import Collapse from '../../../../components/Collapse';
38
+ import Button from '../../../shared/Button';
39
+ import { useTranslation } from 'react-i18next';
40
+ import OperationStartDate from './OperationStartDate';
41
+ import Article from './Article';
42
+ var FormStyled = styled(Form)(function () { return ({
43
+ display: 'flex',
44
+ flexDirection: 'column'
45
+ }); });
3
46
  var EntityInfo = function (_a) {
4
- return _jsx(ScreenContainer, {});
47
+ var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
48
+ var _c = React.useState(false), collapse = _c[0], setCollapse = _c[1];
49
+ var _d = useAppSelector(entitySelector), data = _d.data, loading = _d.loading, error = _d.error, uploading = _d.uploading;
50
+ var isAr = useLanguage().isAr;
51
+ var t = useTranslation().t;
52
+ var dispatch = useAppDispatch();
53
+ var _e = data.entityData, responseBody = _e.responseBody, defaultValues = __rest(_e, ["responseBody"]);
54
+ var methods = useForm({
55
+ resolver: yupResolver(EntityInfoValidationSchema),
56
+ defaultValues: defaultValues,
57
+ mode: 'onChange'
58
+ });
59
+ useSetFromDefaultValues(methods, defaultValues);
60
+ var onSubmit = function (data) {
61
+ dispatch(updateEntity(__assign({}, data)));
62
+ };
63
+ var handleCollapseOpenClose = function (flag) {
64
+ setCollapse(flag);
65
+ };
66
+ var onBack = function () {
67
+ dispatch(handlePrevScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
68
+ };
69
+ var handleMenuClick = function () {
70
+ anchorEl ? setAnchorEl(false) : setAnchorEl(true);
71
+ };
72
+ var disabled = !methods.formState.isValid || !!error || uploading;
73
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Collapse, __assign({ in: !collapse && !anchorEl }, { children: [_jsx(LicenseName, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ActivitiesList, { onListOpen: function () { return handleMenuClick(); }, onListClose: function () { return handleMenuClick(); } }) })), _jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(Article, {}) })), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(OperationStartDate, { onDateClicked: handleCollapseOpenClose }) })), _jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
5
74
  };
6
75
  export default EntityInfo;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ interface LicenseNameProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: LicenseNameProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { ScreenContainer } from '../../../shared/Containers';
5
+ import { useController, useFormContext } from 'react-hook-form';
6
+ import Input from '../../../shared/Input';
7
+ import { useAppSelector, useLanguage } from '../../../../hooks';
8
+ import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
9
+ import { entitySelector } from '../../../app/entity/entityStore';
10
+ var LicenseName = function (_a) {
11
+ var _b, _c;
12
+ var t = useTranslation().t;
13
+ var isAr = useLanguage();
14
+ var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
15
+ var data = useAppSelector(entitySelector).data;
16
+ var verify = data.verify;
17
+ var legalName = (_c = (_b = verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.legal_name;
18
+ var name = isAr ? legalName === null || legalName === void 0 ? void 0 : legalName.ar : legalName === null || legalName === void 0 ? void 0 : legalName.en;
19
+ var licenseNameControl = useController({ control: control, name: 'licenseName' });
20
+ var licenseNameValue = licenseNameControl.field.value;
21
+ React.useEffect(function () {
22
+ if (name && !licenseNameValue)
23
+ setValue('licenseName', name, { shouldValidate: true });
24
+ }, [name]);
25
+ var handleChange = function (_a) {
26
+ var target = _a.target;
27
+ var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
28
+ licenseNameControl.field.onChange(value);
29
+ };
30
+ return (_jsx(ScreenContainer, { children: _jsx(Input, { onChange: handleChange, value: licenseNameValue, label: t('license_name_label'), placeholder: t('license_name_label'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }));
31
+ };
32
+ export default React.memo(LicenseName);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ interface LicenseNumberProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: LicenseNumberProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,49 @@
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 } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import { ScreenContainer } from '../../../shared/Containers';
17
+ import Input from '../../../shared/Input';
18
+ import { useAppSelector } from '../../../../hooks';
19
+ import { entitySelector } from '../../../app/entity/entityStore';
20
+ import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
21
+ import { BusinessType } from '../../../../@types';
22
+ import { CR_NUMBER_LENGTH, FL_NUMBER_LENGTH } from '../../../../constants';
23
+ var LicenseNumber = function (_a) {
24
+ var _b, _c;
25
+ var t = useTranslation().t;
26
+ var data = useAppSelector(entitySelector).data;
27
+ var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
28
+ var entity = (data.verify.responseBody || {}).entity;
29
+ var licenseType = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.type;
30
+ var type = licenseType === 'freelance' ? BusinessType.FL : BusinessType.CR;
31
+ var isLicensedTrue = entity === null || entity === void 0 ? void 0 : entity.is_licensed;
32
+ var hasLicenseNumber = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number;
33
+ var licenseNumber = data.entityData.licenseNumber;
34
+ React.useEffect(function () {
35
+ setValue('licenseNumber', licenseNumber, { shouldValidate: true });
36
+ }, [licenseNumber]);
37
+ var handleChange = function (_a) {
38
+ var target = _a.target;
39
+ var value = removeAllOtherThanCharsAndNumber(target.value);
40
+ licenseNumberControl.field.onChange(value);
41
+ };
42
+ var licenseNumberControl = useController({ control: control, name: 'licenseNumber' });
43
+ var licenseNumberValue = licenseNumberControl.field.value;
44
+ var isCR = type === BusinessType.CR;
45
+ var length = isCR ? CR_NUMBER_LENGTH : FL_NUMBER_LENGTH;
46
+ var disabled = hasLicenseNumber && isLicensedTrue;
47
+ return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('license_number_label'), onChange: handleChange, disabled: disabled, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) })));
48
+ };
49
+ export default React.memo(LicenseNumber);
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface OperationStartDateProps {
3
+ onDateClicked?: (flag: boolean) => void;
4
+ }
5
+ declare const OperationStartDate: ({ onDateClicked }: OperationStartDateProps) => JSX.Element;
6
+ export default OperationStartDate;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { useController, useFormContext } from 'react-hook-form';
5
+ import { ScreenContainer } from '../../../shared/Containers';
6
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
+ import { entitySelector, clearError } from '../../../app/entity/entityStore';
8
+ import DatePicker from '../../../../components/DatePicker';
9
+ import { InputLabelStyled } from './ActivitiesList';
10
+ var OperationStartDate = function (_a) {
11
+ var _b;
12
+ var onDateClicked = _a.onDateClicked;
13
+ var t = useTranslation().t;
14
+ var dispatch = useAppDispatch();
15
+ var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
16
+ var _d = useAppSelector(entitySelector), data = _d.data, error = _d.error;
17
+ var operationStartDate = (data.entityData.responseBody || {}).operationStartDate;
18
+ var oDateControl = useController({ control: control, name: 'operationStartDate' });
19
+ var dateValue = (_b = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _b === void 0 ? void 0 : _b.value;
20
+ React.useEffect(function () {
21
+ if (!dateValue) {
22
+ var date = operationStartDate || new Date().toString();
23
+ setValue('operationStartDate', date, { shouldValidate: true });
24
+ }
25
+ }, [operationStartDate]);
26
+ var handleOperationStartDateChange = function (data) {
27
+ if (error)
28
+ dispatch(clearError());
29
+ oDateControl.field.onChange(data);
30
+ };
31
+ return (_jsx(ScreenContainer, { children: _jsxs(_Fragment, { children: [_jsx(InputLabelStyled, { children: t('business_start_date') }), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleOperationStartDateChange })] }) }));
32
+ };
33
+ export default OperationStartDate;
@@ -0,0 +1,68 @@
1
+ import * as yup from 'yup';
2
+ export declare const EntityInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ licenseName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
+ activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
10
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
12
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
13
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
16
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
18
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
19
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
20
+ }>>[] | undefined>;
21
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
22
+ articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
23
+ articleFile: any;
24
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
25
+ licenseName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
26
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
27
+ activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
28
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
29
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
30
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
31
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
32
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
33
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
34
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
35
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
36
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
37
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
38
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
39
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
40
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
41
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
42
+ }>>[] | undefined>;
43
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
44
+ articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
45
+ articleFile: any;
46
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
47
+ licenseName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
48
+ licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
49
+ activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
50
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
51
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
52
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
53
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
54
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
55
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
56
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
57
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
58
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
59
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
60
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
61
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
62
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
63
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
64
+ }>>[] | undefined>;
65
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
66
+ articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
67
+ articleFile: any;
68
+ }>>>;
@@ -0,0 +1,24 @@
1
+ import { MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
2
+ import * as yup from 'yup';
3
+ export var EntityInfoValidationSchema = yup.object().shape({
4
+ licenseName: yup.string().required(''),
5
+ licenseNumber: yup.string().required(''),
6
+ activities: yup.array().of(yup.object().shape({
7
+ ar: yup.string(),
8
+ en: yup.string()
9
+ })),
10
+ operationStartDate: yup.string().required('choose_any_business_date'),
11
+ articleId: yup.string().optional(),
12
+ articleFile: yup
13
+ .mixed()
14
+ .test({
15
+ test: function (value) {
16
+ if (!!value)
17
+ return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE
18
+ ? true
19
+ : this.createError({ message: 'alert_file_upload' });
20
+ return true;
21
+ }
22
+ })
23
+ .optional()
24
+ });
@@ -44,12 +44,12 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
44
44
  });
45
45
  });
46
46
  var SuccessWithFlowButtons = function () {
47
- var _a, _b, _c;
47
+ var _a, _b, _c, _d;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
50
  var data = useAppSelector(entitySelector).data;
51
- var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank, merchant = _d.merchant, identification_id = _d.identification_id, vatID = _d.vatID;
52
- var _e = useState([]), buttons = _e[0], setButtons = _e[1];
51
+ var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank, merchant = _e.merchant, vatID = _e.vatID, user = _e.user;
52
+ var _f = useState([]), buttons = _f[0], setButtons = _f[1];
53
53
  var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
54
54
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
55
55
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
@@ -58,9 +58,10 @@ var SuccessWithFlowButtons = function () {
58
58
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
59
  var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
60
  var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
- var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
61
+ var identification = (user || {}).identification;
62
+ var maskedId = !!(identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
62
63
  var settings = useAppSelector(settingsSelector);
63
- var _f = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _f.contact, board_id = _f.board_id, board_info_id = _f.board_info_id;
64
+ var _g = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _g.contact, board_id = _g.board_id, board_info_id = _g.board_info_id;
64
65
  var email = (contact || { email: '' }).email;
65
66
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
66
67
  var reMapFlowData = function (flows) {
@@ -9,9 +9,20 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
25
+ import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
15
26
  import { useTranslation } from 'react-i18next';
16
27
  import { useForm, FormProvider } from 'react-hook-form';
17
28
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -47,18 +58,20 @@ var FormStyled = styled(Form)(function () { return ({
47
58
  flexDirection: 'column'
48
59
  }); });
49
60
  var VerifyNumber = function (_a) {
50
- var _b, _c, _d;
61
+ var _b, _c;
51
62
  var dispatch = useAppDispatch();
52
- var _e = useAppSelector(entitySelector), data = _e.data, loading = _e.loading, error = _e.error;
63
+ var _d = useAppSelector(entitySelector), data = _d.data, loading = _d.loading, error = _d.error;
64
+ var _e = data.otpData, responseBody = _e.responseBody, defaultValues = __rest(_e, ["responseBody"]);
53
65
  var methods = useForm({
54
66
  resolver: yupResolver(OTPValidation),
55
- defaultValues: data.otpData,
67
+ defaultValues: defaultValues,
56
68
  mode: 'onChange'
57
69
  });
70
+ useSetFromDefaultValues(methods, defaultValues);
58
71
  var t = useTranslation().t;
59
72
  var isAr = useLanguage().isAr;
60
73
  var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
61
- var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
74
+ var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
62
75
  React.useEffect(function () {
63
76
  if (error && methods.formState.isValid && phone)
64
77
  dispatch(clearError());
@@ -7,4 +7,4 @@ export declare const bankFeatureScreens: Array<FeatureScreenStep>;
7
7
  export declare const taxFeatureScreens: Array<FeatureScreenStep>;
8
8
  export declare const signInFeatureScreens: Array<FeatureScreenStep>;
9
9
  export declare const entityFeatureScreens: Array<FeatureScreenStep>;
10
- export declare const otpFeatureScreens: Array<FeatureScreenStep>;
10
+ export declare const authFeatureScreens: Array<FeatureScreenStep>;
@@ -1,5 +1,7 @@
1
1
  import MobileScreen from './connect/screens/Mobile';
2
2
  import NIDScreen from './connect/screens/NID';
3
+ import ConnectCivilIDScreen from '../features/connect/screens/CivilID';
4
+ import ConnectVerifyPACIScreen from './connect/screens/VerifyPACI';
3
5
  import IndividualScreen from './connect/screens/Individual';
4
6
  import MerchantInfoScreen from './connect/screens/Merchant';
5
7
  import ConnectOTPScreen from './connect/screens/OTP';
@@ -13,6 +15,8 @@ import ActivitiesPage from './business/screens/Activities';
13
15
  import SuccessPage from './business/screens/Success';
14
16
  import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
15
17
  import ResetPasswordSuccessPage from './business/screens/ResetPasswordSuccess';
18
+ import BusCivilIDscreen from './business/screens/CivilID';
19
+ import BusVerifyPACIScreen from './business/screens/VerifyPACI';
16
20
  import PasswordVerifyPage from './password/screens/Verify';
17
21
  import CreatePasswordPage from './password/screens/CreatePassword';
18
22
  import PasswordOTPPage from './password/screens/OTP';
@@ -41,14 +45,19 @@ import SignInPasswordPage from './signIn/screens/Password';
41
45
  import EntityVerifyPage from './entity/screens/Verify';
42
46
  import EntityInfoConfirmPage from './entity/screens/EntityInfoConfirm';
43
47
  import EntitySuccessPage from './entity/screens/Success';
44
- import EntitySuccessWithFlowPage from './entity/screens/Success';
45
- import EntityResetPasswordSuccessPage from './entity/screens/SuccessWithFlowButtons';
46
- import OtpVerifyPage from '../features/otp/screens/OTPVerify';
48
+ import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
49
+ import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
50
+ import AuthNIDPage from './auth/screens/NID';
51
+ import AuthVerifyPage from './auth/screens/OTP';
47
52
  export var connectFeatureScreens = [
48
53
  {
49
54
  name: 'CONNECT_NID_STEP',
50
55
  element: NIDScreen
51
56
  },
57
+ {
58
+ name: 'CONNECT_CIVIL_ID_STEP',
59
+ element: ConnectCivilIDScreen
60
+ },
52
61
  {
53
62
  name: 'CONNECT_MOBILE_STEP',
54
63
  element: MobileScreen
@@ -57,6 +66,10 @@ export var connectFeatureScreens = [
57
66
  name: 'CONNECT_OTP_STEP',
58
67
  element: ConnectOTPScreen
59
68
  },
69
+ {
70
+ name: 'CONNECT_VERIFY_PACI_STEP',
71
+ element: ConnectVerifyPACIScreen
72
+ },
60
73
  {
61
74
  name: 'CONNECT_INDIVIDUAL_STEP',
62
75
  element: IndividualScreen
@@ -79,6 +92,14 @@ export var businessFeatureScreens = [
79
92
  name: 'BUSINESS_IDBOD_STEP',
80
93
  element: IDBODPage
81
94
  },
95
+ {
96
+ name: 'BUSINESS_CIVIL_ID_STEP',
97
+ element: BusCivilIDscreen
98
+ },
99
+ {
100
+ name: 'BUSINESS_VERIFY_PACI_STEP',
101
+ element: BusVerifyPACIScreen
102
+ },
82
103
  {
83
104
  name: 'BUSINESS_OTP_STEP',
84
105
  element: BusinessOTPPage
@@ -216,9 +237,13 @@ export var entityFeatureScreens = [
216
237
  },
217
238
  { name: 'ENTITY_RESET_PASSWORD_SUCCESS', element: EntityResetPasswordSuccessPage }
218
239
  ];
219
- export var otpFeatureScreens = [
240
+ export var authFeatureScreens = [
241
+ {
242
+ name: 'AUTH_NID_STEP',
243
+ element: AuthNIDPage
244
+ },
220
245
  {
221
- name: 'OTP_VERIFY_STEP',
222
- element: OtpVerifyPage
246
+ name: 'AUTH_VERIFY_STEP',
247
+ element: AuthVerifyPage
223
248
  }
224
249
  ];
@@ -4,4 +4,4 @@ export interface IndividualLibProps extends LibConfig {
4
4
  }
5
5
  export declare function IndividualLib(props: IndividualLibProps): JSX.Element;
6
6
  export declare function renderIndividualLib(config: IndividualLibProps, elementId: string): void;
7
- export declare function unmountIndividualLib(elementId: string): void;
7
+ export declare function unmountIndividualLib(elementId: string, unmountTimeout?: number): void;
@@ -17,9 +17,9 @@ import AnimationFlow from '../../components/AnimationFlow';
17
17
  import { store } from '../../app/store';
18
18
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
19
  import Collapse from '../../components/Collapse';
20
- import { getParameterByName, reactElement } from '../../utils';
20
+ import { getParameterByName, reactElement, removeElement } from '../../utils';
21
21
  import { FeatureContainer } from '../shared/Containers';
22
- import { INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
22
+ import { DIALOG_ID, INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
23
23
  import { individualFeatureScreens } from '../featuresScreens';
24
24
  import { individualSelector, verifyLeadToken } from '../app/individual/individualStore';
25
25
  import CustomFooter from '../shared/Footer';
@@ -28,7 +28,7 @@ var Individual = 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 _b = useAppSelector(individualSelector), customLoading = _b.customLoading, individualError = _b.error;
31
+ var _b = useAppSelector(individualSelector), customLoading = _b.customLoading, individualError = _b.error, loading = _b.loading;
32
32
  useAppConfig(__assign({ navigation: INDIVIDUAL_SCREENS_NAVIGATION }, props));
33
33
  useErrorListener(individualError || error);
34
34
  useStepStartedListener();
@@ -43,10 +43,10 @@ var Individual = memo(function (props) {
43
43
  dispatch(verifyLeadToken(token));
44
44
  };
45
45
  useEffect(function () {
46
- if (!settingLoading)
46
+ if (!settingLoading && open)
47
47
  verifyToken();
48
48
  }, [settingLoading]);
49
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
49
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
50
50
  var Element = _a.element, name = _a.name;
51
51
  var isActive = activeScreen.name === name;
52
52
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -58,6 +58,13 @@ export function IndividualLib(props) {
58
58
  export function renderIndividualLib(config, elementId) {
59
59
  reactElement(elementId).render(_jsx(IndividualLib, __assign({}, config)));
60
60
  }
61
- export function unmountIndividualLib(elementId) {
62
- reactElement(elementId).unmount();
61
+ export function unmountIndividualLib(elementId, unmountTimeout) {
62
+ if (unmountTimeout === void 0) { unmountTimeout = 1000; }
63
+ var element = document.getElementById(elementId);
64
+ setTimeout(function () {
65
+ var _a;
66
+ ((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
67
+ removeElement(DIALOG_ID);
68
+ elementId && reactElement(elementId).unmount();
69
+ }, unmountTimeout);
63
70
  }
@@ -9,13 +9,24 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import * as React from 'react';
14
25
  import { yupResolver } from '@hookform/resolvers/yup';
15
26
  import { useForm, FormProvider } from 'react-hook-form';
16
27
  import Box from '@mui/material/Box';
17
28
  import { useTranslation } from 'react-i18next';
18
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
29
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
19
30
  import { handleCurrentActiveScreen, settingsSelector } from '../../../../app/settings';
20
31
  import Form from '../../../../components/Form';
21
32
  import Collapse from '../../../../components/Collapse';
@@ -45,40 +56,22 @@ var AdditionalIndividualInfo = function (_a) {
45
56
  var _b = useAppSelector(individualSelector), data = _b.data, loading = _b.loading, error = _b.error;
46
57
  var settingsData = useAppSelector(settingsSelector).data;
47
58
  var countries = settingsData.countries;
48
- var _c = data.individualData || {}, sourceIncome = _c.sourceIncome, monthlyIncome = _c.monthlyIncome, employerLocation = _c.employerLocation, occupation = _c.occupation, isPEP = _c.isPEP, isInfluencer = _c.isInfluencer;
59
+ var _c = data.individualData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
49
60
  var methods = useForm({
50
61
  resolver: yupResolver(IndividualInfoValidationSchema),
51
- defaultValues: data.individualData,
62
+ defaultValues: defaultValues,
52
63
  mode: 'onChange'
53
64
  });
65
+ useSetFromDefaultValues(methods, defaultValues);
54
66
  var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
55
67
  var _e = React.useState(false), employerFieldsActive = _e[0], setEmployerFieldsActive = _e[1];
56
68
  React.useEffect(function () {
57
69
  var _a, _b;
58
- if (((_b = (_a = methods.getValues('sourceIncome')) === null || _a === void 0 ? void 0 : _a.name_en) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'salary')
70
+ if (((_b = (_a = methods.getValues('sourceIncome')) === null || _a === void 0 ? void 0 : _a.name.en) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'salary')
59
71
  setEmployerFieldsActive(true);
60
- else {
72
+ else
61
73
  setEmployerFieldsActive(false);
62
- }
63
74
  }, [methods.watch('sourceIncome')]);
64
- React.useEffect(function () {
65
- if (!!sourceIncome) {
66
- methods.setValue('sourceIncome', sourceIncome);
67
- }
68
- if (!!monthlyIncome) {
69
- methods.setValue('monthlyIncome', monthlyIncome);
70
- }
71
- if (!!employerLocation) {
72
- methods.setValue('employerLocation', employerLocation);
73
- }
74
- if (!!occupation) {
75
- methods.setValue('occupation', occupation);
76
- }
77
- if (isPEP !== undefined)
78
- methods.setValue('isPEP', isPEP);
79
- if (isInfluencer !== undefined)
80
- methods.setValue('isInfluencer', isInfluencer);
81
- }, [data.individualData]);
82
75
  var onSubmit = function (data) {
83
76
  dispatch(updateIndividualInfo(data));
84
77
  };
@@ -95,7 +88,7 @@ var AdditionalIndividualInfo = function (_a) {
95
88
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive &&
96
89
  employerFieldsActive &&
97
90
  !isMonthlyIncomeListActive &&
98
- !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
91
+ !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
99
92
  };
100
93
  export default React.memo(AdditionalIndividualInfo);
101
94
  AdditionalIndividualInfo.defaultProps = {};