@opexa/portal-components 0.0.307 → 0.0.309

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 (266) hide show
  1. package/dist/client/hooks/useCamera.js +2 -2
  2. package/dist/client/hooks/useControllableState.js +1 -1
  3. package/dist/client/hooks/useInfiniteQueryHelper.js +2 -3
  4. package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +1 -2
  5. package/dist/client/hooks/useMobileNumberParser.js +1 -1
  6. package/dist/client/utils/recaptcha.d.ts +14 -0
  7. package/dist/client/utils/recaptcha.js +18 -0
  8. package/dist/components/Account/Account.lazy.js +5 -5
  9. package/dist/components/Account/account.recipe.js +4 -4
  10. package/dist/components/AccountInfo/AccountInfo.js +6 -6
  11. package/dist/components/AccountSecurity/AccountSecurity.js +6 -6
  12. package/dist/components/AccountVerification/AccountVerification.js +7 -7
  13. package/dist/components/Banner/Banner.js +1 -1
  14. package/dist/components/BetRecords/BetRecords.client.js +5 -5
  15. package/dist/components/Bonus/Bonus.client.js +2 -2
  16. package/dist/components/Bonuses/Bonuses.client.js +10 -10
  17. package/dist/components/Bonuses/BonusesTrigger.js +1 -1
  18. package/dist/components/Bonuses/ClaimSpotBonus.lazy.js +1 -1
  19. package/dist/components/Cashback/Cashback.client.js +2 -2
  20. package/dist/components/CustomPromo/CustomPromo.js +1 -1
  21. package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +1 -1
  22. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +2 -2
  23. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +2 -2
  24. package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +2 -2
  25. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +2 -2
  26. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +2 -2
  27. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +1 -1
  28. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +2 -2
  29. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
  30. package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +2 -2
  31. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +1 -1
  32. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +2 -2
  33. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +1 -1
  34. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -2
  35. package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +2 -2
  36. package/dist/components/DepositWithdrawal/HasPendingBonuses.js +1 -1
  37. package/dist/components/DepositWithdrawal/PaymentMethods.js +1 -1
  38. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +3 -3
  39. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +2 -4
  40. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +2 -2
  41. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +3 -3
  42. package/dist/components/DepositWithdrawal/Withdrawal/PisoPayWithdrawal/PisoPayWithdrawal.js +2 -2
  43. package/dist/components/DepositWithdrawal/Withdrawal/TransactionPasswordNotSet.js +2 -2
  44. package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +2 -2
  45. package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +4 -4
  46. package/dist/components/DigitainLauncher/Fallback.js +1 -1
  47. package/dist/components/DigitainLauncher/Loading.js +1 -1
  48. package/dist/components/DigitainLauncher/utils.js +1 -2
  49. package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
  50. package/dist/components/Disclaimer/DisclaimerV2.js +3 -3
  51. package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
  52. package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
  53. package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
  54. package/dist/components/Disclaimer/TermsOfUse.js +13 -0
  55. package/dist/components/FavoriteGames/FavoriteGames.client.js +4 -4
  56. package/dist/components/ForgotPassword/ForgotPassword.lazy.js +1 -1
  57. package/dist/components/ForgotPassword/ForgotPasswordForm.js +5 -5
  58. package/dist/components/GCashFailed/GCashFailed.js +1 -1
  59. package/dist/components/GCashSuccess/GCashSuccess.js +1 -1
  60. package/dist/components/GameLaunch/GameLaunch.lazy.js +4 -4
  61. package/dist/components/GameLaunch/GameLaunchTrigger.js +2 -4
  62. package/dist/components/GameProviders/GameProvidersCarousel.js +1 -1
  63. package/dist/components/GameProviders/GameProvidersList.js +1 -1
  64. package/dist/components/Games/Game.js +3 -3
  65. package/dist/components/Games/GamesCarousel.client.js +2 -4
  66. package/dist/components/Games/GamesList.client.js +2 -2
  67. package/dist/components/GamesSearch/GamesSearch.js +4 -6
  68. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +1 -1
  69. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.d.ts +1 -1
  70. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +54 -54
  71. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  72. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
  73. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  74. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +14 -12
  75. package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +1 -1
  76. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +13 -11
  77. package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +1 -1
  78. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +16 -18
  79. package/dist/components/KYC/BasicInformation.js +1 -1
  80. package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
  81. package/dist/components/KYC/CaptureIdDocument.js +219 -0
  82. package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
  83. package/dist/components/KYC/CaptureSelfie.js +285 -0
  84. package/dist/components/KYC/DisplayImage.d.ts +5 -0
  85. package/dist/components/KYC/DisplayImage.js +8 -0
  86. package/dist/components/KYC/FileUpload.d.ts +10 -0
  87. package/dist/components/KYC/FileUpload.js +72 -0
  88. package/dist/components/KYC/IdentityVerification.js +1 -1
  89. package/dist/components/KYC/KYC.lazy.js +1 -1
  90. package/dist/components/KYC/KYCReminder.lazy.js +1 -1
  91. package/dist/components/KYC/NoCameraError.d.ts +7 -0
  92. package/dist/components/KYC/NoCameraError.js +6 -0
  93. package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
  94. package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
  95. package/dist/components/KYC/PersonalInformation.js +1 -1
  96. package/dist/components/KYC/utils.d.ts +9 -0
  97. package/dist/components/KYC/utils.js +79 -0
  98. package/dist/components/Marquee/Marquee.js +1 -1
  99. package/dist/components/Messages/Messages.lazy.js +5 -5
  100. package/dist/components/Messages/MessagesPopup.js +3 -3
  101. package/dist/components/Messages/MessagesTrigger.js +1 -1
  102. package/dist/components/News/News.js +1 -1
  103. package/dist/components/NewsFeed/News.d.ts +2 -2
  104. package/dist/components/NewsFeed/News.js +1 -1
  105. package/dist/components/NewsFeed/NewsFeedCarousel.js +2 -2
  106. package/dist/components/NewsFeed/NewsFeedList.js +1 -1
  107. package/dist/components/PortalProvider/Snackbar.js +2 -2
  108. package/dist/components/Promo/Promo.client.js +2 -2
  109. package/dist/components/Promos/Cashback.js +1 -1
  110. package/dist/components/Promos/CustomPromo.d.ts +2 -2
  111. package/dist/components/Promos/CustomPromo.js +1 -1
  112. package/dist/components/Promos/Promo.js +1 -1
  113. package/dist/components/Promos/PromosCarousel.js +2 -2
  114. package/dist/components/Promos/PromosGrid.js +2 -2
  115. package/dist/components/Quests/DailyCheckInQuest.js +3 -3
  116. package/dist/components/Quests/JourneyQuest.js +5 -5
  117. package/dist/components/Quests/OnboardingQuest.js +2 -2
  118. package/dist/components/Quests/Quests.client.js +4 -4
  119. package/dist/components/Quests/WageringQuest.js +2 -2
  120. package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.js +1 -1
  121. package/dist/components/Search/Search.lazy.js +7 -9
  122. package/dist/components/SignIn/MobileNumberSignIn.js +5 -5
  123. package/dist/components/SignIn/NameAndPasswordSignIn.js +2 -2
  124. package/dist/components/SignIn/SignIn.lazy.d.ts +1 -1
  125. package/dist/components/SignIn/SignIn.lazy.js +1 -2
  126. package/dist/components/SignIn/SignInForm.js +1 -1
  127. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
  128. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
  129. package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
  130. package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
  131. package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.js +1 -1
  132. package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +7 -7
  133. package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
  134. package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
  135. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
  136. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
  137. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
  138. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
  139. package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.client.js +7 -7
  140. package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.js +1 -1
  141. package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
  142. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
  143. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
  144. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
  145. package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.client.js +6 -6
  146. package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.js +1 -1
  147. package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +0 -1
  148. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
  149. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
  150. package/dist/components/SignUp/SignUpKYC/SignUpKYC.lazy.js +1 -1
  151. package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +8 -8
  152. package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
  153. package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
  154. package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
  155. package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
  156. package/dist/components/TermsAndConditions/TermsAndConditions.lazy.js +1 -1
  157. package/dist/components/TermsOfUse/TermsOfUse.lazy.js +1 -1
  158. package/dist/components/TopWins/TopWins.client.js +3 -3
  159. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +1 -1
  160. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +10 -8
  161. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  162. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  163. package/dist/components/Tournaments/TournamentsList/TournamentsList.js +2 -2
  164. package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +9 -7
  165. package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +1 -1
  166. package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +8 -6
  167. package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.js +1 -1
  168. package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.js +1 -1
  169. package/dist/components/TransactionRecords/DepositRecordsTable.js +2 -2
  170. package/dist/components/TransactionRecords/TableFilters.js +1 -1
  171. package/dist/components/TransactionRecords/TransactionRecords.suspense.js +1 -1
  172. package/dist/components/TransactionRecords/TransactionRecordsTable.js +2 -2
  173. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +2 -2
  174. package/dist/components/shared/Empty.js +1 -1
  175. package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +7 -7
  176. package/dist/components/shared/IdFrontImageField/IdFrontImageField.js +1 -1
  177. package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +6 -6
  178. package/dist/components/shared/SelfieImageField/SelfieImageField.js +1 -1
  179. package/dist/components/shared/SelfieImageField/useSelfieImageField.js +0 -1
  180. package/dist/constants/EnvVar.d.ts +1 -1
  181. package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
  182. package/dist/handlers/postTransformIdFrontImage.js +82 -0
  183. package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
  184. package/dist/handlers/postTransformSelfieImage.js +82 -0
  185. package/dist/middleware.d.ts +1 -1
  186. package/dist/middleware.js +1 -1
  187. package/dist/services/graphqlRequest.js +0 -1
  188. package/dist/styles/theme.css +706 -706
  189. package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
  190. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
  191. package/dist/ui/AlertDialog/alertDialog.recipe.js +6 -6
  192. package/dist/ui/Avatar/avatar.recipe.js +3 -3
  193. package/dist/ui/Badge/Badge.d.ts +12 -12
  194. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  195. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  196. package/dist/ui/Badge/badge.recipe.js +7 -7
  197. package/dist/ui/Button/button.recipe.d.ts +2 -2
  198. package/dist/ui/Button/button.recipe.js +3 -3
  199. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  200. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  201. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  202. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  203. package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
  204. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  205. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  206. package/dist/ui/Clipboard/clipboard.recipe.js +2 -2
  207. package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
  208. package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
  209. package/dist/ui/Collapsible/collapsible.recipe.js +2 -2
  210. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  211. package/dist/ui/Combobox/Combobox.js +0 -1
  212. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  213. package/dist/ui/Combobox/combobox.recipe.js +6 -6
  214. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  215. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  216. package/dist/ui/DatePicker/datePicker.recipe.js +7 -7
  217. package/dist/ui/Dialog/Dialog.d.ts +154 -154
  218. package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
  219. package/dist/ui/Dialog/dialog.recipe.js +4 -4
  220. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  221. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  222. package/dist/ui/Drawer/drawer.recipe.js +5 -5
  223. package/dist/ui/Field/Field.d.ts +21 -21
  224. package/dist/ui/Field/field.recipe.d.ts +3 -3
  225. package/dist/ui/Field/field.recipe.js +3 -3
  226. package/dist/ui/IconButton/iconButton.recipe.d.ts +2 -2
  227. package/dist/ui/Menu/Menu.d.ts +144 -144
  228. package/dist/ui/Menu/menu.recipe.d.ts +8 -8
  229. package/dist/ui/NumberInput/numberInput.recipe.js +5 -5
  230. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  231. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  232. package/dist/ui/PasswordInput/passwordInput.recipe.js +3 -3
  233. package/dist/ui/PinInput/pinInput.recipe.js +3 -3
  234. package/dist/ui/Popover/Popover.d.ts +121 -121
  235. package/dist/ui/Popover/popover.recipe.d.ts +11 -11
  236. package/dist/ui/Popover/popover.recipe.js +1 -1
  237. package/dist/ui/Presence/Presence.js +1 -1
  238. package/dist/ui/Progress/Progress.d.ts +27 -27
  239. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  240. package/dist/ui/Progress/progress.recipe.js +2 -2
  241. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  242. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  243. package/dist/ui/SegmentGroup/segmentGroup.recipe.js +4 -4
  244. package/dist/ui/Select/Select.d.ts +45 -45
  245. package/dist/ui/Select/Select.js +0 -1
  246. package/dist/ui/Select/select.recipe.d.ts +3 -3
  247. package/dist/ui/Select/select.recipe.js +7 -7
  248. package/dist/ui/Table/Table.d.ts +21 -21
  249. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  250. package/dist/ui/Table/table.recipe.d.ts +3 -3
  251. package/dist/ui/Table/table.recipe.js +3 -3
  252. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  253. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  254. package/dist/ui/Tabs/tabs.recipe.js +4 -4
  255. package/dist/ui/Tooltip/tooltip.recipe.js +1 -1
  256. package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
  257. package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
  258. package/dist/utils/getGameName.d.ts +1 -0
  259. package/dist/utils/getGameName.js +6 -0
  260. package/dist/utils/getLocaleInfo.js +7 -7
  261. package/dist/utils/getQueryClient.js +1 -1
  262. package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
  263. package/dist/utils/isBetween3amAnd3pm.js +5 -0
  264. package/dist/utils/parseDecimal.js +1 -1
  265. package/dist/utils/validateFile.d.ts +1 -1
  266. package/package.json +159 -164
