@tap-payments/auth-jsconnect 2.3.5-test → 2.3.6

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 (471) hide show
  1. package/build/@types/app.d.ts +303 -1
  2. package/build/@types/app.js +17 -0
  3. package/build/@types/form.d.ts +10 -7
  4. package/build/@types/redux.d.ts +4 -0
  5. package/build/@types/user.d.ts +39 -3
  6. package/build/api/brand.d.ts +7 -0
  7. package/build/api/brand.js +10 -1
  8. package/build/api/data.d.ts +8 -0
  9. package/build/api/data.js +34 -2
  10. package/build/api/entity.d.ts +20 -5
  11. package/build/api/entity.js +26 -1
  12. package/build/api/index.d.ts +29 -5
  13. package/build/api/index.js +3 -1
  14. package/build/api/individual.d.ts +24 -6
  15. package/build/api/individual.js +9 -1
  16. package/build/api/init.d.ts +17 -0
  17. package/build/api/init.js +13 -0
  18. package/build/api/lead.d.ts +8 -1
  19. package/build/api/lead.js +9 -1
  20. package/build/app/settings.d.ts +12 -9
  21. package/build/app/settings.js +77 -34
  22. package/build/assets/locales/ar.json +28 -1
  23. package/build/assets/locales/en.json +28 -1
  24. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
  25. package/build/components/AnimationFlow/AnimationFlow.js +4 -4
  26. package/build/components/AnimationFlow/BottomSheet.d.ts +4 -1
  27. package/build/components/AnimationFlow/BottomSheet.js +43 -19
  28. package/build/components/AnimationFlow/Dialog.d.ts +4 -2
  29. package/build/components/AnimationFlow/Dialog.js +30 -7
  30. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +5 -2
  31. package/build/components/ArabicDatePicker/ArabicDatePicker.js +45 -23
  32. package/build/components/ArabicDatePicker/arabicAr.d.ts +8 -0
  33. package/build/components/ArabicDatePicker/arabicAr.js +32 -0
  34. package/build/components/ArabicDatePicker/arabicEn.d.ts +8 -0
  35. package/build/components/ArabicDatePicker/arabicEn.js +32 -0
  36. package/build/components/ArabicDatePicker/style.css +45 -5
  37. package/build/components/DatePicker/DatePicker.d.ts +4 -1
  38. package/build/components/DatePicker/DatePicker.js +27 -17
  39. package/build/components/LogoBadge/LogoBadge.js +3 -0
  40. package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
  41. package/build/components/RadioGroup/RadioGroup.js +5 -9
  42. package/build/components/RadioGroup/index.d.ts +1 -1
  43. package/build/components/SimpleList/SimpleList.d.ts +5 -2
  44. package/build/components/SimpleList/SimpleList.js +31 -11
  45. package/build/components/Slide/Slide.d.ts +1 -1
  46. package/build/constants/api.d.ts +7 -0
  47. package/build/constants/api.js +14 -1
  48. package/build/constants/app.d.ts +45 -0
  49. package/build/constants/app.js +101 -52
  50. package/build/constants/assets.d.ts +9 -0
  51. package/build/constants/assets.js +9 -0
  52. package/build/constants/validation.d.ts +3 -2
  53. package/build/constants/validation.js +3 -2
  54. package/build/features/app/bank/bankStore.d.ts +7 -3
  55. package/build/features/app/bank/bankStore.js +155 -115
  56. package/build/features/app/brand/brandStore.d.ts +32 -12
  57. package/build/features/app/brand/brandStore.js +384 -203
  58. package/build/features/app/business/businessStore.d.ts +16 -13
  59. package/build/features/app/business/businessStore.js +364 -295
  60. package/build/features/app/connect/connectStore.d.ts +15 -1
  61. package/build/features/app/connect/connectStore.js +292 -95
  62. package/build/features/app/connectExpress/connectExpressStore.d.ts +17 -3
  63. package/build/features/app/connectExpress/connectExpressStore.js +232 -100
  64. package/build/features/app/entity/entityStore.d.ts +15 -17
  65. package/build/features/app/entity/entityStore.js +279 -248
  66. package/build/features/app/individual/individualStore.d.ts +22 -10
  67. package/build/features/app/individual/individualStore.js +531 -418
  68. package/build/features/app/password/passwordStore.d.ts +4 -0
  69. package/build/features/app/password/passwordStore.js +99 -43
  70. package/build/features/app/tax/taxStore.d.ts +6 -2
  71. package/build/features/app/tax/taxStore.js +143 -101
  72. package/build/features/bank/Bank.js +10 -6
  73. package/build/features/bank/screens/BankDetails/BankDetails.js +43 -17
  74. package/build/features/bank/screens/BankDetails/BankName.d.ts +5 -1
  75. package/build/features/bank/screens/BankDetails/BankName.js +9 -9
  76. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +5 -1
  77. package/build/features/bank/screens/BankDetails/BankStatement.js +7 -10
  78. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +3 -1
  79. package/build/features/bank/screens/BankDetails/Beneficiary.js +6 -7
  80. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
  81. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +12 -13
  82. package/build/features/bank/screens/BankDetails/IBAN.d.ts +3 -1
  83. package/build/features/bank/screens/BankDetails/IBAN.js +3 -5
  84. package/build/features/bank/screens/BankDetails/validation.d.ts +8 -8
  85. package/build/features/bank/screens/BankDetails/validation.js +6 -17
  86. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  87. package/build/features/bank/screens/Verify/OTPInput.js +5 -3
  88. package/build/features/bank/screens/Verify/Verify.js +1 -5
  89. package/build/features/brand/Brand.js +10 -6
  90. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +10 -27
  91. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +45 -28
  92. package/build/features/brand/screens/BrandActivities/BrandActivities.js +41 -9
  93. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +11 -38
  94. package/build/features/brand/screens/BrandActivities/CustomerBase.js +22 -31
  95. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +3 -1
  96. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +24 -20
  97. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +3 -1
  98. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +31 -19
  99. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +13 -6
  100. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
  101. package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -2
  102. package/build/features/brand/screens/BrandActivities/TAC.js +21 -12
  103. package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
  104. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +18 -4
  105. package/build/features/brand/screens/BrandActivities/validation.d.ts +43 -43
  106. package/build/features/brand/screens/BrandActivities/validation.js +11 -25
  107. package/build/features/brand/screens/BrandInfo/BrandInfo.js +40 -33
  108. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
  109. package/build/features/brand/screens/BrandInfo/BrandLogo.js +41 -0
  110. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +3 -2
  111. package/build/features/brand/screens/BrandInfo/BrandName.js +4 -7
  112. package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
  113. package/build/features/brand/screens/BrandInfo/SalesChannels.js +19 -25
  114. package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -13
  115. package/build/features/brand/screens/BrandInfo/validation.js +43 -53
  116. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.d.ts +5 -0
  117. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +102 -0
  118. package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.d.ts +10 -0
  119. package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.js +69 -0
  120. package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.d.ts +10 -0
  121. package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.js +69 -0
  122. package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.d.ts +10 -0
  123. package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.js +69 -0
  124. package/build/features/{connect/screens/Merchant → brand/screens/BrandSegmentInfo}/TeamSize.d.ts +3 -1
  125. package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.js +20 -25
  126. package/build/features/brand/screens/BrandSegmentInfo/index.d.ts +2 -0
  127. package/build/features/brand/screens/BrandSegmentInfo/index.js +2 -0
  128. package/build/features/brand/screens/BrandSegmentInfo/validation.d.ts +17 -0
  129. package/build/features/brand/screens/BrandSegmentInfo/validation.js +9 -0
  130. package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  131. package/build/features/brand/screens/Verify/OTPInput.js +5 -3
  132. package/build/features/brand/screens/Verify/Verify.js +7 -20
  133. package/build/features/business/Business.js +7 -5
  134. package/build/features/business/screens/Activities/ActivitiesList.d.ts +15 -68
  135. package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
  136. package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
  137. package/build/features/business/screens/Activities/OperationStartDate.js +3 -3
  138. package/build/features/business/screens/Activities/validation.d.ts +165 -30
  139. package/build/features/business/screens/Activities/validation.js +5 -2
  140. package/build/features/business/screens/BrandDetails/BrandDetails.d.ts +5 -0
  141. package/build/features/business/screens/BrandDetails/BrandDetails.js +39 -0
  142. package/build/features/business/screens/BrandDetails/BrandName.d.ts +5 -0
  143. package/build/features/business/screens/BrandDetails/BrandName.js +36 -0
  144. package/build/features/business/screens/BrandDetails/Header.d.ts +5 -0
  145. package/build/features/business/screens/BrandDetails/Header.js +49 -0
  146. package/build/features/business/screens/BrandDetails/LicenseInfo.d.ts +5 -0
  147. package/build/features/business/screens/BrandDetails/LicenseInfo.js +38 -0
  148. package/build/features/{brand/screens/BrandActivities/OperationStartDate.d.ts → business/screens/BrandDetails/SalesChannel.d.ts} +5 -7
  149. package/build/features/business/screens/BrandDetails/SalesChannel.js +48 -0
  150. package/build/features/business/screens/BrandDetails/index.d.ts +3 -0
  151. package/build/features/business/screens/BrandDetails/index.js +2 -0
  152. package/build/features/business/screens/BusinessType/Article.d.ts +3 -1
  153. package/build/features/business/screens/BusinessType/Article.js +19 -54
  154. package/build/features/business/screens/BusinessType/BusinessType.js +35 -11
  155. package/build/features/business/screens/BusinessType/EntityLicenseList.d.ts +9 -0
  156. package/build/features/business/screens/BusinessType/EntityLicenseList.js +129 -0
  157. package/build/features/business/screens/BusinessType/EntityName.js +6 -7
  158. package/build/features/business/screens/BusinessType/LicenseCertificate.js +2 -1
  159. package/build/features/business/screens/BusinessType/LicenseList.d.ts +1 -0
  160. package/build/features/business/screens/BusinessType/LicenseList.js +7 -22
  161. package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +1 -2
  162. package/build/features/business/screens/BusinessType/LicenseNumber.js +7 -5
  163. package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
  164. package/build/features/business/screens/BusinessType/validation.js +2 -2
  165. package/build/features/business/screens/CivilID/IDNumber.js +2 -3
  166. package/build/features/business/screens/Customers/CustomerLocations.d.ts +44 -37
  167. package/build/features/business/screens/Customers/CustomerLocations.js +35 -19
  168. package/build/features/business/screens/Customers/Customers.js +27 -16
  169. package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -4
  170. package/build/features/business/screens/Customers/ExpectedSalesRange.js +14 -6
  171. package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
  172. package/build/features/business/screens/Customers/RefundPolicy.js +15 -4
  173. package/build/features/business/screens/Customers/TransactionPolicy.js +19 -9
  174. package/build/features/business/screens/IDBOD/DOB.js +3 -3
  175. package/build/features/business/screens/IDBOD/ID.js +2 -3
  176. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  177. package/build/features/business/screens/Verify/OTPInput.js +5 -3
  178. package/build/features/connect/Connect.d.ts +2 -0
  179. package/build/features/connect/Connect.js +86 -11
  180. package/build/features/connect/screens/BrandSegment/BrandSegment.d.ts +5 -0
  181. package/build/features/connect/screens/BrandSegment/BrandSegment.js +84 -0
  182. package/build/features/connect/screens/BrandSegment/SegmentLocations.d.ts +8 -0
  183. package/build/features/connect/screens/{Merchant/Segments.js → BrandSegment/SegmentLocations.js} +17 -25
  184. package/build/features/connect/screens/BrandSegment/SegmentProfits.d.ts +8 -0
  185. package/build/features/{brand/screens/BrandInfo/Segments.js → connect/screens/BrandSegment/SegmentProfits.js} +18 -26
  186. package/build/features/connect/screens/BrandSegment/SegmentTechs.d.ts +8 -0
  187. package/build/features/connect/screens/BrandSegment/SegmentTechs.js +66 -0
  188. package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.js +12 -20
  189. package/build/features/connect/screens/BrandSegment/index.d.ts +3 -0
  190. package/build/features/connect/screens/BrandSegment/index.js +2 -0
  191. package/build/features/connect/screens/BrandSegment/validation.d.ts +17 -0
  192. package/build/features/connect/screens/BrandSegment/validation.js +9 -0
  193. package/build/features/connect/screens/CivilID/CivilID.js +5 -13
  194. package/build/features/connect/screens/CivilID/IDNumber.js +5 -6
  195. package/build/features/connect/screens/Individual/Email.js +17 -27
  196. package/build/features/connect/screens/Individual/Individual.js +8 -1
  197. package/build/features/connect/screens/Individual/MobileNumber.js +16 -15
  198. package/build/features/connect/screens/Individual/Name.js +11 -15
  199. package/build/features/connect/screens/Merchant/BrandList.js +4 -22
  200. package/build/features/connect/screens/Merchant/BrandName.js +4 -7
  201. package/build/features/connect/screens/Merchant/Merchant.js +13 -15
  202. package/build/features/connect/screens/Merchant/SalesChannels.js +6 -6
  203. package/build/features/connect/screens/Merchant/validation.d.ts +3 -6
  204. package/build/features/connect/screens/Merchant/validation.js +14 -17
  205. package/build/features/connect/screens/Mobile/Mobile.js +13 -16
  206. package/build/features/connect/screens/Mobile/MobileNumber.js +14 -10
  207. package/build/features/connect/screens/NID/DOB.js +3 -3
  208. package/build/features/connect/screens/NID/IDNumber.js +6 -7
  209. package/build/features/connect/screens/NID/NID.js +6 -0
  210. package/build/features/connect/screens/OTP/OTP.js +13 -15
  211. package/build/features/connect/screens/OTP/OTPInput.js +10 -0
  212. package/build/features/connect/screens/ThankYou/ThankYou.js +17 -2
  213. package/build/features/connectExpress/ConnectExpress.d.ts +1 -0
  214. package/build/features/connectExpress/ConnectExpress.js +72 -12
  215. package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
  216. package/build/features/connectExpress/screens/CivilID/IDNumber.js +6 -7
  217. package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +6 -7
  218. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
  219. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -7
  220. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +7 -4
  221. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
  222. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +9 -14
  223. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
  224. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +4 -4
  225. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +4 -3
  226. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +4 -2
  227. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +14 -1
  228. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +9 -10
  229. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +4 -4
  230. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +11 -6
  231. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
  232. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +6 -14
  233. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +1 -0
  234. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +6 -2
  235. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +2 -1
  236. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +3 -4
  237. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +2 -2
  238. package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -3
  239. package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +1 -0
  240. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -2
  241. package/build/features/connectExpress/screens/Mobile/TAC.d.ts +2 -1
  242. package/build/features/connectExpress/screens/Mobile/TAC.js +3 -1
  243. package/build/features/connectExpress/screens/NID/DOB.d.ts +2 -1
  244. package/build/features/connectExpress/screens/NID/DOB.js +3 -3
  245. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  246. package/build/features/connectExpress/screens/NID/IDNumber.js +3 -4
  247. package/build/features/connectExpress/screens/NID/NID.js +4 -2
  248. package/build/features/connectExpress/screens/NID/TAC.d.ts +14 -1
  249. package/build/features/connectExpress/screens/NID/TAC.js +9 -10
  250. package/build/features/connectExpress/screens/NIDMissed/DOB.js +2 -2
  251. package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +2 -3
  252. package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -3
  253. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -1
  254. package/build/features/entity/Entity.js +10 -6
  255. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +16 -68
  256. package/build/features/entity/screens/EntityCapital/ActivityList.js +221 -106
  257. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +3 -1
  258. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +14 -15
  259. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +3 -1
  260. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +10 -11
  261. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +3 -1
  262. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +15 -16
  263. package/build/features/entity/screens/EntityCapital/EntityCapital.js +31 -20
  264. package/build/features/entity/screens/EntityCapital/validation.d.ts +175 -40
  265. package/build/features/entity/screens/EntityCapital/validation.js +9 -12
  266. package/build/features/entity/screens/EntityName/Article.d.ts +5 -1
  267. package/build/features/entity/screens/EntityName/Article.js +20 -54
  268. package/build/features/entity/screens/EntityName/EntityName.js +60 -16
  269. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +11 -27
  270. package/build/features/entity/screens/EntityName/EntityTypeList.js +32 -43
  271. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +5 -3
  272. package/build/features/entity/screens/EntityName/ExpiryDate.js +5 -5
  273. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +5 -3
  274. package/build/features/entity/screens/EntityName/IssuingDate.js +4 -5
  275. package/build/features/entity/screens/EntityName/LegalName.d.ts +3 -1
  276. package/build/features/entity/screens/EntityName/LegalName.js +9 -6
  277. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
  278. package/build/features/entity/screens/EntityName/LicenseCertificate.js +13 -7
  279. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +3 -1
  280. package/build/features/entity/screens/EntityName/LicenseNumber.js +13 -11
  281. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +3 -1
  282. package/build/features/entity/screens/EntityName/UnifiedNumber.js +9 -7
  283. package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
  284. package/build/features/entity/screens/EntityName/validation.js +68 -93
  285. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  286. package/build/features/entity/screens/Verify/OTPInput.js +5 -3
  287. package/build/features/entity/screens/Verify/Verify.js +7 -20
  288. package/build/features/featuresScreens.js +13 -1
  289. package/build/features/individual/Individual.js +10 -6
  290. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  291. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -23
  292. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
  293. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +29 -10
  294. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +3 -1
  295. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +17 -12
  296. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
  297. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +30 -41
  298. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +3 -3
  299. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +94 -55
  300. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +5 -3
  301. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +17 -12
  302. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
  303. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +9 -2
  304. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
  305. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +13 -7
  306. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
  307. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +14 -8
  308. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
  309. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +32 -42
  310. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +8 -8
  311. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +8 -12
  312. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  313. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
  314. package/build/features/individual/screens/IndividualList/UserList.js +10 -6
  315. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +2 -0
  316. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +14 -20
  317. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +2 -0
  318. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +8 -14
  319. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +3 -1
  320. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +4 -4
  321. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +3 -1
  322. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +3 -10
  323. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +3 -1
  324. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +5 -7
  325. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +5 -3
  326. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +5 -2
  327. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +3 -1
  328. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +3 -10
  329. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  330. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +79 -36
  331. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +2 -0
  332. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +10 -21
  333. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +2 -0
  334. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +14 -16
  335. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +3 -1
  336. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +3 -10
  337. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +2 -0
  338. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +10 -21
  339. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
  340. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
  341. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +6 -3
  342. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  343. package/build/features/individual/screens/Verify/OTPInput.js +5 -3
  344. package/build/features/individual/screens/Verify/Verify.js +1 -5
  345. package/build/features/password/Password.js +7 -5
  346. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
  347. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  348. package/build/features/password/screens/Verify/OTPInput.js +5 -3
  349. package/build/features/password/screens/Verify/Verify.js +7 -20
  350. package/build/features/shared/Address/CountryList.d.ts +7 -7
  351. package/build/features/shared/Address/CountryList.js +1 -1
  352. package/build/features/shared/Address/InputSelect.d.ts +7 -7
  353. package/build/features/shared/Address/InputSelect.js +1 -1
  354. package/build/features/shared/Button/Button.d.ts +3 -1
  355. package/build/features/shared/Button/Button.js +2 -2
  356. package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
  357. package/build/features/shared/Button/FlowsButtons.js +22 -20
  358. package/build/features/shared/Button/IndividualActionButtons.d.ts +3 -1
  359. package/build/features/shared/Button/IndividualActionButtons.js +28 -4
  360. package/build/features/shared/Calender/Calender.d.ts +13 -0
  361. package/build/features/shared/Calender/Calender.js +56 -0
  362. package/build/features/shared/Calender/index.d.ts +2 -0
  363. package/build/features/shared/Calender/index.js +2 -0
  364. package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
  365. package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
  366. package/build/features/shared/Chip/Chip.d.ts +3 -0
  367. package/build/features/shared/Chip/Chip.js +21 -0
  368. package/build/features/shared/Chip/index.d.ts +2 -0
  369. package/build/features/shared/Chip/index.js +2 -0
  370. package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
  371. package/build/features/shared/Containers/FeatureContainer.js +5 -4
  372. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  373. package/build/features/shared/Dot/Dot.d.ts +8 -0
  374. package/build/features/shared/Dot/Dot.js +29 -0
  375. package/build/features/shared/Dot/index.d.ts +2 -0
  376. package/build/features/shared/Dot/index.js +2 -0
  377. package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
  378. package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
  379. package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
  380. package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
  381. package/build/features/shared/EndAdornment/index.d.ts +3 -0
  382. package/build/features/shared/EndAdornment/index.js +3 -0
  383. package/build/features/shared/Footer/Footer.js +8 -0
  384. package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
  385. package/build/features/shared/Footer/PoweredByFooter.js +36 -0
  386. package/build/features/shared/Footer/index.d.ts +3 -2
  387. package/build/features/shared/Footer/index.js +3 -2
  388. package/build/features/shared/GenericError/GenericError.js +1 -1
  389. package/build/features/shared/Input/Input.d.ts +5 -6
  390. package/build/features/shared/Input/Input.js +2 -3
  391. package/build/features/shared/Input/index.d.ts +2 -1
  392. package/build/features/shared/InputSelect/InputSelect.d.ts +4 -0
  393. package/build/features/shared/InputSelect/InputSelect.js +33 -0
  394. package/build/features/shared/InputSelect/index.d.ts +2 -0
  395. package/build/features/shared/InputSelect/index.js +2 -0
  396. package/build/features/shared/OTP/OTP.d.ts +2 -1
  397. package/build/features/shared/OTP/OTP.js +2 -2
  398. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +3 -1
  399. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +8 -6
  400. package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -1
  401. package/build/features/shared/SalesChannels/SalesChannel.js +9 -4
  402. package/build/features/shared/Search/Search.d.ts +2 -1
  403. package/build/features/shared/Search/Search.js +2 -2
  404. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +19 -8
  405. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  406. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  407. package/build/features/shared/UploadFile/FileUpload.d.ts +32 -0
  408. package/build/features/shared/UploadFile/FileUpload.js +267 -0
  409. package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
  410. package/build/features/shared/UploadFile/UploadFile.js +7 -7
  411. package/build/features/shared/UploadFile/UploadWrapper.d.ts +36 -0
  412. package/build/features/shared/UploadFile/UploadWrapper.js +115 -0
  413. package/build/features/shared/UploadFile/index.d.ts +2 -1
  414. package/build/features/shared/UploadFile/index.js +2 -1
  415. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +8 -27
  416. package/build/features/shared/UploadMultipleFile/UploadFile.js +70 -56
  417. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -3
  418. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +11 -17
  419. package/build/features/signIn/SignIn.js +3 -4
  420. package/build/features/tax/Tax.js +10 -6
  421. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  422. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  423. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
  424. package/build/features/tax/screens/TaxDetails/TaxDetails.js +23 -10
  425. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  426. package/build/features/tax/screens/TaxDetails/TaxDocument.js +7 -5
  427. package/build/features/tax/screens/TaxDetails/VATId.d.ts +5 -1
  428. package/build/features/tax/screens/TaxDetails/VATId.js +6 -10
  429. package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
  430. package/build/features/tax/screens/TaxDetails/validation.js +2 -5
  431. package/build/features/tax/screens/Verify/OTPInput.js +5 -3
  432. package/build/features/tax/screens/Verify/Verify.js +6 -22
  433. package/build/hooks/index.d.ts +5 -0
  434. package/build/hooks/index.js +5 -0
  435. package/build/hooks/useAppConfig.d.ts +4 -2
  436. package/build/hooks/useAppConfig.js +18 -16
  437. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  438. package/build/hooks/useDataNoneEditable.js +19 -0
  439. package/build/hooks/useDataVerified.d.ts +6 -0
  440. package/build/hooks/useDataVerified.js +19 -0
  441. package/build/hooks/useErrorListener.d.ts +2 -1
  442. package/build/hooks/useErrorListener.js +16 -1
  443. package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
  444. package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
  445. package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
  446. package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
  447. package/build/hooks/useFormReadOnly.d.ts +6 -0
  448. package/build/hooks/useFormReadOnly.js +40 -0
  449. package/build/hooks/useVerifyToken.js +1 -1
  450. package/build/theme/shadows.js +1 -1
  451. package/build/utils/array.d.ts +14 -2
  452. package/build/utils/array.js +196 -4
  453. package/build/utils/common.d.ts +1 -0
  454. package/build/utils/common.js +10 -0
  455. package/build/utils/date.d.ts +1 -0
  456. package/build/utils/date.js +6 -0
  457. package/build/utils/error.d.ts +1 -0
  458. package/build/utils/error.js +3 -0
  459. package/build/utils/gtm.d.ts +6 -0
  460. package/build/utils/gtm.js +29 -0
  461. package/build/utils/index.d.ts +1 -0
  462. package/build/utils/index.js +1 -0
  463. package/build/utils/object.d.ts +4 -0
  464. package/build/utils/object.js +17 -0
  465. package/build/utils/string.d.ts +5 -2
  466. package/build/utils/string.js +28 -7
  467. package/package.json +4 -2
  468. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
  469. package/build/features/brand/screens/BrandInfo/Segments.d.ts +0 -8
  470. package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
  471. /package/build/features/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
