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

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 (295) hide show
  1. package/build/@types/app.d.ts +50 -20
  2. package/build/@types/app.js +9 -3
  3. package/build/@types/form.d.ts +20 -12
  4. package/build/api/auth.d.ts +28 -5
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +51 -5
  14. package/build/api/entity.js +39 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +44 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +0 -1
  23. package/build/app/rootReducer.js +0 -2
  24. package/build/app/settings.d.ts +8 -2
  25. package/build/app/settings.js +29 -12
  26. package/build/app/store.d.ts +1 -3
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  34. package/build/components/AnimationFlow/Dialog.js +7 -5
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  41. package/build/components/FileInput/DragAndDrop.js +108 -8
  42. package/build/components/Lottie/Lottie.d.ts +878 -0
  43. package/build/components/Lottie/Lottie.js +58 -0
  44. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  45. package/build/components/Lottie/files/success.json +425 -0
  46. package/build/components/Lottie/index.d.ts +3 -0
  47. package/build/components/Lottie/index.js +3 -0
  48. package/build/components/OTPField/OTPField.d.ts +2 -1
  49. package/build/components/OTPField/OTPField.js +2 -2
  50. package/build/components/OTPTimer/OTPTimer.js +1 -1
  51. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  52. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  53. package/build/components/ProgressBar/index.d.ts +2 -0
  54. package/build/components/ProgressBar/index.js +2 -0
  55. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  56. package/build/components/RadioLabel/RadioLabel.js +2 -2
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  59. package/build/constants/api.d.ts +6 -0
  60. package/build/constants/api.js +14 -1
  61. package/build/constants/app.d.ts +6 -5
  62. package/build/constants/app.js +53 -28
  63. package/build/constants/assets.d.ts +14 -0
  64. package/build/constants/assets.js +16 -2
  65. package/build/constants/dummy.d.ts +1 -1
  66. package/build/constants/dummy.js +2 -2
  67. package/build/constants/validation.d.ts +10 -0
  68. package/build/constants/validation.js +11 -1
  69. package/build/features/app/auth/authStore.d.ts +30 -4
  70. package/build/features/app/auth/authStore.js +181 -21
  71. package/build/features/app/bank/bankStore.d.ts +16 -0
  72. package/build/features/app/bank/bankStore.js +86 -39
  73. package/build/features/app/business/businessStore.d.ts +22 -3
  74. package/build/features/app/business/businessStore.js +438 -296
  75. package/build/features/app/connect/connectStore.d.ts +34 -31
  76. package/build/features/app/connect/connectStore.js +427 -300
  77. package/build/features/app/entity/entityStore.d.ts +27 -7
  78. package/build/features/app/entity/entityStore.js +222 -145
  79. package/build/features/app/individual/individualStore.d.ts +18 -0
  80. package/build/features/app/individual/individualStore.js +171 -84
  81. package/build/features/app/password/passwordStore.js +1 -1
  82. package/build/features/app/tax/taxStore.js +18 -14
  83. package/build/features/auth/Auth.d.ts +3 -1
  84. package/build/features/auth/Auth.js +48 -14
  85. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  86. package/build/features/auth/screens/NID/DOB.js +47 -0
  87. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  88. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  89. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  90. package/build/features/auth/screens/NID/NID.js +68 -0
  91. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  92. package/build/features/auth/screens/NID/TAC.js +87 -0
  93. package/build/features/auth/screens/NID/index.d.ts +3 -0
  94. package/build/features/auth/screens/NID/index.js +2 -0
  95. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  96. package/build/features/auth/screens/NID/validation.js +19 -0
  97. package/build/features/auth/screens/OTP/OTP.js +8 -4
  98. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  99. package/build/features/bank/Bank.js +12 -6
  100. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  101. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  102. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  103. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  104. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  105. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  106. package/build/features/business/Business.d.ts +1 -1
  107. package/build/features/business/Business.js +14 -7
  108. package/build/features/business/screens/Activities/Activities.js +16 -17
  109. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  110. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  111. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  112. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  113. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  114. package/build/features/business/screens/Activities/validation.js +0 -9
  115. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  116. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  117. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  118. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  119. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  120. package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
  121. package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
  122. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  123. package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
  124. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  125. package/build/features/business/screens/BusinessType/validation.js +52 -3
  126. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  127. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  128. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  129. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  130. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  131. package/build/features/business/screens/CivilID/index.js +2 -0
  132. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  133. package/build/features/business/screens/CivilID/validation.js +4 -0
  134. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  135. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  136. package/build/features/business/screens/Customers/Customers.js +15 -9
  137. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  138. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  139. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  140. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  141. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  142. package/build/features/business/screens/OTP/OTP.js +15 -2
  143. package/build/features/business/screens/Success/Success.js +10 -3
  144. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  145. package/build/features/business/screens/Verify/Verify.js +4 -4
  146. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  147. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  148. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  152. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  153. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  154. package/build/features/connect/Connect.d.ts +2 -1
  155. package/build/features/connect/Connect.js +47 -12
  156. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  157. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  158. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  159. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  160. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  161. package/build/features/connect/screens/CivilID/index.js +2 -0
  162. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  163. package/build/features/connect/screens/CivilID/validation.js +4 -0
  164. package/build/features/connect/screens/Individual/Email.js +11 -3
  165. package/build/features/connect/screens/Individual/Individual.js +44 -28
  166. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  167. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  168. package/build/features/connect/screens/Merchant/Merchant.js +41 -64
  169. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
  170. package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
  171. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  172. package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
  173. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  174. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  175. package/build/features/connect/screens/Merchant/validation.js +108 -173
  176. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  177. package/build/features/connect/screens/NID/NID.js +5 -1
  178. package/build/features/connect/screens/OTP/OTP.js +20 -6
  179. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  180. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  181. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  186. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  187. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  188. package/build/features/entity/Entity.d.ts +1 -1
  189. package/build/features/entity/Entity.js +16 -9
  190. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  191. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  192. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  193. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  194. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +26 -7
  195. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  196. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +25 -4
  197. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  198. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +12 -51
  199. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -10
  200. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
  201. package/build/features/entity/screens/Verify/Verify.js +18 -5
  202. package/build/features/featuresScreens.d.ts +0 -1
  203. package/build/features/featuresScreens.js +25 -7
  204. package/build/features/individual/Individual.d.ts +1 -1
  205. package/build/features/individual/Individual.js +14 -7
  206. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  207. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  208. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  209. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  210. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  211. package/build/features/individual/screens/Verify/Verify.js +18 -5
  212. package/build/features/password/Password.d.ts +1 -1
  213. package/build/features/password/Password.js +14 -7
  214. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  215. package/build/features/password/screens/OTP/OTP.js +15 -2
  216. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
  217. package/build/features/password/screens/Verify/Verify.js +16 -3
  218. package/build/features/shared/Background/Background.d.ts +4 -5
  219. package/build/features/shared/Background/Background.js +16 -5
  220. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  221. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  222. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  223. package/build/features/shared/Button/MobileButton.js +2 -2
  224. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  225. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  226. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  227. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  228. package/build/features/shared/Dialog/index.d.ts +4 -0
  229. package/build/features/shared/Dialog/index.js +4 -0
  230. package/build/features/shared/Input/Input.d.ts +1 -1
  231. package/build/features/shared/Input/Input.js +2 -2
  232. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  233. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  234. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  235. package/build/features/signIn/SignIn.d.ts +1 -1
  236. package/build/features/signIn/SignIn.js +14 -6
  237. package/build/features/signIn/screens/Email/Email.js +4 -2
  238. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  239. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  240. package/build/features/signIn/screens/Password/Password.js +15 -2
  241. package/build/features/tax/Tax.d.ts +1 -1
  242. package/build/features/tax/Tax.js +16 -8
  243. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
  244. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  245. package/build/features/tax/screens/Verify/Verify.js +16 -3
  246. package/build/hooks/index.d.ts +2 -0
  247. package/build/hooks/index.js +2 -0
  248. package/build/hooks/useAppConfig.d.ts +3 -1
  249. package/build/hooks/useAppConfig.js +4 -2
  250. package/build/hooks/useAppDispatch.d.ts +0 -1
  251. package/build/hooks/useErrorListener.js +0 -6
  252. package/build/hooks/useScreen.d.ts +3 -0
  253. package/build/hooks/useScreen.js +14 -0
  254. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  255. package/build/hooks/useSetFromDefaultValues.js +24 -0
  256. package/build/index.d.ts +2 -3
  257. package/build/index.js +1 -4
  258. package/build/utils/array.d.ts +49 -1
  259. package/build/utils/array.js +58 -0
  260. package/build/utils/common.d.ts +1 -0
  261. package/build/utils/common.js +3 -0
  262. package/build/utils/device.d.ts +1 -0
  263. package/build/utils/device.js +13 -0
  264. package/build/utils/html.d.ts +1 -0
  265. package/build/utils/html.js +6 -0
  266. package/build/utils/index.d.ts +1 -0
  267. package/build/utils/index.js +1 -0
  268. package/build/utils/locale.js +1 -1
  269. package/build/utils/object.d.ts +1 -0
  270. package/build/utils/object.js +12 -0
  271. package/build/utils/rsa.d.ts +2 -2
  272. package/build/utils/rsa.js +1 -1
  273. package/build/utils/string.d.ts +33 -20
  274. package/build/utils/string.js +71 -1
  275. package/build/utils/validation.d.ts +2 -0
  276. package/build/utils/validation.js +6 -0
  277. package/package.json +5 -4
  278. package/build/features/app/otp/otpStore.d.ts +0 -28
  279. package/build/features/app/otp/otpStore.js +0 -153
  280. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  281. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  282. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  283. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  284. package/build/features/otp/OTP.d.ts +0 -7
  285. package/build/features/otp/OTP.js +0 -58
  286. package/build/features/otp/index.d.ts +0 -0
  287. package/build/features/otp/index.js +0 -1
  288. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  289. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  290. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  291. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  292. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  293. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  294. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  295. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -0,0 +1,4 @@