@@ -24,5 +24,5 @@ export function TransactionRecords__suspense(props) {
24
24
  newSearchParams.delete('id');
25
25
  router.push(`${pathname}?${newSearchParams.toString()}`);
26
26
  };
27
- return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-sm font-semibold leading-tight lg:text-lg", children: "Transactions" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm leading-tight", children: "View your transaction records" }), _jsxs(Tabs.Root, { className: "mt-lg lg:mt-2xl", value: tab, onValueChange: (details) => setTab(TabSchema.parse(details.value)), lazyMount: true, unmountOnExit: true, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Trigger, { value: "transactions", children: "All Transactions" }), _jsx(Tabs.Trigger, { value: "deposits", children: "Deposits" }), _jsx(Tabs.Trigger, { value: "withdrawals", children: "Withdrawals" }), _jsx(Tabs.Indicator, {})] }), _jsx("div", { className: "border-border-secondary mt-2xl hidden border-[1.5px] border-t lg:block" }), _jsx("h3", { className: "text-text-secondary-700 mt-3xl text-sm font-semibold", children: "Table" }), _jsx(Tabs.Content, { value: "transactions", className: "mt-xl", children: _jsx(TransactionRecordsTable, {}) }), _jsx(Tabs.Content, { value: "deposits", className: "mt-xl", children: _jsx(Suspense, { fallback: null, children: _jsx(DepositRecordsTable, {}) }) }), _jsx(Tabs.Content, { value: "withdrawals", className: "mt-xl", children: _jsx(Suspense, { fallback: null, children: _jsx(WithdrawalRecordsTable, {}) }) })] })] }));
27
+ return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "font-semibold text-sm leading-tight lg:text-lg", children: "Transactions" }), _jsx("p", { className: "mt-xs text-sm text-text-tertiary-600 leading-tight", children: "View your transaction records" }), _jsxs(Tabs.Root, { className: "mt-lg lg:mt-2xl", value: tab, onValueChange: (details) => setTab(TabSchema.parse(details.value)), lazyMount: true, unmountOnExit: true, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Trigger, { value: "transactions", children: "All Transactions" }), _jsx(Tabs.Trigger, { value: "deposits", children: "Deposits" }), _jsx(Tabs.Trigger, { value: "withdrawals", children: "Withdrawals" }), _jsx(Tabs.Indicator, {})] }), _jsx("div", { className: "mt-2xl hidden border-[1.5px] border-border-secondary border-t lg:block" }), _jsx("h3", { className: "mt-3xl font-semibold text-sm text-text-secondary-700", children: "Table" }), _jsx(Tabs.Content, { value: "transactions", className: "mt-xl", children: _jsx(TransactionRecordsTable, {}) }), _jsx(Tabs.Content, { value: "deposits", className: "mt-xl", children: _jsx(Suspense, { fallback: null, children: _jsx(DepositRecordsTable, {}) }) }), _jsx(Tabs.Content, { value: "withdrawals", className: "mt-xl", children: _jsx(Suspense, { fallback: null, children: _jsx(WithdrawalRecordsTable, {}) }) })] })] }));
28
28
  }