@@ -50,10 +50,11 @@ var TextStyled = styled(Text)(function (_a) {
50
50
  return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
51
51
  });
52
52
  var CheckBoxStyled = styled(CheckBox)(function (_a) {
53
- var theme = _a.theme;
53
+ var theme = _a.theme, disabled = _a.disabled;
54
54
  return ({
55
55
  paddingInline: '15px',
56
56
  marginInlineEnd: theme.spacing(-1),
57
+ opacity: disabled ? 0.6 : 1,
57
58
  '& .MuiSvgIcon-root': {
58
59
  fontSize: 30
59
60
  },
@@ -74,7 +75,7 @@ var CollapseStyled = styled(Collapse)(function (_a) {
74
75
  });
75
76
  });
76
77
  var SalesChannel = function (_a) {
77
- var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
78
+ var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, readOnly = _a.readOnly, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d, isChannelVerified = _a.isChannelVerified;
78
79
  var _e = React.useState(''), activeSaleIconId = _e[0], setActiveSaleIconId = _e[1];
79
80
  var _f = React.useState([]), selectedSalas = _f[0], setSelectedSales = _f[1];
80
81
  var t = useTranslation().t;
@@ -141,9 +142,13 @@ var SalesChannel = function (_a) {
141
142
  selectFirstIcon(defaultValue);
142
143
  }
143
144
  }, [selectFirstIconListener]);
145
+ var selectedChannel = React.useMemo(function () { return selectedSalas.find(function (_a) {
146
+ var id = _a.id;
147
+ return id === activeSaleIconId;
148
+ }); }, [selectedSalas, activeSaleIconId]);
144
149
  return (_jsxs(_Fragment, { children: [_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), list.map(function (channel, index) {
145
150
  var _a, _b;
146
- return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
147
- }), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas }, 'saleChannelIconsInput')] }));
151
+ return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled || readOnly, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
152
+ }), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas, isVerified: isChannelVerified === null || isChannelVerified === void 0 ? void 0 : isChannelVerified(activeSaleIconId, selectedChannel) }, 'saleChannelIconsInput')] }));
148
153
  };
