@opexa/portal-components 0.0.888 → 0.0.890

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 (261) hide show
  1. package/dist/client/hooks/useCreateAurixPayGCashDepositMutation.d.ts +4 -0
  2. package/dist/client/hooks/useCreateAurixPayGCashDepositMutation.js +82 -0
  3. package/dist/client/hooks/useCreateAurixPayGrabPayDepositMutation.d.ts +4 -0
  4. package/dist/client/hooks/useCreateAurixPayGrabPayDepositMutation.js +88 -0
  5. package/dist/client/hooks/useCreateAurixPayPayMayaDepositMutation.d.ts +4 -0
  6. package/dist/client/hooks/useCreateAurixPayPayMayaDepositMutation.js +88 -0
  7. package/dist/client/hooks/useCreateAurixPayQrphDepositMutation.d.ts +4 -0
  8. package/dist/client/hooks/useCreateAurixPayQrphDepositMutation.js +88 -0
  9. package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +1 -1
  10. package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.js +1 -1
  11. package/dist/components/DepositWithdrawal/Deposit/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +1 -1
  12. package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +1 -1
  13. package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.d.ts +1 -0
  14. package/dist/components/DepositWithdrawal/{Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.js → Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js} +90 -22
  15. package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.d.ts +1 -0
  16. package/dist/components/DepositWithdrawal/{Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js → Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js} +94 -24
  17. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.d.ts +1 -0
  18. package/dist/components/DepositWithdrawal/{Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.js → Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js} +94 -24
  19. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDeposit.d.ts +1 -0
  20. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDeposit.js +12 -0
  21. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +25 -0
  22. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.js +2 -0
  23. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Confirmed.d.ts +1 -0
  24. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Confirmed.js +11 -0
  25. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Failed.d.ts +1 -0
  26. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Failed.js +13 -0
  27. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Form.d.ts +1 -0
  28. package/dist/components/DepositWithdrawal/Deposit/{QRPHDeposit__legacy/QRPHDepositForm.js → AurixPayQRPHDeposit/Form.js} +17 -7
  29. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/GeneratingQrCode.d.ts +1 -0
  30. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/GeneratingQrCode.js +10 -0
  31. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/QrCodeGenerated.d.ts +1 -0
  32. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/QrCodeGenerated.js +41 -0
  33. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +17 -0
  34. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.js +117 -0
  35. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +23 -1
  36. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  37. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  38. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  39. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QrCodeGenerated.js +37 -1
  40. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  41. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +6 -0
  42. package/dist/components/DepositWithdrawal/PaymentMethods.js +20 -0
  43. package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
  44. package/dist/components/DepositWithdrawal/utils.js +4 -0
  45. package/dist/components/ForgotPassword/ForgotPassword.lazy.d.ts +2 -2
  46. package/dist/components/ForgotPassword/ForgotPassword.lazy.js +14 -3
  47. package/dist/components/ForgotPassword/ForgotPasswordForm.d.ts +5 -1
  48. package/dist/components/ForgotPassword/ForgotPasswordForm.js +68 -33
  49. package/dist/components/SignIn/MobileNumberField.js +27 -26
  50. package/dist/components/SignUp/SignUpDefault/SignUpDefaultFormInternational.js +4 -1
  51. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.d.ts +1 -0
  52. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +3 -2
  53. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.HappyBingo.d.ts +1 -0
  54. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.HappyBingo.js +54 -0
  55. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +2 -2
  56. package/dist/components/TransactionRecords/DepositRecordsTable.js +6 -21
  57. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
  58. package/dist/schemas/forgotPasswordSchema.d.ts +8 -8
  59. package/dist/services/queries.d.ts +6 -2
  60. package/dist/services/queries.js +177 -1
  61. package/dist/services/wallet.d.ts +55 -0
  62. package/dist/services/wallet.js +44 -1
  63. package/dist/types/index.d.ts +4 -0
  64. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  65. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  66. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  67. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  68. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  69. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  70. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  71. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  72. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  73. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  74. package/dist/ui/Field/Field.d.ts +21 -21
  75. package/dist/ui/Field/field.recipe.d.ts +3 -3
  76. package/dist/ui/Popover/Popover.d.ts +55 -55
  77. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  78. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  79. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  80. package/dist/ui/Select/Select.d.ts +45 -45
  81. package/dist/ui/Select/select.recipe.d.ts +3 -3
  82. package/dist/ui/Table/Table.d.ts +21 -21
  83. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  84. package/dist/ui/Table/table.recipe.d.ts +3 -3
  85. package/dist/utils/capitalize.d.ts +11 -0
  86. package/dist/utils/capitalize.js +48 -5
  87. package/dist/utils/countries/types.d.ts +1 -1
  88. package/dist/utils/downloadImage.d.ts +4 -0
  89. package/dist/utils/downloadImage.js +47 -0
  90. package/dist/utils/mutationKeys.d.ts +4 -0
  91. package/dist/utils/mutationKeys.js +16 -0
  92. package/package.json +1 -1
  93. package/dist/assets/providers/alize.png +0 -0
  94. package/dist/assets/providers/bigtime-gaming.png +0 -0
  95. package/dist/assets/providers/bng.png +0 -0
  96. package/dist/assets/providers/boongo.png +0 -0
  97. package/dist/assets/providers/btg.png +0 -0
  98. package/dist/assets/providers/cq9.png +0 -0
  99. package/dist/assets/providers/darwin.png +0 -0
  100. package/dist/assets/providers/digitain.png +0 -0
  101. package/dist/assets/providers/evolution.png +0 -0
  102. package/dist/assets/providers/fantasma-games.png +0 -0
  103. package/dist/assets/providers/fc.png +0 -0
  104. package/dist/assets/providers/fp.png +0 -0
  105. package/dist/assets/providers/habanero.png +0 -0
  106. package/dist/assets/providers/hacksaw.png +0 -0
  107. package/dist/assets/providers/jdb.png +0 -0
  108. package/dist/assets/providers/jili.png +0 -0
  109. package/dist/assets/providers/leap.png +0 -0
  110. package/dist/assets/providers/live-22-metaverse.png +0 -0
  111. package/dist/assets/providers/netent.png +0 -0
  112. package/dist/assets/providers/no-limit.png +0 -0
  113. package/dist/assets/providers/pg.png +0 -0
  114. package/dist/assets/providers/pgsoft.png +0 -0
  115. package/dist/assets/providers/pragmatic-play.png +0 -0
  116. package/dist/assets/providers/realtime-gaming.png +0 -0
  117. package/dist/assets/providers/redtiger.png +0 -0
  118. package/dist/assets/providers/rtg.png +0 -0
  119. package/dist/assets/providers/sagaming.png +0 -0
  120. package/dist/components/Banner/Banner.client.d.ts +0 -12
  121. package/dist/components/Banner/Banner.client.js +0 -49
  122. package/dist/components/DepositWithdrawal/AiOPaymentMethods.d.ts +0 -11
  123. package/dist/components/DepositWithdrawal/AiOPaymentMethods.js +0 -55
  124. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +0 -1
  125. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +0 -99
  126. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +0 -1
  127. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +0 -17
  128. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +0 -1
  129. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +0 -116
  130. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.d.ts +0 -3
  131. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.js +0 -69
  132. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.d.ts +0 -1
  133. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.js +0 -10
  134. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.d.ts +0 -1
  135. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.js +0 -99
  136. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts +0 -25
  137. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.js +0 -2
  138. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.d.ts +0 -1
  139. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.js +0 -17
  140. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.d.ts +0 -1
  141. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.d.ts +0 -3
  142. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.js +0 -69
  143. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +0 -13
  144. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.js +0 -85
  145. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.d.ts +0 -1
  146. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.d.ts +0 -1
  147. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.d.ts +0 -1
  148. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.d.ts +0 -1
  149. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.js +0 -171
  150. package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.d.ts +0 -8
  151. package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.js +0 -33
  152. package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.d.ts +0 -1
  153. package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.js +0 -120
  154. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.d.ts +0 -1
  155. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.js +0 -163
  156. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.d.ts +0 -1
  157. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.js +0 -165
  158. package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.d.ts +0 -1
  159. package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.js +0 -186
  160. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.d.ts +0 -1
  161. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.js +0 -157
  162. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.d.ts +0 -1
  163. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.js +0 -163
  164. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +0 -1
  165. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.js +0 -166
  166. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.d.ts +0 -1
  167. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.js +0 -10
  168. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +0 -1
  169. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.js +0 -99
  170. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +0 -25
  171. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.js +0 -2
  172. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +0 -1
  173. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.js +0 -19
  174. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.d.ts +0 -1
  175. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.js +0 -115
  176. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +0 -13
  177. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.js +0 -81
  178. package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.d.ts +0 -1
  179. package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.js +0 -180
  180. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.d.ts +0 -1
  181. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.js +0 -10
  182. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.d.ts +0 -1
  183. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.js +0 -99
  184. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +0 -25
  185. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.js +0 -2
  186. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.d.ts +0 -1
  187. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.js +0 -17
  188. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.d.ts +0 -1
  189. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.js +0 -116
  190. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.d.ts +0 -3
  191. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.js +0 -69
  192. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +0 -13
  193. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.js +0 -85
  194. package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
  195. package/dist/components/DigitainLauncher/Loading.js +0 -5
  196. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +0 -184
  197. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +0 -184
  198. package/dist/components/KYC/BasicInformation.d.ts +0 -1
  199. package/dist/components/KYC/BasicInformation.js +0 -101
  200. package/dist/components/KYC/IdentityVerification.d.ts +0 -1
  201. package/dist/components/KYC/IdentityVerification.js +0 -120
  202. package/dist/components/KYC/Indicator.d.ts +0 -1
  203. package/dist/components/KYC/Indicator.js +0 -8
  204. package/dist/components/KYC/KYC.lazy.d.ts +0 -6
  205. package/dist/components/KYC/KYC.lazy.js +0 -45
  206. package/dist/components/KYC/KYCContext.d.ts +0 -6
  207. package/dist/components/KYC/KYCContext.js +0 -2
  208. package/dist/components/KYC/KYCDefault/BasicInformation.d.ts +0 -1
  209. package/dist/components/KYC/KYCDefault/BasicInformation.js +0 -101
  210. package/dist/components/KYC/KYCVerificationStatus.d.ts +0 -1
  211. package/dist/components/KYC/KYCVerificationStatus.js +0 -10
  212. package/dist/components/KYC/KYCVerificationStatus.lazy.d.ts +0 -1
  213. package/dist/components/KYC/KYCVerificationStatus.lazy.js +0 -36
  214. package/dist/components/KYC/PersonalInformation.d.ts +0 -1
  215. package/dist/components/KYC/PersonalInformation.js +0 -122
  216. package/dist/components/KYC/useKYC.d.ts +0 -25
  217. package/dist/components/KYC/useKYC.js +0 -38
  218. package/dist/components/KYCNotRequired/KYCNotRequired.d.ts +0 -0
  219. package/dist/components/KYCNotRequired/KYCNotRequired.js +0 -1
  220. package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
  221. package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
  222. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +0 -1
  223. package/dist/components/PortalProvider/CXDTokenObserver.js +0 -30
  224. package/dist/components/PortalProvider/LinkGoogleAccountObserver.d.ts +0 -1
  225. package/dist/components/PortalProvider/LinkGoogleAccountObserver.js +0 -29
  226. package/dist/components/Quests/MultiWageringQuest.d.ts +0 -1
  227. package/dist/components/Quests/MultiWageringQuest.js +0 -111
  228. package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
  229. package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
  230. package/dist/components/SessionWatcher/index.d.ts +0 -1
  231. package/dist/components/SessionWatcher/index.js +0 -1
  232. package/dist/components/SignIn/utils.d.ts +0 -8
  233. package/dist/components/SignIn/utils.js +0 -26
  234. package/dist/constants/Branches.d.ts +0 -2
  235. package/dist/constants/Branches.js +0 -42
  236. package/dist/images/game-providers/ALPHACHINKO.png +0 -0
  237. package/dist/images/responsible-gaming-yellow.png +0 -0
  238. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
  239. package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
  240. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  241. package/dist/third-parties/FacebookPixel/api.js +0 -1
  242. package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
  243. package/dist/third-parties/FacebookPixel/index.js +0 -1
  244. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
  245. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
  246. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  247. package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
  248. package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
  249. package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
  250. package/dist/third-parties/index.d.ts +0 -2
  251. package/dist/third-parties/index.js +0 -2
  252. package/dist/utils/getLocaleInfo.d.ts +0 -79
  253. package/dist/utils/getLocaleInfo.js +0 -175
  254. /package/dist/client/hooks/{useAiOGCashDepositMutation.d.ts → useCreateAiOGCashDepositMutation.d.ts} +0 -0
  255. /package/dist/client/hooks/{useAiOGCashDepositMutation.js → useCreateAiOGCashDepositMutation.js} +0 -0
  256. /package/dist/client/hooks/{useAiOGrabPayDepositMutation.d.ts → useCreateAiOGrabPayDepositMutation.d.ts} +0 -0
  257. /package/dist/client/hooks/{useAiOGrabPayDepositMutation.js → useCreateAiOGrabPayDepositMutation.js} +0 -0
  258. /package/dist/client/hooks/{useAiOPalawanPayDepositMutation.d.ts → useCreateAiOPalawanPayDepositMutation.d.ts} +0 -0
  259. /package/dist/client/hooks/{useAiOPalawanPayDepositMutation.js → useCreateAiOPalawanPayDepositMutation.js} +0 -0
  260. /package/dist/client/hooks/{useAiOPayMayaDepositMutation.d.ts → useCreateAiOPayMayaDepositMutation.d.ts} +0 -0
  261. /package/dist/client/hooks/{useAiOPayMayaDepositMutation.js → useCreateAiOPayMayaDepositMutation.js} +0 -0