@@ -55,7 +55,7 @@ export function TransactionRecordsTable() {
55
55
  transactionType: true,
56
56
  } }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
57
57
  ? 'Fetching latest transaction records...'
58
- : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Transaction Type" }), _jsx(Table.Heading, { children: "Transaction Time" }), _jsx(Table.Heading, { children: "Transaction Amount" }), _jsx(Table.Heading, { children: "Current Balance" }), _jsx(Table.Heading, { children: "Reference Number" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
58
+ : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Transaction Type" }), _jsx(Table.Heading, { children: "Transaction Time" }), _jsx(Table.Heading, { children: "Transaction Amount" }), _jsx(Table.Heading, { children: "Current Balance" }), _jsx(Table.Heading, { children: "Reference Number" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
59
59
  delimiter: capitalize.delimiters.UNDERSCORE,
60
60
  }) }), _jsxs(Table.Cell, { className: "!py-1", children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeCreated, 'MM/dd/yyyy', {
61
61
  in: tz(localeInfo.timezone),
@@ -67,5 +67,5 @@ export function TransactionRecordsTable() {
67
67
  }) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.currentBalance, {
68
68
  currency: localeInfo.currency.code,
69
69
  minDecimalPlaces: 2,
70
- }) }), _jsx(Table.Cell, { className: "!py-1", children: data.referenceNumber })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700 text-sm font-medium", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
70
+ }) }), _jsx(Table.Cell, { className: "!py-1", children: data.referenceNumber })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "font-medium text-sm text-text-secondary-700", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
71
71
  }