1
+ import DialogContainer from './DialogContainer';
2
+ import CloseDialog from './CloseDialog';
3
+ export { CloseDialog };
4
+ export default DialogContainer;
@@ -22,5 +22,5 @@ interface CustomButtonProps extends InputProps {
22
22
  label?: string;
23
23
  required?: boolean;
24
24
  }
25
- export default function CustomInput({ label, required, ...props }: CustomButtonProps): JSX.Element;
25
+ export default function CustomInput({ label, required, placeholder, ...props }: CustomButtonProps): JSX.Element;
26
26
  export {};
@@ -51,6 +51,6 @@ var LabelContainerStyled = styled(Box)(function (_a) {
51
51
  });
52
52
  });
53
53
  export default function CustomInput(_a) {
54
- var label = _a.label, required = _a.required, props = __rest(_a, ["label", "required"]);
55
- return (_jsxs(_Fragment, { children: [label && (_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] })), _jsx(InputStyled, __assign({}, props))] }));
54
+ var label = _a.label, required = _a.required, placeholder = _a.placeholder, props = __rest(_a, ["label", "required", "placeholder"]);
55
+ return (_jsxs(_Fragment, { children: [label && (_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] })), _jsx(InputStyled, __assign({}, props, { placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.toString() }))] }));
56
56
  }