149
154
  export default React.memo(SalesChannel);
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface SearchProps {
3
3
  showSearch?: boolean;
4
+ placeholder?: string;
4
5
  onSearchValue?: (value: string) => void;
5
6
  }
6
- declare const Search: ({ onSearchValue }: SearchProps) => JSX.Element;
7
+ declare const Search: ({ onSearchValue, placeholder }: SearchProps) => JSX.Element;
7
8
  export default Search;
@@ -3,11 +3,11 @@ import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import Input from '../../shared/Input';
5
5
  var Search = function (_a) {
6
- var onSearchValue = _a.onSearchValue;
6
+ var onSearchValue = _a.onSearchValue, placeholder = _a.placeholder;
7
7
  var t = useTranslation().t;
8
8
  var handleOnChange = function (event) {
9
9
  onSearchValue === null || onSearchValue === void 0 ? void 0 : onSearchValue(event.target.value);
10
10
  };
11
- return (_jsx(React.Fragment, { children: _jsx(Input, { placeholder: t('search_placeholder'), onChange: handleOnChange }) }));
11
+ return (_jsx(React.Fragment, { children: _jsx(Input, { placeholder: t(placeholder || 'search_placeholder'), onChange: handleOnChange }) }));
12
12
  };
13
13
  export default Search;