@@ -85,7 +85,7 @@ export function WithdrawalRecordsTable() {
85
85
  withdrawalStatus: true,
86
86
  } }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
87
87
  ? 'Fetching latest withdrawal records...'
88
- : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Withdrawal No." }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Withdrawal Method" }), _jsx(Table.Heading, { children: "Mobile Number" }), _jsx(Table.Heading, { children: "Withdrawal Amount" }), _jsx(Table.Heading, { children: "Net Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Bank Name" }), _jsx(Table.Heading, { children: "Withdrawal Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.withdrawalNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1 text-right", children: capitalize(data.type, {
88
+ : 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "scrollbar:h-2 overflow-hidden overflow-x-auto rounded-none scrollbar-thumb:rounded-full border-border-secondary border-b scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Withdrawal No." }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Withdrawal Method" }), _jsx(Table.Heading, { children: "Mobile Number" }), _jsx(Table.Heading, { children: "Withdrawal Amount" }), _jsx(Table.Heading, { children: "Net Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Bank Name" }), _jsx(Table.Heading, { children: "Withdrawal Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.withdrawalNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1 text-right", children: capitalize(data.type, {
89
89
  delimiter: capitalize.delimiters.UNDERSCORE,
90
90
  }) }), _jsx(Table.Cell, { className: "!py-1", children: data.recipientMobileNumber }), _jsx(Table.Cell, { className: "!py-1 text-right", children: formatNumber(data.amount, {
91
91
  currency: localeInfo.currency.code,
@@ -108,5 +108,5 @@ export function WithdrawalRecordsTable() {
108
108
  ? 'warning'
109
109
  : 'success', children: _jsx(Badge.Label, { children: capitalize(data.status, {
110
110
  delimiter: capitalize.delimiters.UNDERSCORE,
111
- }) }) }) })] }, data.id))) })] }) }), _jsxs("div", { className: "gap-lg flex items-center justify-between px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700 text-sm font-medium", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
111
+ }) }) }) })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "font-medium text-sm text-text-secondary-700", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
112
112
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  export function Empty(props) {
3
- return (_jsxs("div", { role: "alert", "aria-live": "polite", style: props.style, className: props.className, children: [_jsxs("div", { className: "relative mx-auto w-[9.5rem] pt-4", children: [_jsx("div", { className: "bg-utility-gray-200 absolute left-1/2 top-0 size-[6.5rem] -translate-x-1/2 rounded-full" }), _jsx(CloudIcon, { className: "relative h-auto w-full shrink-0" }), _jsx("div", { className: "bg-utility-gray-200/40 absolute bottom-2 left-1/2 flex size-12 -translate-x-1/2 items-center justify-center rounded-full backdrop-blur-sm", children: _jsx(props.icon, { className: "size-6 text-white" }) }), _jsx("div", { className: "bg-utility-gray-100 absolute left-4 top-3.5 size-2.5 rounded-full" }), _jsx("div", { className: "bg-utility-gray-100 absolute bottom-0.5 left-3 size-3.5 rounded-full" }), _jsx("div", { className: "bg-utility-gray-100 absolute right-3.5 top-1 size-2 rounded-full" }), _jsx("div", { className: "bg-utility-gray-100 absolute right-0 top-6.5 size-3.5 rounded-full" })] }), _jsx("h2", { className: "mt-xl text-center font-semibold", children: props.title }), _jsx("p", { className: "text-text-tertiary-600 mx-auto mt-xs max-w-[25rem] text-center text-sm", children: props.message })] }));
3
+ return (_jsxs("div", { role: "alert", "aria-live": "polite", style: props.style, className: props.className, children: [_jsxs("div", { className: "relative mx-auto w-[9.5rem] pt-4", children: [_jsx("div", { className: "-translate-x-1/2 absolute top-0 left-1/2 size-[6.5rem] rounded-full bg-utility-gray-200" }), _jsx(CloudIcon, { className: "relative h-auto w-full shrink-0" }), _jsx("div", { className: "-translate-x-1/2 absolute bottom-2 left-1/2 flex size-12 items-center justify-center rounded-full bg-utility-gray-200/40 backdrop-blur-sm", children: _jsx(props.icon, { className: "size-6 text-white" }) }), _jsx("div", { className: "absolute top-3.5 left-4 size-2.5 rounded-full bg-utility-gray-100" }), _jsx("div", { className: "absolute bottom-0.5 left-3 size-3.5 rounded-full bg-utility-gray-100" }), _jsx("div", { className: "absolute top-1 right-3.5 size-2 rounded-full bg-utility-gray-100" }), _jsx("div", { className: "absolute top-6.5 right-0 size-3.5 rounded-full bg-utility-gray-100" })] }), _jsx("h2", { className: "mt-xl text-center font-semibold", children: props.title }), _jsx("p", { className: "mx-auto mt-xs max-w-[25rem] text-center text-sm text-text-tertiary-600", children: props.message })] }));
4
4
  }