@@ -1,13 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import { ObjectId } from '@opexa/object-id';
3
4
  import Link from 'next/link';
4
5
  import { useEffect, useState } from 'react';
5
6
  import { Controller, useForm } from 'react-hook-form';
6
7
  import invariant from 'tiny-invariant';
8
+ import { useBoolean } from 'usehooks-ts';
7
9
  import { z } from 'zod';
8
10
  import { useShallow } from 'zustand/shallow';
9
- import { useCreateAiOPalawanPayDepositMutation } from '../../../../client/hooks/useAiOPalawanPayDepositMutation.js';
10
11
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
12
+ import { useCreateAurixPayPayMayaDepositMutation } from '../../../../client/hooks/useCreateAurixPayPayMayaDepositMutation.js';
13
+ import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
11
14
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
12
15
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
13
16
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
@@ -16,8 +19,10 @@ import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSett
16
19
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
17
20
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
18
21
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
22
+ import { RefreshCcw01Icon } from '../../../../icons/RefreshCcw01Icon.js';
19
23
  import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
20
24
  import { XIcon } from '../../../../icons/XIcon.js';
25
+ import { ObjectType } from '../../../../services/ObjectType.js';
21
26
  import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
22
27
  import { Button } from '../../../../ui/Button/index.js';
23
28
  import { Field } from '../../../../ui/Field/index.js';