@@ -56,6 +56,6 @@ var ThankYou = function (_a) {
56
56
  var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error;
57
57
  var t = useTranslation().t;
58
58
  var isAr = useLanguage().isAr;
59
- 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: 'https://www.icloud.com/mail/' } }) })), 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 || '') })) }))] }));
59
+ 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 || '') })) }))] }));
60
60
  };
61
61
  export default React.memo(ThankYou);
@@ -10,12 +10,19 @@ export declare const InputContainerStyled: import("@emotion/styled").StyledCompo
10
10
  interface UploadFileProps {
11
11
  label: string;
12
12
  required?: boolean;
13
- dragTitle: string;
14
- uploadTitle: string;
13
+ title: string;
14
+ subTitle: string;
15
+ dragDescription: string;
16
+ uploadingTitle: string;
17
+ successTitle: string;
15
18
  error?: string;
19
+ progress?: number;
16
20
  isSubmitting?: boolean;
21
+ isUploading?: boolean;
22
+ isFileUploaded?: boolean;
17
23
  onFileUploaded: (file: File) => void;
18
24
  onReset: () => void;
25
+ initialFileName?: string;
19
26
  }
20
- declare const UploadFile: ({ label, required, dragTitle, uploadTitle, isSubmitting, error, onFileUploaded, onReset }: UploadFileProps) => JSX.Element;
27
+ declare const UploadFile: ({ label, required, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, isUploading, isFileUploaded, error, progress, onFileUploaded, onReset, initialFileName }: UploadFileProps) => JSX.Element;
21
28
  export default UploadFile;
@@ -16,10 +16,14 @@ import { ScreenContainer } from '../../shared/Containers';
16
16
  import Box from '@mui/material/Box';
17
17
  import { InputLabelStyled } from '../../shared/Input/Input';
18
18
  import Mandatory from '../../shared/Mandatory';
19
- import { DragAndDrop, UploadInput } from '../../../components/FileInput';
19
+ import { DragAndDrop } from '../../../components/FileInput';
20
20
  import Collapse from '../../../components/Collapse';
21
- import Warning from '../../../components/Warning';
22
21
  import ClearIcon from '@mui/icons-material/Clear';
22
+ import CheckIcon from '../../../features/shared/CheckIcon';
23
+ import { maskFileName } from '../../../utils';
24
+ import Icon from '../../../components/Icon';
25
+ import { ICONS_NAMES } from '../../../constants';
26
+ import Text from '../../../components/Text';
23
27
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
24
28
  var theme = _a.theme;