5
5
  function CloudIcon(props) {
6
6
  return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 152 104", fill: "none", ...props, children: [_jsxs("g", { filter: "url(#filter0_dd_2719_19242)", children: [_jsx("path", { d: "M77.6 0C66.8273 0 57.2978 5.32329 51.4987 13.4829C49.605 13.0363 47.6301 12.8 45.6 12.8C31.4615 12.8 20 24.2615 20 38.4C20 52.5385 31.4615 64 45.6 64L109.6 64C121.971 64 132 53.9712 132 41.6C132 29.2288 121.971 19.2 109.6 19.2C108.721 19.2 107.854 19.2506 107.002 19.349C102.098 7.9677 90.7797 0 77.6 0Z", fill: "#F9FAFB" }), _jsx("ellipse", { cx: "45.6", cy: "38.4008", rx: "25.6", ry: "25.6", fill: "url(#paint0_linear_2719_19242)" }), _jsx("circle", { cx: "77.6", cy: "32", r: "32", fill: "url(#paint1_linear_2719_19242)" }), _jsx("ellipse", { cx: "109.6", cy: "41.5992", rx: "22.4", ry: "22.4", fill: "url(#paint2_linear_2719_19242)" })] }), _jsxs("defs", { children: [_jsxs("filter", { id: "filter0_dd_2719_19242", x: "0", y: "0", width: "152", height: "104", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB", children: [_jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), _jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), _jsx("feMorphology", { radius: "4", operator: "erode", in: "SourceAlpha", result: "effect1_dropShadow_2719_19242" }), _jsx("feOffset", { dy: "8" }), _jsx("feGaussianBlur", { stdDeviation: "4" }), _jsx("feComposite", { in2: "hardAlpha", operator: "out" }), _jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.03 0" }), _jsx("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_2719_19242" }), _jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), _jsx("feMorphology", { radius: "4", operator: "erode", in: "SourceAlpha", result: "effect2_dropShadow_2719_19242" }), _jsx("feOffset", { dy: "20" }), _jsx("feGaussianBlur", { stdDeviation: "12" }), _jsx("feComposite", { in2: "hardAlpha", operator: "out" }), _jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.08 0" }), _jsx("feBlend", { mode: "normal", in2: "effect1_dropShadow_2719_19242", result: "effect2_dropShadow_2719_19242" }), _jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect2_dropShadow_2719_19242", result: "shape" })] }), _jsxs("linearGradient", { id: "paint0_linear_2719_19242", x1: "25.9429", y1: "21.4865", x2: "71.2", y2: "64.0007", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { stopColor: "#D0D5DD" }), _jsx("stop", { offset: "0.350715", stopColor: "white", stopOpacity: "0" })] }), _jsxs("linearGradient", { id: "paint1_linear_2719_19242", x1: "53.0286", y1: "10.8571", x2: "109.6", y2: "64", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { stopColor: "#D0D5DD" }), _jsx("stop", { offset: "0.350715", stopColor: "white", stopOpacity: "0" })] }), _jsxs("linearGradient", { id: "paint2_linear_2719_19242", x1: "92.4", y1: "26.7992", x2: "132", y2: "63.9992", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { stopColor: "#D0D5DD" }), _jsx("stop", { offset: "0.350715", stopColor: "white", stopOpacity: "0" })] })] })] }));
@@ -25,7 +25,7 @@ export function IdFrontImageField__client(props) {
25
25
  'defaultValue',
26
26
  ])(props);
27
27
  const context = useIdFrontImageField(useIdFrontImageFieldProps);
28
- return (_jsxs(IdFrontImageFieldProvider, { value: context, children: [_jsxs("div", { ref: localProps.ref, id: localProps.id, style: localProps.style, className: twMerge('border-border-primary bg-bg-primary group relative aspect-[352/180] w-full shrink-0 rounded-xl border p-xl', localProps.className), onDragOver: (e) => e.preventDefault(), onDragEnter: (e) => e.preventDefault(), onDragLeave: (e) => e.preventDefault(), onDrop: (e) => {
28
+ return (_jsxs(IdFrontImageFieldProvider, { value: context, children: [_jsxs("div", { ref: localProps.ref, id: localProps.id, style: localProps.style, className: twMerge('group relative aspect-[352/180] w-full shrink-0 rounded-xl border border-border-primary bg-bg-primary p-xl', localProps.className), onDragOver: (e) => e.preventDefault(), onDragEnter: (e) => e.preventDefault(), onDragLeave: (e) => e.preventDefault(), onDrop: (e) => {
29
29
  e.preventDefault();
30
30
  const file = e.dataTransfer.files?.[0];
31
31
  if (!file)
@@ -45,21 +45,21 @@ export function IdFrontImageField__client(props) {
45
45
  }, disabled: context.field?.disabled ||
46
46
  context.query.isLoading ||
47
47
  context.mutation.isPending ||
48
- localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: context.query.isLoading ? (_jsx(Spinner02Icon, { className: "text-text-placeholder-subtle size-4" })) : (_jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" })) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
48
+ localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "mx-auto flex size-8 items-center justify-center rounded-sm border border-border-primary shadow-xs", children: context.query.isLoading ? (_jsx(Spinner02Icon, { className: "size-4 text-text-placeholder-subtle" })) : (_jsx(UploadCloud02Icon, { className: "size-4 text-text-placeholder-subtle" })) }), _jsxs("h2", { className: "mt-lg text-text-tertiary-600", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
49
49
  context.inputRef.current?.click();
50
50
  }, disabled: context.field?.disabled ||
51
51
  context.field?.readOnly ||
52
52
  context.query.isLoading ||
53
53
  context.mutation.isPending ||
54
54
  localProps.disabled ||
55
- localProps.readOnly, className: "text-button-secondary-fg font-semibold disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
55
+ localProps.readOnly, className: "font-semibold text-button-secondary-fg disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
56
56
  context.disclosure.setOpen(true);
57
57
  }, disabled: context.field?.disabled ||
58
58
  context.field?.readOnly ||
59
59
  context.query.isLoading ||
60
60
  context.mutation.isPending ||
61
61
  localProps.disabled ||
62
- localProps.readOnly, children: "Take a photo" })] })), context.query.data?.url && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.query.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "backdrop-blur-xs absolute right-2 top-2 rounded-full bg-white/10 p-1", onClick: () => {
62
+ localProps.readOnly, children: "Take a photo" })] })), context.query.data?.url && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.query.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "absolute top-2 right-2 rounded-full bg-white/10 p-1 backdrop-blur-xs", onClick: () => {
63
63
  context.setValue('');
64
64
  }, children: _jsx(XIcon, { className: "size-5" }) })] }))] }), _jsx(Camera, {})] }));
65
65
  }