@@ -28,11 +33,16 @@ import { parseDecimal } from '../../../../utils/parseDecimal.js';
28
33
  import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
29
34
  import { AmountChoices } from '../../AmountChoices.js';
30
35
  import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
31
- import { explainError } from '../../utils.js';
32
36
  import { AvailablePromos } from '../AvailablePromos.js';
33
- export function AiOPalawanPayDeposit() {
37
+ export function AurixPayPayMayaDeposit() {
34
38
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
35
- const disclosure = useDisclosure();
39
+ const disclosure = useDisclosure({
40
+ onOpenChange(open) {
41
+ if (!open) {
42
+ form.reset();
43
+ }
44
+ },
45
+ });
36
46
  const globalStore = useGlobalStore(useShallow((ctx) => ({
37
47
  depositWithdrawal: ctx.depositWithdrawal,
38
48
  kycVerificationStatus: ctx.kycVerificationStatus,
@@ -40,7 +50,8 @@ export function AiOPalawanPayDeposit() {
40
50
  const verificationQuery = useMemberVerificationQuery();
41
51
  const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
42
52
  const [status, setStatus] = useState('waiting');
43
- const createDepositMutation = useCreateAiOPalawanPayDepositMutation({
53
+ const [errorMessage, setErrorMessage] = useState(null);
54
+ const createDepositMutation = useCreateAurixPayPayMayaDepositMutation({
44
55
  onMutate() {
45
56
  disclosure.setOpen(true);
46
57
  setStatus('processing');
@@ -49,18 +60,44 @@ export function AiOPalawanPayDeposit() {
49
60
  const queryClient = getQueryClient();
50
61
  invariant(data.checkoutUrl);
51
62
  window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
52
- queryClient.invalidateQueries({ queryKey: getDepositsCountQueryKey() });
63
+ queryClient.invalidateQueries({
64
+ queryKey: getDepositsCountQueryKey(),
65
+ });
53
66
  setStatus('success');
54
67
  },
55
- onError() {
68
+ onError(data) {
56
69
  setStatus('failed');
70
+ setErrorMessage({
71
+ name: data.name,
72
+ message: data.message,
73
+ });
57
74
  },
58
75
  });
76
+ const warn = useBoolean();
77
+ const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
78
+ enabled: !warn.value && status === 'success',
79
+ refetchInterval: (ctx) => ctx.state.data?.status === 'CONFIRMED' ||
80
+ ctx.state.data?.status === 'REJECTED' ||
81
+ ctx.state.data?.status === 'CANCELLED'
82
+ ? false
83
+ : 1000,
84
+ });
85
+ useEffect(() => {
86
+ if (depositQuery.data?.status === 'CONFIRMED') {
87
+ setStatus('confirmed');
88
+ return;
89
+ }
90
+ if (depositQuery.data?.status === 'REJECTED' ||
91
+ depositQuery.data?.status === 'CANCELLED') {
92
+ setStatus('failed');
93
+ return;
94
+ }
95
+ }, [depositQuery.data?.status]);
59
96
  const depositsCountQuery = useDepositsCountQuery();
60
97
  const depositsCount = depositsCountQuery.data ?? 0;
61
98
  const paymentSettingsQuery = usePaymentSettingsQuery();
62
99
  const paymentSettings = paymentSettingsQuery.data;
63
- const gatewaySettings = paymentSettings?.aioPalawanPayDepositGatewaySettings;
100
+ const gatewaySettings = paymentSettings?.aioGCashDepositGatewaySettings;
64
101
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
65
102
  const minimumAmount = depositsCount <= 0
66
103
  ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
@@ -91,6 +128,11 @@ export function AiOPalawanPayDeposit() {
91
128
  }
92
129
  }),
93
130
  promo: z.string().optional().nullable(),
131
+ accountNumber: z
132
+ .string()
133
+ .min(1, 'Account number is required')
134
+ .min(8, 'Account number must be 8 or more characters')
135
+ .max(32, 'Account number must not be more than 32 characters'),
94
136
  })
95
137
  .superRefine((value, ctx) => {
96
138
  const promo = promos.find((o) => o.id === value.promo);
@@ -118,6 +160,7 @@ export function AiOPalawanPayDeposit() {
118
160
  defaultValues: {
119
161
  amount: '0',
120
162
  promo: globalStore.depositWithdrawal.promo ?? null,
163
+ accountNumber: '',
121
164
  },
122
165
  });
123
166
  useEffect(() => {
@@ -125,28 +168,39 @@ export function AiOPalawanPayDeposit() {
125
168
  form.reset({
126
169
  amount: minimumAmount.toString(),
127
170
  promo: form.getValues('promo') ?? null,
171
+ accountNumber: form.getValues('accountNumber') ?? '',
128
172
  });
129
173
  }
130
174
  }, [form, minimumAmount]);
175
+ const redirectUrl = (() => {
176
+ const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
177
+ const origin = window.location.origin.includes('localhost')
178
+ ? 'https://uat.powerplay.ph/deposit-success' +
179
+ depositWithdrawalProps.depositSuccessPageUrl
180
+ : window.location.origin;
181
+ return `${origin}${path}`;
182
+ })();
131
183
  return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
132
- if (verificationStatus === 'PENDING' ||
133
- verificationStatus === 'UNVERIFIED' ||
134
- verificationStatus === 'REJECTED' ||
135
- verificationStatus === 'CREATED') {
184
+ if (!depositWithdrawalProps.bypassDepositKycCheck &&
185
+ (verificationStatus === 'PENDING' ||
186
+ verificationStatus === 'UNVERIFIED' ||
187
+ verificationStatus === 'REJECTED' ||
188
+ verificationStatus === 'CREATED')) {
136
189
  globalStore.kycVerificationStatus.setOpen(true);
137
190
  return;
138
191
  }
139
192
  else {
193
+ const id = ObjectId.generate(ObjectType.Deposit).toString();
140
194
  createDepositMutation.reset();
141
195
  createDepositMutation.mutate({
196
+ id,
142
197
  amount: data.amount.toString(),
143
198
  promo: data.promo ?? undefined,
144
- redirectUrl: window.location.origin.includes('localhost')
145
- ? 'https://uat.powerplay.ph'
146
- : window.location.origin,
199
+ redirectUrl: redirectUrl.replace(':id', id),
200
+ accountNumber: data.accountNumber,
147
201
  });
148
202
  }
149
- }), noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
203
+ }), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Account number" }), _jsx(Field.Input, { ...form.register('accountNumber') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-lg", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
150
204
  o.field.onChange(details.value);
151
205
  }, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
152
206
  form.setValue('amount', value.toString(), {
@@ -159,13 +213,29 @@ export function AiOPalawanPayDeposit() {
159
213
  globalStore.depositWithdrawal.setPromo(null);
160
214
  }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
161
215
  disclosure.setOpen(details.open);
162
- if (!details.open) {
163
- setStatus('waiting');
164
- form.reset();
165
- }
166
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
167
- "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
168
- explainError(createDepositMutation?.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
216
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
217
+ setStatus('waiting');
218
+ setErrorMessage(null);
219
+ form.reset();
220
+ warn.setFalse();
221
+ }, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.Context, { children: (api) => (_jsx("button", { type: "button", className: "absolute top-2.5 right-2.5 flex icon:size-6 size-11 items-center justify-center text-text-quinary", onClick: () => {
222
+ if (status === 'success' && !warn.value) {
223
+ warn.setTrue();
224
+ }
225
+ else {
169
226
  api.setOpen(false);
170
- }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
227
+ }
228
+ }, children: _jsx(XIcon, {}) })) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && !warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-featured-icon-light-brand", children: _jsx(RefreshCcw01Icon, {}) })), status === 'success' && warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) })), status === 'confirmed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' &&
229
+ !warn.value &&
230
+ 'Didn’t see the payment window?', status === 'success' && warn.value && (_jsx(_Fragment, { children: "Are you sure you want to close this\u00A0window?" })), status === 'confirmed' && 'Deposit Successful', status === 'failed' && errorMessage?.name] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
231
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
232
+ !warn.value &&
233
+ 'Sometimes the payment pop up doesn’t appear right away. Don’t worry, just click the button below to reopen it and continue your deposit.', status === 'success' &&
234
+ warn.value &&
235
+ 'Closing this window might cancel your current deposit. Do you want to continue?', status === 'confirmed' &&
236
+ 'Your deposit has been successfully processed.', status === 'failed' && errorMessage?.message] })] }), (status === 'failed' ||
237
+ status === 'success' ||
238
+ status === 'confirmed') && (_jsxs(AlertDialog.Footer, { children: [status === 'success' && !warn.value && (_jsx(Button, { asChild: true, children: _jsx("a", { href: createDepositMutation.data?.checkoutUrl ?? '', target: "_blank", rel: "noopener noreferrer", children: "Try Again" }) })), status === 'success' && warn.value && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => {
239
+ warn.setFalse();
240
+ }, children: "Go back" }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Continue" })) })] })), status !== 'success' && (_jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Ok" })) }))] }))] }) })] }) })] }));
171
241
  }