@@ -13,6 +13,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
13
  import { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
+ import { MerchantStatus } from '../../../@types';
16
17
  import { FlowsButtons } from '../../shared/Button';
17
18
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../constants';
18
19
  import { useAppSelector, useLanguage } from '../../../hooks';
@@ -53,6 +54,7 @@ var SuccessFlowButtons = function (_a) {
53
54
  var primary_contact = (business || {}).primary_contact;
54
55
  var _g = entity || {}, license = _g.license, vat_id = _g.vat_id, legal_name = _g.legal_name;
55
56
  var count = (individuals || {}).count;
57
+ var _h = merchant || {}, acceptance_status = _h.acceptance_status, payout_status = _h.payout_status;
56
58
  var username = isAr ? concatenateObjectValues((names === null || names === void 0 ? void 0 : names.ar) || (names === null || names === void 0 ? void 0 : names.en), ['first', 'last']) : concatenateObjectValues(names === null || names === void 0 ? void 0 : names.en, ['first', 'last']);
57
59
  var licenseNumber = (license === null || license === void 0 ? void 0 : license.number) || '';
58
60
  var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.name, 20) || t('bank');
@@ -60,21 +62,30 @@ var SuccessFlowButtons = function (_a) {
60
62
  var taxID = vat_id || '';
61
63
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || t('brand');
62
64
  var entityLegalName = shortenString(isAr ? legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar : legal_name === null || legal_name === void 0 ? void 0 : legal_name.en, 20) || t('entity');
63
- var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
64
- var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
65
+ var isAcceptance = acceptance_status === MerchantStatus.ENABLED;
66
+ var isPayout = payout_status === MerchantStatus.ENABLED;
65
67
  var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
66
68
  var email = (primary_contact || {}).email;
67
69
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, boardId, boardInfoId);
70
+ var flowsDetails = [
71
+ { name: 'brand', status: brand === null || brand === void 0 ? void 0 : brand.data_state },
72
+ { name: 'entity', status: entity === null || entity === void 0 ? void 0 : entity.data_state },
73
+ { name: 'bank', status: bank === null || bank === void 0 ? void 0 : bank.data_state },
74
+ { name: 'tax', status: entity === null || entity === void 0 ? void 0 : entity.tax_data_state },
75
+ { name: 'individual', status: individuals === null || individuals === void 0 ? void 0 : individuals.data_state }
76
+ ];
68
77
  var reMapFlowData = function (flows) {
69
78
  if (flows === void 0) { flows = []; }
70
79
  var images = ICONS_NAMES;
71
80
  var mappedFlows = flows
72
81
  .filter(function (item) { return item === null || item === void 0 ? void 0 : item.name; })
73
82
  .map(function (_a) {
74
- var name = _a.name, url = _a.url, status = _a.status, token = _a.token;
75
- var type = status === 'completed' ? 'completed' : 'pending';
83
+ var _b;
84
+ var name = _a.name, url = _a.url, flowStatus = _a.status, token = _a.token;
85
+ var status = name === 'password' ? flowStatus : (_b = flowsDetails.find(function (flow) { return flow.name === name; })) === null || _b === void 0 ? void 0 : _b.status;
86
+ var type = status === 'reviewed' || status === 'completed' || status === 'complete' || status === 'verified' ? 'completed' : 'pending';
76
87
  var title = t("".concat(name, "_flow_").concat(type), {
77
- individual_name: is_authorized && count > 1 ? t('company_individuals_details', { count: count }) : username.toLowerCase() + maskedId,
88
+ individual_name: (is_authorized && count > 1 ? t('company_individuals_details', { count: count }) : username.toLowerCase() + maskedId) || t('individual'),
78
89
  brand: brandName,
79
90
  business_type: entityLegalName,
80
91
  license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
@@ -82,7 +93,7 @@ var SuccessFlowButtons = function (_a) {
82
93
  iban: iban ? t('masking_symbols') + iban : '',
83
94
  tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
84
95
  });
85
- var isCompleted = status === 'completed' && name !== 'password';
96
+ var isCompleted = status === 'verified' && name !== 'password';
86
97
  var isIndividual = name === 'individual';
87
98
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
88
99
  var hoverSrc = "".concat(name, "_white_icon");
@@ -101,14 +112,14 @@ var SuccessFlowButtons = function (_a) {
101
112
  setButtons(mappedFlows);
102
113
  };
103
114
  var checkIfFlowsAreCompletedExceptPassword = function (data) {
104
- var isFlowsCompleted = data.every(function (flow) { return flow.status === 'completed' && flow.name !== 'password'; });
115
+ var isFlowsCompleted = data.every(function (flow) { return (flow.status === 'complete' || flow.status === 'reviewed' || flow.status === 'verified') && flow.name !== 'password'; });
105
116
  return isFlowsCompleted;
106
117
  };
107
118
  useEffect(function () {
108
119
  var _a, _b;
109
120
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
110
121
  reMapFlowData(flows);
111
- var isFlowsCompleted = checkIfFlowsAreCompletedExceptPassword(flows);
122
+ var isFlowsCompleted = checkIfFlowsAreCompletedExceptPassword(flowsDetails);
112
123
  if (isFlowsCompleted) {
113
124
  (_b = (_a = settings.data.appConfig).onBoardCompleted) === null || _b === void 0 ? void 0 : _b.call(_a);
114
125
  }
@@ -7,6 +7,8 @@ export interface ThankYouProps {
7
7
  loading?: boolean;
8
8
  error?: string;
9
9
  description?: string | React.ReactElement;
10
+ enableBack?: boolean;
11
+ onBack?: () => void;
10
12
  }
11
- declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error }: ThankYouProps) => JSX.Element>;
13
+ declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack }: ThankYouProps) => JSX.Element>;
12
14
  export default _default;
@@ -15,6 +15,7 @@ import { styled } from '@mui/material/styles';
15
15
  import * as React from 'react';
16
16
  import { useTranslation } from 'react-i18next';
17
17
  import Text from '../../../components/Text';
18
+ import Button from '../../../components/Button';
18
19
  import Container from '../Containers/ScreenContainer';
19
20
  import { EmailProvidersButton, SuccessButton } from '../../shared/Button';
20
21
  import Icon from '../../../components/Icon';
@@ -54,9 +55,9 @@ var IconStyled = styled(Icon)(function (_a) {
54
55
  _b);
55
56
  });
56
57
  var ThankYou = function (_a) {
57
- var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error;
58
+ var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack;
58
59
  var t = useTranslation().t;
59
60
  var isAr = useLanguage().isAr;
60
- return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) }))] }));
61
+ return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] }));
61
62
  };
