@tap-payments/auth-jsconnect 2.1.21-test → 2.1.24-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (913) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +167 -167
  3. package/build/@types/app.d.ts +267 -236
  4. package/build/@types/app.js +46 -35
  5. package/build/@types/form.d.ts +99 -94
  6. package/build/@types/form.js +1 -1
  7. package/build/@types/index.d.ts +4 -4
  8. package/build/@types/index.js +4 -4
  9. package/build/@types/redux.d.ts +14 -14
  10. package/build/@types/redux.js +1 -1
  11. package/build/@types/theme.d.ts +14 -14
  12. package/build/@types/theme.js +15 -15
  13. package/build/api/account.d.ts +14 -14
  14. package/build/api/account.js +13 -13
  15. package/build/api/auth.d.ts +88 -87
  16. package/build/api/auth.js +56 -56
  17. package/build/api/availabilityServices.d.ts +20 -20
  18. package/build/api/availabilityServices.js +17 -17
  19. package/build/api/axios.d.ts +7 -7
  20. package/build/api/axios.js +110 -110
  21. package/build/api/board.d.ts +27 -27
  22. package/build/api/board.js +63 -63
  23. package/build/api/brand.d.ts +8 -8
  24. package/build/api/brand.js +49 -49
  25. package/build/api/country.d.ts +6 -6
  26. package/build/api/country.js +14 -14
  27. package/build/api/data.d.ts +41 -41
  28. package/build/api/data.js +76 -76
  29. package/build/api/entity.d.ts +130 -103
  30. package/build/api/entity.js +114 -89
  31. package/build/api/firebase.d.ts +4 -4
  32. package/build/api/firebase.js +14 -14
  33. package/build/api/index.d.ts +118 -114
  34. package/build/api/index.js +33 -33
  35. package/build/api/individual.d.ts +89 -89
  36. package/build/api/individual.js +39 -39
  37. package/build/api/lead.d.ts +96 -96
  38. package/build/api/lead.js +52 -52
  39. package/build/api/location.d.ts +5 -0
  40. package/build/api/location.js +19 -0
  41. package/build/api/operator.d.ts +12 -12
  42. package/build/api/operator.js +65 -65
  43. package/build/api/user.d.ts +8 -8
  44. package/build/api/user.js +12 -12
  45. package/build/app/rootReducer.d.ts +13 -13
  46. package/build/app/rootReducer.js +23 -23
  47. package/build/app/settings.d.ts +44 -44
  48. package/build/app/settings.js +259 -257
  49. package/build/app/store.d.ts +27 -27
  50. package/build/app/store.js +11 -11
  51. package/build/assets/locales/ar.json +356 -336
  52. package/build/assets/locales/en.json +383 -363
  53. package/build/components/AnimationFlow/AnimationFlow.d.ts +17 -17
  54. package/build/components/AnimationFlow/AnimationFlow.js +34 -34
  55. package/build/components/AnimationFlow/BottomSheet.d.ts +11 -11
  56. package/build/components/AnimationFlow/BottomSheet.js +86 -86
  57. package/build/components/AnimationFlow/Dialog.d.ts +15 -15
  58. package/build/components/AnimationFlow/Dialog.js +111 -111
  59. package/build/components/AnimationFlow/Error.d.ts +6 -6
  60. package/build/components/AnimationFlow/Error.js +32 -32
  61. package/build/components/AnimationFlow/Loader.d.ts +2 -2
  62. package/build/components/AnimationFlow/Loader.js +24 -24
  63. package/build/components/AnimationFlow/index.d.ts +2 -2
  64. package/build/components/AnimationFlow/index.js +2 -2
  65. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -13
  66. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -94
  67. package/build/components/ArabicDatePicker/index.d.ts +2 -2
  68. package/build/components/ArabicDatePicker/index.js +2 -2
  69. package/build/components/Button/Button.d.ts +14 -14
  70. package/build/components/Button/Button.js +101 -101
  71. package/build/components/Button/index.d.ts +4 -4
  72. package/build/components/Button/index.js +2 -2
  73. package/build/components/CheckBox/CheckBox.d.ts +5 -5
  74. package/build/components/CheckBox/CheckBox.js +39 -39
  75. package/build/components/CheckBox/index.d.ts +4 -4
  76. package/build/components/CheckBox/index.js +2 -2
  77. package/build/components/Collapse/Collapse.d.ts +5 -5
  78. package/build/components/Collapse/Collapse.js +28 -28
  79. package/build/components/Collapse/index.d.ts +3 -3
  80. package/build/components/Collapse/index.js +2 -2
  81. package/build/components/DatePicker/DatePicker.d.ts +14 -14
  82. package/build/components/DatePicker/DatePicker.js +101 -101
  83. package/build/components/DatePicker/index.d.ts +3 -3
  84. package/build/components/DatePicker/index.js +2 -2
  85. package/build/components/ExpandIcon/ExpandIcon.d.ts +7 -7
  86. package/build/components/ExpandIcon/ExpandIcon.js +24 -24
  87. package/build/components/ExpandIcon/index.d.ts +2 -2
  88. package/build/components/ExpandIcon/index.js +2 -2
  89. package/build/components/FileInput/DragAndDrop.d.ts +17 -17
  90. package/build/components/FileInput/DragAndDrop.js +136 -136
  91. package/build/components/FileInput/UploadInput.d.ts +7 -7
  92. package/build/components/FileInput/UploadInput.js +38 -38
  93. package/build/components/FileInput/index.d.ts +3 -3
  94. package/build/components/FileInput/index.js +3 -3
  95. package/build/components/Footer/Footer.d.ts +15 -15
  96. package/build/components/Footer/Footer.js +62 -62
  97. package/build/components/Footer/index.d.ts +4 -4
  98. package/build/components/Footer/index.js +2 -2
  99. package/build/components/Form/Form.d.ts +11 -11
  100. package/build/components/Form/Form.js +38 -38
  101. package/build/components/Form/index.d.ts +3 -3
  102. package/build/components/Form/index.js +2 -2
  103. package/build/components/Icon/Icon.d.ts +11 -11
  104. package/build/components/Icon/Icon.js +26 -26
  105. package/build/components/Icon/index.d.ts +3 -3
  106. package/build/components/Icon/index.js +2 -2
  107. package/build/components/Input/Input.d.ts +19 -19
  108. package/build/components/Input/Input.js +84 -84
  109. package/build/components/Input/index.d.ts +3 -3
  110. package/build/components/Input/index.js +2 -2
  111. package/build/components/InputAdornment/InputAdornment.d.ts +10 -10
  112. package/build/components/InputAdornment/InputAdornment.js +46 -46
  113. package/build/components/InputAdornment/index.d.ts +3 -3
  114. package/build/components/InputAdornment/index.js +2 -2
  115. package/build/components/List/List.d.ts +5 -5
  116. package/build/components/List/List.js +52 -52
  117. package/build/components/List/index.d.ts +3 -3
  118. package/build/components/List/index.js +2 -2
  119. package/build/components/ListItem/ListItem.d.ts +5 -5
  120. package/build/components/ListItem/ListItem.js +35 -35
  121. package/build/components/ListItem/index.d.ts +3 -3
  122. package/build/components/ListItem/index.js +2 -2
  123. package/build/components/Loader/Loader.d.ts +24 -24
  124. package/build/components/Loader/Loader.js +41 -41
  125. package/build/components/Loader/index.d.ts +4 -4
  126. package/build/components/Loader/index.js +2 -2
  127. package/build/components/LogoBadge/LogoBadge.d.ts +7 -7
  128. package/build/components/LogoBadge/LogoBadge.js +61 -61
  129. package/build/components/LogoBadge/index.d.ts +3 -3
  130. package/build/components/LogoBadge/index.js +2 -2
  131. package/build/components/Lottie/Lottie.d.ts +3675 -3675
  132. package/build/components/Lottie/Lottie.js +62 -62
  133. package/build/components/Lottie/files/error.json +692 -692
  134. package/build/components/Lottie/files/start_loading.json +1140 -1140
  135. package/build/components/Lottie/files/still_loading.json +1140 -1140
  136. package/build/components/Lottie/files/success.json +425 -425
  137. package/build/components/Lottie/index.d.ts +3 -3
  138. package/build/components/Lottie/index.js +3 -3
  139. package/build/components/OTPField/OTPField.d.ts +18 -18
  140. package/build/components/OTPField/OTPField.js +45 -45
  141. package/build/components/OTPField/index.d.ts +4 -4
  142. package/build/components/OTPField/index.js +2 -2
  143. package/build/components/OTPTimer/OTPTimer.d.ts +14 -14
  144. package/build/components/OTPTimer/OTPTimer.js +70 -70
  145. package/build/components/OTPTimer/index.d.ts +4 -4
  146. package/build/components/OTPTimer/index.js +2 -2
  147. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -14
  148. package/build/components/ProgressBar/CircularProgressBar.js +48 -48
  149. package/build/components/ProgressBar/ProgressBar.d.ts +6 -6
  150. package/build/components/ProgressBar/ProgressBar.js +45 -45
  151. package/build/components/ProgressBar/index.d.ts +6 -6
  152. package/build/components/ProgressBar/index.js +4 -4
  153. package/build/components/Providers/ReduxProvider.d.ts +7 -7
  154. package/build/components/Providers/ReduxProvider.js +17 -17
  155. package/build/components/Providers/ThemeProvider.d.ts +8 -8
  156. package/build/components/Providers/ThemeProvider.js +22 -22
  157. package/build/components/Providers/index.d.ts +3 -3
  158. package/build/components/Providers/index.js +3 -3
  159. package/build/components/Radio/Radio.d.ts +5 -5
  160. package/build/components/Radio/Radio.js +31 -31
  161. package/build/components/Radio/index.d.ts +3 -3
  162. package/build/components/Radio/index.js +2 -2
  163. package/build/components/RadioGroup/RadioGroup.d.ts +5 -5
  164. package/build/components/RadioGroup/RadioGroup.js +41 -41
  165. package/build/components/RadioGroup/index.d.ts +3 -3
  166. package/build/components/RadioGroup/index.js +2 -2
  167. package/build/components/RadioLabel/RadioLabel.d.ts +10 -10
  168. package/build/components/RadioLabel/RadioLabel.js +34 -34
  169. package/build/components/RadioLabel/index.d.ts +3 -3
  170. package/build/components/RadioLabel/index.js +2 -2
  171. package/build/components/SimpleList/SimpleList.d.ts +19 -18
  172. package/build/components/SimpleList/SimpleList.js +116 -104
  173. package/build/components/SimpleList/index.d.ts +3 -3
  174. package/build/components/SimpleList/index.js +2 -2
  175. package/build/components/Slide/Slide.d.ts +6 -6
  176. package/build/components/Slide/Slide.js +30 -30
  177. package/build/components/Slide/index.d.ts +3 -3
  178. package/build/components/Slide/index.js +2 -2
  179. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +11 -11
  180. package/build/components/SocialMediaGroup/SocialMediaGroup.js +34 -34
  181. package/build/components/SocialMediaGroup/index.d.ts +3 -3
  182. package/build/components/SocialMediaGroup/index.js +2 -2
  183. package/build/components/Text/Text.d.ts +5 -5
  184. package/build/components/Text/Text.js +35 -35
  185. package/build/components/Text/index.d.ts +3 -3
  186. package/build/components/Text/index.js +2 -2
  187. package/build/components/ToggleButton/ToggleButton.d.ts +5 -5
  188. package/build/components/ToggleButton/ToggleButton.js +44 -44
  189. package/build/components/ToggleButton/index.d.ts +3 -3
  190. package/build/components/ToggleButton/index.js +2 -2
  191. package/build/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +5 -5
  192. package/build/components/ToggleButtonGroup/ToggleButtonGroup.js +37 -37
  193. package/build/components/ToggleButtonGroup/index.d.ts +3 -3
  194. package/build/components/ToggleButtonGroup/index.js +2 -2
  195. package/build/components/Tooltip/Tooltip.d.ts +10 -10
  196. package/build/components/Tooltip/Tooltip.js +53 -53
  197. package/build/components/Tooltip/index.d.ts +3 -3
  198. package/build/components/Tooltip/index.js +2 -2
  199. package/build/components/Warning/Warning.d.ts +13 -13
  200. package/build/components/Warning/Warning.js +53 -53
  201. package/build/components/Warning/index.d.ts +4 -4
  202. package/build/components/Warning/index.js +2 -2
  203. package/build/constants/api.d.ts +41 -40
  204. package/build/constants/api.js +81 -79
  205. package/build/constants/app.d.ts +170 -171
  206. package/build/constants/app.js +501 -502
  207. package/build/constants/assets.d.ts +92 -92
  208. package/build/constants/assets.js +92 -92
  209. package/build/constants/dummy.d.ts +328 -328
  210. package/build/constants/dummy.js +6436 -6436
  211. package/build/constants/index.d.ts +5 -5
  212. package/build/constants/index.js +5 -5
  213. package/build/constants/validation.d.ts +26 -25
  214. package/build/constants/validation.js +26 -25
  215. package/build/features/app/auth/authStore.d.ts +46 -46
  216. package/build/features/app/auth/authStore.js +264 -261
  217. package/build/features/app/bank/bankStore.d.ts +76 -76
  218. package/build/features/app/bank/bankStore.js +472 -472
  219. package/build/features/app/business/businessStore.d.ts +128 -128
  220. package/build/features/app/business/businessStore.js +1187 -1187
  221. package/build/features/app/connect/connectStore.d.ts +100 -100
  222. package/build/features/app/connect/connectStore.js +900 -891
  223. package/build/features/app/entity/entityStore.d.ts +73 -85
  224. package/build/features/app/entity/entityStore.js +607 -690
  225. package/build/features/app/individual/individualStore.d.ts +86 -86
  226. package/build/features/app/individual/individualStore.js +540 -540
  227. package/build/features/app/password/passwordStore.d.ts +84 -84
  228. package/build/features/app/password/passwordStore.js +532 -532
  229. package/build/features/app/signIn/signInStore.d.ts +33 -33
  230. package/build/features/app/signIn/signInStore.js +396 -390
  231. package/build/features/app/tax/taxStore.d.ts +46 -46
  232. package/build/features/app/tax/taxStore.js +385 -385
  233. package/build/features/auth/Auth.d.ts +10 -10
  234. package/build/features/auth/Auth.js +87 -87
  235. package/build/features/auth/index.d.ts +1 -1
  236. package/build/features/auth/index.js +1 -1
  237. package/build/features/auth/screens/NID/DOB.d.ts +7 -7
  238. package/build/features/auth/screens/NID/DOB.js +47 -47
  239. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -3
  240. package/build/features/auth/screens/NID/IDNumber.js +64 -64
  241. package/build/features/auth/screens/NID/NID.d.ts +5 -5
  242. package/build/features/auth/screens/NID/NID.js +68 -68
  243. package/build/features/auth/screens/NID/TAC.d.ts +3 -3
  244. package/build/features/auth/screens/NID/TAC.js +87 -87
  245. package/build/features/auth/screens/NID/index.d.ts +3 -3
  246. package/build/features/auth/screens/NID/index.js +2 -2
  247. package/build/features/auth/screens/NID/validation.d.ts +27 -27
  248. package/build/features/auth/screens/NID/validation.js +19 -19
  249. package/build/features/auth/screens/OTP/OTP.d.ts +5 -5
  250. package/build/features/auth/screens/OTP/OTP.js +76 -76
  251. package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -5
  252. package/build/features/auth/screens/OTP/OTPInput.js +51 -51
  253. package/build/features/auth/screens/OTP/index.d.ts +3 -3
  254. package/build/features/auth/screens/OTP/index.js +2 -2
  255. package/build/features/auth/screens/OTP/validation.d.ts +8 -8
  256. package/build/features/auth/screens/OTP/validation.js +4 -4
  257. package/build/features/bank/Bank.d.ts +7 -7
  258. package/build/features/bank/Bank.js +69 -69
  259. package/build/features/bank/index.d.ts +1 -1
  260. package/build/features/bank/index.js +1 -1
  261. package/build/features/bank/screens/BankDetails/BankDetails.d.ts +5 -5
  262. package/build/features/bank/screens/BankDetails/BankDetails.js +86 -86
  263. package/build/features/bank/screens/BankDetails/BankName.d.ts +3 -3
  264. package/build/features/bank/screens/BankDetails/BankName.js +60 -60
  265. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +6 -6
  266. package/build/features/bank/screens/BankDetails/BankStatement.js +67 -67
  267. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +5 -5
  268. package/build/features/bank/screens/BankDetails/Beneficiary.js +50 -50
  269. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -3
  270. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -67
  271. package/build/features/bank/screens/BankDetails/IBAN.d.ts +7 -7
  272. package/build/features/bank/screens/BankDetails/IBAN.js +100 -100
  273. package/build/features/bank/screens/BankDetails/index.d.ts +3 -3
  274. package/build/features/bank/screens/BankDetails/index.js +2 -2
  275. package/build/features/bank/screens/BankDetails/validation.d.ts +45 -45
  276. package/build/features/bank/screens/BankDetails/validation.js +56 -56
  277. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -5
  278. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -9
  279. package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -3
  280. package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -2
  281. package/build/features/bank/screens/Success/Success.d.ts +5 -5
  282. package/build/features/bank/screens/Success/Success.js +20 -20
  283. package/build/features/bank/screens/Success/index.d.ts +3 -3
  284. package/build/features/bank/screens/Success/index.js +2 -2
  285. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -3
  286. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +116 -115
  287. package/build/features/bank/screens/SuccessWithFlowButtons/index.d.ts +2 -2
  288. package/build/features/bank/screens/SuccessWithFlowButtons/index.js +2 -2
  289. package/build/features/bank/screens/Verify/OTPInput.d.ts +7 -7
  290. package/build/features/bank/screens/Verify/OTPInput.js +47 -47
  291. package/build/features/bank/screens/Verify/Verify.d.ts +5 -5
  292. package/build/features/bank/screens/Verify/Verify.js +78 -78
  293. package/build/features/bank/screens/Verify/index.d.ts +2 -2
  294. package/build/features/bank/screens/Verify/index.js +2 -2
  295. package/build/features/bank/screens/Verify/validation.d.ts +8 -8
  296. package/build/features/bank/screens/Verify/validation.js +4 -4
  297. package/build/features/business/Business.d.ts +7 -7
  298. package/build/features/business/Business.js +70 -70
  299. package/build/features/business/index.d.ts +1 -1
  300. package/build/features/business/index.js +1 -1
  301. package/build/features/business/screens/Activities/Activities.d.ts +5 -5
  302. package/build/features/business/screens/Activities/Activities.js +69 -69
  303. package/build/features/business/screens/Activities/ActivitiesList.d.ts +90 -90
  304. package/build/features/business/screens/Activities/ActivitiesList.js +170 -170
  305. package/build/features/business/screens/Activities/LicenseName.d.ts +5 -5
  306. package/build/features/business/screens/Activities/LicenseName.js +30 -30
  307. package/build/features/business/screens/Activities/OperationStartDate.d.ts +20 -20
  308. package/build/features/business/screens/Activities/OperationStartDate.js +45 -45
  309. package/build/features/business/screens/Activities/index.d.ts +3 -3
  310. package/build/features/business/screens/Activities/index.js +2 -2
  311. package/build/features/business/screens/Activities/validation.d.ts +56 -56
  312. package/build/features/business/screens/Activities/validation.js +11 -11
  313. package/build/features/business/screens/BusinessType/Article.d.ts +6 -6
  314. package/build/features/business/screens/BusinessType/Article.js +89 -89
  315. package/build/features/business/screens/BusinessType/BusinessType.d.ts +5 -5
  316. package/build/features/business/screens/BusinessType/BusinessType.js +76 -76
  317. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -6
  318. package/build/features/business/screens/BusinessType/EntityName.js +56 -56
  319. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -6
  320. package/build/features/business/screens/BusinessType/LicenseCertificate.js +81 -81
  321. package/build/features/business/screens/BusinessType/LicenseList.d.ts +8 -8
  322. package/build/features/business/screens/BusinessType/LicenseList.js +148 -148
  323. package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +7 -7
  324. package/build/features/business/screens/BusinessType/LicenseNumber.js +52 -52
  325. package/build/features/business/screens/BusinessType/LicenseType.d.ts +34 -34
  326. package/build/features/business/screens/BusinessType/LicenseType.js +107 -107
  327. package/build/features/business/screens/BusinessType/SelectType.d.ts +8 -8
  328. package/build/features/business/screens/BusinessType/SelectType.js +106 -106
  329. package/build/features/business/screens/BusinessType/Switch.d.ts +7 -7
  330. package/build/features/business/screens/BusinessType/Switch.js +35 -35
  331. package/build/features/business/screens/BusinessType/index.d.ts +3 -3
  332. package/build/features/business/screens/BusinessType/index.js +2 -2
  333. package/build/features/business/screens/BusinessType/validation.d.ts +30 -30
  334. package/build/features/business/screens/BusinessType/validation.js +90 -90
  335. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -5
  336. package/build/features/business/screens/CivilID/CivilID.js +67 -67
  337. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -7
  338. package/build/features/business/screens/CivilID/IDNumber.js +59 -59
  339. package/build/features/business/screens/CivilID/index.d.ts +3 -3
  340. package/build/features/business/screens/CivilID/index.js +2 -2
  341. package/build/features/business/screens/CivilID/validation.d.ts +8 -8
  342. package/build/features/business/screens/CivilID/validation.js +4 -4
  343. package/build/features/business/screens/Customers/CustomerLocations.d.ts +82 -82
  344. package/build/features/business/screens/Customers/CustomerLocations.js +144 -144
  345. package/build/features/business/screens/Customers/Customers.d.ts +5 -5
  346. package/build/features/business/screens/Customers/Customers.js +90 -90
  347. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +8 -8
  348. package/build/features/business/screens/Customers/ExpectedCustomers.js +98 -98
  349. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +8 -8
  350. package/build/features/business/screens/Customers/ExpectedSalesRange.js +127 -127
  351. package/build/features/business/screens/Customers/RefundPolicy.d.ts +36 -36
  352. package/build/features/business/screens/Customers/RefundPolicy.js +84 -84
  353. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +3 -3
  354. package/build/features/business/screens/Customers/TransactionPolicy.js +44 -44
  355. package/build/features/business/screens/Customers/index.d.ts +3 -3
  356. package/build/features/business/screens/Customers/index.js +2 -2
  357. package/build/features/business/screens/Customers/validation.d.ts +20 -20
  358. package/build/features/business/screens/Customers/validation.js +13 -13
  359. package/build/features/business/screens/IDBOD/DOB.d.ts +6 -6
  360. package/build/features/business/screens/IDBOD/DOB.js +45 -45
  361. package/build/features/business/screens/IDBOD/ID.d.ts +5 -5
  362. package/build/features/business/screens/IDBOD/ID.js +28 -28
  363. package/build/features/business/screens/IDBOD/IDBOD.d.ts +5 -5
  364. package/build/features/business/screens/IDBOD/IDBOD.js +68 -68
  365. package/build/features/business/screens/IDBOD/index.d.ts +3 -3
  366. package/build/features/business/screens/IDBOD/index.js +2 -2
  367. package/build/features/business/screens/IDBOD/validation.d.ts +11 -11
  368. package/build/features/business/screens/IDBOD/validation.js +9 -9
  369. package/build/features/business/screens/OTP/OTP.d.ts +8 -8
  370. package/build/features/business/screens/OTP/OTP.js +90 -90
  371. package/build/features/business/screens/OTP/OTPInput.d.ts +5 -5
  372. package/build/features/business/screens/OTP/OTPInput.js +46 -46
  373. package/build/features/business/screens/OTP/index.d.ts +3 -3
  374. package/build/features/business/screens/OTP/index.js +2 -2
  375. package/build/features/business/screens/OTP/validation.d.ts +8 -8
  376. package/build/features/business/screens/OTP/validation.js +4 -4
  377. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -5
  378. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -9
  379. package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -3
  380. package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -2
  381. package/build/features/business/screens/Success/Success.d.ts +5 -5
  382. package/build/features/business/screens/Success/Success.js +23 -23
  383. package/build/features/business/screens/Success/index.d.ts +3 -3
  384. package/build/features/business/screens/Success/index.js +2 -2
  385. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -3
  386. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +116 -114
  387. package/build/features/business/screens/SuccessWithFlowButtons/index.d.ts +2 -2
  388. package/build/features/business/screens/SuccessWithFlowButtons/index.js +2 -2
  389. package/build/features/business/screens/Verify/OTPInput.d.ts +7 -7
  390. package/build/features/business/screens/Verify/OTPInput.js +47 -47
  391. package/build/features/business/screens/Verify/Verify.d.ts +5 -5
  392. package/build/features/business/screens/Verify/Verify.js +78 -78
  393. package/build/features/business/screens/Verify/index.d.ts +2 -2
  394. package/build/features/business/screens/Verify/index.js +2 -2
  395. package/build/features/business/screens/Verify/validation.d.ts +8 -8
  396. package/build/features/business/screens/Verify/validation.js +4 -4
  397. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -5
  398. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +34 -34
  399. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -3
  400. package/build/features/business/screens/VerifyPACI/index.js +2 -2
  401. package/build/features/connect/Connect.d.ts +8 -8
  402. package/build/features/connect/Connect.js +84 -84
  403. package/build/features/connect/index.d.ts +1 -1
  404. package/build/features/connect/index.js +1 -1
  405. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -5
  406. package/build/features/connect/screens/CivilID/CivilID.js +102 -102
  407. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -7
  408. package/build/features/connect/screens/CivilID/IDNumber.js +59 -59
  409. package/build/features/connect/screens/CivilID/index.d.ts +3 -3
  410. package/build/features/connect/screens/CivilID/index.js +2 -2
  411. package/build/features/connect/screens/CivilID/validation.d.ts +8 -8
  412. package/build/features/connect/screens/CivilID/validation.js +4 -4
  413. package/build/features/connect/screens/Individual/Email.d.ts +8 -8
  414. package/build/features/connect/screens/Individual/Email.js +116 -116
  415. package/build/features/connect/screens/Individual/Individual.d.ts +5 -5
  416. package/build/features/connect/screens/Individual/Individual.js +101 -101
  417. package/build/features/connect/screens/Individual/MobileNumber.d.ts +10 -10
  418. package/build/features/connect/screens/Individual/MobileNumber.js +152 -152
  419. package/build/features/connect/screens/Individual/Name.d.ts +6 -6
  420. package/build/features/connect/screens/Individual/Name.js +48 -48
  421. package/build/features/connect/screens/Individual/index.d.ts +3 -3
  422. package/build/features/connect/screens/Individual/index.js +2 -2
  423. package/build/features/connect/screens/Individual/validation.d.ts +24 -24
  424. package/build/features/connect/screens/Individual/validation.js +41 -41
  425. package/build/features/connect/screens/Merchant/BrandList.d.ts +10 -10
  426. package/build/features/connect/screens/Merchant/BrandList.js +93 -93
  427. package/build/features/connect/screens/Merchant/BrandName.d.ts +8 -8
  428. package/build/features/connect/screens/Merchant/BrandName.js +142 -142
  429. package/build/features/connect/screens/Merchant/Merchant.d.ts +5 -5
  430. package/build/features/connect/screens/Merchant/Merchant.js +80 -80
  431. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +5 -5
  432. package/build/features/connect/screens/Merchant/SalesChannels.js +37 -37
  433. package/build/features/connect/screens/Merchant/TAC.d.ts +6 -6
  434. package/build/features/connect/screens/Merchant/TAC.js +86 -86
  435. package/build/features/connect/screens/Merchant/index.d.ts +3 -3
  436. package/build/features/connect/screens/Merchant/index.js +2 -2
  437. package/build/features/connect/screens/Merchant/validation.d.ts +32 -32
  438. package/build/features/connect/screens/Merchant/validation.js +130 -130
  439. package/build/features/connect/screens/Mobile/Mobile.d.ts +5 -5
  440. package/build/features/connect/screens/Mobile/Mobile.js +133 -133
  441. package/build/features/connect/screens/Mobile/MobileNumber.d.ts +12 -12
  442. package/build/features/connect/screens/Mobile/MobileNumber.js +154 -154
  443. package/build/features/connect/screens/Mobile/Title.d.ts +8 -8
  444. package/build/features/connect/screens/Mobile/Title.js +29 -29
  445. package/build/features/connect/screens/Mobile/index.d.ts +3 -3
  446. package/build/features/connect/screens/Mobile/index.js +2 -2
  447. package/build/features/connect/screens/Mobile/validation.d.ts +8 -8
  448. package/build/features/connect/screens/Mobile/validation.js +28 -28
  449. package/build/features/connect/screens/NID/DOB.d.ts +6 -6
  450. package/build/features/connect/screens/NID/DOB.js +47 -47
  451. package/build/features/connect/screens/NID/IDNumber.d.ts +6 -6
  452. package/build/features/connect/screens/NID/IDNumber.js +60 -60
  453. package/build/features/connect/screens/NID/NID.d.ts +5 -5
  454. package/build/features/connect/screens/NID/NID.js +94 -94
  455. package/build/features/connect/screens/NID/index.d.ts +3 -3
  456. package/build/features/connect/screens/NID/index.js +2 -2
  457. package/build/features/connect/screens/NID/validation.d.ts +11 -11
  458. package/build/features/connect/screens/NID/validation.js +9 -9
  459. package/build/features/connect/screens/OTP/OTP.d.ts +5 -5
  460. package/build/features/connect/screens/OTP/OTP.js +94 -94
  461. package/build/features/connect/screens/OTP/OTPInput.d.ts +5 -5
  462. package/build/features/connect/screens/OTP/OTPInput.js +54 -54
  463. package/build/features/connect/screens/OTP/index.d.ts +3 -3
  464. package/build/features/connect/screens/OTP/index.js +2 -2
  465. package/build/features/connect/screens/OTP/validation.d.ts +8 -8
  466. package/build/features/connect/screens/OTP/validation.js +4 -4
  467. package/build/features/connect/screens/ThankYou/ThankYou.d.ts +5 -5
  468. package/build/features/connect/screens/ThankYou/ThankYou.js +16 -16
  469. package/build/features/connect/screens/ThankYou/index.d.ts +3 -3
  470. package/build/features/connect/screens/ThankYou/index.js +2 -2
  471. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -5
  472. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +95 -95
  473. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -3
  474. package/build/features/connect/screens/VerifyPACI/index.js +2 -2
  475. package/build/features/entity/Entity.d.ts +7 -7
  476. package/build/features/entity/Entity.js +70 -70
  477. package/build/features/entity/index.d.ts +1 -1
  478. package/build/features/entity/index.js +1 -1
  479. package/build/features/entity/screens/{Customers/CustomerLocations.d.ts → EntityCapital/ActivityList.d.ts} +90 -118
  480. package/build/features/entity/screens/EntityCapital/ActivityList.js +178 -0
  481. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +5 -0
  482. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +47 -0
  483. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +5 -0
  484. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +42 -0
  485. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +5 -0
  486. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +47 -0
  487. package/build/features/entity/screens/EntityCapital/EntityCapital.d.ts +5 -0
  488. package/build/features/entity/screens/EntityCapital/EntityCapital.js +75 -0
  489. package/build/features/entity/screens/EntityCapital/index.d.ts +2 -0
  490. package/build/features/entity/screens/EntityCapital/index.js +2 -0
  491. package/build/features/entity/screens/EntityCapital/validation.d.ts +62 -0
  492. package/build/features/entity/screens/EntityCapital/validation.js +25 -0
  493. package/build/features/entity/screens/EntityName/EntityName.d.ts +5 -0
  494. package/build/features/entity/screens/EntityName/EntityName.js +87 -0
  495. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +90 -0
  496. package/build/features/entity/screens/EntityName/EntityTypeList.js +151 -0
  497. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +19 -0
  498. package/build/features/entity/screens/EntityName/ExpiryDate.js +46 -0
  499. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +19 -0
  500. package/build/features/entity/screens/EntityName/IssuingDate.js +46 -0
  501. package/build/features/entity/screens/EntityName/LegalName.d.ts +5 -0
  502. package/build/features/entity/screens/EntityName/LegalName.js +48 -0
  503. package/build/features/entity/screens/{EntityInfoConfirm → EntityName}/LicenseNumber.d.ts +6 -6
  504. package/build/features/entity/screens/{EntityInfoConfirm → EntityName}/LicenseNumber.js +51 -57
  505. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +6 -0
  506. package/build/features/entity/screens/EntityName/UnifiedNumber.js +43 -0
  507. package/build/features/entity/screens/EntityName/index.d.ts +2 -0
  508. package/build/features/entity/screens/EntityName/index.js +2 -0
  509. package/build/features/entity/screens/EntityName/validation.d.ts +48 -0
  510. package/build/features/entity/screens/EntityName/validation.js +112 -0
  511. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -5
  512. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -9
  513. package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +3 -3
  514. package/build/features/entity/screens/ResetPasswordSuccess/index.js +2 -2
  515. package/build/features/entity/screens/Success/Success.d.ts +5 -5
  516. package/build/features/entity/screens/Success/Success.js +20 -20
  517. package/build/features/entity/screens/Success/index.d.ts +3 -3
  518. package/build/features/entity/screens/Success/index.js +2 -2
  519. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -3
  520. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +117 -117
  521. package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +2 -2
  522. package/build/features/entity/screens/SuccessWithFlowButtons/index.js +2 -2
  523. package/build/features/entity/screens/Verify/OTPInput.d.ts +7 -7
  524. package/build/features/entity/screens/Verify/OTPInput.js +47 -47
  525. package/build/features/entity/screens/Verify/Verify.d.ts +5 -5
  526. package/build/features/entity/screens/Verify/Verify.js +91 -91
  527. package/build/features/entity/screens/Verify/index.d.ts +2 -2
  528. package/build/features/entity/screens/Verify/index.js +2 -2
  529. package/build/features/entity/screens/Verify/validation.d.ts +8 -8
  530. package/build/features/entity/screens/Verify/validation.js +4 -4
  531. package/build/features/featuresScreens.d.ts +10 -10
  532. package/build/features/featuresScreens.js +254 -254
  533. package/build/features/individual/Individual.d.ts +7 -7
  534. package/build/features/individual/Individual.js +70 -70
  535. package/build/features/individual/index.d.ts +1 -1
  536. package/build/features/individual/index.js +1 -1
  537. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +8 -8
  538. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +94 -94
  539. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +10 -10
  540. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +92 -92
  541. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.d.ts +6 -6
  542. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +46 -46
  543. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +6 -6
  544. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +49 -49
  545. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +10 -10
  546. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +107 -107
  547. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -10
  548. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +97 -97
  549. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +34 -34
  550. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +68 -68
  551. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +10 -10
  552. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +89 -89
  553. package/build/features/individual/screens/AdditionalIndividualInfo/index.d.ts +3 -3
  554. package/build/features/individual/screens/AdditionalIndividualInfo/index.js +2 -2
  555. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +25 -25
  556. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +24 -24
  557. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -5
  558. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -9
  559. package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -3
  560. package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -2
  561. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +19 -19
  562. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +52 -52
  563. package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +3 -3
  564. package/build/features/individual/screens/ShowIndividualInfo/index.js +2 -2
  565. package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +7 -7
  566. package/build/features/individual/screens/ShowIndividualInfo/info.js +28 -28
  567. package/build/features/individual/screens/Success/Success.d.ts +5 -5
  568. package/build/features/individual/screens/Success/Success.js +20 -20
  569. package/build/features/individual/screens/Success/index.d.ts +3 -3
  570. package/build/features/individual/screens/Success/index.js +2 -2
  571. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -3
  572. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +117 -115
  573. package/build/features/individual/screens/SuccessWithFlowButtons/index.d.ts +2 -2
  574. package/build/features/individual/screens/SuccessWithFlowButtons/index.js +2 -2
  575. package/build/features/individual/screens/Verify/OTPInput.d.ts +7 -7
  576. package/build/features/individual/screens/Verify/OTPInput.js +47 -47
  577. package/build/features/individual/screens/Verify/Verify.d.ts +5 -5
  578. package/build/features/individual/screens/Verify/Verify.js +91 -91
  579. package/build/features/individual/screens/Verify/index.d.ts +2 -2
  580. package/build/features/individual/screens/Verify/index.js +2 -2
  581. package/build/features/individual/screens/Verify/validation.d.ts +8 -8
  582. package/build/features/individual/screens/Verify/validation.js +4 -4
  583. package/build/features/password/Password.d.ts +7 -7
  584. package/build/features/password/Password.js +77 -77
  585. package/build/features/password/index.d.ts +1 -1
  586. package/build/features/password/index.js +1 -1
  587. package/build/features/password/screens/CreatePassword/ConditionText.d.ts +7 -7
  588. package/build/features/password/screens/CreatePassword/ConditionText.js +23 -23
  589. package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +8 -8
  590. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +22 -22
  591. package/build/features/password/screens/CreatePassword/CreatePassword.d.ts +5 -5
  592. package/build/features/password/screens/CreatePassword/CreatePassword.js +73 -73
  593. package/build/features/password/screens/CreatePassword/Password.d.ts +5 -5
  594. package/build/features/password/screens/CreatePassword/Password.js +76 -76
  595. package/build/features/password/screens/CreatePassword/PasswordBar.d.ts +7 -7
  596. package/build/features/password/screens/CreatePassword/PasswordBar.js +29 -29
  597. package/build/features/password/screens/CreatePassword/index.d.ts +3 -3
  598. package/build/features/password/screens/CreatePassword/index.js +2 -2
  599. package/build/features/password/screens/CreatePassword/validation.d.ts +11 -11
  600. package/build/features/password/screens/CreatePassword/validation.js +8 -8
  601. package/build/features/password/screens/OTP/OTP.d.ts +8 -8
  602. package/build/features/password/screens/OTP/OTP.js +91 -91
  603. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -5
  604. package/build/features/password/screens/OTP/OTPInput.js +46 -46
  605. package/build/features/password/screens/OTP/index.d.ts +3 -3
  606. package/build/features/password/screens/OTP/index.js +2 -2
  607. package/build/features/password/screens/OTP/validation.d.ts +8 -8
  608. package/build/features/password/screens/OTP/validation.js +4 -4
  609. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -5
  610. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -9
  611. package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -3
  612. package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -2
  613. package/build/features/password/screens/Success/Success.d.ts +5 -5
  614. package/build/features/password/screens/Success/Success.js +26 -26
  615. package/build/features/password/screens/Success/index.d.ts +3 -3
  616. package/build/features/password/screens/Success/index.js +2 -2
  617. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -3
  618. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +117 -115
  619. package/build/features/password/screens/SuccessWithFlowButtons/index.d.ts +2 -2
  620. package/build/features/password/screens/SuccessWithFlowButtons/index.js +2 -2
  621. package/build/features/password/screens/Verify/OTPInput.d.ts +7 -7
  622. package/build/features/password/screens/Verify/OTPInput.js +47 -47
  623. package/build/features/password/screens/Verify/Verify.d.ts +5 -5
  624. package/build/features/password/screens/Verify/Verify.js +91 -91
  625. package/build/features/password/screens/Verify/index.d.ts +2 -2
  626. package/build/features/password/screens/Verify/index.js +2 -2
  627. package/build/features/password/screens/Verify/validation.d.ts +8 -8
  628. package/build/features/password/screens/Verify/validation.js +4 -4
  629. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.d.ts +7 -7
  630. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +65 -65
  631. package/build/features/shared/AcceptancePayouts/index.d.ts +2 -2
  632. package/build/features/shared/AcceptancePayouts/index.js +2 -2
  633. package/build/features/shared/Address/Address.d.ts +11 -0
  634. package/build/features/shared/Address/Address.js +63 -0
  635. package/build/features/shared/Address/CountryList.d.ts +72 -0
  636. package/build/features/shared/Address/CountryList.js +89 -0
  637. package/build/features/{entity/screens/EntityInfoConfirm/ActivitiesList.d.ts → shared/Address/InputSelect.d.ts} +71 -55
  638. package/build/features/shared/Address/InputSelect.js +172 -0
  639. package/build/features/shared/Address/InputText.d.ts +11 -0
  640. package/build/features/shared/Address/InputText.js +12 -0
  641. package/build/features/shared/Address/index.d.ts +2 -0
  642. package/build/features/shared/Address/index.js +2 -0
  643. package/build/features/shared/Background/Background.d.ts +12 -12
  644. package/build/features/shared/Background/Background.js +41 -41
  645. package/build/features/shared/Background/LogoBackground.d.ts +3 -3
  646. package/build/features/shared/Background/LogoBackground.js +42 -42
  647. package/build/features/shared/Background/index.d.ts +2 -2
  648. package/build/features/shared/Background/index.js +2 -2
  649. package/build/features/shared/BouncingDotsLoader/BouncingDotsLoader.d.ts +3 -3
  650. package/build/features/shared/BouncingDotsLoader/BouncingDotsLoader.js +31 -31
  651. package/build/features/shared/BouncingDotsLoader/index.d.ts +2 -2
  652. package/build/features/shared/BouncingDotsLoader/index.js +2 -2
  653. package/build/features/shared/Button/AbsherButton.d.ts +8 -8
  654. package/build/features/shared/Button/AbsherButton.js +46 -46
  655. package/build/features/shared/Button/Button.d.ts +12 -12
  656. package/build/features/shared/Button/Button.js +102 -102
  657. package/build/features/shared/Button/EmailProvidersButtons.d.ts +14 -14
  658. package/build/features/shared/Button/EmailProvidersButtons.js +67 -67
  659. package/build/features/shared/Button/FlowsButtons.d.ts +25 -25
  660. package/build/features/shared/Button/FlowsButtons.js +222 -219
  661. package/build/features/shared/Button/MobileButton.d.ts +9 -9
  662. package/build/features/shared/Button/MobileButton.js +44 -44
  663. package/build/features/shared/Button/SuccessButton.d.ts +9 -9
  664. package/build/features/shared/Button/SuccessButton.js +86 -86
  665. package/build/features/shared/Button/index.d.ts +8 -8
  666. package/build/features/shared/Button/index.js +8 -8
  667. package/build/features/shared/CheckIcon/CheckIcon.d.ts +2 -2
  668. package/build/features/shared/CheckIcon/CheckIcon.js +14 -14
  669. package/build/features/shared/CheckIcon/index.d.ts +2 -2
  670. package/build/features/shared/CheckIcon/index.js +2 -2
  671. package/build/features/shared/ClearIcon/ClearIcon.d.ts +6 -6
  672. package/build/features/shared/ClearIcon/ClearIcon.js +26 -26
  673. package/build/features/shared/ClearIcon/index.d.ts +2 -2
  674. package/build/features/shared/ClearIcon/index.js +2 -2
  675. package/build/features/shared/Containers/FeatureContainer.d.ts +4 -4
  676. package/build/features/shared/Containers/FeatureContainer.js +36 -36
  677. package/build/features/shared/Containers/ScreenContainer.d.ts +4 -4
  678. package/build/features/shared/Containers/ScreenContainer.js +29 -29
  679. package/build/features/shared/Containers/index.d.ts +3 -3
  680. package/build/features/shared/Containers/index.js +3 -3
  681. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -11
  682. package/build/features/shared/Dialog/CloseDialog.js +71 -71
  683. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -8
  684. package/build/features/shared/Dialog/DialogContainer.js +56 -56
  685. package/build/features/shared/Dialog/index.d.ts +4 -4
  686. package/build/features/shared/Dialog/index.js +4 -4
  687. package/build/features/shared/Footer/Footer.d.ts +2 -2
  688. package/build/features/shared/Footer/Footer.js +20 -20
  689. package/build/features/shared/Footer/index.d.ts +2 -2
  690. package/build/features/shared/Footer/index.js +2 -2
  691. package/build/features/shared/Input/Input.d.ts +28 -26
  692. package/build/features/shared/Input/Input.js +56 -56
  693. package/build/features/shared/Input/index.d.ts +2 -2
  694. package/build/features/shared/Input/index.js +2 -2
  695. package/build/features/shared/Mandatory/Mandatory.d.ts +2 -2
  696. package/build/features/shared/Mandatory/Mandatory.js +20 -20
  697. package/build/features/shared/Mandatory/index.d.ts +2 -2
  698. package/build/features/shared/Mandatory/index.js +2 -2
  699. package/build/features/shared/OTP/OTP.d.ts +10 -10
  700. package/build/features/shared/OTP/OTP.js +93 -93
  701. package/build/features/shared/OTP/index.d.ts +2 -2
  702. package/build/features/shared/OTP/index.js +2 -2
  703. package/build/features/shared/PaciVerification/PaciVerification.d.ts +12 -12
  704. package/build/features/shared/PaciVerification/PaciVerification.js +91 -91
  705. package/build/features/shared/PaciVerification/VerifyPACILoading.d.ts +7 -7
  706. package/build/features/shared/PaciVerification/VerifyPACILoading.js +13 -13
  707. package/build/features/shared/PaciVerification/VerifyPACISuccess.d.ts +5 -5
  708. package/build/features/shared/PaciVerification/VerifyPACISuccess.js +8 -8
  709. package/build/features/shared/PaciVerification/index.d.ts +2 -2
  710. package/build/features/shared/PaciVerification/index.js +2 -2
  711. package/build/features/shared/PasswordIcon/PasswordIcon.d.ts +8 -8
  712. package/build/features/shared/PasswordIcon/PasswordIcon.js +37 -37
  713. package/build/features/shared/PasswordIcon/index.d.ts +2 -2
  714. package/build/features/shared/PasswordIcon/index.js +2 -2
  715. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +11 -11
  716. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +100 -100
  717. package/build/features/shared/SalesChannels/SalesChannel.d.ts +10 -10
  718. package/build/features/shared/SalesChannels/SalesChannel.js +135 -135
  719. package/build/features/shared/SalesChannels/index.d.ts +2 -2
  720. package/build/features/shared/SalesChannels/index.js +2 -2
  721. package/build/features/shared/Search/Search.d.ts +7 -7
  722. package/build/features/shared/Search/Search.js +13 -13
  723. package/build/features/shared/Search/index.d.ts +2 -2
  724. package/build/features/shared/Search/index.js +2 -2
  725. package/build/features/shared/SearchIcon/SearchIcon.d.ts +6 -6
  726. package/build/features/shared/SearchIcon/SearchIcon.js +26 -26
  727. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +12 -12
  728. package/build/features/shared/SuccessScreen/SuccessScreen.js +62 -62
  729. package/build/features/shared/SuccessScreen/index.d.ts +2 -2
  730. package/build/features/shared/SuccessScreen/index.js +2 -2
  731. package/build/features/shared/UploadFile/UploadFile.d.ts +29 -29
  732. package/build/features/shared/UploadFile/UploadFile.js +91 -91
  733. package/build/features/shared/UploadFile/index.d.ts +2 -2
  734. package/build/features/shared/UploadFile/index.js +2 -2
  735. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +0 -0
  736. package/build/features/shared/UploadMultipleFile/UploadFile.js +1 -0
  737. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +0 -0
  738. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +1 -0
  739. package/build/features/signIn/SignIn.d.ts +7 -7
  740. package/build/features/signIn/SignIn.js +57 -57
  741. package/build/features/signIn/index.d.ts +1 -1
  742. package/build/features/signIn/index.js +1 -1
  743. package/build/features/signIn/screens/Email/Email.d.ts +5 -5
  744. package/build/features/signIn/screens/Email/Email.js +97 -97
  745. package/build/features/signIn/screens/Email/EmailField.d.ts +5 -5
  746. package/build/features/signIn/screens/Email/EmailField.js +55 -55
  747. package/build/features/signIn/screens/Email/index.d.ts +3 -3
  748. package/build/features/signIn/screens/Email/index.js +2 -2
  749. package/build/features/signIn/screens/Email/validation.d.ts +8 -8
  750. package/build/features/signIn/screens/Email/validation.js +5 -5
  751. package/build/features/signIn/screens/Mobile/Mobile.d.ts +5 -5
  752. package/build/features/signIn/screens/Mobile/Mobile.js +110 -110
  753. package/build/features/signIn/screens/Mobile/MobileNumber.d.ts +11 -11
  754. package/build/features/signIn/screens/Mobile/MobileNumber.js +151 -151
  755. package/build/features/signIn/screens/Mobile/index.d.ts +3 -3
  756. package/build/features/signIn/screens/Mobile/index.js +2 -2
  757. package/build/features/signIn/screens/Mobile/validation.d.ts +8 -8
  758. package/build/features/signIn/screens/Mobile/validation.js +28 -28
  759. package/build/features/signIn/screens/OTP/OTP.d.ts +5 -5
  760. package/build/features/signIn/screens/OTP/OTP.js +93 -93
  761. package/build/features/signIn/screens/OTP/OTPInput.d.ts +5 -5
  762. package/build/features/signIn/screens/OTP/OTPInput.js +53 -53
  763. package/build/features/signIn/screens/OTP/index.d.ts +3 -3
  764. package/build/features/signIn/screens/OTP/index.js +2 -2
  765. package/build/features/signIn/screens/OTP/validation.d.ts +8 -8
  766. package/build/features/signIn/screens/OTP/validation.js +4 -4
  767. package/build/features/signIn/screens/Password/Password.d.ts +5 -5
  768. package/build/features/signIn/screens/Password/Password.js +67 -67
  769. package/build/features/signIn/screens/Password/PasswordInput.d.ts +5 -5
  770. package/build/features/signIn/screens/Password/PasswordInput.js +28 -28
  771. package/build/features/signIn/screens/Password/index.d.ts +3 -3
  772. package/build/features/signIn/screens/Password/index.js +2 -2
  773. package/build/features/signIn/screens/Password/validation.d.ts +8 -8
  774. package/build/features/signIn/screens/Password/validation.js +4 -4
  775. package/build/features/tax/Tax.d.ts +7 -7
  776. package/build/features/tax/Tax.js +71 -71
  777. package/build/features/tax/index.d.ts +1 -1
  778. package/build/features/tax/index.js +1 -1
  779. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -5
  780. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -9
  781. package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -3
  782. package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -2
  783. package/build/features/tax/screens/Success/Success.d.ts +5 -5
  784. package/build/features/tax/screens/Success/Success.js +22 -22
  785. package/build/features/tax/screens/Success/index.d.ts +3 -3
  786. package/build/features/tax/screens/Success/index.js +2 -2
  787. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -3
  788. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +117 -115
  789. package/build/features/tax/screens/SuccessWithFlowButtons/index.d.ts +2 -2
  790. package/build/features/tax/screens/SuccessWithFlowButtons/index.js +2 -2
  791. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -3
  792. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -66
  793. package/build/features/tax/screens/TaxDetails/TaxDetails.d.ts +5 -5
  794. package/build/features/tax/screens/TaxDetails/TaxDetails.js +63 -63
  795. package/build/features/tax/screens/TaxDetails/VATId.d.ts +3 -3
  796. package/build/features/tax/screens/TaxDetails/VATId.js +37 -37
  797. package/build/features/tax/screens/TaxDetails/index.d.ts +3 -3
  798. package/build/features/tax/screens/TaxDetails/index.js +2 -2
  799. package/build/features/tax/screens/TaxDetails/validation.d.ts +11 -11
  800. package/build/features/tax/screens/TaxDetails/validation.js +5 -5
  801. package/build/features/tax/screens/Verify/OTPInput.d.ts +7 -7
  802. package/build/features/tax/screens/Verify/OTPInput.js +47 -47
  803. package/build/features/tax/screens/Verify/Verify.d.ts +5 -5
  804. package/build/features/tax/screens/Verify/Verify.js +91 -91
  805. package/build/features/tax/screens/Verify/index.d.ts +2 -2
  806. package/build/features/tax/screens/Verify/index.js +2 -2
  807. package/build/features/tax/screens/Verify/validation.d.ts +8 -8
  808. package/build/features/tax/screens/Verify/validation.js +4 -4
  809. package/build/hooks/index.d.ts +15 -15
  810. package/build/hooks/index.js +15 -15
  811. package/build/hooks/useAppConfig.d.ts +8 -8
  812. package/build/hooks/useAppConfig.js +61 -61
  813. package/build/hooks/useAppDispatch.d.ts +12 -12
  814. package/build/hooks/useAppDispatch.js +2 -2
  815. package/build/hooks/useAppSelector.d.ts +3 -3
  816. package/build/hooks/useAppSelector.js +2 -2
  817. package/build/hooks/useAppTheme.d.ts +4 -4
  818. package/build/hooks/useAppTheme.js +15 -15
  819. package/build/hooks/useContainerDimensions.d.ts +4 -4
  820. package/build/hooks/useContainerDimensions.js +21 -21
  821. package/build/hooks/useCountUp.d.ts +9 -9
  822. package/build/hooks/useCountUp.js +17 -17
  823. package/build/hooks/useErrorListener.d.ts +1 -1
  824. package/build/hooks/useErrorListener.js +12 -12
  825. package/build/hooks/useEventListener.d.ts +5 -5
  826. package/build/hooks/useEventListener.js +20 -20
  827. package/build/hooks/useLanguage.d.ts +4 -4
  828. package/build/hooks/useLanguage.js +8 -8
  829. package/build/hooks/useRedirectionListener.d.ts +4 -4
  830. package/build/hooks/useRedirectionListener.js +12 -12
  831. package/build/hooks/useScreen.d.ts +3 -3
  832. package/build/hooks/useScreen.js +14 -14
  833. package/build/hooks/useSetFromDefaultValues.d.ts +2 -2
  834. package/build/hooks/useSetFromDefaultValues.js +26 -26
  835. package/build/hooks/useStepStartedListener.d.ts +1 -1
  836. package/build/hooks/useStepStartedListener.js +10 -10
  837. package/build/hooks/useThemeMode.d.ts +4 -4
  838. package/build/hooks/useThemeMode.js +7 -7
  839. package/build/hooks/useWindowSize.d.ts +6 -6
  840. package/build/hooks/useWindowSize.js +19 -19
  841. package/build/i18n.d.ts +2 -2
  842. package/build/i18n.js +34 -34
  843. package/build/index.d.ts +13 -13
  844. package/build/index.js +33 -33
  845. package/build/theme/components.d.ts +2 -2
  846. package/build/theme/components.js +19 -19
  847. package/build/theme/index.d.ts +1 -1
  848. package/build/theme/index.js +1 -1
  849. package/build/theme/palette.d.ts +3 -3
  850. package/build/theme/palette.js +68 -68
  851. package/build/theme/shadows.d.ts +2 -2
  852. package/build/theme/shadows.js +27 -27
  853. package/build/theme/theme.d.ts +2 -2
  854. package/build/theme/theme.js +43 -43
  855. package/build/theme/typography.d.ts +2 -2
  856. package/build/theme/typography.js +31 -31
  857. package/build/utils/array.d.ts +63 -63
  858. package/build/utils/array.js +140 -140
  859. package/build/utils/common.d.ts +1 -1
  860. package/build/utils/common.js +3 -3
  861. package/build/utils/date.d.ts +1 -1
  862. package/build/utils/date.js +5 -5
  863. package/build/utils/device.d.ts +5 -5
  864. package/build/utils/device.js +26 -26
  865. package/build/utils/html.d.ts +5 -5
  866. package/build/utils/html.js +32 -32
  867. package/build/utils/index.d.ts +11 -11
  868. package/build/utils/index.js +11 -11
  869. package/build/utils/locale.d.ts +2 -2
  870. package/build/utils/locale.js +22 -22
  871. package/build/utils/object.d.ts +5 -5
  872. package/build/utils/object.js +35 -35
  873. package/build/utils/rsa.d.ts +2 -2
  874. package/build/utils/rsa.js +19 -19
  875. package/build/utils/storage.d.ts +5 -5
  876. package/build/utils/storage.js +21 -21
  877. package/build/utils/string.d.ts +58 -58
  878. package/build/utils/string.js +260 -260
  879. package/build/utils/style.d.ts +1 -1
  880. package/build/utils/style.js +1 -1
  881. package/build/utils/validation.d.ts +17 -17
  882. package/build/utils/validation.js +51 -51
  883. package/package.json +1 -1
  884. package/build/api/ip.d.ts +0 -4
  885. package/build/api/ip.js +0 -12
  886. package/build/features/entity/screens/Customers/CustomerLocations.js +0 -171
  887. package/build/features/entity/screens/Customers/Customers.d.ts +0 -5
  888. package/build/features/entity/screens/Customers/Customers.js +0 -90
  889. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +0 -8
  890. package/build/features/entity/screens/Customers/ExpectedCustomers.js +0 -98
  891. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +0 -8
  892. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +0 -127
  893. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +0 -36
  894. package/build/features/entity/screens/Customers/RefundPolicy.js +0 -84
  895. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +0 -3
  896. package/build/features/entity/screens/Customers/TransactionPolicy.js +0 -44
  897. package/build/features/entity/screens/Customers/index.d.ts +0 -3
  898. package/build/features/entity/screens/Customers/index.js +0 -2
  899. package/build/features/entity/screens/Customers/validation.d.ts +0 -20
  900. package/build/features/entity/screens/Customers/validation.js +0 -13
  901. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +0 -149
  902. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +0 -3
  903. package/build/features/entity/screens/EntityInfoConfirm/Article.js +0 -76
  904. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +0 -5
  905. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +0 -84
  906. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +0 -5
  907. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +0 -32
  908. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +0 -6
  909. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +0 -33
  910. package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +0 -2
  911. package/build/features/entity/screens/EntityInfoConfirm/index.js +0 -2
  912. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +0 -141
  913. package/build/features/entity/screens/EntityInfoConfirm/validation.js +0 -83