25
29
  return ({
@@ -36,11 +40,11 @@ var LabelContainerStyled = styled(Box)(function (_a) {
36
40
  });
37
41
  var BoxStyled = styled(Box)(function (_a) {
38
42
  var theme = _a.theme;
39
- 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: '85%', wordBreak: 'break-all' }));
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' }));
40
44
  });
41
45
  var UploadBoxStyled = styled(Box)(function (_a) {
42
46
  var theme = _a.theme;
43
- return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '15%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
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' }));
44
48
  });
45
49
  var ClearIconStyled = styled(ClearIcon)(function (_a) {
46
50
  var theme = _a.theme;
@@ -55,14 +59,16 @@ export var InputContainerStyled = styled(Box)(function (_a) {
55
59
  var theme = _a.theme;
56
60
  return ({
57
61
  display: 'flex',
58
- width: '100%'
62
+ width: '100%',
63
+ justifyContent: 'center'
59
64
  });
60
65
  });
61
66
  var UploadFile = function (_a) {
62
- var label = _a.label, required = _a.required, dragTitle = _a.dragTitle, uploadTitle = _a.uploadTitle, isSubmitting = _a.isSubmitting, error = _a.error, onFileUploaded = _a.onFileUploaded, onReset = _a.onReset;
63
- var _b = React.useState(''), fileName = _b[0], setFileName = _b[1];
67
+ var label = _a.label, required = _a.required, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, isUploading = _a.isUploading, isFileUploaded = _a.isFileUploaded, error = _a.error, progress = _a.progress, onFileUploaded = _a.onFileUploaded, onReset = _a.onReset, initialFileName = _a.initialFileName;
68
+ var _b = React.useState(initialFileName || ''), fileName = _b[0], setFileName = _b[1];
69
+ var _c = React.useState(!!initialFileName), showFile = _c[0], setShowFile = _c[1];
64
70
  var handleFileChange = function (file) {
65
- setFileName(file === null || file === void 0 ? void 0 : file.name);
71
+ setFileName(maskFileName(file === null || file === void 0 ? void 0 : file.name));
66
72
  onFileUploaded === null || onFileUploaded === void 0 ? void 0 : onFileUploaded(file);
67
73
  };
68
74
  var handleReset = function () {
@@ -71,6 +77,15 @@ var UploadFile = function (_a) {
71
77
  onReset === null || onReset === void 0 ? void 0 : onReset();
72
78
  }
73
79
  };
74
- return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(DragAndDrop, { title: dragTitle, onSuccess: handleFileChange }), _jsx(UploadInput, { title: uploadTitle, onChange: handleFileChange })] }) })), _jsx(Collapse, __assign({ in: !!fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(BoxStyled, { children: fileName }), _jsx(UploadBoxStyled, __assign({ onClick: handleReset }, { children: _jsx(ClearIconStyled, {}) }))] }) })), _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: error })) }))] }));
80
+ React.useEffect(function () {
81
+ if (isFileUploaded && !!fileName) {
82
+ setTimeout(function () {
83
+ setShowFile(true);
84
+ }, 600);
85
+ }
86
+ else
87
+ setShowFile(false);
88
+ }, [isFileUploaded]);
89
+ return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !showFile }, { children: _jsx(InputContainerStyled, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: !!fileName, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: progress, uploading: isUploading, uploadSuccess: isFileUploaded, onSuccess: handleFileChange, error: error }) }) })), _jsx(Collapse, __assign({ in: showFile, timeout: 300 }, { children: _jsxs(InputContainerStyled, { children: [_jsxs(BoxStyled, { children: [_jsxs(Box, __assign({ sx: { display: 'flex' } }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: fileName })] })), _jsx(Box, { children: _jsx(CheckIcon, {}) })] }), _jsx(UploadBoxStyled, __assign({ onClick: handleReset }, { children: _jsx(ClearIconStyled, {}) }))] }) }))] }));
75
90
  };
76
91
  export default UploadFile;
@@ -4,4 +4,4 @@ export interface SignInLibProps extends LibConfig {
4
4
  }
5
5
  export declare function SignInLib(props: SignInLibProps): JSX.Element;
6
6
  export declare function renderSignInLib(config: SignInLibProps, elementId: string): void;
7
- export declare function unmountSignInLib(elementId: string): void;
7
+ export declare function unmountSignInLib(elementId: string, unmountTimeout?: number): void;
@@ -19,20 +19,20 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
19
  import Collapse from '../../components/Collapse';
20
20
  import { reactElement } from '../../utils';
21
21
  import { FeatureContainer } from '../shared/Containers';
22
- import { SigIn_SCREENS_NAVIGATION } from '../../constants';
22
+ import { DIALOG_ID, SigIn_SCREENS_NAVIGATION } from '../../constants';
23
23
  import { signInFeatureScreens } from '../featuresScreens';