62
63
  export default React.memo(ThankYou);
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { FileInfo, FileRemoveType } from '../../../constants';
4
+ export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<Theme> & {
5
+ children?: React.ReactNode;
6
+ component?: React.ElementType<any> | undefined;
7
+ ref?: React.Ref<unknown> | undefined;
8
+ sx?: SxProps<Theme> | undefined;
9
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
10
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
11
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
12
+ export declare type FileUploadProps = {
13
+ key?: string;
14
+ show: boolean;
15
+ purpose: string;
16
+ file: File;
17
+ fileRemoveType: FileRemoveType;
18
+ required?: boolean;
19
+ title?: string;
20
+ uploadedFile: FileInfo;
21
+ onSuccess: (file: FileInfo) => void;
22
+ onDelete: () => void;
23
+ onUpdate: (file: FileInfo, loadingStatus: boolean) => void;
24
+ sx?: SxProps<Theme> | undefined;
25
+ isSubmitting?: boolean;
26
+ initialFileId?: string;
27
+ validFileFormats?: Array<string>;
28
+ readOnly?: boolean;
29
+ isVerified?: boolean;
30
+ };
31
+ declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId, validFileFormats, readOnly, isVerified }: FileUploadProps) => JSX.Element;
32
+ export default FileUpload;
@@ -0,0 +1,267 @@
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
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
49
+ import React from 'react';
50
+ import { useTranslation } from 'react-i18next';
51
+ import { alpha, styled, useTheme } from '@mui/material/styles';
52
+ import Box from '@mui/material/Box';
53
+ import ClearIcon from '@mui/icons-material/Clear';
54
+ import { CircularProgress as MUICircularProgress } from '@mui/material';
55
+ import Collapse from '../../../components/Collapse';
56
+ import { CircularProgress } from '../../../components/ProgressBar';
57
+ import Text from '../../../components/Text';
58
+ import Icon from '../../../components/Icon';
59
+ import { maskFileName } from '../../../utils';
60
+ import API from '../../../api';
61
+ import { DeleteFileStatus, FileStatus, ICONS_NAMES, MAX_FILE_SIZE_FOUR_MB, VALID_FILE_FORMATS, FileRemoveType } from '../../../constants';
62
+ import CheckIcon from '../../shared/CheckIcon';
63
+ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
64
+ var theme = _a.theme, readOnly = _a.readOnly;
65
+ return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
66
+ });
67
+ var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['uploading', 'readOnly'].includes(prop.toString()); } })(function (_a) {
68
+ var theme = _a.theme, uploading = _a.uploading, readOnly = _a.readOnly;
69
+ return (__assign(__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }), ((readOnly || uploading) && { background: alpha(theme.palette.primary.main, 0.5), cursor: 'default' })));
70
+ });
71
+ var ClearIconStyled = styled(ClearIcon)(function (_a) {
72
+ var theme = _a.theme;
73
+ return ({
74
+ width: theme.spacing(3),
75
+ height: theme.spacing(3),
76
+ cursor: 'pointer',
77
+ color: theme.palette.common.white
78
+ });
79
+ });
80
+ export var InputContainerStyled = styled(Box)(function () { return ({
81
+ display: 'flex',
82
+ width: '100%',
83
+ justifyContent: 'center'
84
+ }); });
85
+ var ProgressBoxStyled = styled(Box)(function () { return ({
86
+ display: 'flex',
87
+ justifyContent: 'center',
88
+ alignItems: 'center'
89
+ }); });
90
+ var WarningIconStyled = styled(Icon)(function (_a) {
91
+ var theme = _a.theme;
92
+ return ({
93
+ width: theme.spacing(1.625),
94
+ height: theme.spacing(1.625),
95
+ marginInline: theme.spacing(0.5)
96
+ });
97
+ });
98
+ var ErrorIconStyled = styled(Icon)(function (_a) {
99
+ var theme = _a.theme;
100
+ return ({
101
+ width: theme.spacing(1.625),
102
+ height: theme.spacing(1.625),
103
+ marginInline: theme.spacing(0.5)
104
+ });
105
+ });
106
+ var WarningContainer = styled(Box)(function (_a) {
107
+ var theme = _a.theme;
108
+ return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
109
+ });
110
+ var FileUpload = function (_a) {
111
+ var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId, _b = _a.validFileFormats, validFileFormats = _b === void 0 ? VALID_FILE_FORMATS : _b, readOnly = _a.readOnly, isVerified = _a.isVerified;
112
+ var theme = useTheme();
113
+ var t = useTranslation().t;
114
+ var _c = file || {}, name = _c.name, size = _c.size, type = _c.type;
115
+ var _d = uploadedFile || {}, status = _d.status, progress = _d.progress, error = _d.error, fileId = _d.fileId, deleteStatus = _d.deleteStatus, docId = _d.docId;
116
+ var uploadFile = function () { return __awaiter(void 0, void 0, void 0, function () {
117
+ var uploadPayload, onUploadProgress, data, fileId;
118
+ return __generator(this, function (_a) {
119
+ switch (_a.label) {
120
+ case 0:
121
+ uploadPayload = {
122
+ file_link_create: true,
123
+ title: title || (file === null || file === void 0 ? void 0 : file.name),
124
+ purpose: purpose,
125
+ file: file
126
+ };
127
+ onUploadProgress = function (progressEvent) {
128
+ var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
129
+ uploadedFile = __assign(__assign({}, uploadedFile), { progress: Math.floor(progress), status: FileStatus.UPLOADING, error: '' });
130
+ onUpdate(uploadedFile, true);
131
+ };
132
+ return [4, API.fileService.uploadFile(uploadPayload, { onUploadProgress: onUploadProgress })];
133
+ case 1:
134
+ data = (_a.sent()).data;
135
+ fileId = (data || {}).id;
136
+ if (fileId) {
137
+ uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS, fileId: fileId, error: '' });
138
+ onSuccess(uploadedFile);
139
+ }
140
+ else {
141
+ uploadedFile = __assign(__assign({}, uploadedFile), { progress: 0, status: FileStatus.ERROR, error: t('file_upload_error') });
142
+ onUpdate(uploadedFile, false);
143
+ }
144
+ return [2];
145
+ }
146
+ });
147
+ }); };
148
+ var downloadFile = function () { return __awaiter(void 0, void 0, void 0, function () {
149
+ var onDownloadProgress, data, _a;
150
+ return __generator(this, function (_b) {
151
+ switch (_b.label) {
152
+ case 0:
153
+ onDownloadProgress = function (progressEvent) {
154
+ var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
155
+ uploadedFile = __assign(__assign({}, uploadedFile), { progress: Math.floor(progress), status: FileStatus.DOWNLOADING, error: '' });
156
+ onUpdate(uploadedFile, true);
157
+ };
158
+ _b.label = 1;
159
+ case 1:
160
+ _b.trys.push([1, 3, , 4]);
161
+ uploadedFile = __assign(__assign({}, uploadedFile), { progress: 0, status: FileStatus.DOWNLOADING, error: '' });
162
+ onUpdate(uploadedFile, true);
163
+ return [4, API.fileService.downloadFile(fileId, uploadedFile === null || uploadedFile === void 0 ? void 0 : uploadedFile.name, { onDownloadProgress: onDownloadProgress })];
164
+ case 2:
165
+ data = (_b.sent()).data;
166
+ if (data) {
167
+ uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.SUCCESS, error: '' });
168
+ onSuccess(uploadedFile);
169
+ }
170
+ return [3, 4];
171
+ case 3:
172
+ _a = _b.sent();
173
+ uploadedFile = __assign(__assign({}, uploadedFile), { error: t('file_download_error'), status: FileStatus.SUCCESS });
174
+ onUpdate(uploadedFile, false);
175
+ return [3, 4];
176
+ case 4: return [2];
177
+ }
178
+ });
179
+ }); };
180
+ var deleteFile = function () { return __awaiter(void 0, void 0, void 0, function () {
181
+ var payload, data, entity, _a;
182
+ var _b;
183
+ return __generator(this, function (_c) {
184
+ switch (_c.label) {
185
+ case 0:
186
+ _c.trys.push([0, 3, , 4]);
187
+ uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.DELETING, error: '' });
188
+ onUpdate(uploadedFile, true);
189
+ if (!(fileRemoveType === FileRemoveType.AOA_FILE_ID)) return [3, 2];
190
+ payload = (_b = {
191
+ id: docId
192
+ },
193
+ _b[fileRemoveType] = '',
194
+ _b);
195
+ return [4, API.entityService.updateEntityAOAFile(payload)];
196
+ case 1:
197
+ data = _c.sent();
198
+ entity = (data || {}).entity;
199
+ if (entity === null || entity === void 0 ? void 0 : entity.id) {
200
+ uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.SUCCESS, fileId: '', error: '', docId: '' });
201
+ onUpdate(uploadedFile, false);
202
+ onDelete();
203
+ }
204
+ else {
205
+ uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.ERROR, error: 'file_delete_error' });
206
+ onUpdate(uploadedFile, false);
207
+ }
208
+ _c.label = 2;
209
+ case 2: return [3, 4];
210
+ case 3:
211
+ _a = _c.sent();
212
+ uploadedFile = __assign(__assign({}, uploadedFile), { deleteStatus: DeleteFileStatus.ERROR, error: 'file_delete_error' });
213
+ onUpdate(uploadedFile, false);
214
+ return [3, 4];
215
+ case 4: return [2];
216
+ }
217
+ });
218
+ }); };
219
+ var handleDeleteFile = function () {
220
+ if (initialFileId === uploadedFile.fileId && docId) {
221
+ deleteFile();
222
+ return;
223
+ }
224
+ onDelete();
225
+ };
226
+ var getProgressComponent = function () {
227
+ if (status === FileStatus.ERROR)
228
+ return _jsx(ErrorIconStyled, { src: ICONS_NAMES.ERROR_ICON });
229
+ if (status === FileStatus.SUCCESS)
230
+ return _jsx(CheckIcon, { isVerified: isVerified });
231
+ if (status === FileStatus.DOWNLOADING && !progress)
232
+ return _jsx(MUICircularProgress, { size: 25, thickness: 5 });
233
+ if (progress)
234
+ return (_jsx(CircularProgress, { sx: { backgroundColor: alpha(theme.palette.primary.main, 0.05), borderRadius: '32px' }, textSx: { fontSize: theme.spacing(1.125) }, value: progress, size: 35 }));
235
+ return _jsx(_Fragment, {});
236
+ };
237
+ React.useEffect(function () {
238
+ if (!file)
239
+ return;
240
+ else if (!validFileFormats.includes(type)) {
241
+ uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.ERROR, error: t('file_not_supported_alert') });
242
+ onUpdate(uploadedFile, false);
243
+ }
244
+ else if (size > MAX_FILE_SIZE_FOUR_MB) {
245
+ uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.ERROR, error: t('file_size_alert') });
246
+ onUpdate(uploadedFile, false);
247
+ }
248
+ else {
249
+ if (status === FileStatus.INIT || status === FileStatus.ERROR) {
250
+ uploadFile();
251
+ }
252
+ }
253
+ }, [name]);
254
+ var canDownloadFile = fileId && status !== FileStatus.DOWNLOADING;
255
+ var canDeleteFile = status !== FileStatus.UPLOADING && status !== FileStatus.DOWNLOADING;
256
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(Box, __assign({ sx: { pointerEvents: isSubmitting ? 'none' : 'auto' } }, { children: _jsxs(InputContainerStyled, __assign({ sx: __assign({ borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }, sx) }, { children: [_jsxs(BoxStyled, __assign({ readOnly: readOnly }, { children: [_jsxs(Box, __assign({ sx: {
257
+ display: 'flex',
258
+ flexDirection: 'column',
259
+ padding: theme.spacing(1.5, 0, 1.5),
260
+ width: '100%'
261
+ } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: name ? maskFileName(name) : uploadedFile.fileId })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] })), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || status === FileStatus.DOWNLOADING, onClick: function () {
262
+ if (readOnly)
263
+ return;
264
+ canDeleteFile && handleDeleteFile();
265
+ } }, { children: deleteStatus === DeleteFileStatus.DELETING ? (_jsx(MUICircularProgress, { size: 25, thickness: 5, sx: { color: theme.palette.common.white } })) : (_jsx(ClearIconStyled, {})) }))] })) }), key) })));
266
+ };
267
+ export default FileUpload;
@@ -6,7 +6,7 @@ export declare const InputContainerStyled: import("@emotion/styled").StyledCompo
6
6
  sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