@@ -1,690 +1,607 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var _a;
49
- import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
- import API from '../../../api';
51
- import { BusinessType, FlowsTypes } from '../../../@types';
52
- import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
53
- import { ENTITY_STEP_NAMES } from '../../../constants';
54
- import moment from 'moment';
55
- import { convertNumbers2English } from '../../../utils';
56
- export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
57
- var payload, data, boardData, entityData, boardInfoData, countryIso2, board_id, entityId, activities, data_1, info, hasEntityCompleted;
58
- var _a, _b, _c, _d;
59
- return __generator(this, function (_e) {
60
- switch (_e.label) {
61
- case 0:
62
- payload = {
63
- service_name: 'tap_email',
64
- verify_token: token
65
- };
66
- return [4, API.leadService.verifyLeadToken(payload)];
67
- case 1:
68
- data = (_e.sent()).data;
69
- countryIso2 = undefined;
70
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 8];
71
- if (data === null || data === void 0 ? void 0 : data.country_code) {
72
- countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
73
- if (countryIso2)
74
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
75
- }
76
- if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 8];
77
- board_id = data === null || data === void 0 ? void 0 : data.id;
78
- if (!board_id) return [3, 4];
79
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
80
- case 2:
81
- boardInfoData = _e.sent();
82
- return [4, API.boardService.retrieveBoardDetails(board_id)];
83
- case 3:
84
- boardData = _e.sent();
85
- _e.label = 4;
86
- case 4:
87
- entityId = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.id;
88
- if (!entityId) return [3, 7];
89
- return [4, API.entityService.retrieveEntity(entityId)];
90
- case 5:
91
- entityData = _e.sent();
92
- activities = (entityData || {}).activities;
93
- if (!!activities) return [3, 7];
94
- return [4, API.dataService.getActivities()];
95
- case 6:
96
- data_1 = _e.sent();
97
- entityData = __assign(__assign({}, entityData), { entity_activities: data_1.list });
98
- _e.label = 7;
99
- case 7:
100
- if (!countryIso2) {
101
- countryIso2 = entityData.country;
102
- if (countryIso2)
103
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
104
- }
105
- info = (boardInfoData || {}).info;
106
- hasEntityCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
107
- if (hasEntityCompleted) {
108
- thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
109
- }
110
- else {
111
- thunkApi.dispatch(handleNextScreenStep('ENTITY_INFO_STEP'));
112
- }
113
- _e.label = 8;
114
- case 8: return [2, {
115
- data: data,
116
- boardResponse: {
117
- user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
118
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
119
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
120
- entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
121
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
122
- name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
123
- contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
124
- flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info,
125
- entity_activities: entityData === null || entityData === void 0 ? void 0 : entityData.entity_activities
126
- },
127
- token: token
128
- }];
129
- }
130
- });
131
- }); });
132
- export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
133
- var entity, payload, data;
134
- return __generator(this, function (_a) {
135
- switch (_a.label) {
136
- case 0:
137
- entity = thunkApi.getState().entity;
138
- payload = {
139
- service_name: 'tap_email',
140
- verify_token: entity.data.verify.token
141
- };
142
- return [4, API.leadService.verifyLeadToken(payload)];
143
- case 1:
144
- data = (_a.sent()).data;
145
- return [2, { data: data }];
146
- }
147
- });
148
- }); });
149
- export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
150
- var _a, entity, settings, responseBody, payload, data, boardData, entityData, boardInfoData, board_id, entityId, activities, data_2, info, hasEntityCompleted;
151
- var _b, _c, _d, _e, _f, _g, _h;
152
- return __generator(this, function (_j) {
153
- switch (_j.label) {
154
- case 0:
155
- _a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
156
- responseBody = entity.data.verify.responseBody;
157
- payload = {
158
- data: params.otp,
159
- service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
160
- verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
161
- step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
162
- encryption_contract: ['data']
163
- };
164
- return [4, API.leadService.verifyLeadOTP(payload)];
165
- case 1:
166
- data = (_j.sent()).data;
167
- boardInfoData = undefined;
168
- if (!!data.errors) return [3, 8];
169
- board_id = responseBody === null || responseBody === void 0 ? void 0 : responseBody.id;
170
- if (!board_id) return [3, 4];
171
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
172
- case 2:
173
- boardInfoData = _j.sent();
174
- return [4, API.boardService.retrieveBoardDetails(board_id)];
175
- case 3:
176
- boardData = _j.sent();
177
- _j.label = 4;
178
- case 4:
179
- entityId = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.id;
180
- if (!entityId) return [3, 7];
181
- return [4, API.entityService.retrieveEntity(entityId)];
182
- case 5:
183
- entityData = _j.sent();
184
- activities = (entityData || {}).activities;
185
- if (!!activities) return [3, 7];
186
- return [4, API.dataService.getActivities()];
187
- case 6:
188
- data_2 = _j.sent();
189
- entityData = __assign(__assign({}, entityData), { entity_activities: data_2.list });
190
- _j.label = 7;
191
- case 7:
192
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
193
- info = (boardInfoData || {}).info;
194
- hasEntityCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
195
- if (hasEntityCompleted) {
196
- thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
197
- }
198
- else {
199
- thunkApi.dispatch(handleNextScreenStep('ENTITY_INFO_STEP'));
200
- }
201
- _j.label = 8;
202
- case 8: return [2, {
203
- data: data,
204
- boardResponse: {
205
- user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
206
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
207
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
208
- entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
209
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
210
- name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
211
- contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
212
- flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info,
213
- entity_activities: entityData === null || entityData === void 0 ? void 0 : entityData.entity_activities
214
- },
215
- formData: params
216
- }];
217
- }
218
- });
219
- }); });
220
- export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
221
- var data;
222
- var _a, _b;
223
- return __generator(this, function (_c) {
224
- switch (_c.label) {
225
- case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
226
- case 1:
227
- data = _c.sent();
228
- return [2, {
229
- data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
230
- }];
231
- }
232
- });
233
- }); });
234
- export var updateEntity = createAsyncThunk('entityUpdateEntity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
235
- var _a, settings, entity, id, brandId, articleId, requestBody, brandData, payload, data;
236
- var _b, _c, _d, _e, _f, _g, _h;
237
- return __generator(this, function (_j) {
238
- switch (_j.label) {
239
- case 0:
240
- _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
241
- id = (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id;
242
- brandId = (_e = (_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.id;
243
- articleId = entity.data.entityData.articleId;
244
- requestBody = {
245
- id: brandId,
246
- activities: (_f = (params.activities || [])) === null || _f === void 0 ? void 0 : _f.map(function (_a) {
247
- var id = _a.id;
248
- return ({ id: id });
249
- }),
250
- operations: {
251
- start_date: params.operationStartDate
252
- },
253
- encryption_contract: ['operations.start_date']
254
- };
255
- return [4, API.brandService.updateBrandInfo(requestBody)];
256
- case 1:
257
- brandData = (_j.sent()).data;
258
- payload = {
259
- id: id,
260
- license: {
261
- number: params.licenseNumber && params.licenseNumber,
262
- type: params.licenseType
263
- },
264
- legal_name: {
265
- ar: params.licenseName,
266
- en: params.licenseName
267
- },
268
- AOA_file_id: articleId,
269
- encryption_contract: ['license.number', 'legal_name.ar', 'legal_name.en', 'license.type']
270
- };
271
- return [4, API.entityService.updateEntity(payload)];
272
- case 2:
273
- data = _j.sent();
274
- thunkApi.dispatch(retrieveDataList());
275
- thunkApi.dispatch(handleNextScreenStep());
276
- (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, id);
277
- return [2, { data: __assign(__assign({}, data), brandData), formData: params }];
278
- }
279
- });
280
- }); });
281
- export var uploadArticle = createAsyncThunk('entityUploadArticle', function (_a) {
282
- var file = _a.file, onProgress = _a.onProgress;
283
- return __awaiter(void 0, void 0, void 0, function () {
284
- var typeArray, type, uploadPayload, onUploadProgress, data;
285
- var _b;
286
- return __generator(this, function (_c) {
287
- switch (_c.label) {
288
- case 0:
289
- typeArray = ((_b = file === null || file === void 0 ? void 0 : file.type) === null || _b === void 0 ? void 0 : _b.split('/')) || [];
290
- type = typeArray[1] || '';
291
- uploadPayload = {
292
- file_link_create: true,
293
- title: file === null || file === void 0 ? void 0 : file.name,
294
- purpose: 'article_of_association',
295
- type: type,
296
- file: file
297
- };
298
- onUploadProgress = function (progressEvent) {
299
- var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
300
- onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
301
- };
302
- return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
303
- case 1:
304
- data = _c.sent();
305
- return [2, { data: data }];
306
- }
307
- });
308
- });
309
- });
310
- export var updateCustomersInfo = createAsyncThunk('entityUpdateCustomersInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
311
- var _a, settings, entity, id, customerLocation, customerBase, sales, requestBody, data;
312
- var _b, _c, _d, _e, _f, _g;
313
- return __generator(this, function (_h) {
314
- switch (_h.label) {
315
- case 0:
316
- _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
317
- id = (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) === null || _c === void 0 ? void 0 : _c.id;
318
- customerLocation = params.customerLocations.map(function (location) { return ({
319
- id: location === null || location === void 0 ? void 0 : location.id
320
- }); });
321
- customerBase = { id: ((_d = params.expectedCustomer) === null || _d === void 0 ? void 0 : _d.id) || '', period: 'monthly', locations: customerLocation };
322
- sales = { id: ((_e = params.expectedSale) === null || _e === void 0 ? void 0 : _e.id) || '', period: 'monthly' };
323
- requestBody = {
324
- operations: {
325
- customer_base: customerBase,
326
- sales: sales,
327
- start_date: entity.data.entityData.operationStartDate
328
- },
329
- term: ['refund', 'chargeback'],
330
- id: id,
331
- encryption_contract: []
332
- };
333
- return [4, API.brandService.updateBrandInfo(requestBody)];
334
- case 1:
335
- data = _h.sent();
336
- thunkApi.dispatch(handleNextScreenStep());
337
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
338
- return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: params }];
339
- }
340
- });
341
- }); });
342
- export var retrieveDataList = createAsyncThunk('entityRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
343
- var settings, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
344
- return __generator(this, function (_b) {
345
- switch (_b.label) {
346
- case 0:
347
- settings = thunkApi.getState().settings;
348
- dataBody = {
349
- page: 0
350
- };
351
- salesDataBody = {
352
- page: 0,
353
- country_code: [settings.data.businessCountry.iso2]
354
- };
355
- return [4, Promise.all([
356
- API.dataService.getCustomerBases(dataBody),
357
- API.dataService.getExpectedSales(salesDataBody),
358
- API.dataService.getExpectedCustomerSales(dataBody)
359
- ])];
360
- case 1:
361
- _a = _b.sent(), customerBases = _a[0], expectedSales = _a[1], expectedCustomerSales = _a[2];
362
- return [2, {
363
- customerBases: customerBases,
364
- expectedSales: expectedSales,
365
- expectedCustomerSales: expectedCustomerSales
366
- }];
367
- }
368
- });
369
- }); });
370
- export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
371
- var _a, settings, entity, _b, id, infoId, payload, data, boardInfoData;
372
- var _c, _d, _e, _f;
373
- return __generator(this, function (_g) {
374
- switch (_g.label) {
375
- case 0:
376
- _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
377
- _b = entity.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
378
- if (!id)
379
- return [2];
380
- payload = {
381
- lang: settings.data.language,
382
- step_name: ENTITY_STEP_NAMES.ENTITY_SUCCESS,
383
- id: id
384
- };
385
- return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
386
- case 1:
387
- data = _g.sent();
388
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
389
- case 2:
390
- boardInfoData = _g.sent();
391
- return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
392
- case 3:
393
- _g.sent();
394
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
395
- (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
396
- thunkApi.dispatch(handleNextScreenStep());
397
- return [2, { response: __assign(__assign({}, data), { flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info }), formData: params }];
398
- }
399
- });
400
- }); });
401
- var initialState = {
402
- error: null,
403
- loading: false,
404
- customLoading: false,
405
- uploading: false,
406
- data: {
407
- flowName: FlowsTypes.ENTITY,
408
- verify: {
409
- token: ''
410
- },
411
- otpData: {
412
- otp: ''
413
- },
414
- entityData: {
415
- licenseName: '',
416
- licenseNumber: '',
417
- licenseType: BusinessType.CR,
418
- activities: [],
419
- operationStartDate: moment(new Date()).format('YYYY-MM-DD'),
420
- uploading: false
421
- },
422
- customersData: {
423
- customerLocations: [],
424
- expectedCustomer: undefined,
425
- expectedSale: undefined,
426
- refundPolicy: false,
427
- transactionPolicy: false
428
- }
429
- }
430
- };
431
- export var entitySlice = createSlice({
432
- name: 'entity/store',
433
- initialState: initialState,
434
- reducers: {
435
- clearError: function (state) {
436
- state.error = null;
437
- },
438
- stopLoader: function (state) {
439
- state.loading = false;
440
- },
441
- resetOTPScreen: function (state) {
442
- state.data.otpData.otp = '';
443
- }
444
- },
445
- extraReducers: function (builder) {
446
- builder
447
- .addCase(verifyLeadToken.pending, function (state) {
448
- state.error = null;
449
- state.customLoading = true;
450
- })
451
- .addCase(verifyLeadToken.fulfilled, function (state, action) {
452
- var _a, _b, _c, _d, _e;
453
- state.error = null;
454
- state.customLoading = false;
455
- var _f = action.payload, data = _f.data, token = _f.token, boardResponse = _f.boardResponse;
456
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
457
- if (description) {
458
- state.error = description;
459
- return;
460
- }
461
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
462
- state.data.verify.token = token;
463
- var _g = boardResponse || {}, brand = _g.brand, entity = _g.entity, entity_activities = _g.entity_activities;
464
- var licenseNumber = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.number;
465
- var licenseType = (_c = entity === null || entity === void 0 ? void 0 : entity.type) === null || _c === void 0 ? void 0 : _c.toLowerCase();
466
- var entityDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.issuing_date;
467
- var startDate = (_e = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _e === void 0 ? void 0 : _e.start_date;
468
- var issuingDate = undefined;
469
- if (entityDate) {
470
- var date = new Date(entityDate);
471
- var formattedDate = moment(date).format('YYYY-MM-DD');
472
- issuingDate = convertNumbers2English(formattedDate);
473
- }
474
- if (licenseNumber)
475
- state.data.entityData.licenseNumber = licenseNumber;
476
- if (licenseType)
477
- state.data.entityData.licenseType = licenseType;
478
- var activities = (entity === null || entity === void 0 ? void 0 : entity.activities) || entity_activities || [];
479
- var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
480
- var _a;
481
- return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
482
- });
483
- state.data.entityData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
484
- state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, operationStartDate: startDate || issuingDate, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [] });
485
- })
486
- .addCase(verifyLeadToken.rejected, function (state, action) {
487
- state.error = action.error.message;
488
- state.customLoading = false;
489
- })
490
- .addCase(resendOTP.pending, function (state) {
491
- state.error = null;
492
- })
493
- .addCase(resendOTP.fulfilled, function (state, action) {
494
- var _a;
495
- state.error = null;
496
- var data = action.payload.data;
497
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
498
- if (description) {
499
- state.error = description;
500
- return;
501
- }
502
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
503
- })
504
- .addCase(resendOTP.rejected, function (state, action) {
505
- state.error = action.error.message;
506
- })
507
- .addCase(verifyEntityLeadOTP.pending, function (state) {
508
- state.loading = true;
509
- state.error = null;
510
- })
511
- .addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
512
- var _a, _b, _c, _d, _e;
513
- state.loading = false;
514
- state.error = null;
515
- var _f = action.payload, data = _f.data, boardResponse = _f.boardResponse, formData = _f.formData;
516
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
517
- if (description) {
518
- state.error = description;
519
- return;
520
- }
521
- state.data.otpData = formData;
522
- state.data.otpData.responseBody = data;
523
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
524
- var _g = boardResponse || {}, brand = _g.brand, entity = _g.entity, entity_activities = _g.entity_activities;
525
- var licenseNumber = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.number;
526
- var licenseType = (_c = entity === null || entity === void 0 ? void 0 : entity.type) === null || _c === void 0 ? void 0 : _c.toLowerCase();
527
- var entityDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.issuing_date;
528
- var startDate = (_e = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _e === void 0 ? void 0 : _e.start_date;
529
- var issuingDate = undefined;
530
- if (entityDate) {
531
- var date = new Date(entityDate);
532
- var formattedDate = moment(date).format('YYYY-MM-DD');
533
- issuingDate = convertNumbers2English(formattedDate);
534
- }
535
- if (licenseNumber)
536
- state.data.entityData.licenseNumber = licenseNumber;
537
- if (licenseType)
538
- state.data.entityData.licenseType = licenseType;
539
- var activities = (entity === null || entity === void 0 ? void 0 : entity.activities) || entity_activities || [];
540
- var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
541
- var _a;
542
- return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
543
- });
544
- state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [], operationStartDate: startDate || issuingDate });
545
- })
546
- .addCase(verifyEntityLeadOTP.rejected, function (state, action) {
547
- state.loading = false;
548
- state.error = action.error.message;
549
- })
550
- .addCase(updateEntity.pending, function (state) {
551
- state.loading = true;
552
- state.error = null;
553
- })
554
- .addCase(updateEntity.fulfilled, function (state, action) {
555
- var _a;
556
- state.loading = false;
557
- state.error = null;
558
- var _b = action.payload, data = _b.data, formData = _b.formData;
559
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
560
- if (description) {
561
- state.error = description;
562
- return;
563
- }
564
- state.data.entityData = formData;
565
- state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { data: data });
566
- })
567
- .addCase(updateEntity.rejected, function (state, action) {
568
- state.loading = false;
569
- state.error = action.error.message;
570
- })
571
- .addCase(retrieveBoardDetails.pending, function (state) {
572
- state.error = null;
573
- state.loading = true;
574
- })
575
- .addCase(retrieveBoardDetails.fulfilled, function (state, action) {
576
- state.error = null;
577
- state.loading = false;
578
- var data = (action.payload || {}).data;
579
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
580
- })
581
- .addCase(retrieveBoardDetails.rejected, function (state, action) {
582
- state.error = action.error.message;
583
- state.loading = false;
584
- })
585
- .addCase(retrieveDataList.pending, function (state) {
586
- state.loading = true;
587
- state.error = null;
588
- })
589
- .addCase(retrieveDataList.fulfilled, function (state, action) {
590
- var _a, _b, _c, _d, _e, _f;
591
- state.loading = false;
592
- state.error = null;
593
- var payload = action.payload;
594
- state.data.customersData.responseBody = payload;
595
- var brand = (state.data.verify.responseBody || {}).brand;
596
- var _g = (brand === null || brand === void 0 ? void 0 : brand.operations) || {}, customer_base = _g.customer_base, sales = _g.sales;
597
- var customerBases = ((_a = payload.customerBases) === null || _a === void 0 ? void 0 : _a.list) || [];
598
- var customerBase = undefined;
599
- if ((customerBases === null || customerBases === void 0 ? void 0 : customerBases.length) > 1)
600
- customerBase = [customerBases === null || customerBases === void 0 ? void 0 : customerBases[1], customerBases[0]];
601
- else if ((customerBases === null || customerBases === void 0 ? void 0 : customerBases.length) === 1)
602
- customerBase = [customerBases[0]];
603
- if (((_b = customer_base === null || customer_base === void 0 ? void 0 : customer_base.locations) === null || _b === void 0 ? void 0 : _b.length) > 0) {
604
- customerBase = customerBases === null || customerBases === void 0 ? void 0 : customerBases.filter(function (base) {
605
- var _a;
606
- return (_a = customer_base === null || customer_base === void 0 ? void 0 : customer_base.locations) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === base.id; });
607
- });
608
- }
609
- var expectedSales = ((_c = payload.expectedSales) === null || _c === void 0 ? void 0 : _c.list) || [];
610
- var expectedSale = (_e = (_d = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales[0]) === null || _d === void 0 ? void 0 : _d.sub) === null || _e === void 0 ? void 0 : _e[4];
611
- if ((sales === null || sales === void 0 ? void 0 : sales.length) > 0) {
612
- expectedSale = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.find(function (sale) {
613
- var _a;
614
- return (_a = sales === null || sales === void 0 ? void 0 : sales.sub) === null || _a === void 0 ? void 0 : _a.find(function (s) { return s.id === sale.id; });
615
- });
616
- }
617
- var expectedCustomerSales = ((_f = payload.expectedCustomerSales) === null || _f === void 0 ? void 0 : _f.list) || [];
618
- var expectedCustomerSale = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales[3];
619
- if ((customer_base === null || customer_base === void 0 ? void 0 : customer_base.length) > 0) {
620
- expectedCustomerSale = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales.find(function (base) {
621
- return customer_base.id === base.id;
622
- });
623
- }
624
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { customerBases: customerBases, expectedSales: expectedSales, expectedCustomerSales: expectedCustomerSales });
625
- if (!!customerBase)
626
- state.data.customersData.customerLocations = customerBase;
627
- if (!!expectedSale)
628
- state.data.customersData.expectedSale = expectedSale;
629
- if (!!expectedCustomerSale)
630
- state.data.customersData.expectedCustomer = expectedCustomerSale;
631
- })
632
- .addCase(retrieveDataList.rejected, function (state, action) {
633
- state.loading = false;
634
- state.error = action.error.message;
635
- })
636
- .addCase(updateCustomersInfo.pending, function (state) {
637
- state.loading = true;
638
- state.error = null;
639
- })
640
- .addCase(updateCustomersInfo.fulfilled, function (state, action) {
641
- state.loading = false;
642
- state.error = null;
643
- var _a = action.payload, data = _a.data, formData = _a.formData;
644
- state.data.customersData = formData;
645
- state.data.customersData.responseBody = data;
646
- })
647
- .addCase(updateCustomersInfo.rejected, function (state, action) {
648
- state.loading = false;
649
- state.error = action.error.message;
650
- })
651
- .addCase(updateBoardSuccess.fulfilled, function (state, action) {
652
- var _a;
653
- state.loading = false;
654
- state.error = null;
655
- var response = (action.payload || {}).response;
656
- var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
657
- if (description) {
658
- state.error = description;
659
- return;
660
- }
661
- var flows = response.flows;
662
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
663
- })
664
- .addCase(updateBoardSuccess.pending, function (state) {
665
- state.loading = true;
666
- state.error = null;
667
- })
668
- .addCase(updateBoardSuccess.rejected, function (state, action) {
669
- state.loading = false;
670
- state.error = action.error.message;
671
- })
672
- .addCase(uploadArticle.pending, function (state) {
673
- state.error = null;
674
- state.uploading = true;
675
- })
676
- .addCase(uploadArticle.fulfilled, function (state, action) {
677
- state.error = null;
678
- state.uploading = false;
679
- var data = action.payload.data;
680
- state.data.entityData.articleId = data === null || data === void 0 ? void 0 : data.id;
681
- })
682
- .addCase(uploadArticle.rejected, function (state) {
683
- state.uploading = false;
684
- state.error = 'file_upload_error';
685
- });
686
- }
687
- });
688
- export var clearError = (_a = entitySlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
689
- export default entitySlice.reducer;
690
- export var entitySelector = function (state) { return state.entity; };
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var __rest = (this && this.__rest) || function (s, e) {
49
+ var t = {};
50
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ };
59
+ var _a;
60
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
61
+ import API from '../../../api';
62
+ import { BusinessType, FlowsTypes } from '../../../@types';
63
+ import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
64
+ import { ENTITY_STEP_NAMES } from '../../../constants';
65
+ import moment from 'moment';
66
+ import { convertNumbers2English } from '../../../utils';
67
+ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
68
+ var payload, data, boardData, entityData, boardInfoData, entityTypes, countryIso2, board_id, entityId, info, hasEntityCompleted;
69
+ var _a, _b, _c, _d;
70
+ return __generator(this, function (_e) {
71
+ switch (_e.label) {
72
+ case 0:
73
+ payload = {
74
+ service_name: 'tap_email',
75
+ verify_token: token
76
+ };
77
+ return [4, API.leadService.verifyLeadToken(payload)];
78
+ case 1:
79
+ data = (_e.sent()).data;
80
+ countryIso2 = undefined;
81
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 9];
82
+ if (data === null || data === void 0 ? void 0 : data.country_code) {
83
+ countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
84
+ if (countryIso2)
85
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
86
+ }
87
+ if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 9];
88
+ board_id = data === null || data === void 0 ? void 0 : data.id;
89
+ if (!board_id) return [3, 4];
90
+ return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
91
+ case 2:
92
+ boardInfoData = _e.sent();
93
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
94
+ case 3:
95
+ boardData = _e.sent();
96
+ _e.label = 4;
97
+ case 4:
98
+ entityId = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.id;
99
+ if (!entityId) return [3, 6];
100
+ return [4, API.entityService.retrieveEntity(entityId)];
101
+ case 5:
102
+ entityData = _e.sent();
103
+ _e.label = 6;
104
+ case 6:
105
+ if (!countryIso2) {
106
+ countryIso2 = entityData.country;
107
+ if (countryIso2)
108
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
109
+ }
110
+ info = (boardInfoData || {}).info;
111
+ hasEntityCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
112
+ if (!hasEntityCompleted) return [3, 7];
113
+ thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
114
+ return [3, 9];
115
+ case 7: return [4, API.entityService.retrieveEntityType()];
116
+ case 8:
117
+ entityTypes = _e.sent();
118
+ thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
119
+ _e.label = 9;
120
+ case 9: return [2, {
121
+ data: data,
122
+ boardResponse: {
123
+ user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
124
+ brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
125
+ bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
126
+ entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
127
+ merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
128
+ name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
129
+ contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
130
+ flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info,
131
+ entityTypes: entityTypes
132
+ },
133
+ token: token
134
+ }];
135
+ }
136
+ });
137
+ }); });
138
+ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
139
+ var entity, payload, data;
140
+ return __generator(this, function (_a) {
141
+ switch (_a.label) {
142
+ case 0:
143
+ entity = thunkApi.getState().entity;
144
+ payload = {
145
+ service_name: 'tap_email',
146
+ verify_token: entity.data.verify.token
147
+ };
148
+ return [4, API.leadService.verifyLeadToken(payload)];
149
+ case 1:
150
+ data = (_a.sent()).data;
151
+ return [2, { data: data }];
152
+ }
153
+ });
154
+ }); });
155
+ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
156
+ var _a, entity, settings, responseBody, payload, data, boardData, entityData, entityTypes, boardInfoData, board_id, entityId, info, hasEntityCompleted;
157
+ var _b, _c, _d, _e, _f, _g, _h;
158
+ return __generator(this, function (_j) {
159
+ switch (_j.label) {
160
+ case 0:
161
+ _a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
162
+ responseBody = entity.data.verify.responseBody;
163
+ payload = {
164
+ data: params.otp,
165
+ service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
166
+ verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
167
+ step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
168
+ encryption_contract: ['data']
169
+ };
170
+ return [4, API.leadService.verifyLeadOTP(payload)];
171
+ case 1:
172
+ data = (_j.sent()).data;
173
+ boardInfoData = undefined;
174
+ if (!!data.errors) return [3, 9];
175
+ board_id = responseBody === null || responseBody === void 0 ? void 0 : responseBody.id;
176
+ if (!board_id) return [3, 4];
177
+ return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
178
+ case 2:
179
+ boardInfoData = _j.sent();
180
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
181
+ case 3:
182
+ boardData = _j.sent();
183
+ _j.label = 4;
184
+ case 4:
185
+ entityId = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.id;
186
+ if (!entityId) return [3, 6];
187
+ return [4, API.entityService.retrieveEntity(entityId)];
188
+ case 5:
189
+ entityData = _j.sent();
190
+ _j.label = 6;
191
+ case 6:
192
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
193
+ info = (boardInfoData || {}).info;
194
+ hasEntityCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
195
+ if (!hasEntityCompleted) return [3, 7];
196
+ thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
197
+ return [3, 9];
198
+ case 7: return [4, API.entityService.retrieveEntityType()];
199
+ case 8:
200
+ entityTypes = _j.sent();
201
+ thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
202
+ _j.label = 9;
203
+ case 9: return [2, {
204
+ data: data,
205
+ boardResponse: {
206
+ user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
207
+ brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
208
+ bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
209
+ entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
210
+ merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
211
+ name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
212
+ contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
213
+ flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info,
214
+ entityTypes: entityTypes
215
+ },
216
+ formData: params
217
+ }];
218
+ }
219
+ });
220
+ }); });
221
+ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
222
+ var data;
223
+ var _a, _b;
224
+ return __generator(this, function (_c) {
225
+ switch (_c.label) {
226
+ case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
227
+ case 1:
228
+ data = _c.sent();
229
+ return [2, {
230
+ data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
231
+ }];
232
+ }
233
+ });
234
+ }); });
235
+ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
236
+ var _a, settings, entity, id, issuingDate, expiryDate, isFL, payload, data, list;
237
+ var _b, _c, _d, _e;
238
+ return __generator(this, function (_f) {
239
+ switch (_f.label) {
240
+ case 0:
241
+ _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
242
+ id = (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id;
243
+ issuingDate = new Date(params.issuingDate).getTime();
244
+ expiryDate = new Date(params.expiryDate).getTime();
245
+ isFL = params.licenseType === BusinessType.FL;
246
+ payload = {
247
+ id: id,
248
+ license: {
249
+ number: params.licenseNumber && params.licenseNumber,
250
+ type: isFL ? 'freelance' : 'commercial_registration',
251
+ issuing_date: issuingDate === null || issuingDate === void 0 ? void 0 : issuingDate.toString(),
252
+ expiry_date: expiryDate === null || expiryDate === void 0 ? void 0 : expiryDate.toString(),
253
+ additional_info: params.unifiedNumber
254
+ ? {
255
+ unified_number: params.unifiedNumber
256
+ }
257
+ : undefined
258
+ },
259
+ type: params.entityType,
260
+ legal_name: params.legalName
261
+ ? {
262
+ ar: params.legalName,
263
+ en: params.legalName
264
+ }
265
+ : undefined,
266
+ encryption_contract: ['license.number', 'legal_name.ar', 'legal_name.en', 'license.type']
267
+ };
268
+ return [4, API.entityService.updateEntity(payload)];
269
+ case 1:
270
+ data = _f.sent();
271
+ return [4, API.dataService.getActivities()];
272
+ case 2:
273
+ list = (_f.sent()).list;
274
+ data.activityList = list;
275
+ thunkApi.dispatch(handleNextScreenStep());
276
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
277
+ return [2, { data: data, formData: params }];
278
+ }
279
+ });
280
+ }); });
281
+ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
282
+ var _a, settings, entity, id, activities, payload, data;
283
+ var _b, _c, _d, _e, _f;
284
+ return __generator(this, function (_g) {
285
+ switch (_g.label) {
286
+ case 0:
287
+ _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
288
+ id = (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id;
289
+ activities = (_d = (params.activities || [])) === null || _d === void 0 ? void 0 : _d.map(function (_a) {
290
+ var id = _a.id;
291
+ return ({ id: id, action: 'add' });
292
+ });
293
+ payload = {
294
+ id: id,
295
+ activities: (activities === null || activities === void 0 ? void 0 : activities.length) > 0 ? activities : undefined,
296
+ capital: {
297
+ paid: params.capitalPaid,
298
+ shares: {
299
+ count: params.capitalShareCount,
300
+ value: params.capitalShareValue
301
+ }
302
+ }
303
+ };
304
+ return [4, API.entityService.updateEntity(payload)];
305
+ case 1:
306
+ data = _g.sent();
307
+ thunkApi.dispatch(handleNextScreenStep());
308
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
309
+ return [2, { data: data, formData: params }];
310
+ }
311
+ });
312
+ }); });
313
+ export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
314
+ var _a, settings, entity, _b, id, infoId, payload, data, boardInfoData;
315
+ var _c, _d, _e, _f;
316
+ return __generator(this, function (_g) {
317
+ switch (_g.label) {
318
+ case 0:
319
+ _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
320
+ _b = entity.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
321
+ if (!id)
322
+ return [2];
323
+ payload = {
324
+ lang: settings.data.language,
325
+ step_name: ENTITY_STEP_NAMES.ENTITY_SUCCESS,
326
+ id: id
327
+ };
328
+ return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
329
+ case 1:
330
+ data = _g.sent();
331
+ return [4, API.boardService.retrieveBoardInfoStatus(id)];
332
+ case 2:
333
+ boardInfoData = _g.sent();
334
+ return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
335
+ case 3:
336
+ _g.sent();
337
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
338
+ (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
339
+ thunkApi.dispatch(handleNextScreenStep());
340
+ return [2, { response: __assign(__assign({}, data), { flows: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info }), formData: params }];
341
+ }
342
+ });
343
+ }); });
344
+ var initialState = {
345
+ error: null,
346
+ loading: false,
347
+ customLoading: false,
348
+ uploading: false,
349
+ data: {
350
+ flowName: FlowsTypes.ENTITY,
351
+ verify: {
352
+ token: ''
353
+ },
354
+ otpData: {
355
+ otp: ''
356
+ },
357
+ entityNameData: {
358
+ legalName: '',
359
+ licenseNumber: '',
360
+ licenseType: '',
361
+ entityType: '',
362
+ issuingDate: '',
363
+ expiryDate: '',
364
+ unifiedNumber: ''
365
+ },
366
+ entityCapitalData: {
367
+ activities: [],
368
+ capitalPaid: '',
369
+ capitalShareCount: '',
370
+ capitalShareValue: ''
371
+ }
372
+ }
373
+ };
374
+ export var entitySlice = createSlice({
375
+ name: 'entity/store',
376
+ initialState: initialState,
377
+ reducers: {
378
+ clearError: function (state) {
379
+ state.error = null;
380
+ },
381
+ stopLoader: function (state) {
382
+ state.loading = false;
383
+ },
384
+ resetOTPScreen: function (state) {
385
+ state.data.otpData.otp = '';
386
+ }
387
+ },
388
+ extraReducers: function (builder) {
389
+ builder
390
+ .addCase(verifyLeadToken.pending, function (state) {
391
+ state.error = null;
392
+ state.customLoading = true;
393
+ })
394
+ .addCase(verifyLeadToken.fulfilled, function (state, action) {
395
+ var _a, _b, _c, _d;
396
+ state.error = null;
397
+ state.customLoading = false;
398
+ var _e = action.payload, data = _e.data, token = _e.token, boardResponse = _e.boardResponse;
399
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
400
+ if (description) {
401
+ state.error = description;
402
+ return;
403
+ }
404
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
405
+ state.data.verify.token = token;
406
+ var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
407
+ if (entity) {
408
+ var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
409
+ var legalName = legal_name;
410
+ var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
411
+ var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
412
+ var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
413
+ var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
414
+ var _h = capital || {}, paid = _h.paid, shares = _h.shares;
415
+ var entityIssueDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
416
+ var entityExpiredDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.expiry_date;
417
+ var issuingDate = void 0, expiryDate = undefined;
418
+ if (entityIssueDate) {
419
+ var date = new Date(entityIssueDate);
420
+ var formattedDate = moment(date).format('YYYY-MM-DD');
421
+ issuingDate = convertNumbers2English(formattedDate);
422
+ }
423
+ if (entityExpiredDate) {
424
+ var date = new Date(entityExpiredDate);
425
+ var formattedDate = moment(date).format('YYYY-MM-DD');
426
+ expiryDate = convertNumbers2English(formattedDate);
427
+ }
428
+ if ((legalName === null || legalName === void 0 ? void 0 : legalName.en) || (legalName === null || legalName === void 0 ? void 0 : legalName.ar))
429
+ state.data.entityNameData.legalName = (legalName === null || legalName === void 0 ? void 0 : legalName.en) || (legalName === null || legalName === void 0 ? void 0 : legalName.ar);
430
+ if (licenseNumber)
431
+ state.data.entityNameData.licenseNumber = licenseNumber;
432
+ if (unifiedNumber)
433
+ state.data.entityNameData.unifiedNumber = unifiedNumber;
434
+ state.data.entityNameData.licenseType = licenseType;
435
+ if (entityType)
436
+ state.data.entityNameData.entityType = entityType;
437
+ state.data.entityNameData.issuingDate = issuingDate || moment(new Date()).format('YYYY-MM-DD');
438
+ state.data.entityNameData.expiryDate = expiryDate || moment(new Date()).format('YYYY-MM-DD');
439
+ if (activities)
440
+ state.data.entityCapitalData.activities = activities;
441
+ if (paid)
442
+ state.data.entityCapitalData.capitalPaid = paid;
443
+ if (shares === null || shares === void 0 ? void 0 : shares.count)
444
+ state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
445
+ if (shares === null || shares === void 0 ? void 0 : shares.value)
446
+ state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
447
+ state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id });
448
+ }
449
+ })
450
+ .addCase(verifyLeadToken.rejected, function (state, action) {
451
+ state.error = action.error.message;
452
+ state.customLoading = false;
453
+ })
454
+ .addCase(resendOTP.pending, function (state) {
455
+ state.error = null;
456
+ })
457
+ .addCase(resendOTP.fulfilled, function (state, action) {
458
+ var _a;
459
+ state.error = null;
460
+ var data = action.payload.data;
461
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
462
+ if (description) {
463
+ state.error = description;
464
+ return;
465
+ }
466
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
467
+ })
468
+ .addCase(resendOTP.rejected, function (state, action) {
469
+ state.error = action.error.message;
470
+ })
471
+ .addCase(verifyEntityLeadOTP.pending, function (state) {
472
+ state.loading = true;
473
+ state.error = null;
474
+ })
475
+ .addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
476
+ var _a, _b, _c, _d;
477
+ state.loading = false;
478
+ state.error = null;
479
+ var _e = action.payload, data = _e.data, boardResponse = _e.boardResponse, formData = _e.formData;
480
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
481
+ if (description) {
482
+ state.error = description;
483
+ return;
484
+ }
485
+ state.data.otpData = formData;
486
+ state.data.otpData.responseBody = data;
487
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
488
+ var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
489
+ var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
490
+ var legalName = legal_name;
491
+ var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
492
+ var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
493
+ var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
494
+ var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
495
+ var _h = capital || {}, paid = _h.paid, shares = _h.shares;
496
+ var entityIssueDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
497
+ var entityExpiredDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.expiry_date;
498
+ var issuingDate, expiryDate = undefined;
499
+ if (entityIssueDate) {
500
+ var date = new Date(entityIssueDate);
501
+ var formattedDate = moment(date).format('YYYY-MM-DD');
502
+ issuingDate = convertNumbers2English(formattedDate);
503
+ }
504
+ if (entityExpiredDate) {
505
+ var date = new Date(entityExpiredDate);
506
+ var formattedDate = moment(date).format('YYYY-MM-DD');
507
+ expiryDate = convertNumbers2English(formattedDate);
508
+ }
509
+ if ((legalName === null || legalName === void 0 ? void 0 : legalName.en) || (legalName === null || legalName === void 0 ? void 0 : legalName.ar))
510
+ state.data.entityNameData.legalName = (legalName === null || legalName === void 0 ? void 0 : legalName.en) || (legalName === null || legalName === void 0 ? void 0 : legalName.ar);
511
+ if (licenseNumber)
512
+ state.data.entityNameData.licenseNumber = licenseNumber;
513
+ if (unifiedNumber)
514
+ state.data.entityNameData.unifiedNumber = unifiedNumber;
515
+ state.data.entityNameData.licenseType = licenseType;
516
+ if (entityType)
517
+ state.data.entityNameData.entityType = entityType;
518
+ state.data.entityNameData.issuingDate = issuingDate || moment(new Date()).format('YYYY-MM-DD');
519
+ state.data.entityNameData.expiryDate = expiryDate || moment(new Date()).format('YYYY-MM-DD');
520
+ if (activities)
521
+ state.data.entityCapitalData.activities = activities;
522
+ if (paid)
523
+ state.data.entityCapitalData.capitalPaid = paid;
524
+ if (shares === null || shares === void 0 ? void 0 : shares.count)
525
+ state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
526
+ if (shares === null || shares === void 0 ? void 0 : shares.value)
527
+ state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
528
+ state.data.entityNameData = __assign(__assign({}, state.data.entityNameData), { responseBody: __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id }) });
529
+ })
530
+ .addCase(verifyEntityLeadOTP.rejected, function (state, action) {
531
+ state.loading = false;
532
+ state.error = action.error.message;
533
+ })
534
+ .addCase(updateEntityName.pending, function (state) {
535
+ state.loading = true;
536
+ state.error = null;
537
+ })
538
+ .addCase(updateEntityName.fulfilled, function (state, action) {
539
+ state.loading = false;
540
+ state.error = null;
541
+ var _a = action.payload, data = _a.data, formData = _a.formData;
542
+ var _b = data || {}, activityList = _b.activityList, rest = __rest(_b, ["activityList"]);
543
+ state.data.entityNameData = formData;
544
+ state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
545
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { activityList: activityList });
546
+ if (rest === null || rest === void 0 ? void 0 : rest.activities)
547
+ state.data.entityCapitalData = __assign(__assign({}, state.data.entityCapitalData), { activities: rest === null || rest === void 0 ? void 0 : rest.activities });
548
+ })
549
+ .addCase(updateEntityName.rejected, function (state, action) {
550
+ state.loading = false;
551
+ state.error = action.error.message;
552
+ })
553
+ .addCase(updateEntityCapital.pending, function (state) {
554
+ state.loading = true;
555
+ state.error = null;
556
+ })
557
+ .addCase(updateEntityCapital.fulfilled, function (state, action) {
558
+ state.loading = false;
559
+ state.error = null;
560
+ var _a = action.payload, data = _a.data, formData = _a.formData;
561
+ state.data.entityCapitalData = formData;
562
+ state.data.entityCapitalData.responseBody = __assign(__assign({}, state.data.entityCapitalData.responseBody), { data: data });
563
+ })
564
+ .addCase(updateEntityCapital.rejected, function (state, action) {
565
+ state.loading = false;
566
+ state.error = action.error.message;
567
+ })
568
+ .addCase(retrieveBoardDetails.pending, function (state) {
569
+ state.error = null;
570
+ state.loading = true;
571
+ })
572
+ .addCase(retrieveBoardDetails.fulfilled, function (state, action) {
573
+ state.error = null;
574
+ state.loading = false;
575
+ var data = (action.payload || {}).data;
576
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
577
+ })
578
+ .addCase(retrieveBoardDetails.rejected, function (state, action) {
579
+ state.error = action.error.message;
580
+ state.loading = false;
581
+ })
582
+ .addCase(updateBoardSuccess.fulfilled, function (state, action) {
583
+ var _a;
584
+ state.loading = false;
585
+ state.error = null;
586
+ var response = (action.payload || {}).response;
587
+ var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
588
+ if (description) {
589
+ state.error = description;
590
+ return;
591
+ }
592
+ var flows = response.flows;
593
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
594
+ })
595
+ .addCase(updateBoardSuccess.pending, function (state) {
596
+ state.loading = true;
597
+ state.error = null;
598
+ })
599
+ .addCase(updateBoardSuccess.rejected, function (state, action) {
600
+ state.loading = false;
601
+ state.error = action.error.message;
602
+ });
603
+ }
604
+ });
605
+ export var clearError = (_a = entitySlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
606
+ export default entitySlice.reducer;
607
+ export var entitySelector = function (state) { return state.entity; };