@opexa/portal-components 0.0.260 → 0.0.262
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/useCreateVentajaWithdrawalMutation.d.ts +2 -2
- package/dist/client/hooks/useCreateVentajaWithdrawalMutation.js +5 -5
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +2 -2
- package/dist/components/Disclaimer/Disclaimer.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +6 -4
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/utils.js +18 -18
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/services/queries.d.ts +2 -2
- package/dist/services/queries.js +2570 -2568
- package/dist/services/wallet.d.ts +5 -5
- package/dist/services/wallet.js +6 -5
- package/dist/styles/theme.css +694 -694
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/utils/mutationKeys.d.ts +1 -1
- package/dist/utils/mutationKeys.js +1 -4
- package/package.json +166 -166
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -40
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -35
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -20
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpForm.js +0 -284
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/resizeImageSize.d.ts +0 -2
- package/dist/utils/resizeImageSize.js +0 -11
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { createListCollection, parseDate } from '@ark-ui/react';
|
|
4
|
-
import { useDialogContext } from '@ark-ui/react/dialog';
|
|
5
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
6
|
-
import { ObjectId } from '@opexa/object-id';
|
|
7
|
-
import { differenceInYears, format } from 'date-fns';
|
|
8
|
-
import Image from 'next/image';
|
|
9
|
-
import Link from 'next/link';
|
|
10
|
-
import { useSearchParams } from 'next/navigation';
|
|
11
|
-
import { useEffect, useRef, useState } from 'react';
|
|
12
|
-
import { Controller, useForm } from 'react-hook-form';
|
|
13
|
-
import { z } from 'zod';
|
|
14
|
-
import { useShallow } from 'zustand/shallow';
|
|
15
|
-
import { useControllableState } from '../../../client/hooks/useControllableState.js';
|
|
16
|
-
import { useCooldown } from '../../../client/hooks/useCooldown.js';
|
|
17
|
-
import { useCreateMemberVerificationMutation } from '../../../client/hooks/useCreateMemberVerificationMutation.js';
|
|
18
|
-
import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
|
|
19
|
-
import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
|
|
20
|
-
import { useMemberVerificationQuery } from '../../../client/hooks/useMemberVerificationQuery.js';
|
|
21
|
-
import { useMobileNumberParser } from '../../../client/hooks/useMobileNumberParser.js';
|
|
22
|
-
import { useSendVerificationCodeMutation } from '../../../client/hooks/useSendVerificationCodeMutation.js';
|
|
23
|
-
import { useSignInMutation } from '../../../client/hooks/useSignInMutation.js';
|
|
24
|
-
import { useSignUpMutation } from '../../../client/hooks/useSignUpMutation.js';
|
|
25
|
-
import { useUpdateAccountMutation } from '../../../client/hooks/useUpdateAccountMutation.js';
|
|
26
|
-
import { useUpdateMemberVerificationMutation } from '../../../client/hooks/useUpdateMemberVerificationMutation.js';
|
|
27
|
-
import { useUploadImageFileMutation } from '../../../client/hooks/useUploadImageFileMutation.js';
|
|
28
|
-
import { toaster } from '../../../client/utils/toaster.js';
|
|
29
|
-
import { BRANCHES } from '../../../constants/index.js';
|
|
30
|
-
import { ArrowLeftIcon } from '../../../icons/ArrowLeftIcon.js';
|
|
31
|
-
import { CalendarIcon } from '../../../icons/CalendarIcon.js';
|
|
32
|
-
import { CheckIcon } from '../../../icons/CheckIcon.js';
|
|
33
|
-
import { ChevronDownIcon } from '../../../icons/ChevronDownIcon.js';
|
|
34
|
-
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
35
|
-
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
36
|
-
import pagcorLogo from '../../../images/pagcor.png';
|
|
37
|
-
import responsibleGamingLogo from '../../../images/responsible-gaming.png';
|
|
38
|
-
import { ObjectType } from '../../../services/ObjectType.js';
|
|
39
|
-
import { Button } from '../../../ui/Button/index.js';
|
|
40
|
-
import { Checkbox } from '../../../ui/Checkbox/index.js';
|
|
41
|
-
import { DatePicker } from '../../../ui/DatePicker/index.js';
|
|
42
|
-
import { Field } from '../../../ui/Field/index.js';
|
|
43
|
-
import { PinInput } from '../../../ui/PinInput/index.js';
|
|
44
|
-
import { Select } from '../../../ui/Select/index.js';
|
|
45
|
-
import { createPoll } from '../../../utils/createPoll.js';
|
|
46
|
-
import { getQueryClient } from '../../../utils/getQueryClient.js';
|
|
47
|
-
import { getMemberVerificationQueryKey } from '../../../utils/queryKeys.js';
|
|
48
|
-
import ImageUploader from './ImageUploader.js';
|
|
49
|
-
import { useSignUpPagcorPropsContext } from './SignUpPagcorContext.js';
|
|
50
|
-
export function SignUpFormPagcor() {
|
|
51
|
-
const props = useSignUpPagcorPropsContext();
|
|
52
|
-
const branchCollection = createListCollection({
|
|
53
|
-
items: props.branches ?? BRANCHES,
|
|
54
|
-
itemToValue: (item) => item.code,
|
|
55
|
-
itemToString: (item) => `${item.code} - ${item.name}`,
|
|
56
|
-
});
|
|
57
|
-
const [step, setStep] = useState(1);
|
|
58
|
-
const dialog = useDialogContext();
|
|
59
|
-
const search = useSearchParams();
|
|
60
|
-
const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
|
|
61
|
-
const signUpMutation = useSignUpMutation();
|
|
62
|
-
const signInMutation = useSignInMutation();
|
|
63
|
-
const updateAccountMutation = useUpdateAccountMutation();
|
|
64
|
-
const sendVerificationCodeMutation = useSendVerificationCodeMutation();
|
|
65
|
-
const localeInfo = useLocaleInfo();
|
|
66
|
-
const mobileNumberParser = useMobileNumberParser();
|
|
67
|
-
const fileSchema = z
|
|
68
|
-
.instanceof(File)
|
|
69
|
-
.refine((file) => file.size > 0, {
|
|
70
|
-
message: 'File is required.',
|
|
71
|
-
})
|
|
72
|
-
.refine((file) => file.type.startsWith('image/'), {
|
|
73
|
-
message: 'File must be an image.',
|
|
74
|
-
});
|
|
75
|
-
const Step1Definition = z.object({
|
|
76
|
-
name: z
|
|
77
|
-
.string()
|
|
78
|
-
.min(8, 'Username must be 8 or more characters')
|
|
79
|
-
.max(30, 'Username must not be more than 30 characters')
|
|
80
|
-
.trim(),
|
|
81
|
-
password: z
|
|
82
|
-
.string()
|
|
83
|
-
.min(8, 'Password must be 8 or more characters')
|
|
84
|
-
.max(30, 'Password must not be more than 30 characters')
|
|
85
|
-
.trim(),
|
|
86
|
-
mobileNumber: z
|
|
87
|
-
.string()
|
|
88
|
-
.min(1, 'Mobile number is required')
|
|
89
|
-
.superRefine((v, ctx) => {
|
|
90
|
-
if (!mobileNumberParser.validate(v)) {
|
|
91
|
-
ctx.addIssue({
|
|
92
|
-
code: z.ZodIssueCode.custom,
|
|
93
|
-
message: 'Invalid mobile number',
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}),
|
|
97
|
-
firstName: z
|
|
98
|
-
.string()
|
|
99
|
-
.min(2, 'First name must be 2 or more characters')
|
|
100
|
-
.max(50, 'First name must not be more than 50 characters')
|
|
101
|
-
.trim(),
|
|
102
|
-
middleName: z
|
|
103
|
-
.string()
|
|
104
|
-
.min(2, 'First name must be 2 or more characters')
|
|
105
|
-
.max(50, 'First name must not be more than 50 characters')
|
|
106
|
-
.trim(),
|
|
107
|
-
lastName: z
|
|
108
|
-
.string()
|
|
109
|
-
.min(2, 'First name must be 2 or more characters')
|
|
110
|
-
.max(50, 'First name must not be more than 50 characters')
|
|
111
|
-
.trim(),
|
|
112
|
-
birthDay: z
|
|
113
|
-
.date({
|
|
114
|
-
invalid_type_error: 'Date of birth is required',
|
|
115
|
-
required_error: 'Date of birth is required',
|
|
116
|
-
})
|
|
117
|
-
.superRefine((val, ctx) => {
|
|
118
|
-
const now = new Date();
|
|
119
|
-
const age = differenceInYears(now, val);
|
|
120
|
-
if (age < 21) {
|
|
121
|
-
return ctx.addIssue({
|
|
122
|
-
code: z.ZodIssueCode.custom,
|
|
123
|
-
message: 'You must be at least 21 years old',
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}),
|
|
127
|
-
branchCode: z.string().min(1, 'Branch is required').trim(),
|
|
128
|
-
selfieImage: fileSchema,
|
|
129
|
-
frontImage: fileSchema,
|
|
130
|
-
termsAccepted: z.boolean().superRefine((v, ctx) => {
|
|
131
|
-
if (!v) {
|
|
132
|
-
ctx.addIssue({
|
|
133
|
-
code: z.ZodIssueCode.custom,
|
|
134
|
-
message: 'You must accept the terms and conditions',
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}),
|
|
138
|
-
});
|
|
139
|
-
const Step2Definition = z.object({
|
|
140
|
-
verificationCode: z.array(z.string()).superRefine((val, ctx) => {
|
|
141
|
-
if (val.length !== 6 || val.some((v) => v.length !== 1)) {
|
|
142
|
-
ctx.addIssue({
|
|
143
|
-
code: z.ZodIssueCode.custom,
|
|
144
|
-
message: 'Please Enter your 6 digits verification code',
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}),
|
|
148
|
-
});
|
|
149
|
-
const step1Form = useForm({
|
|
150
|
-
mode: 'all',
|
|
151
|
-
resolver: zodResolver(Step1Definition),
|
|
152
|
-
defaultValues: {
|
|
153
|
-
name: '',
|
|
154
|
-
password: '',
|
|
155
|
-
mobileNumber: '',
|
|
156
|
-
firstName: '',
|
|
157
|
-
middleName: '',
|
|
158
|
-
lastName: '',
|
|
159
|
-
branchCode: props?.branches?.[0]?.code ?? BRANCHES[0].code,
|
|
160
|
-
termsAccepted: false,
|
|
161
|
-
frontImage: undefined,
|
|
162
|
-
selfieImage: undefined,
|
|
163
|
-
},
|
|
164
|
-
});
|
|
165
|
-
const step2Form = useForm({
|
|
166
|
-
resolver: zodResolver(Step2Definition),
|
|
167
|
-
defaultValues: {
|
|
168
|
-
verificationCode: Array.from({ length: 6 }).fill(''),
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
const cooldown = useCooldown({
|
|
172
|
-
max: 60,
|
|
173
|
-
duration: 1000 * 60,
|
|
174
|
-
});
|
|
175
|
-
const form2Ref = useRef(null);
|
|
176
|
-
const birthDay = step1Form.watch('birthDay');
|
|
177
|
-
const branchCode = step1Form.watch('branchCode', '');
|
|
178
|
-
useEffect(() => {
|
|
179
|
-
if (props.frontImage) {
|
|
180
|
-
step1Form.setValue('frontImage', props.frontImage);
|
|
181
|
-
}
|
|
182
|
-
if (props.selfieImage) {
|
|
183
|
-
step1Form.setValue('selfieImage', props.selfieImage);
|
|
184
|
-
}
|
|
185
|
-
}, [step1Form, props]);
|
|
186
|
-
const { mutateAsync: createMemberVerification } = useCreateMemberVerificationMutation({
|
|
187
|
-
onError: (error) => {
|
|
188
|
-
toaster.error({
|
|
189
|
-
title: 'Failed to upload ID Front Image & Selfie Image',
|
|
190
|
-
description: error.message,
|
|
191
|
-
});
|
|
192
|
-
},
|
|
193
|
-
});
|
|
194
|
-
const { mutateAsync: updateMemberVerification } = useUpdateMemberVerificationMutation({
|
|
195
|
-
onSuccess: () => {
|
|
196
|
-
const queryClient = getQueryClient();
|
|
197
|
-
queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
|
|
198
|
-
if (!prev)
|
|
199
|
-
return prev;
|
|
200
|
-
return {
|
|
201
|
-
...prev,
|
|
202
|
-
status: 'CREATED',
|
|
203
|
-
};
|
|
204
|
-
});
|
|
205
|
-
},
|
|
206
|
-
onError: (error) => {
|
|
207
|
-
toaster.error({
|
|
208
|
-
title: 'Failed to upload ID Front Image & Selfie Image',
|
|
209
|
-
description: error.message,
|
|
210
|
-
});
|
|
211
|
-
},
|
|
212
|
-
});
|
|
213
|
-
const memberVerification = useMemberVerificationQuery();
|
|
214
|
-
const memberId = memberVerification.data?.id;
|
|
215
|
-
const { mutate: uploadImageFile } = useUploadImageFileMutation();
|
|
216
|
-
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Create an account" }), _jsx("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
217
|
-
try {
|
|
218
|
-
await sendVerificationCodeMutation.mutateAsync({
|
|
219
|
-
channel: 'SMS',
|
|
220
|
-
recipient: mobileNumberParser.format(data.mobileNumber),
|
|
221
|
-
});
|
|
222
|
-
setStep(2);
|
|
223
|
-
cooldown.start();
|
|
224
|
-
}
|
|
225
|
-
catch (e) {
|
|
226
|
-
toaster.error({
|
|
227
|
-
description: e instanceof Error
|
|
228
|
-
? e.message
|
|
229
|
-
: 'Failed to send verification code',
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Account Username" }), _jsx(Field.Input, { placeholder: "Enter Username", ...step1Form.register('name') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.name?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.password, className: "mt-xl", children: [_jsx(Field.Label, { children: "Password" }), _jsx(Field.Input, { type: "password", placeholder: "Enter a password", ...step1Form.register('password') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.password?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "mt-xl", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "absolute left-3.5 top-1/2 flex shrink-0 -translate-y-1/2 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, { style: {
|
|
233
|
-
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
234
|
-
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.firstName, className: "mt-xl", children: [_jsx(Field.Label, { children: "First Name" }), _jsx(Field.Input, { placeholder: "Enter your First Name", ...step1Form.register('firstName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.firstName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.middleName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Middle Name" }), _jsx(Field.Input, { placeholder: "Enter your Middle Name", ...step1Form.register('middleName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.middleName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.lastName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Last Name" }), _jsx(Field.Input, { placeholder: "Enter your Last Name", ...step1Form.register('lastName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.lastName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: birthDay, onChange: (value) => {
|
|
235
|
-
if (!value)
|
|
236
|
-
return;
|
|
237
|
-
step1Form.setValue('birthDay', value, {
|
|
238
|
-
shouldDirty: true,
|
|
239
|
-
shouldTouch: true,
|
|
240
|
-
shouldValidate: true,
|
|
241
|
-
});
|
|
242
|
-
}, onBlur: () => {
|
|
243
|
-
step1Form.trigger('birthDay');
|
|
244
|
-
} }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.birthDay?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.branchCode, className: "mt-xl", children: [_jsxs(Select.Root, { value: [branchCode], onValueChange: (details) => {
|
|
245
|
-
step1Form.setValue('branchCode', details.value.at(0) ??
|
|
246
|
-
props?.branches?.[0]?.code ??
|
|
247
|
-
BRANCHES[0].code, {
|
|
248
|
-
shouldDirty: true,
|
|
249
|
-
shouldTouch: true,
|
|
250
|
-
shouldValidate: true,
|
|
251
|
-
});
|
|
252
|
-
}, collection: branchCollection, positioning: {
|
|
253
|
-
sameWidth: true,
|
|
254
|
-
placement: 'bottom',
|
|
255
|
-
}, lazyMount: true, unmountOnExit: true, children: [_jsx(Select.Label, { className: "flex items-center gap-1", children: "Select Nearest Branch Around You" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: branchCollection.items.map((item) => {
|
|
256
|
-
const label = branchCollection.stringifyItem(item) ?? '';
|
|
257
|
-
return (_jsx(Select.Item, { item: item, children: _jsx("div", { title: label, className: "line-clamp-1", children: label }) }, item.code));
|
|
258
|
-
}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.branchCode?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.frontImage, className: "mt-xl", children: [_jsx(Field.Label, { children: "Front of your ID" }), _jsx(ImageUploader, { value: props.frontImage || null, hasDescription: true, name: "idFrontImage", captureObject: "ID_DOCUMENT", onChange: (file) => {
|
|
259
|
-
step1Form.setValue('frontImage', file);
|
|
260
|
-
props.setFrontImage(file);
|
|
261
|
-
} }, "id-front-image-upload"), _jsx(Field.ErrorText, { children: step1Form.formState.errors.frontImage?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.selfieImage, className: "mt-xl", children: [_jsx(Field.Label, { children: "Selfie holding your ID" }), _jsx(ImageUploader, { value: props.selfieImage || null, name: "selfieImage", captureObject: "SELFIE", onChange: (file) => {
|
|
262
|
-
step1Form.setValue('selfieImage', file);
|
|
263
|
-
props.setSelfieImage(file);
|
|
264
|
-
} }, "selfie-image-upload"), _jsx(Field.ErrorText, { children: step1Form.formState.errors.selfieImage?.message })] }), _jsxs("div", { className: "mt-xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, className: "h-9.5 w-auto" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
265
|
-
o.field.onChange(details.checked);
|
|
266
|
-
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: props.termsAndConditionsUrl ?? '/terms-and-conditions', onClick: () => {
|
|
267
|
-
dialog.setOpen(false);
|
|
268
|
-
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), ' ', _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
269
|
-
dialog.setOpen(false);
|
|
270
|
-
signInStore.setOpen(true);
|
|
271
|
-
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
272
|
-
const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
273
|
-
const { mobileNumber } = step1Form.getValues();
|
|
274
|
-
try {
|
|
275
|
-
await signUpMutation.mutateAsync({
|
|
276
|
-
id,
|
|
277
|
-
mobileNumber: mobileNumberParser.format(mobileNumber),
|
|
278
|
-
verificationCode: verificationCode.join(''),
|
|
279
|
-
referralCode: search.get('referralCode') ?? undefined,
|
|
280
|
-
btag: search.get('btag') ?? undefined,
|
|
281
|
-
});
|
|
282
|
-
const name = mobileNumberParser.format(mobileNumber);
|
|
283
|
-
const password = `${name}${id}`;
|
|
284
|
-
const pollLogin = createPoll(async () => {
|
|
285
|
-
try {
|
|
286
|
-
await signInMutation.mutateAsync({
|
|
287
|
-
type: 'NAME_AND_PASSWORD',
|
|
288
|
-
name,
|
|
289
|
-
password,
|
|
290
|
-
});
|
|
291
|
-
return true;
|
|
292
|
-
}
|
|
293
|
-
catch {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
}, {
|
|
297
|
-
until: (ok) => ok,
|
|
298
|
-
maxAttempt: 3,
|
|
299
|
-
});
|
|
300
|
-
const ok = await pollLogin();
|
|
301
|
-
if (!ok) {
|
|
302
|
-
signInStore.setOpen(true);
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
const pollUpdateAccount = createPoll(async () => {
|
|
306
|
-
try {
|
|
307
|
-
await updateAccountMutation.mutateAsync({
|
|
308
|
-
name: step1Form.getValues('name'),
|
|
309
|
-
password: step1Form.getValues('password'),
|
|
310
|
-
branchCode: step1Form.getValues('branchCode'),
|
|
311
|
-
realName: [
|
|
312
|
-
step1Form.getValues('firstName'),
|
|
313
|
-
step1Form.getValues('middleName'),
|
|
314
|
-
step1Form.getValues('lastName'),
|
|
315
|
-
]
|
|
316
|
-
.filter(Boolean)
|
|
317
|
-
.join(' '),
|
|
318
|
-
birthDay: format(step1Form.getValues('birthDay'), 'yyyy-MM-dd'),
|
|
319
|
-
});
|
|
320
|
-
return true;
|
|
321
|
-
}
|
|
322
|
-
catch {
|
|
323
|
-
return false;
|
|
324
|
-
}
|
|
325
|
-
}, {
|
|
326
|
-
until: (ok) => ok,
|
|
327
|
-
maxAttempt: 3,
|
|
328
|
-
});
|
|
329
|
-
const pollImageUpload = createPoll(async () => {
|
|
330
|
-
const uploadImage = (file) => new Promise((resolve, reject) => {
|
|
331
|
-
if (!file) {
|
|
332
|
-
return reject(new Error('No file provided'));
|
|
333
|
-
}
|
|
334
|
-
uploadImageFile({ file }, {
|
|
335
|
-
onSuccess: (result) => resolve(result),
|
|
336
|
-
onError: (error) => reject(error || new Error('Upload failed')),
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
try {
|
|
340
|
-
const selfieFile = step1Form.getValues('selfieImage');
|
|
341
|
-
const frontFile = step1Form.getValues('frontImage');
|
|
342
|
-
if (!(selfieFile instanceof File) ||
|
|
343
|
-
!(frontFile instanceof File)) {
|
|
344
|
-
throw new Error('Invalid or missing image files');
|
|
345
|
-
}
|
|
346
|
-
const selfieImageId = await uploadImage(selfieFile);
|
|
347
|
-
const frontImageId = await uploadImage(frontFile);
|
|
348
|
-
const data = {
|
|
349
|
-
selfieImage: selfieImageId,
|
|
350
|
-
idFrontImage: frontImageId,
|
|
351
|
-
};
|
|
352
|
-
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
353
|
-
await delay(2000);
|
|
354
|
-
if (!memberId) {
|
|
355
|
-
await createMemberVerification({
|
|
356
|
-
...data,
|
|
357
|
-
address: '',
|
|
358
|
-
nationality: '',
|
|
359
|
-
natureOfWork: '',
|
|
360
|
-
permanentAddress: '',
|
|
361
|
-
placeOfBirth: '',
|
|
362
|
-
sourceOfIncome: '',
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
await updateMemberVerification({
|
|
367
|
-
id: memberId,
|
|
368
|
-
data,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
return true;
|
|
372
|
-
}
|
|
373
|
-
catch (error) {
|
|
374
|
-
console.error('Image upload or verification failed:', error);
|
|
375
|
-
return false;
|
|
376
|
-
}
|
|
377
|
-
}, {
|
|
378
|
-
until: (ok) => ok,
|
|
379
|
-
maxAttempt: 1,
|
|
380
|
-
});
|
|
381
|
-
await pollUpdateAccount();
|
|
382
|
-
await pollImageUpload();
|
|
383
|
-
}
|
|
384
|
-
dialog.setOpen(false);
|
|
385
|
-
step1Form.reset();
|
|
386
|
-
step2Form.reset();
|
|
387
|
-
setStep(1);
|
|
388
|
-
}
|
|
389
|
-
catch (error) {
|
|
390
|
-
toaster.error({
|
|
391
|
-
description: error instanceof Error
|
|
392
|
-
? error.message
|
|
393
|
-
: 'Invalid Verification Code',
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
}), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", value: o.field.value, onValueChange: (details) => {
|
|
397
|
-
o.field.onChange(details.value);
|
|
398
|
-
}, onValueComplete: () => {
|
|
399
|
-
form2Ref.current?.requestSubmit();
|
|
400
|
-
}, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
|
|
401
|
-
await sendVerificationCodeMutation.mutateAsync({
|
|
402
|
-
channel: 'SMS',
|
|
403
|
-
recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
404
|
-
});
|
|
405
|
-
cooldown.start();
|
|
406
|
-
}, children: cooldown.cooling
|
|
407
|
-
? `Resend in ${cooldown.countdown}s`
|
|
408
|
-
: 'Resend' })] }), _jsxs("button", { type: "button", className: "text-text-tertiary-600 mx-auto mt-3xl flex w-fit items-center gap-1 text-sm font-semibold", onClick: () => {
|
|
409
|
-
setStep(1);
|
|
410
|
-
step2Form.reset();
|
|
411
|
-
cooldown.stop();
|
|
412
|
-
}, children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] })] })] }))] }));
|
|
413
|
-
}
|
|
414
|
-
const DEVICE_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
415
|
-
function DateOfBirthField(props) {
|
|
416
|
-
const [value, setValue] = useControllableState({
|
|
417
|
-
value: props.value,
|
|
418
|
-
defaultValue: props.defaultValue ?? null,
|
|
419
|
-
onChange: props.onChange,
|
|
420
|
-
});
|
|
421
|
-
return (_jsxs(DatePicker.Root, { size: "md", variant: "outline", placeholder: "MM/DD/YYYY", lazyMount: true, unmountOnExit: true, fixedWeeks: true, selectionMode: "single", value: value ? [parseDate(value)] : [], onValueChange: (details) => {
|
|
422
|
-
const value = details.value.at(0)?.toDate(DEVICE_TIMEZONE);
|
|
423
|
-
setValue(value ?? null);
|
|
424
|
-
}, children: [_jsx(DatePicker.Label, { children: "Date of Birth" }), _jsxs(DatePicker.Control, { children: [_jsx(DatePicker.Input, { onBlur: props.onBlur, onFocus: props.onFocus }), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsxs(DatePicker.Content, { children: [_jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }), _jsx(DatePicker.View, { view: "month", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
|
|
425
|
-
.getMonthsGrid({ columns: 4, format: 'short' })
|
|
426
|
-
.map((months, id) => (_jsx(DatePicker.TableRow, { children: months.map((month, id) => (_jsx(DatePicker.TableCell, { value: month.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: month.label }) }, id))) }, id))) }) })] })) }) }), _jsx(DatePicker.View, { view: "year", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
|
|
427
|
-
.getYearsGrid({ columns: 4 })
|
|
428
|
-
.map((years, id) => (_jsx(DatePicker.TableRow, { children: years.map((year, id) => (_jsx(DatePicker.TableCell, { value: year.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: year.label }) }, id))) }, id))) }) })] })) }) })] }) })] }));
|
|
429
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ImageProps } from 'next/image';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
3
|
-
import type { Branch } from '../../../types';
|
|
4
|
-
export interface SignUpPagcorProps {
|
|
5
|
-
logo: ImageProps['src'];
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
/** @default "/terms-and-conditions" */
|
|
8
|
-
termsAndConditionsUrl?: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
branches?: Branch[];
|
|
11
|
-
layout: 'pagcor';
|
|
12
|
-
}
|
|
13
|
-
export declare function SignUpPagcor(props: SignUpPagcorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Image, {} from 'next/image';
|
|
4
|
-
import { Suspense } from 'react';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { useShallow } from 'zustand/shallow';
|
|
7
|
-
import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
|
|
8
|
-
import { XIcon } from '../../../icons/XIcon.js';
|
|
9
|
-
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
10
|
-
import { Portal } from '../../../ui/Portal/index.js';
|
|
11
|
-
import { CaptureIdDocument } from './CaptureIdDocument.js';
|
|
12
|
-
import { CaptureSelfie } from './CaptureSelfie.js';
|
|
13
|
-
import { SignUpFormPagcor } from './SignUpFormPagcor.js';
|
|
14
|
-
import { SignUpPagcorPropsProvider } from './SignUpPagcorContext.js';
|
|
15
|
-
import { useImageUploader } from './useImageUploader.js';
|
|
16
|
-
export function SignUpPagcor(props) {
|
|
17
|
-
const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
|
|
18
|
-
const imageUploader = useImageUploader();
|
|
19
|
-
const value = {
|
|
20
|
-
...props,
|
|
21
|
-
...imageUploader,
|
|
22
|
-
};
|
|
23
|
-
return (_jsx(SignUpPagcorPropsProvider, { value: value, children: _jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
|
|
24
|
-
signUpStore.setOpen(details.open);
|
|
25
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-fit lg:rounded-xl', props.className), children: [_jsx(CaptureIdDocument, {}), _jsx(CaptureSelfie, {}), _jsxs("div", { className: "w-full lg:w-[400px]", 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(SignUpFormPagcor, {}) })] })] }) })] }) }) }));
|
|
26
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SignUpPagcorProps } from './SignUpPagcor.lazy';
|
|
2
|
-
import type { UseImageUploaderReturn } from './useImageUploader';
|
|
3
|
-
export declare const SignUpPagcorPropsProvider: (props: {
|
|
4
|
-
value: SignUpPagcorProps & UseImageUploaderReturn;
|
|
5
|
-
} & {
|
|
6
|
-
children?: import("react").ReactNode | undefined;
|
|
7
|
-
}) => React.ReactNode, useSignUpPagcorPropsContext: () => SignUpPagcorProps & UseImageUploaderReturn;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type CaptureSubject = 'SELFIE' | 'ID_DOCUMENT';
|
|
2
|
-
export interface UseImageUploaderReturn {
|
|
3
|
-
capturing: CaptureSubject | null;
|
|
4
|
-
setCapturing: (capturing: CaptureSubject | null) => void;
|
|
5
|
-
frontImage: File | null;
|
|
6
|
-
setFrontImage: (id: File | null) => void;
|
|
7
|
-
selfieImage: File | null;
|
|
8
|
-
setSelfieImage: (id: File | null) => void;
|
|
9
|
-
reset: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function useImageUploader(): UseImageUploaderReturn;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
export function useImageUploader() {
|
|
3
|
-
const [frontImage, setFrontImage] = useState(null);
|
|
4
|
-
const [selfieImage, setSelfieImage] = useState(null);
|
|
5
|
-
const [capturing, setCapturing] = useState(null);
|
|
6
|
-
const reset = () => {
|
|
7
|
-
setCapturing(null);
|
|
8
|
-
setFrontImage(null);
|
|
9
|
-
setFrontImage(null);
|
|
10
|
-
};
|
|
11
|
-
return {
|
|
12
|
-
capturing,
|
|
13
|
-
setCapturing,
|
|
14
|
-
frontImage,
|
|
15
|
-
setFrontImage,
|
|
16
|
-
selfieImage,
|
|
17
|
-
setSelfieImage,
|
|
18
|
-
reset,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const BRANCH_CODES = [
|
|
2
|
-
{
|
|
3
|
-
code: 'BRCAL',
|
|
4
|
-
name: 'Bingo Republic 2nd floor Primark Center Deparo St., Caloocan City',
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
code: 'BRNAG',
|
|
8
|
-
name: 'Bingo Republic 3rd floor Robinsons Mall, Naga City, Camarines Sur',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
code: 'BRANT',
|
|
12
|
-
name: 'Bingo Republic 2nd floor Robinsons Mall, San Vicente,Antique',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
code: 'BRCLA',
|
|
16
|
-
name: 'Clark',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
code: 'BRLAG',
|
|
20
|
-
name: 'Laguna',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
code: 'BREAS',
|
|
24
|
-
name: 'Eastwood City, Quezon City',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
code: 'BRMAR',
|
|
28
|
-
name: 'Bingo ng Bayan 4th floor Marikina Public Market, Marikina City',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
code: 'BRILO',
|
|
32
|
-
name: 'Iloilo',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
code: 'BRFIM',
|
|
36
|
-
name: 'Fisher Mall,Quezon City',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
code: 'BRCAC',
|
|
40
|
-
name: 'Villa Caceres Hotel, Naga City,Camsur',
|
|
41
|
-
},
|
|
42
|
-
];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function BellRingIcon(props) {
|
|
3
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 25 24", fill: "none", stroke: "currentColor", ...props, children: _jsx("path", { d: "M15.5002 19C15.5002 20.6569 14.1571 22 12.5002 22C10.8434 22 9.50025 20.6569 9.50025 19M14.2968 6.23856C14.7322 5.78864 15.0002 5.17562 15.0002 4.5C15.0002 3.11929 13.881 2 12.5002 2C11.1195 2 10.0002 3.11929 10.0002 4.5C10.0002 5.17562 10.2683 5.78864 10.7037 6.23856M3.04707 8.32296C3.03272 6.87161 3.8152 5.51631 5.07928 4.80306M21.9534 8.32296C21.9678 6.87161 21.1853 5.51631 19.9212 4.80306M18.5002 11.2C18.5002 9.82087 17.8681 8.49823 16.7429 7.52304C15.6177 6.54786 14.0915 6 12.5002 6C10.9089 6 9.38283 6.54786 8.25761 7.52304C7.13239 8.49823 6.50025 9.82087 6.50025 11.2C6.50025 13.4818 5.93438 15.1506 5.22831 16.3447C4.42359 17.7056 4.02122 18.3861 4.03711 18.5486C4.05529 18.7346 4.08876 18.7933 4.23959 18.9036C4.37142 19 5.03376 19 6.35844 19H18.6421C19.9667 19 20.6291 19 20.7609 18.9036C20.9117 18.7933 20.9452 18.7346 20.9634 18.5486C20.9793 18.3861 20.5769 17.7056 19.7722 16.3447C19.0661 15.1506 18.5002 13.4818 18.5002 11.2Z", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
4
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function dataURLtoBlob(dataURL: string): Blob;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function dataURLtoBlob(dataURL) {
|
|
2
|
-
const parts = dataURL.split(';base64,');
|
|
3
|
-
const contentType = parts[0].split(':')[1];
|
|
4
|
-
const raw = window.atob(parts[1]);
|
|
5
|
-
const rawLength = raw.length;
|
|
6
|
-
const uInt8Array = new Uint8Array(rawLength);
|
|
7
|
-
for (let i = 0; i < rawLength; ++i) {
|
|
8
|
-
uInt8Array[i] = raw.charCodeAt(i);
|
|
9
|
-
}
|
|
10
|
-
return new Blob([uInt8Array], { type: contentType });
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Resizer from 'react-image-file-resizer';
|
|
2
|
-
export const resizeFile = (file) => new Promise((resolve) => {
|
|
3
|
-
Resizer.imageFileResizer(file, 300, 300, 'jpeg', 100, 0, (uri) => {
|
|
4
|
-
resolve(uri);
|
|
5
|
-
}, 'file');
|
|
6
|
-
});
|
|
7
|
-
export const resizeFileBase64 = (file) => new Promise((resolve) => {
|
|
8
|
-
Resizer.imageFileResizer(file, 1200, 300, 'WEBP', 100, 0, (uri) => {
|
|
9
|
-
resolve(uri);
|
|
10
|
-
}, 'base64');
|
|
11
|
-
});
|