@@ -0,0 +1 @@
1
+ export declare function AurixPayGrabPayDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import { ObjectId } from '@opexa/object-id';
3
4
  import Link from 'next/link';
4
5
  import { useEffect, useState } from 'react';
5
6
  import { Controller, useForm } from 'react-hook-form';
6
7
  import invariant from 'tiny-invariant';
8
+ import { useBoolean } from 'usehooks-ts';
7
9
  import { z } from 'zod';
8
10
  import { useShallow } from 'zustand/shallow';
9
- import { useCreateAiOGrabPayDepositMutation } from '../../../../client/hooks/useAiOGrabPayDepositMutation.js';
10
11
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
12
+ import { useCreateAurixPayGrabPayDepositMutation } from '../../../../client/hooks/useCreateAurixPayGrabPayDepositMutation.js';
13
+ import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
11
14
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
12
15
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
13
16
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
@@ -16,8 +19,10 @@ import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSett
16
19
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
17
20
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
18
21
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
22
+ import { RefreshCcw01Icon } from '../../../../icons/RefreshCcw01Icon.js';
19
23
  import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
20
24
  import { XIcon } from '../../../../icons/XIcon.js';
25
+ import { ObjectType } from '../../../../services/ObjectType.js';
21
26
  import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
22
27
  import { Button } from '../../../../ui/Button/index.js';