@@ -72,9 +72,9 @@ function Camera() {
72
72
  const context = useIdFrontImageFieldContext();
73
73
  return (_jsx(Dialog.Root, { open: context.disclosure.open, onOpenChange: (details) => {
74
74
  context.disclosure.setOpen(details.open);
75
- }, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Picture of Your Front ID" }), _jsxs(Dialog.Description, { className: "text-text-tertiary-600 mt-md text-center text-xs lg:text-base", children: ["Make sure your ID is clearly visible, well-lit, and not blurry.", ' ', _jsx("br", { className: "hidden lg:block" }), "Avoid glare or reflections, and ensure all corners are within\u00A0the\u00A0frame."] }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "text-text-placeholder-subtle size-10 text-center lg:size-12" }), _jsx("h2", { className: "mt-3 text-sm font-semibold lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "text-text-tertiary-600 mt-0.5 text-center text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
75
+ }, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Picture of Your Front ID" }), _jsxs(Dialog.Description, { className: "mt-md text-center text-text-tertiary-600 text-xs lg:text-base", children: ["Make sure your ID is clearly visible, well-lit, and not blurry.", ' ', _jsx("br", { className: "hidden lg:block" }), "Avoid glare or reflections, and ensure all corners are within\u00A0the\u00A0frame."] }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "size-10 text-center text-text-placeholder-subtle lg:size-12" }), _jsx("h2", { className: "mt-3 font-semibold text-sm lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "mt-0.5 text-center text-text-tertiary-600 text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
76
76
  context.camera.reopen();
77
- }, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "text-text-placeholder size-8" }) })), context.camera.data && (_jsx("div", { className: "border-border-disabled aspect-[4/3] w-full overflow-hidden rounded-md border bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "disabled:bg-bg-disabled disabled:text-text-disabled mx-auto w-full px-xl py-lg lg:w-[10rem]", onClick: () => {
77
+ }, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "size-8 text-text-placeholder" }) })), context.camera.data && (_jsx("div", { className: "aspect-[4/3] w-full overflow-hidden rounded-md border border-border-disabled bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "mx-auto w-full px-xl py-lg disabled:bg-bg-disabled disabled:text-text-disabled lg:w-[10rem]", onClick: () => {
78
78
  context.camera.snap();
79
79
  }, disabled: context.camera.snapping ||
80
80
  context.camera.loading ||
@@ -103,5 +103,5 @@ function Video() {
103
103
  const y = (rootRect.height - guideRect.height) / 2;
104
104
  return (_jsxs("div", { ref: rootRef, className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
105
105
  ? 'block'
106
- : 'hidden'), children: [_jsx("video", { ...context.camera.videoProps }), _jsx("div", { className: "pointer-events-none absolute left-0 right-0 top-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { ref: context.guideRef, className: "border-utility-warning-700 pointer-events-none absolute left-1/2 top-1/2 z-10 aspect-[85.6/53.98] w-[calc(100%-1rem)] max-w-[24.688rem] -translate-x-1/2 -translate-y-1/2 border-4 border-dashed transition-all duration-200" })] }));
106
+ : 'hidden'), children: [_jsx("video", { ...context.camera.videoProps }), _jsx("div", { className: "pointer-events-none absolute top-0 right-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { ref: context.guideRef, className: "-translate-x-1/2 -translate-y-1/2 pointer-events-none absolute top-1/2 left-1/2 z-10 aspect-[85.6/53.98] w-[calc(100%-1rem)] max-w-[24.688rem] border-4 border-utility-warning-700 border-dashed transition-all duration-200" })] }));
107
107
  }
@@ -4,7 +4,7 @@ import dynamic from 'next/dynamic';
4
4
  import { Spinner02Icon } from '../../../icons/Spinner02Icon.js';
5
5
  const Component = dynamic(() => import('./IdFrontImageField.client.js').then((mod) => mod.IdFrontImageField__client), {
6
6
  ssr: false,
7
- loading: () => (_jsx("div", { className: "border-border-primary bg-bg-primary flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border", children: _jsx(Spinner02Icon, { className: "text-text-quinary size-8" }) })),
7
+ loading: () => (_jsx("div", { className: "flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border border-border-primary bg-bg-primary", children: _jsx(Spinner02Icon, { className: "size-8 text-text-quinary" }) })),
8
8
  });
9
9
  export function IdFrontImageField(props) {
10
10
  return _jsx(Component, { ...props });
@@ -45,21 +45,21 @@ export function SelfieImageField__client(props) {
45
45
  }, disabled: context.field?.disabled ||
46
46
  context.query.isLoading ||
47
47
  context.mutation.isPending ||
48
- localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: context.query.isLoading ? (_jsx(Spinner02Icon, { className: "text-text-placeholder-subtle size-4" })) : (_jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" })) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
48
+ localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "mx-auto flex size-8 items-center justify-center rounded-sm border border-border-primary shadow-xs", children: context.query.isLoading ? (_jsx(Spinner02Icon, { className: "size-4 text-text-placeholder-subtle" })) : (_jsx(UploadCloud02Icon, { className: "size-4 text-text-placeholder-subtle" })) }), _jsxs("h2", { className: "mt-lg text-text-tertiary-600", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
49
49
  context.inputRef.current?.click();
50
50
  }, disabled: context.field?.disabled ||
51
51
  context.field?.readOnly ||
52
52
  context.query.isLoading ||
53
53
  context.mutation.isPending ||
54
54
  localProps.disabled ||
55
- localProps.readOnly, className: "text-button-secondary-fg font-semibold disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
55
+ localProps.readOnly, className: "font-semibold text-button-secondary-fg disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
56
56
  context.disclosure.setOpen(true);
57
57
  }, disabled: context.field?.disabled ||
58
58
  context.field?.readOnly ||
59
59
  context.query.isLoading ||
60
60
  context.mutation.isPending ||
61
61
  localProps.disabled ||
62
- localProps.readOnly, children: "Take a photo" })] })), context.query.data?.url && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.query.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "backdrop-blur-xs absolute right-2 top-2 rounded-full bg-white/10 p-1", onClick: () => {
62
+ localProps.readOnly, children: "Take a photo" })] })), context.query.data?.url && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.query.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "absolute top-2 right-2 rounded-full bg-white/10 p-1 backdrop-blur-xs", onClick: () => {
63
63
  context.setValue('');
64
64
  }, children: _jsx(XIcon, { className: "size-5" }) })] }))] }), _jsx(Camera, {})] }));
65
65
  }