24
24
  import CustomFooter from '../shared/Footer';
25
25
  import { signInSelector } from '../app/signIn/signInStore';
26
26
  import Background from '../shared/Background';
27
27
  var SignIn = memo(function (props) {
28
28
  var theme = useAppTheme().theme;
29
- var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, loading = _a.loading;
30
- var signInError = useAppSelector(signInSelector).error;
29
+ var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
30
+ var _b = useAppSelector(signInSelector), signInError = _b.error, loading = _b.loading;
31
31
  useAppConfig(__assign({ navigation: SigIn_SCREENS_NAVIGATION }, props));
32
32
  useErrorListener(signInError || error);
33
33
  useStepStartedListener();
34
34
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
35
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
35
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
36
36
  var Element = _a.element, name = _a.name;
37
37
  var isActive = activeScreen.name === name;
38
38
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -44,6 +44,14 @@ export function SignInLib(props) {
44
44
  export function renderSignInLib(config, elementId) {
45
45
  reactElement(elementId).render(_jsx(SignInLib, __assign({}, config)));
46
46
  }
47
- export function unmountSignInLib(elementId) {
48
- reactElement(elementId).unmount();
47
+ export function unmountSignInLib(elementId, unmountTimeout) {
48
+ if (unmountTimeout === void 0) { unmountTimeout = 1000; }
49
+ var element = document.getElementById(elementId);
50
+ var dialogEl = document.getElementById(DIALOG_ID);
51
+ setTimeout(function () {
52
+ var _a;
53
+ ((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
54
+ dialogEl && dialogEl.remove();
55
+ elementId && reactElement(elementId).unmount();
56
+ }, unmountTimeout);
49
57
  }
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
15
15
  import { alpha, styled } from '@mui/material/styles';
16
16
  import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
- import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
18
+ import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
19
19
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
20
  import { clearError, signInSelector, createEmailAuth } from '../../../app/signIn/signInStore';
21
21
  import Form from '../../../../components/Form';
@@ -70,11 +70,13 @@ var Email = function (_a) {
70
70
  var t = useTranslation().t;
71
71
  var _b = useAppSelector(signInSelector), data = _b.data, loading = _b.loading, error = _b.error;
72
72
  var settingsStore = useAppSelector(settingsSelector);
73
+ var _c = data.auth, responseBody = _c.responseBody, email = _c.email;
73
74
  var methods = useForm({
74
75
  resolver: yupResolver(EmailValidationSchema),
75
- defaultValues: { email: data.auth.email || '' },
76
+ defaultValues: { email: email || '' },
76
77
  mode: 'onChange'
77
78
  });
79
+ useSetFromDefaultValues(methods, { email: email || '' });
78
80
  React.useEffect(function () {
79
81
  handleClearError();
80
82
  }, [methods.formState.isValid]);
@@ -19,7 +19,7 @@ import { styled, alpha } from '@mui/material/styles';
19
19
  import Collapse from '../../../../components/Collapse';
20
20
  import Form from '../../../../components/Form';
21
21
  import Button, { MobileButton } from '../../../shared/Button';
22
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
23
23
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
24
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
25
  import { clearError, createMobileAuth, signInSelector } from '../../../app/signIn/signInStore';
@@ -79,6 +79,10 @@ var Mobile = function (_a) {
79
79
  defaultValues: { mobile: data.auth.mobile || '', countryCode: data.auth.countryCode },
80
80
  mode: 'onChange'
81
81
  });
82
+ useSetFromDefaultValues(methods, {
83
+ mobile: data.auth.mobile || '',
84
+ countryCode: data.auth.countryCode
85
+ });
82
86
  var t = useTranslation().t;
83
87
  var isAr = useLanguage().isAr;
84
88
  var handleMenuListClick = function (flag) {
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import Box from '@mui/material/Box/Box';
14
25
  import { styled } from '@mui/material/styles';
@@ -18,7 +29,7 @@ import Text from '../../../../components/Text';
18
29
  import { clearError, signInSelector, resetOTPScreen, verifyAuthOTP } from '../../../app/signIn/signInStore';
19
30
  import Button from '../../../shared/Button';
20
31
  import { ScreenContainer } from '../../../shared/Containers';
21
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
32
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
22
33
  import { handlePrevScreenStep } from '../../../../app/settings';
23
34
  import { useLanguage } from '../../../../hooks';
24
35
  import { useForm, FormProvider } from 'react-hook-form';
@@ -50,11 +61,13 @@ var OTP = function () {
50
61
  var _a;
51
62
  var dispatch = useAppDispatch();
52
63
  var _b = useAppSelector(signInSelector), data = _b.data, loading = _b.loading, error = _b.error;
64
+ var _c = data.otpData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
53
65
  var methods = useForm({
54
66
  resolver: yupResolver(OTPValidation),
55
67
  defaultValues: data.otpData,
56
68
  mode: 'onChange'
57
69
  });
70
+ useSetFromDefaultValues(methods, defaultValues);
58
71
  var t = useTranslation().t;
59
72
  var isAr = useLanguage().isAr;
60
73
  var isEmail = !!data.auth.email;
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import * as React from 'react';
14
25
  import { useForm, FormProvider } from 'react-hook-form';
@@ -17,7 +28,7 @@ import { useSelector } from 'react-redux';
17
28
  import { yupResolver } from '@hookform/resolvers/yup';
18
29
  import Box from '@mui/material/Box';
19
30
  import { styled } from '@mui/material/styles';
20
- import { useAppDispatch } from '../../../../hooks';
31
+ import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
21
32
  import { handlePrevScreenStep } from '../../../../app/settings';
22
33
  import Form from '../../../../components/Form';
23
34
  import { useLanguage } from '../../../../hooks';
@@ -38,11 +49,13 @@ var Password = function (_a) {
38
49
  var dispatch = useAppDispatch();
39
50
  var _b = useSelector(signInSelector), data = _b.data, loading = _b.loading, error = _b.error;
40
51
  var isEmail = !!data.auth.email;
52
+ var _c = data.passwordData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
41
53
  var methods = useForm({
42
54
  resolver: yupResolver(PasswordValidation),
43
- defaultValues: data.passwordData,
55
+ defaultValues: defaultValues,
44
56
  mode: 'onChange'
45
57
  });
58
+ useSetFromDefaultValues(methods, defaultValues);
46
59
  var onSubmit = function (data) {
47
60
  dispatch(verifyAuthPassword(data));
48
61
  };
@@ -4,4 +4,4 @@ export interface TaxLibProps extends LibConfig {
4
4
  }
5
5
  export declare function TaxLib(props: TaxLibProps): JSX.Element;
6
6
  export declare function renderTaxLib(config: TaxLibProps, elementId: string): void;
7
- export declare function unmountTaxLib(elementId: string): void;
7
+ export declare function unmountTaxLib(elementId: string, unmountTimeout?: number): void;
@@ -19,7 +19,7 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
19
  import Collapse from '../../components/Collapse';
20
20
  import { getParameterByName, reactElement } from '../../utils';
21
21
  import { FeatureContainer } from '../shared/Containers';
22
- import { TAX_SCREENS_NAVIGATION } from '../../constants';
22
+ import { DIALOG_ID, TAX_SCREENS_NAVIGATION } from '../../constants';
23
23
  import { taxFeatureScreens } from '../featuresScreens';
24
24
  import CustomFooter from '../shared/Footer';
25
25
  import { taxSelector, verifyLeadToken } from '../app/tax/taxStore';
@@ -27,8 +27,8 @@ import Background from '../shared/Background';
27
27
  var Tax = memo(function (props) {
28
28
  var theme = useAppTheme().theme;
29
29
  var dispatch = useAppDispatch();
30
- var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, loading = _a.loading;
31
- var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error;
30
+ var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
+ var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error, loading = _b.loading;
32
32
  useAppConfig(__assign({ navigation: TAX_SCREENS_NAVIGATION }, props));
33
33
  useErrorListener(taxError || error);
34
34
  useStepStartedListener();
@@ -43,10 +43,10 @@ var Tax = memo(function (props) {
43
43
  dispatch(verifyLeadToken(token));
44
44
  };
45
45
  useEffect(function () {
46
- if (!loading)
46
+ if (!settingLoading && open)
47
47
  verifyToken();
48
- }, [loading]);
49
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
48
+ }, [settingLoading]);
49
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
50
50
  var Element = _a.element, name = _a.name;
51
51
  var isActive = activeScreen.name === name;
52
52
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -58,6 +58,14 @@ export function TaxLib(props) {
58
58
  export function renderTaxLib(config, elementId) {
59
59
  reactElement(elementId).render(_jsx(TaxLib, __assign({}, config)));
60
60
  }
61
- export function unmountTaxLib(elementId) {
62
- reactElement(elementId).unmount();
61
+ export function unmountTaxLib(elementId, unmountTimeout) {
62
+ if (unmountTimeout === void 0) { unmountTimeout = 1000; }
63
+ var element = document.getElementById(elementId);
64
+ var dialogEl = document.getElementById(DIALOG_ID);
65
+ setTimeout(function () {
66
+ var _a;
67
+ ((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
68
+ dialogEl && dialogEl.remove();
69
+ elementId && reactElement(elementId).unmount();
70
+ }, unmountTimeout);
63
71
  }
@@ -16,7 +16,7 @@ import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { getResetFlowUrl, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour, concatenateObjectValues } from '../../../../utils';
20
20
  import { taxSelector } from '../../../app/tax/taxStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -44,13 +44,16 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
44
44
  });
45
45
  });
46
46
  var SuccessWithFlowButtons = function () {
47
- var _a, _b, _c;
47
+ var _a, _b, _c, _d;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
50
  var data = useAppSelector(taxSelector).data;
51
- var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank, merchant = _d.merchant, identification_id = _d.identification_id, vatID = _d.vatID;
52
- var _e = useState([]), buttons = _e[0], setButtons = _e[1];
53
- var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
51
+ var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank, merchant = _e.merchant, vatID = _e.vatID, user = _e.user;
52
+ var _f = useState([]), buttons = _f[0], setButtons = _f[1];
53
+ var _g = nameObj || {}, en = _g.en, ar = _g.ar;
54
+ var username = isAr
55
+ ? concatenateObjectValues(ar || en, ['first', 'last'])
56
+ : concatenateObjectValues(en, ['first', 'last']);
54
57
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
55
58
  var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
56
59
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
@@ -58,9 +61,10 @@ var SuccessWithFlowButtons = function () {
58
61
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
62
  var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
63
  var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
- var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
64
+ var identification = user.identification;
65
+ var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
62
66
  var settings = useAppSelector(settingsSelector);
63
- var _f = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _f.contact, board_id = _f.board_id, board_info_id = _f.board_info_id;
67
+ var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
64
68
  var email = (contact || { email: '' }).email;
65
69
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
66
70
  var reMapFlowData = function (flows) {
@@ -74,10 +78,10 @@ var SuccessWithFlowButtons = function () {
74
78
  var title = t("".concat(name, "_flow_").concat(type), {
75
79
  individual_name: username.toLowerCase() + maskedId,
76
80
  business_type: brandName,
77
- license_number: t('masking_symbols') + showLastFour(licenseNumber),
81
+ license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
78
82
  bank_name: bankName,
79
- iban: t('masking_symbols') + iban,
80
- tax_id: t('masking_symbols') + showLastFour(taxID)
83
+ iban: iban ? t('masking_symbols') + iban : '',
84
+ tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
81
85
  });
82
86
  var isCompleted = status === 'completed' && name !== 'password';
83
87
  var isIndividual = name === 'individual';
@@ -9,10 +9,21 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import { ScreenContainer } from '../../../shared/Containers';
14
25
  import Button from '../../../shared/Button';
15
- import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
26
+ import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
16
27
  import { useTranslation } from 'react-i18next';
17
28
  import { styled } from '@mui/material/styles';
18
29
  import { useForm, FormProvider } from 'react-hook-form';
@@ -32,11 +43,13 @@ var FormStyled = styled(Form)(function () { return ({
32
43
  var TaxDetails = function () {
33
44
  var dispatch = useAppDispatch();
34
45
  var _a = useAppSelector(taxSelector), data = _a.data, loading = _a.loading, error = _a.error;
46
+ var _b = data.taxData, responseBody = _b.responseBody, defaultValues = __rest(_b, ["responseBody"]);
35
47
  var methods = useForm({
36
48
  resolver: yupResolver(Validation),
37
- defaultValues: data.taxData,
49
+ defaultValues: defaultValues,
38
50
  mode: 'onChange'
39
51
  });
52
+ useSetFromDefaultValues(methods, defaultValues);
40
53
  var t = useTranslation().t;
41
54
  var isAr = useLanguage().isAr;
42
55
  var onSubmit = function (data) {
@@ -45,6 +58,6 @@ var TaxDetails = function () {
45
58
  var onBack = function () {
46
59
  dispatch(handleCurrentActiveScreen('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
47
60
  };
48
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(ConfirmPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
61
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(ConfirmPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
49
62
  };
50
63
  export default TaxDetails;
@@ -9,9 +9,20 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
25
+ import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
15
26
  import { useTranslation } from 'react-i18next';
16
27
  import { useForm, FormProvider } from 'react-hook-form';
17
28
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -50,14 +61,16 @@ var VerifyNumber = function (_a) {
50
61
  var _b, _c, _d;
51
62
  var dispatch = useAppDispatch();
52
63
  var _e = useAppSelector(taxSelector), data = _e.data, loading = _e.loading, error = _e.error;
64
+ var _f = data.otpData, responseBody = _f.responseBody, defaultValues = __rest(_f, ["responseBody"]);
53
65
  var methods = useForm({
54
66
  resolver: yupResolver(OTPValidation),
55
- defaultValues: data.otpData,
67
+ defaultValues: defaultValues,
56
68
  mode: 'onChange'
57
69
  });
70
+ useSetFromDefaultValues(methods, defaultValues);
58
71
  var t = useTranslation().t;
59
72
  var isAr = useLanguage().isAr;
60
- var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
73
+ var _g = React.useState(false), resendLoading = _g[0], setResendLoading = _g[1];
61
74
  var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
62
75
  React.useEffect(function () {
63
76
  if (error && methods.formState.isValid && phone)
@@ -10,3 +10,5 @@ export * from './useAppConfig';
10
10
  export * from './useErrorListener';
11
11
  export * from './useWindowSize';
12
12
  export * from './useStepStartedListener';
13
+ export * from './useScreen';
14
+ export * from './useSetFromDefaultValues';
@@ -10,3 +10,5 @@ export * from './useAppConfig';
10
10
  export * from './useErrorListener';
11
11
  export * from './useWindowSize';
12
12
  export * from './useStepStartedListener';
13
+ export * from './useScreen';
14
+ export * from './useSetFromDefaultValues';
@@ -1,6 +1,8 @@
1
1
  import { LibConfig, ScreenStepNavigation } from '../@types';
2
2
  interface AppConfigProps extends LibConfig {
3
3
  navigation: ScreenStepNavigation[];
4
+ disableCountries?: boolean;
5
+ disableLocale?: boolean;
4
6
  }
5
- export declare const useAppConfig: ({ appInfo, navigation, publicKey, ...rest }: AppConfigProps) => void;
7
+ export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, ...rest }: AppConfigProps) => void;
6
8
  export {};
@@ -27,7 +27,7 @@ import { axiosInstance } from '../api';
27
27
  import { isTapDomain, removeRequestHeaders } from '../utils';
28
28
  import { ENDPOINT_PATHS } from '../constants';
29
29
  export var useAppConfig = function (_a) {
30
- var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, rest = __rest(_a, ["appInfo", "navigation", "publicKey"]);
30
+ var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale"]);
31
31
  var dispatch = useAppDispatch();
32
32
  var setBaseUrl = function () {
33
33
  var isProd = publicKey.includes('pk_live');
@@ -49,11 +49,13 @@ export var useAppConfig = function (_a) {
49
49
  dispatch(handleOpen(rest.open));
50
50
  }, [rest.open]);
51
51
  useEffect(function () {
52
+ if (rest.open === false)
53
+ return;
52
54
  removeRequestHeaders();
53
55
  checkDomain();
54
56
  setBaseUrl();
55
57
  setAppConfig();
56
58
  dispatch(handleLanguage(rest.language));
57
- dispatch(fetchAppSettingsSync());
59
+ dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale }));
58
60
  }, []);
59
61
  };
@@ -8,6 +8,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
8
8
  password: import("../features/app/password/passwordStore").PasswordState;
9
9
  signIn: import("../features/app/signIn/signInStore").SignInState;
10
10
  entity: import("../features/app/entity/entityStore").EntityState;
11
- otp: import("../features/app/otp/otpStore").OtpState;
12
11
  auth: import("../features/app/auth/authStore").AuthState;
13
12
  }, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
@@ -9,10 +9,4 @@ export var useErrorListener = function (error) {
9
9
  (_b = (_a = settings.data.appConfig) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);
10
10
  }
11
11
  }, [error]);
12
- useEffect(function () {
13
- var _a, _b;
14
- if (!settings.error && !settings.loading) {
15
- (_b = (_a = settings.data.appConfig).onReady) === null || _b === void 0 ? void 0 : _b.call(_a);
16
- }
17
- }, [settings.error, settings.loading]);
18
12
  };
@@ -0,0 +1,3 @@
1
+ export declare const useScreen: (breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl') => {
2
+ small: boolean;
3
+ };
@@ -0,0 +1,14 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { useWindowSize } from '.';
3
+ import { useTheme } from '@mui/material/styles';
4
+ export var useScreen = function (breakpoint) {
5
+ if (breakpoint === void 0) { breakpoint = 'sm'; }
6
+ var _a = useState(false), small = _a[0], setSmall = _a[1];
7
+ var width = useWindowSize().width;
8
+ var theme = useTheme();
9
+ useEffect(function () {
10
+ var target = theme.breakpoints.values[breakpoint || 'sm'];
11
+ setSmall(width < target);
12
+ }, [width]);
13
+ return { small: small };
14
+ };
@@ -0,0 +1,2 @@
1
+ import { FieldValues, UseFormReturn } from 'react-hook-form';
2
+ export declare const useSetFromDefaultValues: <TFieldValues extends FieldValues = FieldValues>(method: UseFormReturn<TFieldValues, any>, defaultValues: TFieldValues, shouldValidate?: boolean) => void;