23
28
  import { Field } from '../../../../ui/Field/index.js';
@@ -28,11 +33,16 @@ import { parseDecimal } from '../../../../utils/parseDecimal.js';
28
33
  import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
29
34
  import { AmountChoices } from '../../AmountChoices.js';
30
35
  import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
31
- import { explainError } from '../../utils.js';
32
36
  import { AvailablePromos } from '../AvailablePromos.js';
33
- export function AiOGrabPayDeposit() {
37
+ export function AurixPayGrabPayDeposit() {
34
38
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
35
- const disclosure = useDisclosure();
39
+ const disclosure = useDisclosure({
40
+ onOpenChange(open) {
41
+ if (!open) {
42
+ form.reset();
43
+ }
44
+ },
45
+ });
36
46
  const globalStore = useGlobalStore(useShallow((ctx) => ({
37
47
  depositWithdrawal: ctx.depositWithdrawal,
38
48
  kycVerificationStatus: ctx.kycVerificationStatus,
@@ -40,7 +50,8 @@ export function AiOGrabPayDeposit() {
40
50
  const verificationQuery = useMemberVerificationQuery();
41
51
  const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
42
52
  const [status, setStatus] = useState('waiting');
43
- const createDepositMutation = useCreateAiOGrabPayDepositMutation({
53
+ const [errorMessage, setErrorMessage] = useState(null);
54
+ const createDepositMutation = useCreateAurixPayGrabPayDepositMutation({
44
55
  onMutate() {
45
56
  disclosure.setOpen(true);
46
57
  setStatus('processing');
@@ -49,18 +60,44 @@ export function AiOGrabPayDeposit() {
49
60
  const queryClient = getQueryClient();
50
61
  invariant(data.checkoutUrl);
51
62
  window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
52
- queryClient.invalidateQueries({ queryKey: getDepositsCountQueryKey() });
63
+ queryClient.invalidateQueries({
64
+ queryKey: getDepositsCountQueryKey(),
65
+ });
53
66
  setStatus('success');
54
67
  },
55
- onError() {
68
+ onError(data) {
56
69
  setStatus('failed');
70
+ setErrorMessage({
71
+ name: data.name,
72
+ message: data.message,
73
+ });
57
74
  },
58
75
  });
76
+ const warn = useBoolean();
77
+ const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
78
+ enabled: !warn.value && status === 'success',
79
+ refetchInterval: (ctx) => ctx.state.data?.status === 'CONFIRMED' ||
80
+ ctx.state.data?.status === 'REJECTED' ||
81
+ ctx.state.data?.status === 'CANCELLED'
82
+ ? false
83
+ : 1000,
84
+ });
85
+ useEffect(() => {
86
+ if (depositQuery.data?.status === 'CONFIRMED') {
87
+ setStatus('confirmed');
88
+ return;
89
+ }
90
+ if (depositQuery.data?.status === 'REJECTED' ||
91
+ depositQuery.data?.status === 'CANCELLED') {
92
+ setStatus('failed');
93
+ return;
94
+ }
95
+ }, [depositQuery.data?.status]);
59
96
  const depositsCountQuery = useDepositsCountQuery();
60
97
  const depositsCount = depositsCountQuery.data ?? 0;
61
98
  const paymentSettingsQuery = usePaymentSettingsQuery();
62
99
  const paymentSettings = paymentSettingsQuery.data;
63
- const gatewaySettings = paymentSettings?.aioGrabPayDepositGatewaySettings;
100
+ const gatewaySettings = paymentSettings?.aioGCashDepositGatewaySettings;
64
101
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
65
102
  const minimumAmount = depositsCount <= 0
66
103
  ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
@@ -91,6 +128,11 @@ export function AiOGrabPayDeposit() {
91
128
  }
92
129
  }),
93
130
  promo: z.string().optional().nullable(),
131
+ accountNumber: z
132
+ .string()
133
+ .min(1, 'Account number is required')
134
+ .min(8, 'Account number must be 8 or more characters')
135
+ .max(32, 'Account number must not be more than 32 characters'),
94
136
  })
95
137
  .superRefine((value, ctx) => {
96
138
  const promo = promos.find((o) => o.id === value.promo);
@@ -118,6 +160,7 @@ export function AiOGrabPayDeposit() {
118
160
  defaultValues: {
119
161
  amount: '0',
120
162
  promo: globalStore.depositWithdrawal.promo ?? null,
163
+ accountNumber: '',
121
164
  },
122
165
  });
123
166
  useEffect(() => {
@@ -125,28 +168,39 @@ export function AiOGrabPayDeposit() {
125
168
  form.reset({
126
169
  amount: minimumAmount.toString(),
127
170
  promo: form.getValues('promo') ?? null,
171
+ accountNumber: form.getValues('accountNumber') ?? '',
128
172
  });
129
173
  }
130
174
  }, [form, minimumAmount]);
175
+ const redirectUrl = (() => {
176
+ const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
177
+ const origin = window.location.origin.includes('localhost')
178
+ ? 'https://uat.powerplay.ph/deposit-success' +
179
+ depositWithdrawalProps.depositSuccessPageUrl
180
+ : window.location.origin;
181
+ return `${origin}${path}`;
182
+ })();
131
183
  return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
132
- if (verificationStatus === 'PENDING' ||
133
- verificationStatus === 'UNVERIFIED' ||
134
- verificationStatus === 'REJECTED' ||
135
- verificationStatus === 'CREATED') {
184
+ if (!depositWithdrawalProps.bypassDepositKycCheck &&
185
+ (verificationStatus === 'PENDING' ||
186
+ verificationStatus === 'UNVERIFIED' ||
187
+ verificationStatus === 'REJECTED' ||
188
+ verificationStatus === 'CREATED')) {
136
189
  globalStore.kycVerificationStatus.setOpen(true);
137
190
  return;
138
191
  }
139
192
  else {
193
+ const id = ObjectId.generate(ObjectType.Deposit).toString();
140
194
  createDepositMutation.reset();
141
195
  createDepositMutation.mutate({
196
+ id,
142
197
  amount: data.amount.toString(),
143
198
  promo: data.promo ?? undefined,
144
- redirectUrl: window.location.origin.includes('localhost')
145
- ? 'https://uat.powerplay.ph'
146
- : window.location.origin,
199
+ redirectUrl: redirectUrl.replace(':id', id),
200
+ accountNumber: data.accountNumber,
147
201
  });
148
202
  }
149
- }), noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
203
+ }), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Account number" }), _jsx(Field.Input, { ...form.register('accountNumber') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-lg", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
150
204
  o.field.onChange(details.value);
151
205
  }, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
152
206
  form.setValue('amount', value.toString(), {
@@ -159,13 +213,29 @@ export function AiOGrabPayDeposit() {
159
213
  globalStore.depositWithdrawal.setPromo(null);
160
214
  }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
161
215
  disclosure.setOpen(details.open);
162
- if (!details.open) {
163
- setStatus('waiting');
164
- form.reset();
165
- }
166
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
167
- "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
168
- explainError(createDepositMutation?.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
216
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
217
+ setStatus('waiting');
218
+ setErrorMessage(null);
219
+ form.reset();
220
+ warn.setFalse();
221
+ }, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.Context, { children: (api) => (_jsx("button", { type: "button", className: "absolute top-2.5 right-2.5 flex icon:size-6 size-11 items-center justify-center text-text-quinary", onClick: () => {
222
+ if (status === 'success' && !warn.value) {
223
+ warn.setTrue();
224
+ }
225
+ else {
169
226
  api.setOpen(false);
170
- }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
227
+ }
228
+ }, children: _jsx(XIcon, {}) })) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && !warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-featured-icon-light-brand", children: _jsx(RefreshCcw01Icon, {}) })), status === 'success' && warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) })), status === 'confirmed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' &&
229
+ !warn.value &&
230
+ 'Didn’t see the payment window?', status === 'success' && warn.value && (_jsx(_Fragment, { children: "Are you sure you want to close this\u00A0window?" })), status === 'confirmed' && 'Deposit Successful', status === 'failed' && errorMessage?.name] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
231
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
232
+ !warn.value &&
233
+ 'Sometimes the payment pop up doesn’t appear right away. Don’t worry, just click the button below to reopen it and continue your deposit.', status === 'success' &&
234
+ warn.value &&
235
+ 'Closing this window might cancel your current deposit. Do you want to continue?', status === 'confirmed' &&
236
+ 'Your deposit has been successfully processed.', status === 'failed' && errorMessage?.message] })] }), (status === 'failed' ||
237
+ status === 'success' ||
238
+ status === 'confirmed') && (_jsxs(AlertDialog.Footer, { children: [status === 'success' && !warn.value && (_jsx(Button, { asChild: true, children: _jsx("a", { href: createDepositMutation.data?.checkoutUrl ?? '', target: "_blank", rel: "noopener noreferrer", children: "Try Again" }) })), status === 'success' && warn.value && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => {
239
+ warn.setFalse();
240
+ }, children: "Go back" }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Continue" })) })] })), status !== 'success' && (_jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Ok" })) }))] }))] }) })] }) })] }));
171
241
  }