@@ -72,9 +72,9 @@ function Camera() {
72
72
  const context = useSelfieImageFieldContext();
73
73
  return (_jsx(Dialog.Root, { open: context.disclosure.open, onOpenChange: (details) => {
74
74
  context.disclosure.setOpen(details.open);
75
- }, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Selfie Holding Your ID" }), _jsx(Dialog.Description, { className: "text-text-tertiary-600 mt-md text-center text-xs lg:text-base", children: "Make sure your face and ID are clearly visible, with no glare\u00A0or\u00A0blur." }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "text-text-placeholder-subtle size-10 text-center lg:size-12" }), _jsx("h2", { className: "mt-3 text-sm font-semibold lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "text-text-tertiary-600 mt-0.5 text-center text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
75
+ }, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Selfie Holding Your ID" }), _jsx(Dialog.Description, { className: "mt-md text-center text-text-tertiary-600 text-xs lg:text-base", children: "Make sure your face and ID are clearly visible, with no glare\u00A0or\u00A0blur." }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "size-10 text-center text-text-placeholder-subtle lg:size-12" }), _jsx("h2", { className: "mt-3 font-semibold text-sm lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "mt-0.5 text-center text-text-tertiary-600 text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
76
76
  context.camera.reopen();
77
- }, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "text-text-placeholder size-8" }) })), context.camera.data && (_jsx("div", { className: "border-border-disabled aspect-[4/3] w-full overflow-hidden rounded-md border bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "disabled:bg-bg-disabled disabled:text-text-disabled mx-auto w-full px-xl py-lg lg:w-[10rem]", onClick: () => {
77
+ }, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "size-8 text-text-placeholder" }) })), context.camera.data && (_jsx("div", { className: "aspect-[4/3] w-full overflow-hidden rounded-md border border-border-disabled bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "mx-auto w-full px-xl py-lg disabled:bg-bg-disabled disabled:text-text-disabled lg:w-[10rem]", onClick: () => {
78
78
  context.camera.snap();
79
79
  }, disabled: context.camera.loading ||
80
80
  context.camera.snapping ||
@@ -114,7 +114,7 @@ function Video() {
114
114
  const y = (rootRect.height - guideRect.height) / 2;
115
115
  return (_jsxs("div", { ref: rootRef, className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
116
116
  ? 'block'
117
- : 'hidden'), children: [_jsx("div", { className: "pointer-events-none absolute left-0 right-0 top-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("video", { ...context.camera.videoProps }), _jsx("div", { ref: context.guideRef, className: twMerge('border-utility-warning-700 absolute left-1/2 top-1/2 z-20 aspect-square -translate-x-1/2 -translate-y-1/2 border-4 border-dashed', context.faceFound && 'border-utility-success-700', guideWidth <= 0 ? 'hidden' : 'block'), style: {
117
+ : 'hidden'), children: [_jsx("div", { className: "pointer-events-none absolute top-0 right-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("video", { ...context.camera.videoProps }), _jsx("div", { ref: context.guideRef, className: twMerge('-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 z-20 aspect-square border-4 border-utility-warning-700 border-dashed', context.faceFound && 'border-utility-success-700', guideWidth <= 0 ? 'hidden' : 'block'), style: {
118
118
  width: `calc(${pxToRem(guideWidth)}rem - 2rem)`,
119
119
  } })] }));
120
120
  }
@@ -4,7 +4,7 @@ import dynamic from 'next/dynamic';
4
4
  import { Spinner02Icon } from '../../../icons/Spinner02Icon.js';
5
5
  const Component = dynamic(() => import('./SelfieImageField.client.js').then((mod) => mod.SelfieImageField__client), {
6
6
  ssr: false,
7
- loading: () => (_jsx("div", { className: "border-border-primary bg-bg-primary flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border", children: _jsx(Spinner02Icon, { className: "text-text-quinary size-8" }) })),
7
+ loading: () => (_jsx("div", { className: "flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border border-border-primary bg-bg-primary", children: _jsx(Spinner02Icon, { className: "size-8 text-text-quinary" }) })),
8
8
  });
9
9
  export function SelfieImageField(props) {
10
10
  return _jsx(Component, { ...props });
@@ -136,7 +136,6 @@ export function useSelfieImageField(props) {
136
136
  }
137
137
  let __image_face_detector__;
138
138
  let __video_face_detector__;
139
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
140
139
  let __vision__;
141
140
  async function getImageFaceDetector() {
142
141
  if (!__image_face_detector__) {
@@ -1,5 +1,5 @@
1
1
  export declare const SITE_ID: string;
2
2
  export declare const PLATFORM_ID: string;
3
3
  export declare const PLATFORM_CODE: string;
4
- export declare const ENVIRONMENT: "development" | "production";
4
+ export declare const ENVIRONMENT: "production" | "development";
5
5
  export declare const INTERNALS__REPORT_WEB_VITALS: boolean;
@@ -0,0 +1,3 @@
1
+ import type { NextRequest } from 'next/server';
2
+ import { NextResponse } from 'next/server';
3
+ export declare function postTransformIdFrontImage(request: NextRequest): Promise<NextResponse<unknown>>;
@@ -0,0 +1,82 @@
1
+ import { NextResponse } from 'next/server';
2
+ import sharp from 'sharp';
3
+ import { z } from 'zod';
4
+ import { validateFile } from '../utils/validateFile.js';
5
+ const TransformIdFrontImageDefinition = z.object({
6
+ image: z.instanceof(File).superRefine((file, context) => {
7
+ const error = validateFile(file);
8
+ if (error) {
9
+ context.addIssue({
10
+ code: z.ZodIssueCode.custom,
11
+ message: error.message,
12
+ });
13
+ }
14
+ }),
15
+ cropTop: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
16
+ cropLeft: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
17
+ cropWidth: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
18
+ cropHeight: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
19
+ });
20
+ export async function postTransformIdFrontImage(request) {
21
+ const form = await request.formData();
22
+ const parsed = TransformIdFrontImageDefinition.safeParse({
23
+ image: form.get('image'),
24
+ cropTop: form.get('cropTop'),
25
+ cropLeft: form.get('cropLeft'),
26
+ cropWidth: form.get('cropWidth'),
27
+ cropHeight: form.get('cropHeight'),
28
+ });
29
+ if (!parsed.success) {
30
+ return NextResponse.json({
31
+ ok: false,
32
+ message: parsed.error.issues[0].message,
33
+ __error: parsed.error,
34
+ }, { status: 400 });
35
+ }
36
+ const file = parsed.data.image;
37
+ const arrayBuffer = await file.arrayBuffer();
38
+ const buffer = Buffer.from(arrayBuffer);
39
+ const cropped = await sharp(buffer)
40
+ .extract({
41
+ top: parsed.data.cropTop,
42
+ left: parsed.data.cropLeft,
43
+ width: parsed.data.cropWidth,
44
+ height: parsed.data.cropHeight,
45
+ })
46
+ .resize({
47
+ fit: 'contain',
48
+ width: 1200,
49
+ height: 757,
50
+ kernel: sharp.kernel.lanczos3,
51
+ withoutEnlargement: true,
52
+ })
53
+ .modulate({
54
+ brightness: 1.03,
55
+ saturation: 1.05,
56
+ })
57
+ .median(1)
58
+ .blur(0.3)
59
+ .sharpen({
60
+ sigma: 1,
61
+ m1: 0.5,
62
+ m2: 1.0,
63
+ x1: 2,
64
+ y2: 10,
65
+ y3: 20,
66
+ })
67
+ .webp({
68
+ effort: 6,
69
+ quality: 100,
70
+ alphaQuality: 100,
71
+ lossless: false,
72
+ nearLossless: false,
73
+ smartSubsample: true,
74
+ })
75
+ .toBuffer();
76
+ return new NextResponse(cropped, {
77
+ headers: {
78
+ 'Content-Type': 'image/webp',
79
+ 'Content-Disposition': `inline; filename="id-front-${Date.now()}.webp"`,
80
+ },
81
+ });
82
+ }
@@ -0,0 +1,3 @@
1
+ import type { NextRequest } from 'next/server';
2
+ import { NextResponse } from 'next/server';
3
+ export declare function postTransformSelfieImage(request: NextRequest): Promise<NextResponse<unknown>>;
@@ -0,0 +1,82 @@
1
+ import { NextResponse } from 'next/server';
2
+ import sharp from 'sharp';
3
+ import { z } from 'zod';
4
+ import { validateFile } from '../utils/validateFile.js';
5
+ const TransformSelfieImageDefinition = z.object({
6
+ image: z.instanceof(File).superRefine((file, context) => {
7
+ const error = validateFile(file);
8
+ if (error) {
9
+ context.addIssue({
10
+ code: z.ZodIssueCode.custom,
11
+ message: error.message,
12
+ });
13
+ }
14
+ }),
15
+ cropTop: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
16
+ cropLeft: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
17
+ cropWidth: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
18
+ cropHeight: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
19
+ });
20
+ export async function postTransformSelfieImage(request) {
21
+ const form = await request.formData();
22
+ const parsed = TransformSelfieImageDefinition.safeParse({
23
+ image: form.get('image'),
24
+ cropTop: form.get('cropTop'),
25
+ cropLeft: form.get('cropLeft'),
26
+ cropWidth: form.get('cropWidth'),
27
+ cropHeight: form.get('cropHeight'),
28
+ });
29
+ if (!parsed.success) {
30
+ return NextResponse.json({
31
+ ok: false,
32
+ message: parsed.error.issues[0].message,
33
+ __error: parsed.error,
34
+ }, { status: 400 });
35
+ }
36
+ const file = parsed.data.image;
37
+ const arrayBuffer = await file.arrayBuffer();
38
+ const buffer = Buffer.from(arrayBuffer);
39
+ const cropped = await sharp(buffer)
40
+ .extract({
41
+ top: parsed.data.cropTop,
42
+ left: parsed.data.cropLeft,
43
+ width: parsed.data.cropWidth,
44
+ height: parsed.data.cropHeight,
45
+ })
46
+ .resize({
47
+ fit: 'contain',
48
+ width: 1200,
49
+ height: 1200,
50
+ kernel: sharp.kernel.lanczos3,
51
+ withoutEnlargement: true,
52
+ })
53
+ .modulate({
54
+ brightness: 1.03,
55
+ saturation: 1.05,
56
+ })
57
+ .median(1)
58
+ .blur(0.3)
59
+ .sharpen({
60
+ sigma: 1,
61
+ m1: 0.5,
62
+ m2: 1.0,
63
+ x1: 2,
64
+ y2: 10,
65
+ y3: 20,
66
+ })
67
+ .webp({
68
+ effort: 6,
69
+ quality: 100,
70
+ alphaQuality: 100,
71
+ lossless: false,
72
+ nearLossless: false,
73
+ smartSubsample: true,
74
+ })
75
+ .toBuffer();
76
+ return new NextResponse(cropped, {
77
+ headers: {
78
+ 'Content-Type': 'image/webp',
79
+ 'Content-Disposition': `inline; filename="selfie-${Date.now()}.webp"`,
80
+ },
81
+ });
82
+ }
@@ -1,3 +1,3 @@
1
- import { NextFetchEvent, NextResponse, type NextMiddleware, type NextRequest } from 'next/server';
1
+ import { type NextFetchEvent, NextResponse, type NextMiddleware, type NextRequest } from 'next/server';
2
2
  export declare const middleware: (req: NextRequest) => Promise<NextResponse>;
3
3
  export declare function extendMiddleware<T>(fn: (req: NextRequest, evt: NextFetchEvent, res: NextResponse) => NextResponse<T> | Promise<NextResponse<T>>): NextMiddleware;
@@ -1,5 +1,5 @@
1
1
  import { addMinutes } from 'date-fns';
2
- import { NextFetchEvent, NextResponse, } from 'next/server';
2
+ import { NextResponse, } from 'next/server';
3
3
  import { ACCESS_TOKEN_COOKIE_NAME, REFRESH_TOKEN_COOKIE_NAME, } from './constants/index.js';
4
4
  import { refreshSession } from './services/auth.js';
5
5
  export const middleware = async (req) => {
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import { ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, SITE_ID } from '../constants/index.js';
3
2
  export async function graphqlRequest(url, query, variables, options) {
4
3
  const headers = new Headers();