@opexa/portal-components 0.1.52 → 0.1.54
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.
- package/dist/client/hooks/useCreateGCashStandardCashInWithdrawal.d.ts +4 -4
- package/dist/client/hooks/useCreateGCashStandardCashInWithdrawal.js +8 -8
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.d.ts +4 -4
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +8 -8
- package/dist/client/hooks/useGlobalStore.d.ts +8 -2
- package/dist/client/hooks/useGlobalStore.js +27 -1
- package/dist/client/hooks/useRecaptcha.js +3 -1
- package/dist/client/hooks/useRedeemVoucherMutation.js +1 -1
- package/dist/client/hooks/useRequireFirstDepositQuery.js +1 -1
- package/dist/components/Account/Wallet.example.js +1 -1
- package/dist/components/Account/Wallet.js +2 -2
- package/dist/components/AccountInfo/AccountInfo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/Failed.js +3 -1
- package/dist/components/DepositWithdrawal/Deposit/Voucher/Voucher.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/Voucher/definition.js +2 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +3 -3
- package/dist/components/ForgotPassword/Crazywin/CWForgotPassword.js +1 -1
- package/dist/components/ForgotPassword/Crazywin/CWForgotPasswordForm.js +3 -3
- package/dist/components/ForgotPassword/ForgotPassword.lazy.js +4 -2
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +19 -7
- package/dist/components/GameExit/GameExit.lazy.js +1 -1
- package/dist/components/Games/GamesPagination.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +8 -3
- package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageDesktop.js +1 -1
- package/dist/components/KYC/KYCReminder.lazy.js +2 -1
- package/dist/components/NewsFeed/NewsFeedCarousel.js +1 -1
- package/dist/components/ResponsibleGamingLimits/ResponsibleGamingLimits.js +1 -1
- package/dist/components/ResponsibleGamingLimits/ResponsibleGamingLimitsForm.lazy.js +8 -4
- package/dist/components/ResponsibleGamingLimits/index.d.ts +1 -1
- package/dist/components/ResponsibleGamingLimits/index.js +1 -1
- package/dist/components/SignIn/HappyBingo/NameAndPasswordSignIn.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +4 -1
- package/dist/components/SignIn/SignIn.lazy.d.ts +1 -1
- package/dist/components/SignIn/SignIn.lazy.js +12 -0
- package/dist/components/SignIn/useSignIn.js +1 -1
- package/dist/components/SignUp/SignUpCrazyWin/SignUpCrazyWin.lazy.js +1 -1
- package/dist/components/SignUp/SignUpCrazyWin/SignUpCrazyWinContext.js +1 -1
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.d.ts +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +34 -0
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultFormInternational.js +20 -0
- package/dist/components/SignUp/SignUpHappyBingo/SignUpHappyBingoForm.js +3 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.HappyBingo.js +1 -1
- package/dist/components/Tournaments/TournamentsList/TournamentListItemTable.CrazyWin.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.suspense.js +1 -1
- package/dist/components/UpdateMobilePhoneNumber/components/Step1MobileNumberForm.js +1 -1
- package/dist/components/UpdateMobilePhoneNumber/hooks/useUpdateMobileFlow.js +1 -2
- package/dist/constants/PisoPayBanks.js +181 -181
- package/dist/handlers/index.d.ts +2 -2
- package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
- package/dist/schemas/forgotPasswordSchema.js +24 -7
- package/dist/services/account.d.ts +3 -0
- package/dist/services/account.js +1 -0
- package/dist/services/auth.d.ts +4 -0
- package/dist/services/auth.js +7 -0
- package/dist/utils/countries/getLocaleInfo.js +1 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SetOptional } from
|
|
2
|
-
import { type CreateGCashStandardCashInWithdrawalInput } from
|
|
3
|
-
import type { Mutation } from
|
|
4
|
-
export declare const useCreateGCashStandardCashInWithdrawalMutation: Mutation<string, SetOptional<CreateGCashStandardCashInWithdrawalInput,
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import { type CreateGCashStandardCashInWithdrawalInput } from '../../services/wallet';
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
|
+
export declare const useCreateGCashStandardCashInWithdrawalMutation: Mutation<string, SetOptional<CreateGCashStandardCashInWithdrawalInput, 'id'>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { useMutation } from
|
|
3
|
-
import invariant from
|
|
4
|
-
import { ObjectType } from
|
|
5
|
-
import { createGCashStandardCashInWithdrawal, } from
|
|
6
|
-
import { getCreateGCashStandardCashInWithdrawalMutationKey } from
|
|
7
|
-
import { getSession } from
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
|
+
import { createGCashStandardCashInWithdrawal, } from '../../services/wallet.js';
|
|
6
|
+
import { getCreateGCashStandardCashInWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useCreateGCashStandardCashInWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
10
10
|
...config,
|
|
@@ -12,7 +12,7 @@ export const useCreateGCashStandardCashInWithdrawalMutation = (config) => {
|
|
|
12
12
|
mutationFn: async (input) => {
|
|
13
13
|
const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
|
|
14
14
|
const session = await getSession();
|
|
15
|
-
invariant(session.status ===
|
|
15
|
+
invariant(session.status === 'authenticated');
|
|
16
16
|
await createGCashStandardCashInWithdrawal({ ...input, id }, {
|
|
17
17
|
headers: {
|
|
18
18
|
Authorization: `Bearer ${session.token}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SetOptional } from
|
|
2
|
-
import { type CreateGCashWithdrawalInput } from
|
|
3
|
-
import type { Mutation } from
|
|
4
|
-
export declare const useCreateGCashWithdrawalMutation: Mutation<string, SetOptional<CreateGCashWithdrawalInput,
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import { type CreateGCashWithdrawalInput } from '../../services/wallet';
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
|
+
export declare const useCreateGCashWithdrawalMutation: Mutation<string, SetOptional<CreateGCashWithdrawalInput, 'id'>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { useMutation } from
|
|
3
|
-
import invariant from
|
|
4
|
-
import { ObjectType } from
|
|
5
|
-
import { createGCashWithdrawal, } from
|
|
6
|
-
import { getCreateGCashWithdrawalMutationKey } from
|
|
7
|
-
import { getSession } from
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
|
+
import { createGCashWithdrawal, } from '../../services/wallet.js';
|
|
6
|
+
import { getCreateGCashWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useCreateGCashWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
10
10
|
...config,
|
|
@@ -12,7 +12,7 @@ export const useCreateGCashWithdrawalMutation = (config) => {
|
|
|
12
12
|
mutationFn: async (input) => {
|
|
13
13
|
const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
|
|
14
14
|
const session = await getSession();
|
|
15
|
-
invariant(session.status ===
|
|
15
|
+
invariant(session.status === 'authenticated');
|
|
16
16
|
await createGCashWithdrawal({ ...input, id }, {
|
|
17
17
|
headers: {
|
|
18
18
|
Authorization: `Bearer ${session.token}`,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type { FavoriteGame, Game, GameSession, Message } from '../../types';
|
|
1
|
+
import type { FavoriteGame, Game, GameSession, Message, SignInType } from '../../types';
|
|
2
2
|
export interface PopupStore {
|
|
3
3
|
open: boolean;
|
|
4
4
|
setOpen: (open: boolean) => void;
|
|
5
5
|
'~touched': boolean;
|
|
6
6
|
}
|
|
7
|
+
export interface SignInStore extends PopupStore {
|
|
8
|
+
prefillMobileNumber: string | null;
|
|
9
|
+
setPrefillMobileNumber: (value: string | null) => void;
|
|
10
|
+
pendingType: SignInType | null;
|
|
11
|
+
setPendingType: (type: SignInType | null) => void;
|
|
12
|
+
}
|
|
7
13
|
export type GameLaunchStore__Details = {
|
|
8
14
|
status: 'WAITING';
|
|
9
15
|
game?: null;
|
|
@@ -86,7 +92,7 @@ export interface BetDepositLimitReachedStore extends PopupStore {
|
|
|
86
92
|
}
|
|
87
93
|
export interface GlobalStore {
|
|
88
94
|
signUp: PopupStore;
|
|
89
|
-
signIn:
|
|
95
|
+
signIn: SignInStore;
|
|
90
96
|
forgotPassword: PopupStore;
|
|
91
97
|
disclaimer: PopupStore;
|
|
92
98
|
depositWithdrawal: DepositWithdrawalStore;
|
|
@@ -12,6 +12,26 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
12
12
|
},
|
|
13
13
|
}));
|
|
14
14
|
},
|
|
15
|
+
prefillMobileNumber: null,
|
|
16
|
+
setPrefillMobileNumber(value) {
|
|
17
|
+
set((prev) => ({
|
|
18
|
+
signIn: {
|
|
19
|
+
...prev.signIn,
|
|
20
|
+
prefillMobileNumber: value,
|
|
21
|
+
'~touched': true,
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
},
|
|
25
|
+
pendingType: null,
|
|
26
|
+
setPendingType(type) {
|
|
27
|
+
set((prev) => ({
|
|
28
|
+
signIn: {
|
|
29
|
+
...prev.signIn,
|
|
30
|
+
pendingType: type,
|
|
31
|
+
'~touched': true,
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
34
|
+
},
|
|
15
35
|
'~touched': false,
|
|
16
36
|
},
|
|
17
37
|
signUp: {
|
|
@@ -622,7 +642,13 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
622
642
|
set((state) => ({
|
|
623
643
|
...state,
|
|
624
644
|
signUp: { ...state.signUp, open: false, '~touched': false },
|
|
625
|
-
signIn: {
|
|
645
|
+
signIn: {
|
|
646
|
+
...state.signIn,
|
|
647
|
+
open: false,
|
|
648
|
+
prefillMobileNumber: null,
|
|
649
|
+
pendingType: null,
|
|
650
|
+
'~touched': false,
|
|
651
|
+
},
|
|
626
652
|
forgotPassword: {
|
|
627
653
|
...state.forgotPassword,
|
|
628
654
|
open: false,
|
|
@@ -72,7 +72,9 @@ async function executeGoogleFraudDefense(siteKey, action) {
|
|
|
72
72
|
}
|
|
73
73
|
window.grecaptcha.enterprise.ready(async () => {
|
|
74
74
|
try {
|
|
75
|
-
const token = await window.grecaptcha.enterprise.execute(siteKey, {
|
|
75
|
+
const token = await window.grecaptcha.enterprise.execute(siteKey, {
|
|
76
|
+
action,
|
|
77
|
+
});
|
|
76
78
|
resolve(token);
|
|
77
79
|
}
|
|
78
80
|
catch {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
|
-
import { redeemVoucher
|
|
3
|
+
import { redeemVoucher } from '../../services/wallet.js';
|
|
4
4
|
import { getRedeemVoucherMutationKey } from '../../utils/mutationKeys.js';
|
|
5
5
|
import { getSession } from '../services/getSession.js';
|
|
6
6
|
export const useRedeemVoucherMutation = (config) => {
|
|
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getRequireFirstDeposit } from '../../services/account.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import { getRequireFirstDepositQueryKey, getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
5
|
+
import { getRequireFirstDepositQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
6
6
|
import { getSession } from '../services/getSession.js';
|
|
7
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
8
8
|
export const useRequireFirstDepositQuery = (config) => {
|
|
@@ -32,5 +32,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
32
32
|
* - Integration with global store for deposit/withdrawal modals
|
|
33
33
|
*/
|
|
34
34
|
export const WalletExample = () => {
|
|
35
|
-
return (_jsxs("div", { className: "p-4", children: [_jsx("h2", { className:
|
|
35
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx("h2", { className: "mb-4 font-bold text-xl", children: "Wallet Component Example" }), _jsx("p", { className: "mb-4 text-gray-600", children: "The Wallet component is now available as a standalone component that you can use anywhere in your application." }), _jsxs("div", { className: "rounded-lg bg-gray-100 p-4", children: [_jsx("h3", { className: "mb-2 font-semibold", children: "Import:" }), _jsxs("code", { className: "block rounded bg-white p-2 text-sm", children: ["import ", `{ Wallet }`, " from '@opexa/portal-components/Account/Wallet';"] })] }), _jsxs("div", { className: "mt-4 rounded-lg bg-gray-100 p-4", children: [_jsx("h3", { className: "mb-2 font-semibold", children: "Usage:" }), _jsx("code", { className: "block rounded bg-white p-2 text-sm", children: `<Wallet classNames={{ walletActions: "custom-actions" }} />` })] })] }));
|
|
36
36
|
};
|
|
@@ -26,11 +26,11 @@ export function Wallet({ classNames = {} }) {
|
|
|
26
26
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('mt-3 overflow-hidden rounded-xl border border-border-primary', classNames.walletBalanceContainer), children: [_jsxs("div", { className: "bg-bg-tertiary p-xl", children: [_jsx("div", { className: twMerge('text-sm text-text-secondary-700', classNames.totalBalanceLabel), children: "Total Balance" }), _jsx("div", { className: twMerge('font-bold text-3xl', classNames.totalBalanceAmount), children: formatNumber(totalBalance, {
|
|
27
27
|
currency: localeInfo?.currency.code,
|
|
28
28
|
minDecimalPlaces: 2,
|
|
29
|
-
truncate: false
|
|
29
|
+
truncate: false,
|
|
30
30
|
}) }), _jsxs("div", { className: twMerge('mt-1.5 flex gap-7xl', classNames.balanceDetailsContainer), children: [_jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.depositBalanceLabel), children: "Deposit Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.depositBalanceAmount), children: formatNumber(depositBalance, {
|
|
31
31
|
currency: localeInfo?.currency.code,
|
|
32
32
|
minDecimalPlaces: 2,
|
|
33
|
-
truncate: false
|
|
33
|
+
truncate: false,
|
|
34
34
|
}) })] }), _jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.bonusBalanceLabel), children: "Bonus Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.bonusBalanceAmount), children: formatNumber(bonusBalance, {
|
|
35
35
|
currency: localeInfo?.currency.code,
|
|
36
36
|
minDecimalPlaces: 2,
|
|
@@ -13,7 +13,7 @@ import { z } from 'zod';
|
|
|
13
13
|
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
14
14
|
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
15
15
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
16
|
-
import { getLocale, extractPhoneCode } from '../../utils/countries/getLocaleInfo.js';
|
|
16
|
+
import { getLocale, extractPhoneCode, } from '../../utils/countries/getLocaleInfo.js';
|
|
17
17
|
import { useFacebookClientQuery } from '../../client/hooks/useFacebookClientQuery.js';
|
|
18
18
|
import { useGoogleClientIdQuery } from '../../client/hooks/useGoogleClientIdQuery.js';
|
|
19
19
|
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
@@ -7,5 +7,7 @@ import { Portal } from '../../../../ui/Portal/index.js';
|
|
|
7
7
|
import { useQRPHDepositContext } from './QRPHDepositContext.js';
|
|
8
8
|
export function Failed() {
|
|
9
9
|
const context = useQRPHDepositContext();
|
|
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 ||
|
|
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" })] }) })] }) }));
|
|
11
13
|
}
|
|
@@ -68,7 +68,7 @@ export function Voucher() {
|
|
|
68
68
|
const last = values.at(-1);
|
|
69
69
|
if (last)
|
|
70
70
|
field.onChange(last);
|
|
71
|
-
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: channels.map((channel) => (_jsxs(Checkbox.Root, { value: channel.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsx(Image, { src: channel.image, alt: "", width: 100, height: 25, loading: "lazy", className: twMerge('w-auto', 'h-[2.8rem]'), draggable: false }), _jsx(Checkbox.Control, { className: "ml-auto", children: _jsx(Checkbox.Indicator, {}) }), _jsx(Checkbox.HiddenInput, {})] }, channel.value))) })) })] }), _jsxs("section", { className:
|
|
71
|
+
}, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: channels.map((channel) => (_jsxs(Checkbox.Root, { value: channel.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsx(Image, { src: channel.image, alt: "", width: 100, height: 25, loading: "lazy", className: twMerge('w-auto', 'h-[2.8rem]'), draggable: false }), _jsx(Checkbox.Control, { className: "ml-auto", children: _jsx(Checkbox.Indicator, {}) }), _jsx(Checkbox.HiddenInput, {})] }, channel.value))) })) })] }), _jsxs("section", { className: "my-5", children: [_jsx(Field.Label, { asChild: true, children: _jsx("div", { children: "Voucher Code" }) }), _jsx(Controller, { control: control, name: "voucherCode", render: ({ field }) => {
|
|
72
72
|
return (_jsxs(Field.Root, { invalid: !!errors, children: [_jsx(Field.Input, { ...field, placeholder: "Enter your Voucher code", onChange: (e) => {
|
|
73
73
|
redeemVoucherMutation.reset();
|
|
74
74
|
field.onChange(e.target.value.toUpperCase());
|
|
@@ -82,5 +82,5 @@ function SuccessfulRedemptionModal({ open, onClose, }) {
|
|
|
82
82
|
return (_jsx(Dialog.Root, { unmountOnExit: true, open: open, onOpenChange: (isOpen) => {
|
|
83
83
|
if (!isOpen)
|
|
84
84
|
onClose();
|
|
85
|
-
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)]", children: _jsxs(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto px-4 py-3xl lg:h-auto lg:max-h-[80vh] lg:w-[480px] lg:rounded-xl", children: [_jsx(Dialog.Header, { className: "text-center", children: _jsx(Dialog.Title, { className: "flex grow items-center justify-center font-semibold", children: _jsx(CelebrationIcon, { className: "text-6xl" }) }) }), _jsx(Dialog.Body, { className: "mt-4", children: _jsx("p", { className:
|
|
85
|
+
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)]", children: _jsxs(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto px-4 py-3xl lg:h-auto lg:max-h-[80vh] lg:w-[480px] lg:rounded-xl", children: [_jsx(Dialog.Header, { className: "text-center", children: _jsx(Dialog.Title, { className: "flex grow items-center justify-center font-semibold", children: _jsx(CelebrationIcon, { className: "text-6xl" }) }) }), _jsx(Dialog.Body, { className: "mt-4", children: _jsx("p", { className: "text-center font-bold", children: "Voucher successfully redeemed." }) }), _jsx(Dialog.Footer, { className: "mt-6", children: _jsx(Button, { className: "w-full", onClick: onClose, children: "OK" }) })] }) })] }) }));
|
|
86
86
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export const definition = z.object({
|
|
3
3
|
voucherChannel: z.string().optional().nullable(),
|
|
4
|
-
voucherCode: z
|
|
4
|
+
voucherCode: z
|
|
5
|
+
.string()
|
|
5
6
|
.regex(/^[A-Z0-9-_]+$/, 'Voucher code can only contain uppercase letters, numbers, hyphens, and underscores'),
|
|
6
7
|
});
|
|
@@ -37,6 +37,6 @@ export function DepositWithdrawalTrigger({ asChild, children, colorScheme = 'pri
|
|
|
37
37
|
: 'border-border-dark bg-bg-dark text-dark-text'), children: formatNumber(totalBalance, {
|
|
38
38
|
currency: localeInfo.currency.code,
|
|
39
39
|
minDecimalPlaces: 2,
|
|
40
|
-
truncate: false
|
|
40
|
+
truncate: false,
|
|
41
41
|
}) }), _jsx("div", { className: "flex h-10 items-center gap-1.5 rounded-r-md bg-button-primary-bg px-3.5 font-semibold text-button-primary-fg text-sm", children: label })] })) }));
|
|
42
42
|
}
|
|
@@ -132,7 +132,7 @@ const OPTIONS = [
|
|
|
132
132
|
value: 'VOUCHER',
|
|
133
133
|
label: 'Voucher',
|
|
134
134
|
image: voucherIcon,
|
|
135
|
-
}
|
|
135
|
+
},
|
|
136
136
|
];
|
|
137
137
|
export function PaymentMethods(props) {
|
|
138
138
|
const options = useMemo(() => props.options?.length
|
|
@@ -156,6 +156,6 @@ export function PaymentMethods(props) {
|
|
|
156
156
|
? 'h-[2.5rem]'
|
|
157
157
|
: '', (option.value === 'AIO_GRAB_PAY' ||
|
|
158
158
|
option.value === 'AURIX_PAY_GRAB_PAY') &&
|
|
159
|
-
'h-[3rem] rounded-[4px]', option.value === 'AIO_PALAWAN_PAY' && 'h-[2rem]' ||
|
|
160
|
-
option.value ===
|
|
159
|
+
'h-[3rem] rounded-[4px]', (option.value === 'AIO_PALAWAN_PAY' && 'h-[2rem]') ||
|
|
160
|
+
(option.value === 'VOUCHER' && 'h-[2rem]')), draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
|
|
161
161
|
}
|
|
@@ -6,6 +6,6 @@ import { Dialog } from '../../../ui/Dialog/index.js';
|
|
|
6
6
|
import CWForgotPasswordForm from './CWForgotPasswordForm.js';
|
|
7
7
|
import styles from './ForgotPassword.module.css';
|
|
8
8
|
const ForgotPassword = ({ logo }) => {
|
|
9
|
-
return (_jsx(Dialog.Content, { className: "overflow-y-invisible top-0 left-0 flex h-full w-full items-center bg-transparent", children: _jsxs("div", { className: "flex h-[90dvh] w-full flex-col justify-center scroll-smooth", children: [_jsxs("div", { className: "relative mx-auto w-full max-w-[22.5rem]", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto mt-8 h-auto w-[12.04544rem]", draggable: false }), _jsx(Dialog.CloseTrigger, { className:
|
|
9
|
+
return (_jsx(Dialog.Content, { className: "overflow-y-invisible top-0 left-0 flex h-full w-full items-center bg-transparent", children: _jsxs("div", { className: "flex h-[90dvh] w-full flex-col justify-center scroll-smooth", children: [_jsxs("div", { className: "relative mx-auto w-full max-w-[22.5rem]", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto mt-8 h-auto w-[12.04544rem]", draggable: false }), _jsx(Dialog.CloseTrigger, { className: "h-fit w-fit rounded-md bg-gradient-to-t from-[#FFE5AF] to-[#EAC467] p-0.5 text-[#6C5200]", children: _jsx(XIcon, {}) })] }), _jsx("h2", { className: "mx-auto mt-10 w-fit bg-[linear-gradient(50deg,#c7802d_-5.1%,#ffe585_44.95%,#c7802d_109.05%)] bg-clip-text font-bold text-2xl text-transparent uppercase", children: "Forgot Password" }), _jsx("div", { className: twMerge('mx-auto mt-7.5 max-w-[20.6875rem] p-7.5', styles.card), children: _jsx(CWForgotPasswordForm, {}) })] }) }));
|
|
10
10
|
};
|
|
11
11
|
export default ForgotPassword;
|
|
@@ -59,15 +59,15 @@ const CWForgotPasswordForm = () => {
|
|
|
59
59
|
verificationCode: data.verificationCode,
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
|
-
return (_jsx("form", { autoComplete:
|
|
62
|
+
return (_jsx("form", { autoComplete: "off", onSubmit: handleSubmit(onSubmit), children: _jsxs("div", { className: "space-y-4", children: [_jsxs(Field.Root, { invalid: !!errors.mobileNumber, children: [_jsx(Field.Label, { className: "text-xs", children: "Phone Number" }), _jsxs("div", { className: "relative flex h-10 gap-3", children: [_jsxs("div", { className: "flex h-full items-center gap-2 rounded-full bg-black/40 px-3.5 text-xs", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { className: commonInputClass, placeholder: "Enter Phone Number", ...register('mobileNumber') })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!errors.password, children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-xs", children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { className: "relative flex h-10 items-center rounded-full border-0 bg-black/40 text-xs", children: [_jsx(Image, { src: lockIcon, alt: "lock icon", width: 20, height: 20, className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 h-5 w-5" }), _jsx(PasswordInput.Input, { className: "pl-10", placeholder: "8 - 20 characters", ...register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, { className: "text-white/50" }), asChild: true, children: _jsx(EyeIcon, { className: "text-white/50" }) }) })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.password?.message })] })] }) }), _jsx(Field.Root, { invalid: !!errors.confirmPassword, children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-xs", children: "Confirm Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { className: "relative flex h-10 items-center rounded-full border-0 bg-black/40 text-xs", children: [_jsx(Image, { src: lockIcon, alt: "lock icon", width: 20, height: 20, className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 h-5 w-5" }), _jsx(PasswordInput.Input, { className: "pl-10", placeholder: "8 - 20 characters", ...register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, { className: "text-white/50" }), asChild: true, children: _jsx(EyeIcon, { className: "text-white/50" }) }) })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.confirmPassword?.message })] })] }) }), _jsxs(Field.Root, { invalid: !!errors.verificationCode, children: [_jsx(Field.Label, { className: "text-xs", children: "OTP Code" }), _jsxs("div", { className: "relative", children: [_jsx(Field.Input, { className: twMerge(commonInputClass, 'pr-[5.75rem]'), placeholder: "Enter OTP Code", ...register('verificationCode') }), _jsx(Button, { type: "button", className: "-translate-y-1/2 absolute top-1/2 right-1 h-fit w-fit rounded-full bg-[linear-gradient(89deg,#c7802d_-15.91%,#ffe585_28.75%,#ffeca6_49.46%,#c7802d_112.69%)] py-[0.375rem] text-sm shadow-[inset_0px_-1px_2px_1px_#fff7e1]", disabled: !mobileNumberValue || !!errors.mobileNumber || cooldown.cooling, onClick: async () => {
|
|
63
63
|
if (!cooldown.cooling) {
|
|
64
64
|
await sendVerificationCodeMutation.mutateAsync({
|
|
65
65
|
channel: 'SMS',
|
|
66
|
-
recipient: mobileNumberParser.format(getValues('mobileNumber'))
|
|
66
|
+
recipient: mobileNumberParser.format(getValues('mobileNumber')),
|
|
67
67
|
});
|
|
68
68
|
cooldown.start();
|
|
69
69
|
toaster.success({
|
|
70
|
-
description: `OTP sent to ${getValues('mobileNumber')}
|
|
70
|
+
description: `OTP sent to ${getValues('mobileNumber')}`,
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
}, children: cooldown.cooling ? cooldown.countdown : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-7.5 rounded-full bg-[linear-gradient(89deg,#c7802d_-15.91%,#ffe585_28.75%,#ffeca6_49.46%,#c7802d_112.69%)] text-sm shadow-[inset_0px_-1px_2px_1px_#fff7e1]", fullWidth: true, disabled: !isValid || !isDirty, children: "Change Password" })] }) }));
|
|
@@ -26,8 +26,10 @@ export function ForgotPassword(props) {
|
|
|
26
26
|
});
|
|
27
27
|
}, [props.layout]);
|
|
28
28
|
const Body = {
|
|
29
|
-
crazywin:
|
|
30
|
-
default: (_jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.layout === 'happybingo'
|
|
29
|
+
crazywin: _jsx(CrazywinForgotPassword, { logo: props.logo }),
|
|
30
|
+
default: (_jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.layout === 'happybingo'
|
|
31
|
+
? 'bg-white dark:bg-[#0C111D]'
|
|
32
|
+
: 'bg-bg-primary-alt', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(ForgotPasswordForm, { layout: props.layout }) })] })),
|
|
31
33
|
};
|
|
32
34
|
return (_jsx(Dialog.Root, { open: globalStore.forgotPassword.open, onOpenChange: (details) => {
|
|
33
35
|
globalStore.forgotPassword.setOpen(details.open);
|
|
@@ -49,10 +49,16 @@ export function ForgotPasswordForm({ layout }) {
|
|
|
49
49
|
const base = z.object({
|
|
50
50
|
mobileNumber: z.string().superRefine((v, ctx) => {
|
|
51
51
|
if (!mobileNumberParser.validate(v)) {
|
|
52
|
-
ctx.addIssue({
|
|
52
|
+
ctx.addIssue({
|
|
53
|
+
code: z.ZodIssueCode.custom,
|
|
54
|
+
message: 'Invalid mobile number',
|
|
55
|
+
});
|
|
53
56
|
}
|
|
54
57
|
}),
|
|
55
|
-
newPassword: z
|
|
58
|
+
newPassword: z
|
|
59
|
+
.string()
|
|
60
|
+
.min(8, 'Password must be 8 or more characters')
|
|
61
|
+
.max(100),
|
|
56
62
|
confirmPassword: z.string().min(1, 'Confirm your password'),
|
|
57
63
|
verificationCode: includeOtp
|
|
58
64
|
? z.string().refine((v) => /^\d{4,6}$/.test(v), 'Invalid OTP')
|
|
@@ -103,8 +109,10 @@ export function ForgotPasswordForm({ layout }) {
|
|
|
103
109
|
});
|
|
104
110
|
const form2Ref = useRef(null);
|
|
105
111
|
const Header = {
|
|
106
|
-
1: (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Forgot Password" }), _jsx("p", { className: twMerge('mt-xs text-center text-sm', layout === 'happybingo'
|
|
107
|
-
|
|
112
|
+
1: (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Forgot Password" }), _jsx("p", { className: twMerge('mt-xs text-center text-sm', layout === 'happybingo'
|
|
113
|
+
? 'text-[#475467] dark:text-[#94969C]'
|
|
114
|
+
: 'text-text-secondary-700'), children: "Your new password will be used to sign in." })] })),
|
|
115
|
+
2: (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] })] })),
|
|
108
116
|
};
|
|
109
117
|
if (layout === 'happybingo') {
|
|
110
118
|
return (_jsxs(_Fragment, { children: [Header[step], _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
@@ -113,9 +121,11 @@ export function ForgotPasswordForm({ layout }) {
|
|
|
113
121
|
newPassword: step1Form.getValues('newPassword'),
|
|
114
122
|
verificationCode: step1Form.getValues('verificationCode'),
|
|
115
123
|
});
|
|
116
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { className:
|
|
124
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { className: "text-[#344054] dark:text-[#CECFD2]", children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { className: "border-[#D0D5DD] bg-transparent dark:border-[#333741]", style: {
|
|
117
125
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
118
|
-
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className:
|
|
126
|
+
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.newPassword, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-[#344054] dark:text-[#CECFD2]", children: "New Password" }), _jsxs(PasswordInput.Control, { className: "border-[#D0D5DD] bg-transparent dark:border-[#333741]", children: [_jsx(PasswordInput.Input, { placeholder: "Enter your new password", ...step1Form.register('newPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.newPassword?.message })] }) }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.confirmPassword, className: "mt-xl bg-transparent", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { className: "text-[#344054] dark:text-[#CECFD2]", children: "Confirm Password" }), _jsxs(PasswordInput.Control, { className: "border-[#D0D5DD] bg-transparent dark:border-[#333741]", children: [_jsx(PasswordInput.Input, { placeholder: "Confirm new password", ...step1Form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.confirmPassword?.message })] }) }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.verificationCode, className: "mt-xl bg-transparent", children: [_jsx(Field.Label, { className: "text-[#344054] dark:text-[#CECFD2]", children: "OTP Code" }), _jsxs("div", { className: "grid grid-cols-[1fr_104px] gap-2", children: [_jsx(Field.Input, { placeholder: "Enter OTP Code", ...step1Form.register('verificationCode'), className: "border-[#D0D5DD] bg-transparent dark:border-[#333741]" }), _jsx(Button, { variant: "outline", className: "bg-transparent", type: "button", disabled: !mobileNumberValue ||
|
|
127
|
+
!!step1Form.formState.errors.mobileNumber ||
|
|
128
|
+
cooldown.cooling, onClick: async () => {
|
|
119
129
|
if (!cooldown.cooling) {
|
|
120
130
|
try {
|
|
121
131
|
await sendVerificationCodeMutation.mutateAsync({
|
|
@@ -132,7 +142,9 @@ export function ForgotPasswordForm({ layout }) {
|
|
|
132
142
|
});
|
|
133
143
|
}
|
|
134
144
|
}
|
|
135
|
-
}, children: cooldown.cooling ? `${cooldown.countdown} sec` : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: step1Form.formState.errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting ||
|
|
145
|
+
}, children: cooldown.cooling ? `${cooldown.countdown} sec` : 'Get OTP' })] }), _jsx(Field.ErrorText, { className: "text-[#ff2525b3] text-xs", children: step1Form.formState.errors.verificationCode?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting ||
|
|
146
|
+
!step1Form.formState.isValid ||
|
|
147
|
+
!step1Form.formState.isDirty, children: "Set up New Password" })] })] }));
|
|
136
148
|
}
|
|
137
149
|
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [Header[step], _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
138
150
|
try {
|
|
@@ -35,7 +35,7 @@ export function GameExit(props) {
|
|
|
35
35
|
}
|
|
36
36
|
return (_jsx(Dialog.Root, { open: isOpen, onOpenChange: (details) => {
|
|
37
37
|
setIsOpen(details.open);
|
|
38
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: twMerge('relative flex h-full w-full flex-col items-center overflow-hidden rounded-2xl p-8 shadow-2xl', 'lg:mx-auto lg:h-auto lg:max-h-[90vh] lg:w-[480px] lg:p-10', 'fade-in-0 zoom-in-95 animate-in duration-300'), children: [props.logo && (_jsx("div", { className: "w-full", children: _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "h-auto w-[7.5rem]", draggable: false }) })), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "mt-3xl text-center font-semibold text-brand-400 text-lg", children: "Game Exit" }), _jsx(Dialog.Description, { className:
|
|
38
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: twMerge('relative flex h-full w-full flex-col items-center overflow-hidden rounded-2xl p-8 shadow-2xl', 'lg:mx-auto lg:h-auto lg:max-h-[90vh] lg:w-[480px] lg:p-10', 'fade-in-0 zoom-in-95 animate-in duration-300'), children: [props.logo && (_jsx("div", { className: "w-full", children: _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "h-auto w-[7.5rem]", draggable: false }) })), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "mt-3xl text-center font-semibold text-brand-400 text-lg", children: "Game Exit" }), _jsx(Dialog.Description, { className: "mt-lg mb-lg px-4 text-center leading-2xl", children: props.message ||
|
|
39
39
|
'You have successfully quit the game. Thank you for playing!' })] }), _jsx(Dialog.Context, { children: (api) => (_jsx(Button, { type: "button", className: "mt-3 py-2.5", onClick: () => {
|
|
40
40
|
handleClose();
|
|
41
41
|
api.setOpen(false);
|
|
@@ -51,7 +51,7 @@ export function GamesPagination({ currentPage, totalPages, onPageChange, sibling
|
|
|
51
51
|
if (currentPage === 0 || (paginationRange && paginationRange.length < 2)) {
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
return (_jsx("div", { className:
|
|
54
|
+
return (_jsx("div", { className: "mx-10 flex items-center justify-center", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "w-fit rounded-md border-transparent", onClick: handlePrevious, disabled: currentPage === 1, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-6" }) }), paginationRange?.map((pageNumber, index) => {
|
|
55
55
|
if (pageNumber === DOTS) {
|
|
56
56
|
return (_jsx("span", { className: "flex h-10 w-10 items-center justify-center text-sm text-text-secondary", children: "..." }, `dots-${index}`));
|
|
57
57
|
}
|
|
@@ -30,7 +30,7 @@ import { useJackpotsCarouselItemContext } from './JackpotsCarouselContext.js';
|
|
|
30
30
|
export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = true, customJackpotChestImage, chestImagesByTier, jackpotProfileShape = 'oval', }) {
|
|
31
31
|
const [ref, inView] = useIntersectionObserver({
|
|
32
32
|
threshold: 0.5,
|
|
33
|
-
rootMargin: '50px'
|
|
33
|
+
rootMargin: '50px',
|
|
34
34
|
});
|
|
35
35
|
const jackpot = useJackpotsCarouselItemContext();
|
|
36
36
|
const getTierFromName = useCallback((name) => {
|
|
@@ -68,7 +68,12 @@ export function JackpotsCarouselItem({ style, className, viewAllUrl, animate = t
|
|
|
68
68
|
closed: closeChest,
|
|
69
69
|
style: undefined,
|
|
70
70
|
};
|
|
71
|
-
}, [
|
|
71
|
+
}, [
|
|
72
|
+
chestImagesByTier,
|
|
73
|
+
customJackpotChestImage,
|
|
74
|
+
jackpot.name,
|
|
75
|
+
getTierFromName,
|
|
76
|
+
]);
|
|
72
77
|
const jackpotPayoutsQuery = useJackpotPayoutsQuery({
|
|
73
78
|
first: 30,
|
|
74
79
|
filter: {
|
|
@@ -195,7 +200,7 @@ function getPercentage(value, total) {
|
|
|
195
200
|
return t === 0 ? 0 : (v / t) * 100;
|
|
196
201
|
}
|
|
197
202
|
// Memoized table row component to reduce re-renders (TBT optimization)
|
|
198
|
-
const PayoutRow = memo(({ payout, className, localeInfo }) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: mask(payout.member.name, {
|
|
203
|
+
const PayoutRow = memo(({ payout, className, localeInfo, }) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: mask(payout.member.name, {
|
|
199
204
|
totalCharsCount: 6,
|
|
200
205
|
}) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: capitalize(payout.game?.provider ?? '-', {
|
|
201
206
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
@@ -68,7 +68,7 @@ export function JackpotMultiStageDesktop({ animate = true, customJackpotChestIma
|
|
|
68
68
|
const OverallProgressBar = () => {
|
|
69
69
|
return (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-[0.3125rem] flex items-center justify-between font-semibold text-sm text-text-primary-900", children: [_jsx("p", { children: "Overall Progress" }), overallPercentage, "%"] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: overallPercentage, children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsx(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }) }) }) })] }));
|
|
70
70
|
};
|
|
71
|
-
const RecentPayoutsTable = () => (_jsx("div", { className: twMerge('max-h-[17rem] overflow-y-scroll rounded-xl', styles.scrollArea), children: _jsx("div", { className:
|
|
71
|
+
const RecentPayoutsTable = () => (_jsx("div", { className: twMerge('max-h-[17rem] overflow-y-scroll rounded-xl', styles.scrollArea), children: _jsx("div", { className: "rounded-xl border-gray-200", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsx("tr", { className: twMerge('h-8 whitespace-nowrap bg-bg-secondary text-left font-medium text-text-tertiary-600 text-xs', className?.recentPayoutsTableHeadRow), children: ['Stage', 'Player', 'Turnover Target', 'Prize', 'Timestamp'].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpot.stages
|
|
72
72
|
? jackpot.stages.map((j, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: i + 1 }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: j.member?.name
|
|
73
73
|
? maskFirstLast(j.member.name, {
|
|
74
74
|
firstCharsCount: 3,
|
|
@@ -167,7 +167,8 @@ export function KYCReminder({ enablePendingKycReminder = false, ...props }) {
|
|
|
167
167
|
router.push('/');
|
|
168
168
|
}, children: "Log Out" }) })] })), isPending &&
|
|
169
169
|
!isVerificationLocked &&
|
|
170
|
-
(enablePendingKycReminder || globalStore.kycReminder.open) && (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-primary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "VERIFICATION IN PROGRESS" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account verification is currently under review. Please wait for approval to regain full access to this platform." }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo?.logo ?? pagcorLogo, alt: "PAGCOR logo", height: 88, width: 88, className: `h-[88px] w-auto shrink-0 ${props.pagcorLogo?.styles ?? ''}`, draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo?.logo ??
|
|
170
|
+
(enablePendingKycReminder || globalStore.kycReminder.open) && (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-primary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "VERIFICATION IN PROGRESS" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account verification is currently under review. Please wait for approval to regain full access to this platform." }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo?.logo ?? pagcorLogo, alt: "PAGCOR logo", height: 88, width: 88, className: `h-[88px] w-auto shrink-0 ${props.pagcorLogo?.styles ?? ''}`, draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo?.logo ??
|
|
171
|
+
responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: `h-[50px] w-auto shrink-0 ${props.responsibleGamingLogo?.styles ?? ''}`, draggable: false, unoptimized: true })] }), _jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { className: "bg-transparent text-text-brand-primary-600", onClick: async () => {
|
|
171
172
|
if (Capacitor.isNativePlatform()) {
|
|
172
173
|
const session = await getQueryClient().fetchQuery({
|
|
173
174
|
queryKey: getSessionQueryKey(),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
4
4
|
import Link from 'next/link';
|
|
5
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import { useCallback, useEffect, useState, } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
8
8
|
import { ArrowRightIcon } from '../../icons/ArrowRightIcon.js';
|
|
@@ -56,7 +56,8 @@ export function ResponsibleGamingLimitsForm() {
|
|
|
56
56
|
: null,
|
|
57
57
|
used: wallet?.dailyTotalBet ?? 0,
|
|
58
58
|
resetsLabel: 'Resets daily',
|
|
59
|
-
active: (optimisticOverrides['Bet-daily'] ??
|
|
59
|
+
active: (optimisticOverrides['Bet-daily'] ??
|
|
60
|
+
Number(account?.dailyBetLimit ?? 0)) > 0,
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
period: 'monthly',
|
|
@@ -68,7 +69,8 @@ export function ResponsibleGamingLimitsForm() {
|
|
|
68
69
|
: null,
|
|
69
70
|
used: wallet?.monthlyTotalBet ?? 0,
|
|
70
71
|
resetsLabel: 'Resets on the 1st of every month',
|
|
71
|
-
active: (optimisticOverrides['Bet-monthly'] ??
|
|
72
|
+
active: (optimisticOverrides['Bet-monthly'] ??
|
|
73
|
+
Number(account?.monthlyBetLimit ?? 0)) > 0,
|
|
72
74
|
},
|
|
73
75
|
];
|
|
74
76
|
const depositLimits = [
|
|
@@ -82,7 +84,8 @@ export function ResponsibleGamingLimitsForm() {
|
|
|
82
84
|
: null,
|
|
83
85
|
used: wallet?.dailyTotalDeposit ?? 0,
|
|
84
86
|
resetsLabel: 'Resets daily',
|
|
85
|
-
active: (optimisticOverrides['Deposit-daily'] ??
|
|
87
|
+
active: (optimisticOverrides['Deposit-daily'] ??
|
|
88
|
+
Number(account?.dailyDepositLimit ?? 0)) > 0,
|
|
86
89
|
},
|
|
87
90
|
{
|
|
88
91
|
period: 'monthly',
|
|
@@ -94,7 +97,8 @@ export function ResponsibleGamingLimitsForm() {
|
|
|
94
97
|
: null,
|
|
95
98
|
used: wallet?.monthlyTotalDeposit ?? 0,
|
|
96
99
|
resetsLabel: 'Resets on the 1st of every month',
|
|
97
|
-
active: (optimisticOverrides['Deposit-monthly'] ??
|
|
100
|
+
active: (optimisticOverrides['Deposit-monthly'] ??
|
|
101
|
+
Number(account?.monthlyDepositLimit ?? 0)) > 0,
|
|
98
102
|
},
|
|
99
103
|
];
|
|
100
104
|
const limits = activeTab === 'Bet' ? betLimits : depositLimits;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './ResponsibleGamingLimits';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './ResponsibleGamingLimits.js';
|