@opexa/portal-components 0.0.289 → 0.0.291
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/useAuthenticateMutation.js +8 -3
- package/dist/client/hooks/useSignInMutation.js +8 -3
- package/dist/components/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- package/dist/components/Bonus/Bonus.client.js +4 -4
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- 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/News/News.js +1 -1
- package/dist/components/PortalProvider/FeatureFlag.js +1 -1
- package/dist/components/PortalProvider/PortalProvider.d.ts +3 -2
- package/dist/components/PortalProvider/PortalProvider.js +3 -4
- package/dist/components/PortalProvider/Providers.d.ts +5 -4
- package/dist/components/PortalProvider/Providers.js +3 -2
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Quests/JourneyQuest.d.ts +1 -0
- package/dist/components/Quests/JourneyQuest.js +61 -0
- package/dist/components/Quests/Quests.client.js +2 -0
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/components/SignIn/MobileNumberSignIn.d.ts +1 -5
- package/dist/components/SignIn/MobileNumberSignIn.js +5 -23
- package/dist/components/SignIn/NameAndPasswordSignIn.d.ts +1 -5
- package/dist/components/SignIn/NameAndPasswordSignIn.js +6 -14
- package/dist/components/SignIn/SignIn.lazy.js +1 -1
- package/dist/components/SignIn/SignInForm.d.ts +1 -5
- package/dist/components/SignIn/SignInForm.js +2 -2
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +3 -7
- package/dist/components/SignUp/SignUpKYC/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/constants/EnvVar.d.ts +0 -2
- package/dist/constants/EnvVar.js +0 -11
- package/dist/constants/GameProvider.d.ts +1 -1
- package/dist/constants/GameProvider.js +1 -0
- package/dist/handlers/postAuthenticate.js +1 -1
- package/dist/handlers/postSession.js +1 -1
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +82 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +82 -0
- package/dist/services/graphqlRequest.js +1 -9
- package/dist/services/httpRequest.js +1 -9
- package/dist/services/queries.js +2574 -2574
- package/dist/styles/theme.css +704 -701
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
- package/dist/ui/Badge/Badge.d.ts +12 -0
- package/dist/ui/Badge/badge.recipe.d.ts +3 -0
- package/dist/ui/Badge/badge.recipe.js +11 -0
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +55 -55
- package/dist/ui/Dialog/dialog.recipe.d.ts +5 -5
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/package.json +164 -163
- package/dist/client/hooks/index.d.ts +0 -65
- package/dist/client/hooks/index.js +0 -65
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
- package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
- package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
- package/dist/components/CashbackBonus/index.d.ts +0 -1
- package/dist/components/CashbackBonus/index.js +0 -1
- package/dist/components/Empty.d.ts +0 -9
- package/dist/components/Empty.js +0 -7
- 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/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/InfiniteScroll.d.ts +0 -10
- package/dist/components/InfiniteScroll.js +0 -25
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -93
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -45
- package/dist/components/KYC/Header.d.ts +0 -1
- package/dist/components/KYC/Header.js +0 -8
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -13
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -13
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -13
- package/dist/components/KYC/Step4.d.ts +0 -1
- package/dist/components/KYC/Step4.js +0 -7
- 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 -34
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Messages/MessageItem.js +0 -34
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -19
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Promo/PromoContent.d.ts +0 -2
- package/dist/components/Promo/PromoContent.js +0 -9
- package/dist/components/Promos/PromoCarousel.d.ts +0 -2
- package/dist/components/Promos/PromoCarousel.js +0 -41
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -12
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -10
- 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 -288
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -72
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -33
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/constants/endpoints.d.ts +0 -10
- package/dist/constants/endpoints.js +0 -41
- package/dist/constants/envVars.d.ts +0 -5
- package/dist/constants/envVars.js +0 -28
- package/dist/constants/gameProviders.d.ts +0 -76
- package/dist/constants/gameProviders.js +0 -361
- package/dist/constants/gameTypes.d.ts +0 -3
- package/dist/constants/gameTypes.js +0 -64
- package/dist/constants/headerKeys.d.ts +0 -2
- package/dist/constants/headerKeys.js +0 -2
- package/dist/constants/secretQuestions.d.ts +0 -3
- package/dist/constants/secretQuestions.js +0 -24
- package/dist/constants/storageKeys.d.ts +0 -2
- package/dist/constants/storageKeys.js +0 -2
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/icons/index.d.ts +0 -65
- package/dist/icons/index.js +0 -65
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -29
- package/dist/server/utils/index.js +0 -29
- package/dist/ui/Presence.d.ts +0 -2
- package/dist/ui/Presence.js +0 -7
- package/dist/ui/Prose.d.ts +0 -2
- package/dist/ui/Prose.js +0 -5
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/createErrorFromCode.d.ts +0 -2
- package/dist/utils/createErrorFromCode.js +0 -11
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -17
- package/dist/utils/isMobile.d.ts +0 -5
- package/dist/utils/isMobile.js +0 -9
- package/dist/utils/resizeImageSize.d.ts +0 -1
- package/dist/utils/resizeImageSize.js +0 -6
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useFieldContext } from '@ark-ui/react';
|
|
3
|
-
import { FaceDetector, FilesetResolver } from '@mediapipe/tasks-vision';
|
|
4
|
-
import Image from 'next/image';
|
|
5
|
-
import { useEffect, useId, useRef, useState, } from 'react';
|
|
6
|
-
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { useInterval } from 'usehooks-ts';
|
|
8
|
-
import { useCamera } from '../../client/hooks/useCamera.js';
|
|
9
|
-
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
10
|
-
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
11
|
-
import { useFileQuery } from '../../client/hooks/useFileQuery.js';
|
|
12
|
-
import { useUploadImageFileMutation } from '../../client/hooks/useUploadImageFileMutation.js';
|
|
13
|
-
import { createContext } from '../../client/utils/createContext.js';
|
|
14
|
-
import { toaster } from '../../client/utils/toaster.js';
|
|
15
|
-
import { Camera01Icon } from '../../icons/Camera01Icon.js';
|
|
16
|
-
import { CameraOffIcon } from '../../icons/CameraOffIcon.js';
|
|
17
|
-
import { CheckCircleIcon } from '../../icons/CheckCircleIcon.js';
|
|
18
|
-
import { RefreshCcw01Icon } from '../../icons/RefreshCcw01Icon.js';
|
|
19
|
-
import { Spinner02Icon } from '../../icons/Spinner02Icon.js';
|
|
20
|
-
import { UploadCloud02Icon } from '../../icons/UploadCloud02Icon.js';
|
|
21
|
-
import { XIcon } from '../../icons/XIcon.js';
|
|
22
|
-
import { Button } from '../../ui/Button/index.js';
|
|
23
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
24
|
-
import { Portal } from '../../ui/Portal/index.js';
|
|
25
|
-
import { validateFile } from '../../utils/validateFile.js';
|
|
26
|
-
export function SelfieField__client(props) {
|
|
27
|
-
const context = useSelfieField(props);
|
|
28
|
-
return (_jsxs(SelfieFieldProvider, { value: context, children: [_jsxs("div", { ref: props.ref, id: props.id, style: props.style, className: twMerge('group', 'border', 'border-border-primary', 'bg-bg-primary', 'relative', 'w-full', 'aspect-[352/180]', 'shrink-0', 'rounded-xl', 'p-xl', props.className), onDragOver: (e) => e.preventDefault(), onDragEnter: (e) => e.preventDefault(), onDragLeave: (e) => e.preventDefault(), onDrop: async (e) => {
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
const file = e.dataTransfer.files?.[0];
|
|
31
|
-
if (!file)
|
|
32
|
-
return;
|
|
33
|
-
const error = validateFile(file);
|
|
34
|
-
if (error)
|
|
35
|
-
return props.onError?.(error);
|
|
36
|
-
context.mutation.mutate({ file });
|
|
37
|
-
}, "aria-describedby": context.field?.ariaDescribedby, children: [_jsx("input", { id: context.field?.ids?.control, ref: context.inputRef, type: "file", accept: "image/png, image/jpeg", onChange: async (e) => {
|
|
38
|
-
const file = e.target.files?.[0];
|
|
39
|
-
if (!file)
|
|
40
|
-
return;
|
|
41
|
-
const error = validateFile(file);
|
|
42
|
-
if (error)
|
|
43
|
-
return props.onError?.(error);
|
|
44
|
-
context.mutation.mutate({ file });
|
|
45
|
-
}, disabled: context.field?.disabled ||
|
|
46
|
-
context.query.isLoading ||
|
|
47
|
-
context.mutation.isPending ||
|
|
48
|
-
props.disabled, readOnly: context.field?.readOnly || props.readOnly, required: context.field?.required || props.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: _jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" }) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
|
|
49
|
-
context.inputRef.current?.click();
|
|
50
|
-
}, disabled: context.field?.disabled ||
|
|
51
|
-
context.field?.readOnly ||
|
|
52
|
-
context.query.isLoading ||
|
|
53
|
-
context.mutation.isPending ||
|
|
54
|
-
props.disabled ||
|
|
55
|
-
props.readOnly, className: "text-button-secondary-fg font-semibold disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
|
|
56
|
-
context.disclosure.setOpen(true);
|
|
57
|
-
}, disabled: context.field?.disabled ||
|
|
58
|
-
context.field?.readOnly ||
|
|
59
|
-
context.query.isLoading ||
|
|
60
|
-
context.mutation.isPending ||
|
|
61
|
-
props.disabled ||
|
|
62
|
-
props.readOnly, children: "Take a photo" })] })), context.query.data?.url && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.query.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "backdrop-blur-xs absolute right-2 top-2 rounded-full bg-white/10 p-1", onClick: () => {
|
|
63
|
-
context.setValue('');
|
|
64
|
-
}, children: _jsx(XIcon, { className: "size-5" }) })] }))] }), _jsx(Camera, {})] }));
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* -------------------------------------
|
|
68
|
-
* Camera
|
|
69
|
-
* -------------------------------------
|
|
70
|
-
*/
|
|
71
|
-
function Camera() {
|
|
72
|
-
const context = useSelfieFieldContext();
|
|
73
|
-
return (_jsx(Dialog.Root, { open: context.disclosure.open, onOpenChange: (details) => {
|
|
74
|
-
context.disclosure.setOpen(details.open);
|
|
75
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Selfie Holding Your ID" }), _jsx(Dialog.Description, { className: "text-text-tertiary-600 mt-md text-center text-xs lg:text-base", children: "Make sure your face and ID are clearly visible, with no glare\u00A0or\u00A0blur." }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "text-text-placeholder-subtle size-10 text-center lg:size-12" }), _jsx("h2", { className: "mt-3 text-sm font-semibold lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "text-text-tertiary-600 mt-0.5 text-center text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
|
|
76
|
-
context.camera.reopen();
|
|
77
|
-
}, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "border-border-disabled flex aspect-[4/3] flex-col items-center justify-center rounded-md border bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "text-text-placeholder size-8" }) })), context.camera.data && (_jsx("div", { className: "border-border-disabled aspect-[4/3] w-full overflow-hidden rounded-md border bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "disabled:bg-bg-disabled disabled:text-text-disabled mx-auto w-full px-xl py-lg lg:w-[10rem]", onClick: () => {
|
|
78
|
-
context.camera.snap({
|
|
79
|
-
crop: context.guideRef.current?.getBoundingClientRect(),
|
|
80
|
-
});
|
|
81
|
-
}, disabled: !context.faceFound ||
|
|
82
|
-
context.camera.loading ||
|
|
83
|
-
context.camera.snapping ||
|
|
84
|
-
!!context.camera.error, children: [context.camera.snapping ? (_jsx(Spinner02Icon, { className: "size-5" })) : (_jsx(Camera01Icon, { className: "size-5" })), "Capture"] }) })), context.camera.data && (_jsxs("div", { className: "mt-5 flex gap-3 lg:mt-10 lg:justify-center", children: [_jsxs(Button, { onClick: () => {
|
|
85
|
-
const file = context.camera.data?.file;
|
|
86
|
-
if (!file)
|
|
87
|
-
return;
|
|
88
|
-
context.mutation.mutate({ file });
|
|
89
|
-
context.disclosure.setOpen(false);
|
|
90
|
-
}, className: "w-full lg:w-[10rem]", children: [_jsx(CheckCircleIcon, { className: "size-5" }), "Use Photo"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
91
|
-
context.camera.reset();
|
|
92
|
-
}, className: "w-full lg:w-[10rem]", children: [_jsx(RefreshCcw01Icon, { className: "size-5" }), " Retake"] })] }))] }) })] }) }));
|
|
93
|
-
}
|
|
94
|
-
/*
|
|
95
|
-
* -------------------------------------
|
|
96
|
-
* Video
|
|
97
|
-
* -------------------------------------
|
|
98
|
-
*/
|
|
99
|
-
function Video() {
|
|
100
|
-
const id = useId();
|
|
101
|
-
const context = useSelfieFieldContext();
|
|
102
|
-
const [maskBox, setMaskBox] = useState({
|
|
103
|
-
x: 0,
|
|
104
|
-
y: 0,
|
|
105
|
-
width: 0,
|
|
106
|
-
height: 0,
|
|
107
|
-
});
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
const update = () => {
|
|
110
|
-
const guide = context.guideRef.current;
|
|
111
|
-
const mask = context.maskRef.current;
|
|
112
|
-
if (!guide || !mask)
|
|
113
|
-
return;
|
|
114
|
-
const guideRect = guide.getBoundingClientRect();
|
|
115
|
-
const maskRect = mask.getBoundingClientRect();
|
|
116
|
-
const x = guideRect.left - maskRect.left;
|
|
117
|
-
const y = guideRect.top - maskRect.top;
|
|
118
|
-
const width = guideRect.width;
|
|
119
|
-
const height = guideRect.height;
|
|
120
|
-
if (width && height) {
|
|
121
|
-
setMaskBox({
|
|
122
|
-
x,
|
|
123
|
-
y,
|
|
124
|
-
width,
|
|
125
|
-
height,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
const observer = new ResizeObserver(update);
|
|
130
|
-
if (context.guideRef.current)
|
|
131
|
-
observer.observe(context.guideRef.current);
|
|
132
|
-
if (context.maskRef.current)
|
|
133
|
-
observer.observe(context.maskRef.current);
|
|
134
|
-
requestAnimationFrame(update);
|
|
135
|
-
return () => observer.disconnect();
|
|
136
|
-
}, [context.guideRef, context.maskRef]);
|
|
137
|
-
const [videoSize, setVideoSize] = useState({
|
|
138
|
-
width: 0,
|
|
139
|
-
height: 0,
|
|
140
|
-
});
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
const video = context.camera.videoRef.current;
|
|
143
|
-
if (!video)
|
|
144
|
-
return;
|
|
145
|
-
const updateVideoWidth = () => {
|
|
146
|
-
const rect = video.getBoundingClientRect();
|
|
147
|
-
setVideoSize({
|
|
148
|
-
width: rect.width,
|
|
149
|
-
height: rect.height,
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
video.addEventListener('loadedmetadata', updateVideoWidth);
|
|
153
|
-
video.addEventListener('resize', updateVideoWidth);
|
|
154
|
-
return () => {
|
|
155
|
-
video.removeEventListener('loadedmetadata', updateVideoWidth);
|
|
156
|
-
video.removeEventListener('resize', updateVideoWidth);
|
|
157
|
-
};
|
|
158
|
-
}, [context.camera.videoRef]);
|
|
159
|
-
const guideWidth = videoSize.width <= 0 || videoSize.height <= 0
|
|
160
|
-
? 0
|
|
161
|
-
: videoSize.width > videoSize.height
|
|
162
|
-
? videoSize.height
|
|
163
|
-
: videoSize.width;
|
|
164
|
-
return (_jsxs("div", { className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
|
|
165
|
-
? 'block'
|
|
166
|
-
: 'hidden'), children: [_jsx("video", { ...context.camera.videoProps }), _jsx("svg", { className: "pointer-events-none absolute -inset-4 size-[200%]", children: _jsx("defs", { children: _jsxs("mask", { id: id, maskUnits: "userSpaceOnUse", children: [_jsx("rect", { x: "0", y: "0", width: "200%", height: "200%", fill: "white" }), _jsx("rect", { x: maskBox.x, y: maskBox.y, width: maskBox.width, height: maskBox.height, fill: "black", rx: "8", ry: "8" })] }) }) }), _jsx("div", { ref: context.maskRef, className: "absolute -inset-4 size-[200%] bg-black/60 backdrop-blur-sm", style: {
|
|
167
|
-
mask: `url(#${id})`,
|
|
168
|
-
WebkitMask: `url(#${id})`,
|
|
169
|
-
maskRepeat: 'no-repeat',
|
|
170
|
-
WebkitMaskRepeat: 'no-repeat',
|
|
171
|
-
} }), _jsx("div", { ref: context.guideRef, className: twMerge('border-utility-warning-700 absolute left-1/2 top-1/2 z-20 aspect-square -translate-x-1/2 -translate-y-1/2 rounded-md border-2 border-dashed', context.faceFound && 'border-utility-success-700', guideWidth <= 0 ? 'hidden' : 'block'), style: {
|
|
172
|
-
width: `calc(${guideWidth}px - 2rem)`,
|
|
173
|
-
} })] }));
|
|
174
|
-
}
|
|
175
|
-
function useSelfieField(props) {
|
|
176
|
-
const field = useFieldContext();
|
|
177
|
-
const [value, setValue] = useControllableState({
|
|
178
|
-
value: props.value,
|
|
179
|
-
defaultValue: props.defaultValue ?? '',
|
|
180
|
-
onChange: props.onChange,
|
|
181
|
-
});
|
|
182
|
-
const query = useFileQuery(value, {
|
|
183
|
-
refetchInterval({ state }) {
|
|
184
|
-
return !state.data || state.data.status === 'UPLOADING' ? 1000 : false;
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
const mutation = useUploadImageFileMutation({
|
|
188
|
-
onSuccess(id) {
|
|
189
|
-
setValue(id);
|
|
190
|
-
},
|
|
191
|
-
onMutate() {
|
|
192
|
-
setValue('');
|
|
193
|
-
},
|
|
194
|
-
onError(error) {
|
|
195
|
-
toaster.error({
|
|
196
|
-
title: 'Upload Failed',
|
|
197
|
-
description: error.message,
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
onSettled() {
|
|
201
|
-
if (inputRef.current) {
|
|
202
|
-
inputRef.current.value = '';
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
});
|
|
206
|
-
const inputRef = useRef(null);
|
|
207
|
-
const maskRef = useRef(null);
|
|
208
|
-
const guideRef = useRef(null);
|
|
209
|
-
const camera = useCamera({
|
|
210
|
-
async validate(data) {
|
|
211
|
-
/*
|
|
212
|
-
* 💁♂️
|
|
213
|
-
* Check if we still have the face.
|
|
214
|
-
* User could have moved away from the camera
|
|
215
|
-
*/
|
|
216
|
-
const ok = await validateFaceFromImage(data.image);
|
|
217
|
-
if (!ok) {
|
|
218
|
-
return {
|
|
219
|
-
name: 'FaceNotFoundError',
|
|
220
|
-
message: 'Please ensure your face is clearly visible in the photo.',
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
});
|
|
225
|
-
const disclosure = useDisclosure({
|
|
226
|
-
onOpenChange(open) {
|
|
227
|
-
if (open) {
|
|
228
|
-
camera.open();
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
});
|
|
232
|
-
const [faceFound, setFaceFound] = useState(false);
|
|
233
|
-
useInterval(async () => {
|
|
234
|
-
if (!camera.videoRef.current || !guideRef.current) {
|
|
235
|
-
return setFaceFound(false);
|
|
236
|
-
}
|
|
237
|
-
setFaceFound(await validateFace(camera.videoRef.current, guideRef.current));
|
|
238
|
-
}, disclosure.open && !camera.data && !camera.error && !camera.loading
|
|
239
|
-
? 1000
|
|
240
|
-
: null);
|
|
241
|
-
return {
|
|
242
|
-
field,
|
|
243
|
-
value,
|
|
244
|
-
setValue,
|
|
245
|
-
query,
|
|
246
|
-
mutation,
|
|
247
|
-
camera,
|
|
248
|
-
disclosure,
|
|
249
|
-
inputRef,
|
|
250
|
-
guideRef,
|
|
251
|
-
maskRef,
|
|
252
|
-
faceFound,
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
const [SelfieFieldProvider, useSelfieFieldContext] = createContext();
|
|
256
|
-
/*
|
|
257
|
-
* -------------------------------------
|
|
258
|
-
* Utils
|
|
259
|
-
* -------------------------------------
|
|
260
|
-
*/
|
|
261
|
-
let __video_detector__;
|
|
262
|
-
let __image_detector__;
|
|
263
|
-
async function getDetector(mode) {
|
|
264
|
-
if (mode === 'VIDEO' && __video_detector__)
|
|
265
|
-
return __video_detector__;
|
|
266
|
-
if (mode === 'IMAGE' && __image_detector__)
|
|
267
|
-
return __image_detector__;
|
|
268
|
-
const vision = await FilesetResolver.forVisionTasks('https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.0/wasm');
|
|
269
|
-
if (mode === 'VIDEO') {
|
|
270
|
-
__video_detector__ = await FaceDetector.createFromOptions(vision, {
|
|
271
|
-
baseOptions: {
|
|
272
|
-
modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
|
|
273
|
-
delegate: 'GPU',
|
|
274
|
-
},
|
|
275
|
-
runningMode: 'VIDEO',
|
|
276
|
-
});
|
|
277
|
-
return __video_detector__;
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
__image_detector__ = await FaceDetector.createFromOptions(vision, {
|
|
281
|
-
baseOptions: {
|
|
282
|
-
modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
|
|
283
|
-
delegate: 'GPU',
|
|
284
|
-
},
|
|
285
|
-
runningMode: 'IMAGE',
|
|
286
|
-
});
|
|
287
|
-
return __image_detector__;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
async function validateFace(video, guide) {
|
|
291
|
-
if (video.readyState < 2)
|
|
292
|
-
return false;
|
|
293
|
-
const detector = await getDetector('VIDEO');
|
|
294
|
-
const result = detector.detectForVideo(video, performance.now());
|
|
295
|
-
const detection = result.detections.at(0);
|
|
296
|
-
if (!detection)
|
|
297
|
-
return false;
|
|
298
|
-
const category = detection.categories.at(0);
|
|
299
|
-
if (!category || category.score < 0.75)
|
|
300
|
-
return false;
|
|
301
|
-
const videoRect = video.getBoundingClientRect(); // DOM position & size
|
|
302
|
-
const guideRect = guide.getBoundingClientRect();
|
|
303
|
-
if (!detection.boundingBox)
|
|
304
|
-
return false;
|
|
305
|
-
const faceLeft = videoRect.left +
|
|
306
|
-
(detection.boundingBox.originX / video.videoWidth) * videoRect.width;
|
|
307
|
-
const faceTop = videoRect.top +
|
|
308
|
-
(detection.boundingBox.originY / video.videoHeight) * videoRect.height;
|
|
309
|
-
const faceRight = faceLeft +
|
|
310
|
-
(detection.boundingBox.width / video.videoWidth) * videoRect.width;
|
|
311
|
-
const faceBottom = faceTop +
|
|
312
|
-
(detection.boundingBox.height / video.videoHeight) * videoRect.height;
|
|
313
|
-
const isInside = faceLeft >= guideRect.left &&
|
|
314
|
-
faceTop >= guideRect.top &&
|
|
315
|
-
faceRight <= guideRect.right &&
|
|
316
|
-
faceBottom <= guideRect.bottom;
|
|
317
|
-
return isInside;
|
|
318
|
-
}
|
|
319
|
-
async function validateFaceFromImage(image) {
|
|
320
|
-
const detector = await getDetector('IMAGE');
|
|
321
|
-
const result = detector.detect(image);
|
|
322
|
-
const detection = result.detections.at(0);
|
|
323
|
-
if (!detection)
|
|
324
|
-
return false;
|
|
325
|
-
const category = detection.categories.at(0);
|
|
326
|
-
return !category || category.score < 0.75 ? false : true;
|
|
327
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
4
|
-
import { Spinner02Icon } from '../../icons/Spinner02Icon.js';
|
|
5
|
-
const Component = dynamic(() => import('./SelfieField.client.js').then((mod) => mod.SelfieField__client), {
|
|
6
|
-
ssr: false,
|
|
7
|
-
loading: () => (_jsx("div", { className: "border-border-primary bg-bg-primary flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border", children: _jsx(Spinner02Icon, { className: "text-text-quinary size-8" }) })),
|
|
8
|
-
});
|
|
9
|
-
export function SelfieField(props) {
|
|
10
|
-
return _jsx(Component, { ...props });
|
|
11
|
-
}
|
|
@@ -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,10 +0,0 @@
|
|
|
1
|
-
export declare const ACCOUNT_GRAPHQL_ENDPOINT: string;
|
|
2
|
-
export declare const FILE_GRAPHQL_ENDPOINT: string;
|
|
3
|
-
export declare const GAME_GRAPHQL_ENDPOINT: string;
|
|
4
|
-
export declare const PORTAL_GRAPHQL_ENDPOINT: string;
|
|
5
|
-
export declare const REPORT_GRAPHQL_ENDPOINT: string;
|
|
6
|
-
export declare const TRIGGER_GRAPHQL_ENDPOINT: string;
|
|
7
|
-
export declare const WALLET_GRAPHQL_ENDPOINT: string;
|
|
8
|
-
export declare const AUTH_ENDPOINT: string;
|
|
9
|
-
export declare const CMS_PORTAL_ENDPOINT: string;
|
|
10
|
-
export declare const STATIC_ENDPOINT: string;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ENVIRONMENT } from './envVars.js';
|
|
2
|
-
export const ACCOUNT_GRAPHQL_ENDPOINT = {
|
|
3
|
-
development: 'https://account.development.opexa.io/graphql',
|
|
4
|
-
production: 'https://account.opexa.io/graphql',
|
|
5
|
-
}[ENVIRONMENT];
|
|
6
|
-
export const FILE_GRAPHQL_ENDPOINT = {
|
|
7
|
-
development: 'https://file.development.opexa.io/graphql',
|
|
8
|
-
production: 'https://file.opexa.io/graphql',
|
|
9
|
-
}[ENVIRONMENT];
|
|
10
|
-
export const GAME_GRAPHQL_ENDPOINT = {
|
|
11
|
-
development: 'https://game.development.opexa.io/graphql',
|
|
12
|
-
production: 'https://game.opexa.io/graphql',
|
|
13
|
-
}[ENVIRONMENT];
|
|
14
|
-
export const PORTAL_GRAPHQL_ENDPOINT = {
|
|
15
|
-
development: 'https://portal.development.opexa.io/graphql',
|
|
16
|
-
production: 'https://portal.opexa.io/graphql',
|
|
17
|
-
}[ENVIRONMENT];
|
|
18
|
-
export const REPORT_GRAPHQL_ENDPOINT = {
|
|
19
|
-
development: 'https://report.development.opexa.io/graphql',
|
|
20
|
-
production: 'https://report.opexa.io/graphql',
|
|
21
|
-
}[ENVIRONMENT];
|
|
22
|
-
export const TRIGGER_GRAPHQL_ENDPOINT = {
|
|
23
|
-
development: 'https://trigger.development.opexa.io/graphql',
|
|
24
|
-
production: 'https://trigger.opexa.io/graphql',
|
|
25
|
-
}[ENVIRONMENT];
|
|
26
|
-
export const WALLET_GRAPHQL_ENDPOINT = {
|
|
27
|
-
development: 'https://wallet.development.opexa.io/graphql',
|
|
28
|
-
production: 'https://wallet.opexa.io/graphql',
|
|
29
|
-
}[ENVIRONMENT];
|
|
30
|
-
export const AUTH_ENDPOINT = {
|
|
31
|
-
development: 'https://auth.development.opexa.io',
|
|
32
|
-
production: 'https://auth.opexa.io',
|
|
33
|
-
}[ENVIRONMENT];
|
|
34
|
-
export const CMS_PORTAL_ENDPOINT = {
|
|
35
|
-
development: 'https://portal-api.opexacms.io',
|
|
36
|
-
production: 'https://portal-api.opexacms.io',
|
|
37
|
-
}[ENVIRONMENT];
|
|
38
|
-
export const STATIC_ENDPOINT = {
|
|
39
|
-
development: 'https://static.development.atalos.io',
|
|
40
|
-
production: 'https://static.atalos.io',
|
|
41
|
-
}[ENVIRONMENT];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const SITE_ID = z
|
|
3
|
-
.string()
|
|
4
|
-
.min(1, 'Environment variable "NEXT_PUBLIC_SITE_ID" must be 1 or more characters')
|
|
5
|
-
.max(32, 'Environment variable "NEXT_PUBLIC_SITE_ID" must not be more than 32 characters')
|
|
6
|
-
.trim()
|
|
7
|
-
.parse(process.env.NEXT_PUBLIC_SITE_ID);
|
|
8
|
-
export const PLATFORM_ID = z
|
|
9
|
-
.string()
|
|
10
|
-
.min(1, 'Environment variable "NEXT_PUBLIC_PLATFORM_ID" must be 1 or more characters')
|
|
11
|
-
.max(32, 'Environment variable "NEXT_PUBLIC_PLATFORM_ID" must not be more than 32 characters')
|
|
12
|
-
.trim()
|
|
13
|
-
.parse(process.env.NEXT_PUBLIC_PLATFORM_ID);
|
|
14
|
-
export const PLATFORM_CODE = z
|
|
15
|
-
.string()
|
|
16
|
-
.min(4, 'Environment variable "NEXT_PUBLIC_PLATFORM_CODE" must be at least 4 characters')
|
|
17
|
-
.max(8, 'Environment variable "NEXT_PUBLIC_PLATFORM_CODE" must not be more than 8 characters')
|
|
18
|
-
.trim()
|
|
19
|
-
.parse(process.env.NEXT_PUBLIC_PLATFORM_CODE);
|
|
20
|
-
export const ENVIRONMENT = z
|
|
21
|
-
.enum(['production', 'development'])
|
|
22
|
-
.catch('development')
|
|
23
|
-
.parse(process.env.NEXT_PUBLIC_ENVIRONMENT);
|
|
24
|
-
export const BYPASS_RECAPTCHA = z
|
|
25
|
-
.any()
|
|
26
|
-
.transform(Boolean)
|
|
27
|
-
.catch(false)
|
|
28
|
-
.parse(process.env.NEXT_PUBLIC_BYPASS_RECAPTCHA);
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { GameProvider, GameProviderData } from '../types';
|
|
2
|
-
export declare const GAME_PROVIDER_DATA: Record<GameProvider, GameProviderData>;
|
|
3
|
-
export declare const GAME_PROVIDERS: [
|
|
4
|
-
'ALIZE',
|
|
5
|
-
'BGAMING',
|
|
6
|
-
'BOOONGO',
|
|
7
|
-
'EVOPLAY',
|
|
8
|
-
'BTI',
|
|
9
|
-
'CQ9',
|
|
10
|
-
'DARWIN',
|
|
11
|
-
'DG',
|
|
12
|
-
'DRBINGO',
|
|
13
|
-
'E2E',
|
|
14
|
-
'ETENGJUE',
|
|
15
|
-
'EVOLUTION',
|
|
16
|
-
'EVOLUTION_REDTIGER',
|
|
17
|
-
'EZUGI',
|
|
18
|
-
'FACHAI',
|
|
19
|
-
'HABANERO',
|
|
20
|
-
'HACKSAW',
|
|
21
|
-
'HOLLYWOODTV',
|
|
22
|
-
'JDB',
|
|
23
|
-
'JILI',
|
|
24
|
-
'JDBGTF',
|
|
25
|
-
'JOKER',
|
|
26
|
-
'JDBSPRIBE',
|
|
27
|
-
'JILI_BINGO',
|
|
28
|
-
'KINGMAKER',
|
|
29
|
-
'KINGMIDAS',
|
|
30
|
-
'MEGA2SPIN',
|
|
31
|
-
'MICROGAMING',
|
|
32
|
-
'MEGABALL',
|
|
33
|
-
'ONEAPI_EVOLUTION',
|
|
34
|
-
'PGSOFT',
|
|
35
|
-
'PLAYTECH',
|
|
36
|
-
'PRAGMATICPLAY',
|
|
37
|
-
'RELAXGAMING',
|
|
38
|
-
'RTG',
|
|
39
|
-
'SABA',
|
|
40
|
-
'SPINIX',
|
|
41
|
-
'SPRIBE',
|
|
42
|
-
'YELLOWBAT',
|
|
43
|
-
'EVOLUTION_NETENT',
|
|
44
|
-
];
|
|
45
|
-
export declare const LEGACY_GAME_PROVIDERS: [
|
|
46
|
-
'JILI',
|
|
47
|
-
'PGSOFT',
|
|
48
|
-
'FACHAI',
|
|
49
|
-
'BTI',
|
|
50
|
-
'DG',
|
|
51
|
-
'PLAYTECH',
|
|
52
|
-
'E2E',
|
|
53
|
-
'ONEAPI_EVOLUTION',
|
|
54
|
-
'CQ9',
|
|
55
|
-
'JDB',
|
|
56
|
-
'HABANERO',
|
|
57
|
-
'SPINIX',
|
|
58
|
-
'JOKER',
|
|
59
|
-
'HACKSAW',
|
|
60
|
-
'JDBGTF',
|
|
61
|
-
'JDBSPRIBE',
|
|
62
|
-
'MICROGAMING',
|
|
63
|
-
'RELAXGAMING',
|
|
64
|
-
'EVOPLAY',
|
|
65
|
-
'BOOONGO',
|
|
66
|
-
'BGAMING',
|
|
67
|
-
'KINGMAKER',
|
|
68
|
-
'KINGMIDAS',
|
|
69
|
-
'YELLOWBAT',
|
|
70
|
-
'ETENGJUE',
|
|
71
|
-
'SABA',
|
|
72
|
-
'PRAGMATICPLAY',
|
|
73
|
-
'SPRIBE',
|
|
74
|
-
'EZUGI',
|
|
75
|
-
'ALIZE',
|
|
76
|
-
];
|