7
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
8
8
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
9
- }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
9
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
10
10
  interface UploadFileProps {
11
11
  label: string;
12
12
  required?: boolean;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import React from 'react';
14
- import { styled } from '@mui/material/styles';
14
+ import { styled, alpha } from '@mui/material/styles';
15
15
  import { ScreenContainer } from '../../shared/Containers';
16
16
  import Box from '@mui/material/Box';
17
17
  import { InputLabelStyled } from '../../shared/Input/Input';
@@ -38,13 +38,13 @@ var LabelContainerStyled = styled(Box)(function (_a) {
38
38
  padding: theme.spacing(0, 2.5, 1.25, 2.5)
39
39
  });
40
40
  });
41
- var BoxStyled = styled(Box)(function (_a) {
42
- var theme = _a.theme;
43
- return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
41
+ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
42
+ var theme = _a.theme, readOnly = _a.readOnly;
43
+ return (__assign(__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }), (readOnly && { opacity: '0.6' })));
44
44
  });
45
- var UploadBoxStyled = styled(Box)(function (_a) {
46
- var theme = _a.theme;
47
- return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
45
+ var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
46
+ var theme = _a.theme, readOnly = _a.readOnly;
47
+ return (__assign(__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }), (readOnly && { background: alpha(theme.palette.primary.main, 0.5), cursor: 'default' })));
48
48
  });