@@ -0,0 +1 @@
1
+ export declare function AurixPayQRPHDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AurixPayQRPHDepositContext } from './AurixPayQRPHDepositContext.js';
3
+ import { Confirmed } from './Confirmed.js';
4
+ import { Failed } from './Failed.js';
5
+ import { Form } from './Form.js';
6
+ import { GeneratingQrCode } from './GeneratingQrCode.js';
7
+ import { QrCodeGenerated } from './QrCodeGenerated.js';
8
+ import { useAurixPayQRPHDeposit } from './useAurixPayQRPHDeposit.js';
9
+ export function AurixPayQRPHDeposit() {
10
+ const context = useAurixPayQRPHDeposit();
11
+ return (_jsxs(AurixPayQRPHDepositContext, { value: context, children: [_jsx(Form, {}), _jsx(GeneratingQrCode, {}), _jsx(QrCodeGenerated, {}), _jsx(Failed, {}), _jsx(Confirmed, {})] }));
12
+ }
@@ -0,0 +1,25 @@
1
+ export declare const AurixPayQRPHDepositContext: (props: {
2
+ value: {
3
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
4
+ deposit: import("../../../../types").Deposit | null;
5
+ errorMessage: {
6
+ name: string;
7
+ message: string;
8
+ } | null;
9
+ generateQRCode: (input: import("./useAurixPayQRPHDeposit").GenerateQRCodeInput) => Promise<void>;
10
+ regenerateQRCode: () => Promise<void>;
11
+ reset: () => void;
12
+ };
13
+ } & {
14
+ children?: import("react").ReactNode | undefined;
15
+ }) => React.ReactNode, useAurixPayQRPHDepositContext: () => {
16
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
17
+ deposit: import("../../../../types").Deposit | null;
18
+ errorMessage: {
19
+ name: string;
20
+ message: string;
21
+ } | null;
22
+ generateQRCode: (input: import("./useAurixPayQRPHDeposit").GenerateQRCodeInput) => Promise<void>;
23
+ regenerateQRCode: () => Promise<void>;
24
+ reset: () => void;
25
+ };
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../../../../client/utils/createContext.js';
2
+ export const [AurixPayQRPHDepositContext, useAurixPayQRPHDepositContext] = createContext();
@@ -0,0 +1 @@
1
+ export declare function Confirmed(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CheckCircleIcon } from '../../../../icons/CheckCircleIcon.js';
3
+ import { XIcon } from '../../../../icons/XIcon.js';
4
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
5
+ import { Button } from '../../../../ui/Button/index.js';
6
+ import { Portal } from '../../../../ui/Portal/index.js';
7
+ import { useAurixPayQRPHDepositContext } from './AurixPayQRPHDepositContext.js';
8
+ export function Confirmed() {
9
+ const context = useAurixPayQRPHDepositContext();
10
+ return (_jsx(AlertDialog.Root, { open: context.status === 'confirmed', lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)]", children: _jsxs(AlertDialog.Content, { children: [_jsx("button", { type: "button", className: "absolute top-4 right-4 icon:size-6 p-md text-text-quinary disabled:cursor-not-allowed disabled:opacity-50", onClick: context.reset, children: _jsx(XIcon, {}) }), _jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-success-secondary", children: _jsx(CheckCircleIcon, { className: "size-6 text-text-featured-icon-light-success" }) }), _jsx(AlertDialog.Title, { className: "mt-xl", children: "Your deposit was successful!" }), _jsx(AlertDialog.Description, { className: "mt-xl px-3", children: "The funds have been added to your account." }), _jsx(Button, { className: "mt-4xl w-full", onClick: context.reset, children: "Ok" })] }) })] }) }));
11
+ }
@@ -0,0 +1 @@
1
+ export declare function Failed(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
3
+ import { XIcon } from '../../../../icons/XIcon.js';
4
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
5
+ import { Button } from '../../../../ui/Button/index.js';
6
+ import { Portal } from '../../../../ui/Portal/index.js';
7
+ import { useAurixPayQRPHDepositContext } from './AurixPayQRPHDepositContext.js';
8
+ export function Failed() {
9
+ const context = useAurixPayQRPHDepositContext();
10
+ return (_jsx(AlertDialog.Root, { open: context.status === 'failed', lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)]", children: _jsxs(AlertDialog.Content, { children: [_jsx("button", { type: "button", className: "absolute top-4 right-4 icon:size-6 p-md text-text-quinary disabled:cursor-not-allowed disabled:opacity-50", onClick: context.reset, children: _jsx(XIcon, {}) }), _jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-error-secondary", children: _jsx(AlertCircleIcon, { className: "size-6 text-text-featured-icon-light-error" }) }), _jsx(AlertDialog.Title, { className: "mt-xl", children: context.errorMessage?.name ||
11
+ 'Your deposit failed or was cancelled.' }), _jsx(AlertDialog.Description, { className: "mt-xl px-3", children: context.errorMessage?.message ||
12
+ 'Your deposit was not completed or has been cancelled. You can try again by generating a new QR code.' }), _jsx(Button, { className: "mt-4xl w-full", variant: "outline", onClick: context.regenerateQRCode, children: "Generate New QR Code" })] }) })] }) }));
13
+ }
@@ -0,0 +1 @@
1
+ export declare function Form(): import("react/jsx-runtime").JSX.Element;
@@ -3,25 +3,30 @@ import { zodResolver } from '@hookform/resolvers/zod';
3
3
  import Link from 'next/link';