49
49
  var ClearIconStyled = styled(ClearIcon)(function (_a) {
50
50
  var theme = _a.theme;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues } from 'react-hook-form';
3
+ import { FileDetails } from '../../../@types';
4
+ import { FileRemoveType } from '../../../constants';
5
+ export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
6
+ children?: React.ReactNode;
7
+ component?: React.ElementType<any> | undefined;
8
+ ref?: React.Ref<unknown> | undefined;
9
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
10
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
11
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
12
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
13
+ interface UploadWrapperProps {
14
+ id: string;
15
+ control: Control<FieldValues, any>;
16
+ label: string;
17
+ purpose: string;
18
+ fileRemoveType: FileRemoveType;
19
+ fileTitle?: string;
20
+ required?: boolean;
21
+ title: string;
22
+ subTitle: string;
23
+ dragDescription: string;
24
+ uploadingTitle: string;
25
+ successTitle: string;
26
+ isSubmitting?: boolean;
27
+ onFileUploaded: (fileId: string) => void;
28
+ fileUploadingStatus?: (uploading: boolean) => void;
29
+ onDeleteFile: () => void;
30
+ defaultFile?: FileDetails;
31
+ validFileFormats?: Array<string>;
32
+ readOnly?: boolean;
33
+ isVerified?: boolean;
34
+ }
35
+ declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly, isVerified }: UploadWrapperProps) => JSX.Element>;
36
+ export default _default;