4
4
  import { useEffect } from 'react';
5
5
  import { Controller, useForm } from 'react-hook-form';
6
+ import { useBoolean } from 'usehooks-ts';
6
7
  import { z } from 'zod';
7
8
  import { useShallow } from 'zustand/shallow';
8
9
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
9
10
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
10
11
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
11
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
13
+ import { QrCode02Icon } from '../../../../icons/QrCode02Icon.js';
14
+ import { XIcon } from '../../../../icons/XIcon.js';
15
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
12
16
  import { Button } from '../../../../ui/Button/index.js';
13
17
  import { Field } from '../../../../ui/Field/index.js';
18
+ import { Portal } from '../../../../ui/Portal/index.js';
14
19
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
15
20
  import { AmountChoices } from '../../AmountChoices.js';
16
21
  import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
17
22
  import { AvailablePromos } from '../AvailablePromos.js';
18
- import { useQRPHDepositContext } from './QRPHDepositContext.js';
19
- export function QRPHDepositForm() {
23
+ import { useAurixPayQRPHDepositContext } from './AurixPayQRPHDepositContext.js';
24
+ export function Form() {
20
25
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
21
26
  const globalStore = useGlobalStore(useShallow((ctx) => ({
22
27
  depositWithdrawal: ctx.depositWithdrawal,
23
28
  })));
24
- const context = useQRPHDepositContext();
29
+ const context = useAurixPayQRPHDepositContext();
25
30
  const depositsCountQuery = useDepositsCountQuery();
26
31
  const depositsCount = depositsCountQuery.data ?? 0;
27
32
  const paymentSettingsQuery = usePaymentSettingsQuery();
@@ -101,9 +106,11 @@ export function QRPHDepositForm() {
101
106
  });
102
107
  }
103
108
  }, [form, minimumAmount]);
104
- if (context.view !== 'form')
105
- return null;
106
- return (_jsxs("form", { onSubmit: form.handleSubmit(context.generateQRCode), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Enter the amount you want to deposit" }), _jsx(Field.Input, { type: "number", ...form.register('amount') }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
109
+ const confirm = useBoolean();
110
+ return (_jsxs("form", { onSubmit: (e) => {
111
+ e.preventDefault();
112
+ confirm.setTrue();
113
+ }, noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsx(Field.Label, { children: "Enter the amount you want to deposit" }), _jsx(Field.Input, { type: "number", ...form.register('amount') }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
107
114
  form.setValue('amount', value.toString(), {
108
115
  shouldTouch: true,
109
116
  shouldDirty: true,
@@ -112,5 +119,8 @@ export function QRPHDepositForm() {
112
119
  }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
113
120
  o.field.onChange(value);
114
121
  globalStore.depositWithdrawal.setPromo(null);
115
- }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }))] }));
122
+ }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: !!form.formState.errors.amount, children: "Deposit" }), depositWithdrawalProps.hasPrivacyPolicyAndTermsOfUse && (_jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] })), _jsx(AlertDialog.Root, { open: confirm.value, lazyMount: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { onClick: confirm.setFalse, children: _jsx(XIcon, {}) }), _jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary", children: _jsx(QrCode02Icon, { className: "size-6 text-text-featured-icon-light-brand" }) }), _jsx(AlertDialog.Title, { className: "mt-xl", children: "Generate Single Use QR Code" }), _jsx(AlertDialog.Description, { className: "mt-xs px-2", children: "To proceed with your QRPH deposit, please generate a QR code first." }), _jsx(Button, { className: "mt-4xl", variant: "outline", colorScheme: "gray", onClick: form.handleSubmit(async (data) => {
123
+ confirm.setFalse();
124
+ await context.generateQRCode(data);
125
+ }), children: "Generate QR code" })] }) })] }) })] }));
116
126
  }
@@ -0,0 +1 @@
1
+ export declare function GeneratingQrCode(): import("react/jsx-runtime").JSX.Element;