@opexa/portal-components 0.0.697 → 0.0.699

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/client/hooks/useCreateGCashWebpayDepositMutation.d.ts +4 -0
  2. package/dist/client/hooks/useCreateGCashWebpayDepositMutation.js +73 -0
  3. package/dist/components/AccountInfo/GoogleDisconnect.d.ts +7 -0
  4. package/dist/components/AccountInfo/GoogleDisconnect.js +11 -0
  5. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +24 -16
  6. package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit /GCashWebpayDeposit .d.ts +1 -0
  7. package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit /GCashWebpayDeposit .js +191 -0
  8. package/dist/components/DepositWithdrawal/PaymentMethods.js +7 -2
  9. package/dist/components/DepositWithdrawal/utils.d.ts +1 -1
  10. package/dist/components/DepositWithdrawal/utils.js +1 -0
  11. package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
  12. package/dist/components/DigitainLauncher/Loading.js +5 -0
  13. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +23 -0
  14. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +1 -1
  15. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.d.ts +24 -1
  16. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +41 -9
  17. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +22 -0
  18. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
  19. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +24 -1
  20. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +32 -10
  21. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +24 -1
  22. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +32 -10
  23. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +1 -0
  24. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +11 -0
  25. package/dist/components/KYC/BasicInformation.d.ts +1 -0
  26. package/dist/components/KYC/BasicInformation.js +101 -0
  27. package/dist/components/KYC/IdentityVerification.d.ts +1 -0
  28. package/dist/components/KYC/IdentityVerification.js +120 -0
  29. package/dist/components/KYC/Indicator.d.ts +1 -0
  30. package/dist/components/KYC/Indicator.js +8 -0
  31. package/dist/components/KYC/KYC.lazy.d.ts +6 -0
  32. package/dist/components/KYC/KYC.lazy.js +45 -0
  33. package/dist/components/KYC/KYCContext.d.ts +6 -0
  34. package/dist/components/KYC/KYCContext.js +2 -0
  35. package/dist/components/KYC/PersonalInformation.d.ts +1 -0
  36. package/dist/components/KYC/PersonalInformation.js +122 -0
  37. package/dist/components/KYC/useKYC.d.ts +25 -0
  38. package/dist/components/KYC/useKYC.js +38 -0
  39. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
  40. package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
  41. package/dist/icons/LinkBrokenIcon.d.ts +2 -0
  42. package/dist/icons/LinkBrokenIcon.js +4 -0
  43. package/dist/images/responsible-gaming-yellow.png +0 -0
  44. package/dist/services/queries.d.ts +1 -1
  45. package/dist/services/queries.js +3 -0
  46. package/dist/services/wallet.d.ts +2 -0
  47. package/dist/services/wallet.js +4 -4
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
  50. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
  51. package/dist/ui/Carousel/Carousel.d.ts +72 -72
  52. package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
  53. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  54. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  55. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  56. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  57. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  58. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  59. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  60. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  61. package/dist/ui/Menu/Menu.d.ts +252 -252
  62. package/dist/ui/Menu/menu.recipe.d.ts +14 -14
  63. package/dist/ui/Progress/Progress.d.ts +27 -27
  64. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  65. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  66. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  67. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  68. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  69. package/dist/ui/Select/Select.d.ts +45 -45
  70. package/dist/ui/Select/select.recipe.d.ts +3 -3
  71. package/package.json +1 -1
@@ -60,6 +60,28 @@ export interface JackpotsListProps {
60
60
  };
61
61
  };
62
62
  jackpotProfileShape?: 'oval' | 'star';
63
+ chestImagesByTier?: {
64
+ grand?: {
65
+ open: ImageProps['src'];
66
+ closed: ImageProps['src'];
67
+ };
68
+ major?: {
69
+ open: ImageProps['src'];
70
+ closed: ImageProps['src'];
71
+ };
72
+ minor?: {
73
+ open: ImageProps['src'];
74
+ closed: ImageProps['src'];
75
+ };
76
+ default?: {
77
+ open: ImageProps['src'];
78
+ closed: ImageProps['src'];
79
+ };
80
+ style?: {
81
+ wrapper?: string;
82
+ image?: string;
83
+ };
84
+ };
63
85
  }
64
86
  export declare function JackpotsList(props: JackpotsListProps): import("react/jsx-runtime").JSX.Element;
65
87
  export {};
@@ -34,5 +34,5 @@ export function JackpotsList(props) {
34
34
  const classNames = isString(props.className)
35
35
  ? { root: props.className }
36
36
  : (props.className ?? {});
37
- return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { ref: ref, style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 font-semibold text-lg lg:mb-4.5", children: props.heading ?? 'Jackpots' }), jackpots.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape }) }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape }) }, jackpot.id))) })] })) : (_jsxs("div", { className: "mt-5 flex h-fit flex-col items-center justify-center lg:mt-0 lg:h-62", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", className: "size-full h-29.5 w-29.5 mix-blend-luminosity lg:h-25 lg:w-25" }), _jsx("div", { className: "mt-4 font-semibold text-base text-text-primary-900", children: "No Jackpots" }), _jsxs("div", { className: "mt-1 text-center text-sm text-text-tertiary-600", children: ["No jackpots are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
37
+ return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { ref: ref, style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 font-semibold text-lg lg:mb-4.5", children: props.heading ?? 'Jackpots' }), jackpots.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot, index) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier }) }, index))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot, index) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier }) }, index))) })] })) : (_jsxs("div", { className: "mt-5 flex h-fit flex-col items-center justify-center lg:mt-0 lg:h-62", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", className: "size-full h-29.5 w-29.5 mix-blend-luminosity lg:h-25 lg:w-25" }), _jsx("div", { className: "mt-4 font-semibold text-base text-text-primary-900", children: "No Jackpots" }), _jsxs("div", { className: "mt-1 text-center text-sm text-text-tertiary-600", children: ["No jackpots are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
38
38
  }
@@ -1,3 +1,4 @@
1
+ import { type ImageProps } from 'next/image';
1
2
  import type { CSSProperties } from 'react';
2
3
  import type { ClassNameEntries } from './JackpotsList';
3
4
  interface JackpotsListItemDesktopProps {
@@ -14,7 +15,29 @@ interface JackpotsListItemDesktopProps {
14
15
  image?: string;
15
16
  };
16
17
  };
18
+ chestImagesByTier?: {
19
+ grand?: {
20
+ open: ImageProps['src'];
21
+ closed: ImageProps['src'];
22
+ };
23
+ major?: {
24
+ open: ImageProps['src'];
25
+ closed: ImageProps['src'];
26
+ };
27
+ minor?: {
28
+ open: ImageProps['src'];
29
+ closed: ImageProps['src'];
30
+ };
31
+ default?: {
32
+ open: ImageProps['src'];
33
+ closed: ImageProps['src'];
34
+ };
35
+ style?: {
36
+ wrapper?: string;
37
+ image?: string;
38
+ };
39
+ };
17
40
  jackpotProfileShape?: 'oval' | 'star';
18
41
  }
19
- export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element | null;
42
+ export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, chestImagesByTier, jackpotProfileShape, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element | null;
20
43
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Progress } from '@ark-ui/react/progress';
3
3
  import { format } from 'date-fns';
4
- import Image from 'next/image';
4
+ import Image, {} from 'next/image';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
7
7
  import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
@@ -23,9 +23,37 @@ import { useJackpotsListItemContext } from './JackpotsListContext.js';
23
23
  import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
24
24
  import { JackpotsListItemRules } from './JackpotsListItemRules.js';
25
25
  import { useJackpotsListItemData } from './useJackpotsListItemData.js';
26
- export function JackpotsListItemDesktop({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', className, ...props }) {
26
+ export function JackpotsListItemDesktop({ animate = true, customJackpotChestImage, chestImagesByTier, jackpotProfileShape = 'oval', className, ...props }) {
27
27
  const jackpot = useJackpotsListItemContext();
28
- const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
28
+ const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, getTierFromName, } = useJackpotsListItemData();
29
+ const getChestImages = () => {
30
+ // Priority: chestImagesByTier > customJackpotChestImage > default
31
+ if (chestImagesByTier) {
32
+ const tier = getTierFromName(jackpot.name);
33
+ const tierImages = chestImagesByTier[tier] || chestImagesByTier.default;
34
+ if (tierImages) {
35
+ return {
36
+ open: tierImages.open,
37
+ closed: tierImages.closed,
38
+ style: chestImagesByTier.style,
39
+ };
40
+ }
41
+ }
42
+ if (customJackpotChestImage?.image) {
43
+ return {
44
+ open: customJackpotChestImage.image.open,
45
+ closed: customJackpotChestImage.image.closed,
46
+ style: customJackpotChestImage.style,
47
+ };
48
+ }
49
+ // Default fallback
50
+ return {
51
+ open: openChest,
52
+ closed: closeChest,
53
+ style: undefined,
54
+ };
55
+ };
56
+ const chestImages = getChestImages();
29
57
  const ProfileIcon = () => jackpotProfileShape === 'oval' ? (_jsxs("div", { className: "relative flex h-18 w-18 items-center justify-center rounded-full bg-bg-tertiary", children: [_jsx(User01Icon, { className: "size-9 text-text-quarterary-500" }), _jsx("div", { className: twMerge('absolute right-0 bottom-safe-area-inset-bottom flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] })) : (_jsxs("div", { className: "relative grid h-18 w-18", children: [_jsx(StarIcon, { className: "col-start-1 row-start-1 h-full w-full" }), _jsx(User01Icon, { className: "z-10 col-start-1 row-start-1 size-9 place-self-center text-text-quarterary-500" }), _jsx("div", { className: twMerge('-right-0 absolute bottom-safe-area-inset-bottom z-20 flex h-7 w-7 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 text-center font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] }));
30
58
  const PayoutBadge = () => (_jsxs("div", { className: twMerge('flex h-fit w-fit items-center gap-1 rounded-sm border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', className?.latestPayoutBadgeRoot), children: [_jsx(Trophy01Icon, { className: twMerge('size-3.5 text-utility-brand-600', className?.latestPayoutBadgeIcon) }), "Latest Payout"] }));
31
59
  const ProgressBar = () => (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-1 flex justify-between", children: [_jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(0, {
@@ -72,13 +100,7 @@ export function JackpotsListItemDesktop({ animate = true, customJackpotChestImag
72
100
  currency: localeInfo.currency.code,
73
101
  minDecimalPlaces: 2,
74
102
  maxDecimalPlaces: 2,
75
- }) })] }), _jsx("div", { className: "min-w-30" }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 min-w-30 lg:absolute', customJackpotChestImage?.style?.wrapper), children: _jsx(Image, { width: 150, height: 150, src: customJackpotChestImage?.image
76
- ? isPayingOut
77
- ? customJackpotChestImage.image.open
78
- : customJackpotChestImage.image.closed
79
- : isPayingOut
80
- ? openChest
81
- : closeChest, alt: "closeChest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.style?.image) }) })] }), _jsx("div", { className: twMerge('relative mt-4 hidden w-full gap-4 rounded-lg bg-bg-primary p-4 lg:flex', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
103
+ }) })] }), _jsx("div", { className: "min-w-30" }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 min-w-30 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? chestImages.open : chestImages.closed, alt: "chest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', chestImages?.style?.image) }) })] }), _jsx("div", { className: twMerge('relative mt-4 hidden w-full gap-4 rounded-lg bg-bg-primary p-4 lg:flex', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
82
104
  totalCharsCount: 6,
83
105
  }) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
84
106
  currency: localeInfo.currency.code,
@@ -1,3 +1,4 @@
1
+ import { type ImageProps } from 'next/image';
1
2
  import { type CSSProperties } from 'react';
2
3
  import type { ClassNameEntries } from './JackpotsList';
3
4
  interface JackpotsListItemMobileProps {
@@ -14,7 +15,29 @@ interface JackpotsListItemMobileProps {
14
15
  image?: string;
15
16
  };
16
17
  };
18
+ chestImagesByTier?: {
19
+ grand?: {
20
+ open: ImageProps['src'];
21
+ closed: ImageProps['src'];
22
+ };
23
+ major?: {
24
+ open: ImageProps['src'];
25
+ closed: ImageProps['src'];
26
+ };
27
+ minor?: {
28
+ open: ImageProps['src'];
29
+ closed: ImageProps['src'];
30
+ };
31
+ default?: {
32
+ open: ImageProps['src'];
33
+ closed: ImageProps['src'];
34
+ };
35
+ style?: {
36
+ wrapper?: string;
37
+ image?: string;
38
+ };
39
+ };
17
40
  jackpotProfileShape?: 'oval' | 'star';
18
41
  }
19
- export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element | null;
42
+ export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, chestImagesByTier, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element | null;
20
43
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Progress } from '@ark-ui/react/progress';
3
3
  import { format } from 'date-fns';
4
- import Image from 'next/image';
4
+ import Image, {} from 'next/image';
5
5
  import { useCallback, useEffect, useId, useState, } from 'react';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { ArrowNarrowDownIcon } from '../../../icons/ArrowNarrowDownIcon.js';
@@ -31,9 +31,37 @@ function getPercentage(value, total) {
31
31
  const t = parseDecimal(total, 0);
32
32
  return t === 0 ? 0 : (v / t) * 100;
33
33
  }
34
- export function JackpotsListItemMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', className, ...props }) {
34
+ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', chestImagesByTier, className, ...props }) {
35
35
  const jackpot = useJackpotsListItemContext();
36
- const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, } = useJackpotsListItemData();
36
+ const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, getTierFromName, } = useJackpotsListItemData();
37
+ const getChestImages = () => {
38
+ // Priority: chestImagesByTier > customJackpotChestImage > default
39
+ if (chestImagesByTier) {
40
+ const tier = getTierFromName(jackpot.name);
41
+ const tierImages = chestImagesByTier[tier] || chestImagesByTier.default;
42
+ if (tierImages) {
43
+ return {
44
+ open: tierImages.open,
45
+ closed: tierImages.closed,
46
+ style: chestImagesByTier.style,
47
+ };
48
+ }
49
+ }
50
+ if (customJackpotChestImage?.image) {
51
+ return {
52
+ open: customJackpotChestImage.image.open,
53
+ closed: customJackpotChestImage.image.closed,
54
+ style: customJackpotChestImage.style,
55
+ };
56
+ }
57
+ // Default fallback
58
+ return {
59
+ open: openChest,
60
+ closed: closeChest,
61
+ style: undefined,
62
+ };
63
+ };
64
+ const chestImages = getChestImages();
37
65
  const [isDetailsVisible, setIsDetailsVisible] = useState(false);
38
66
  const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
39
67
  const [minLimitTooltipOpen, setMinLimitTooltipOpen] = useState(false);
@@ -107,13 +135,7 @@ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage
107
135
  currency: localeInfo.currency.code,
108
136
  minDecimalPlaces: 2,
109
137
  maxDecimalPlaces: 2,
110
- }) })] }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 block min-w-34.5 lg:absolute', customJackpotChestImage?.style?.wrapper), children: _jsx(Image, { width: 100, height: 100, src: customJackpotChestImage?.image
111
- ? isPayingOut
112
- ? customJackpotChestImage.image.open
113
- : customJackpotChestImage.image.closed
114
- : isPayingOut
115
- ? openChest
116
- : closeChest, alt: "closeChest", className: twMerge('size-full h-34.5 w-34.5 p-2 lg:h-37.5 lg:w-37.5', customJackpotChestImage?.style?.image) }) })] }) }) }) }), _jsx(ProgressBar, {}), _jsx("div", { className: twMerge('relative mt-4 flex w-full gap-4 rounded-lg bg-bg-primary p-4', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
138
+ }) })] }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 block min-w-34.5 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 100, height: 100, src: isPayingOut ? chestImages.open : chestImages.closed, alt: "chest", className: twMerge('size-full h-34.5 w-34.5 p-2 lg:h-37.5 lg:w-37.5', chestImages?.style?.image) }) })] }) }) }) }), _jsx(ProgressBar, {}), _jsx("div", { className: twMerge('relative mt-4 flex w-full gap-4 rounded-lg bg-bg-primary p-4', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
117
139
  totalCharsCount: 6,
118
140
  }) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
119
141
  currency: localeInfo.currency.code,
@@ -8,4 +8,5 @@ export declare function useJackpotsListItemData(): {
8
8
  jackpotAmount: string;
9
9
  arrowImages: import("react/jsx-runtime").JSX.Element[];
10
10
  getAccumulatingJackpotDescription: (part: number, total: number) => string;
11
+ getTierFromName: (name: string) => "grand" | "major" | "minor" | "default";
11
12
  };
@@ -55,6 +55,16 @@ export function useJackpotsListItemData() {
55
55
  ? 'The jackpot is heating up! Keep playing to stay in the action and watch it grow!'
56
56
  : '🔥 It’s about to pop! Stay in the game for your shot at the prize!';
57
57
  };
58
+ const getTierFromName = (name) => {
59
+ const lowerName = name.toLowerCase();
60
+ if (lowerName.includes('grand'))
61
+ return 'grand';
62
+ if (lowerName.includes('major'))
63
+ return 'major';
64
+ if (lowerName.includes('minor'))
65
+ return 'minor';
66
+ return 'default';
67
+ };
58
68
  return {
59
69
  rootRef,
60
70
  jackpotPayouts,
@@ -65,5 +75,6 @@ export function useJackpotsListItemData() {
65
75
  jackpotAmount,
66
76
  arrowImages,
67
77
  getAccumulatingJackpotDescription,
78
+ getTierFromName,
68
79
  };
69
80
  }
@@ -0,0 +1 @@
1
+ export declare function BasicInformation(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,101 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import { differenceInYears, format, isSameDay, isValid, parse } from 'date-fns';
4
+ import { isNil, omitBy, size } from 'lodash-es';
5
+ import { useEffect } from 'react';
6
+ import { useForm } from 'react-hook-form';
7
+ import invariant from 'tiny-invariant';
8
+ import { z } from 'zod';
9
+ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
10
+ import { useUpdateAccountMutation } from '../../client/hooks/useUpdateAccountMutation.js';
11
+ import { toaster } from '../../client/utils/toaster.js';
12
+ import { Button } from '../../ui/Button/index.js';
13
+ import { Dialog } from '../../ui/Dialog/index.js';
14
+ import { Field } from '../../ui/Field/index.js';
15
+ import { useKYCContext } from './KYCContext.js';
16
+ const definition = z.object({
17
+ realName: z
18
+ .string()
19
+ .min(3, 'Name must be 3 or more characters')
20
+ .max(50, 'Name must not be more than 50 characters')
21
+ .regex(/^[a-z0-9 ]+$/gi, 'Name must not contain special characters')
22
+ .trim(),
23
+ birthDay: z
24
+ .string()
25
+ .min(1, 'Date of birth is required')
26
+ .superRefine((value, ctx) => {
27
+ const dob = parse(value, 'yyyy-MM-dd', new Date());
28
+ if (!isValid(dob)) {
29
+ return ctx.addIssue({
30
+ code: z.ZodIssueCode.invalid_date,
31
+ });
32
+ }
33
+ const now = new Date();
34
+ const age = differenceInYears(now, dob);
35
+ if (age < 21) {
36
+ return ctx.addIssue({
37
+ code: z.ZodIssueCode.custom,
38
+ message: 'You must be at least 21 years old',
39
+ });
40
+ }
41
+ }),
42
+ branchCode: z.string().min(4).max(10).optional().or(z.literal('')),
43
+ });
44
+ export function BasicInformation() {
45
+ const kyc = useKYCContext();
46
+ const form = useForm({
47
+ resolver: zodResolver(definition),
48
+ mode: 'all',
49
+ defaultValues: {
50
+ birthDay: '',
51
+ branchCode: '',
52
+ realName: '',
53
+ },
54
+ });
55
+ const accountQuery = useAccountQuery();
56
+ const account = accountQuery.data;
57
+ const stepCompleted = account != null && account.realName != null && account.birthDay != null;
58
+ useEffect(() => {
59
+ if (stepCompleted)
60
+ kyc.setStep(2);
61
+ }, [stepCompleted, kyc]);
62
+ useEffect(() => {
63
+ if (account) {
64
+ form.reset({
65
+ realName: account.realName ?? '',
66
+ birthDay: account.birthDay
67
+ ? format(account.birthDay, 'yyyy-MM-dd')
68
+ : '',
69
+ });
70
+ }
71
+ }, [account, form]);
72
+ const updateAccountMutation = useUpdateAccountMutation({
73
+ onError(error) {
74
+ toaster.error({
75
+ title: 'Error',
76
+ description: error.message,
77
+ });
78
+ },
79
+ onSuccess() {
80
+ kyc.setStep(2);
81
+ toaster.success({
82
+ title: 'Success',
83
+ description: 'Basic information has been set successfully.',
84
+ });
85
+ },
86
+ });
87
+ return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center font-semibold text-lg", children: "Basic Information" }), _jsx(Dialog.Description, { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Enter your basic details for identification and communication." }), _jsxs("form", { className: "mt-3", onSubmit: form.handleSubmit((data) => {
88
+ invariant(account);
89
+ const input = omitBy({
90
+ realName: account.realName === data.realName ? undefined : data.realName,
91
+ birthDay: account.birthDay && isSameDay(data.birthDay, account.birthDay)
92
+ ? undefined
93
+ : format(data.birthDay, 'yyyy-MM-dd'),
94
+ }, isNil);
95
+ if (size(input) === 0)
96
+ return kyc.setStep(2);
97
+ updateAccountMutation.mutate(input);
98
+ }), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!accountQuery.data?.realName, children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-3", invalid: !!form.formState.errors.branchCode, readOnly: !!accountQuery.data?.birthDay, children: [_jsx(Field.Label, { children: "Date of Birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), _jsx(Button, { type: "submit", className: "mt-8", disabled: accountQuery.isLoading ||
99
+ updateAccountMutation.isPending ||
100
+ stepCompleted, children: "Continue" })] })] }));
101
+ }
@@ -0,0 +1 @@
1
+ export declare function IdentityVerification(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,120 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { zodResolver } from '@hookform/resolvers/zod';
4
+ import { useEffect } from 'react';
5
+ import { Controller, useForm } from 'react-hook-form';
6
+ import { z } from 'zod';
7
+ import { useShallow } from 'zustand/shallow';
8
+ import { useCreateMemberVerificationMutation } from '../../client/hooks/useCreateMemberVerificationMutation.js';
9
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
10
+ import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
11
+ import { useUpdateMemberVerificationMutation } from '../../client/hooks/useUpdateMemberVerificationMutation.js';
12
+ import { toaster } from '../../client/utils/toaster.js';
13
+ import { Button } from '../../ui/Button/index.js';
14
+ import { Dialog } from '../../ui/Dialog/index.js';
15
+ import { Field } from '../../ui/Field/index.js';
16
+ import { getQueryClient } from '../../utils/getQueryClient.js';
17
+ import { getMemberVerificationQueryKey } from '../../utils/queryKeys.js';
18
+ import { IdFrontImageField } from '../shared/IdFrontImageField/index.js';
19
+ import { SelfieImageField } from '../shared/SelfieImageField/index.js';
20
+ import { useKYCContext } from './KYCContext.js';
21
+ const formSchema = z.object({
22
+ selfieImage: z.string().min(1, 'Selfie image is required.'),
23
+ idFrontImage: z.string().min(1, 'Front image of ID is required.'),
24
+ });
25
+ export function IdentityVerification() {
26
+ const kyc = useKYCContext();
27
+ const { mutate: createMemberVerification, isPending: createPending } = useCreateMemberVerificationMutation({
28
+ onSuccess: () => {
29
+ toaster.success({
30
+ title: 'ID Front Image & Selfie Image uploaded successfully',
31
+ });
32
+ },
33
+ onError: (error) => {
34
+ toaster.error({
35
+ title: 'Failed to upload ID Front Image & Selfie Image',
36
+ description: error.message,
37
+ });
38
+ },
39
+ });
40
+ const { mutate: updateMemberVerification, isPending: updatePending } = useUpdateMemberVerificationMutation({
41
+ onSuccess: () => {
42
+ const queryClient = getQueryClient();
43
+ toaster.success({
44
+ title: 'ID Front Image & Selfie Image updated successfully',
45
+ });
46
+ queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
47
+ if (!prev)
48
+ return prev;
49
+ return {
50
+ ...prev,
51
+ status: 'CREATED',
52
+ };
53
+ });
54
+ },
55
+ onError: (error) => {
56
+ toaster.error({
57
+ title: 'Failed to upload ID Front Image & Selfie Image',
58
+ description: error.message,
59
+ });
60
+ },
61
+ });
62
+ const memberVerification = useMemberVerificationQuery();
63
+ const memberId = memberVerification.data?.id;
64
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
65
+ kyc: ctx.kyc,
66
+ })));
67
+ const form = useForm({
68
+ resolver: zodResolver(formSchema),
69
+ defaultValues: {
70
+ idFrontImage: '',
71
+ selfieImage: '',
72
+ },
73
+ });
74
+ function onSubmit(values) {
75
+ if (!memberId) {
76
+ createMemberVerification({
77
+ selfieImage: values.selfieImage,
78
+ idFrontImage: values.idFrontImage,
79
+ address: '',
80
+ nationality: '',
81
+ natureOfWork: '',
82
+ permanentAddress: '',
83
+ placeOfBirth: '',
84
+ sourceOfIncome: '',
85
+ });
86
+ kyc.setStep(3);
87
+ }
88
+ else {
89
+ updateMemberVerification({
90
+ id: memberId,
91
+ data: {
92
+ selfieImage: values.selfieImage,
93
+ idFrontImage: values.idFrontImage,
94
+ },
95
+ });
96
+ kyc.setStep(3);
97
+ }
98
+ }
99
+ useEffect(() => {
100
+ if (kyc.selfieImageId)
101
+ form.setValue('selfieImage', kyc.selfieImageId);
102
+ if (kyc.idFrontImageId)
103
+ form.setValue('idFrontImage', kyc.idFrontImageId);
104
+ }, [form, kyc.idFrontImageId, kyc.selfieImageId]);
105
+ return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center font-semibold text-lg", children: "Verify your identity" }), _jsx(Dialog.Description, { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Verify your details to confirm your identity and secure your access." }), _jsxs("div", { className: "mt-7 rounded-xl border border-border-primary bg-bg-primary p-lg text-text-placeholder text-xs leading-tight", children: [_jsx("h3", { className: "font-semibold", children: "Instructions" }), _jsxs("ol", { className: "mt-2 list-inside list-decimal", children: [_jsx("li", { children: "Upload a full photo of your ID." }), _jsx("li", { children: "Please ensure that all details in the uploaded image are legible." }), _jsx("li", { children: "Please ensure that the ID uploaded is within the validity period." })] })] }), _jsxs("form", { className: "mt-xl", onSubmit: form.handleSubmit(onSubmit), children: [_jsx(Controller, { control: form.control, name: "idFrontImage", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsx(Field.Label, { children: "Front of your ID" }), _jsx(IdFrontImageField, { value: o.field.value, onChange: o.field.onChange, onError: (error) => {
106
+ form.setValue('idFrontImage', '');
107
+ form.setError('idFrontImage', {
108
+ type: 'validate',
109
+ message: error.message,
110
+ });
111
+ } }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Controller, { control: form.control, name: "selfieImage", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-3", children: [_jsx(Field.Label, { children: "Selfie holding your ID" }), _jsx(SelfieImageField, { value: o.field.value, onChange: o.field.onChange, onError: (error) => {
112
+ form.setValue('selfieImage', '');
113
+ form.setError('selfieImage', {
114
+ type: 'validate',
115
+ message: error.message,
116
+ });
117
+ } }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", type: "button", onClick: () => {
118
+ globalStore.kyc.setOpen(false);
119
+ }, children: "Skip for now" })] })] }));
120
+ }
@@ -0,0 +1 @@
1
+ export declare function Indicator(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { noop } from 'lodash-es';
3
+ import { Progress } from '../../ui/Progress/index.js';
4
+ import { useKYCContext } from './KYCContext.js';
5
+ export function Indicator() {
6
+ const kyc = useKYCContext();
7
+ return (_jsxs("div", { className: "flex items-center justify-center gap-1.5 py-3", children: [_jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step > 1 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step > 2 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step === 3 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) })] }));
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { ImageProps } from 'next/image';
2
+ import { type KYCReminderProps } from './KYCReminder.lazy';
3
+ export interface KYCProps extends KYCReminderProps {
4
+ logo: ImageProps['src'];
5
+ }
6
+ export declare function KYC(props: KYCProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Image from 'next/image';
3
+ import { useEffect } from 'react';
4
+ import { useShallow } from 'zustand/shallow';
5
+ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
6
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
7
+ import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.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 { BasicInformation } from './BasicInformation.js';
12
+ import { IdentityVerification } from './IdentityVerification.js';
13
+ import { Indicator } from './Indicator.js';
14
+ import { KYCContext } from './KYCContext.js';
15
+ import { KYCReminder } from './KYCReminder.lazy.js';
16
+ import { PersonalInformation } from './PersonalInformation.js';
17
+ import { useKYC } from './useKYC.js';
18
+ export function KYC(props) {
19
+ const globalStore = useGlobalStore(useShallow((ctx) => ({ kyc: ctx.kyc })));
20
+ const kyc = useKYC();
21
+ const { data: account } = useAccountQuery();
22
+ const { data: verification } = useMemberVerificationQuery();
23
+ const isBasicInfoCompleted = account?.realName !== null && account?.birthDay !== null;
24
+ const isUploadCompleted = Boolean(verification?.idFrontImage) && Boolean(verification?.selfieImage);
25
+ const isVerified = Boolean(verification?.status === 'VERIFIED') ||
26
+ Boolean(verification?.status === 'PENDING') ||
27
+ Boolean(verification?.status === 'APPROVED');
28
+ const isRejected = Boolean(verification?.status === 'REJECTED');
29
+ const hasMissingData = !isBasicInfoCompleted || !isUploadCompleted || !isVerified;
30
+ const steps = !isBasicInfoCompleted
31
+ ? 1
32
+ : !isUploadCompleted
33
+ ? 2
34
+ : isRejected
35
+ ? 2
36
+ : 3;
37
+ useEffect(() => {
38
+ if (steps) {
39
+ kyc.setStep(steps);
40
+ }
41
+ }, [steps, kyc]);
42
+ return (_jsxs(_Fragment, { children: [_jsx(KYCContext, { value: kyc, children: _jsx(Dialog.Root, { open: globalStore.kyc.open && hasMissingData, onOpenChange: (details) => {
43
+ globalStore.kyc.setOpen(details.open);
44
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: "mx-auto min-h-full w-full overflow-y-auto bg-bg-primary-alt lg:min-h-auto lg:w-fit", children: _jsxs("div", { className: "flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit sm:overflow-auto lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(BasicInformation, {}), kyc.step === 2 && _jsx(IdentityVerification, {}), kyc.step === 3 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
45
+ }
@@ -0,0 +1,6 @@
1
+ import type { UseKYCReturn } from './useKYC';
2
+ export declare const KYCContext: (props: {
3
+ value: UseKYCReturn;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useKYCContext: () => UseKYCReturn;
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../../client/utils/createContext.js';
2
+ export const [KYCContext, useKYCContext] = createContext();
@@ -0,0 +1 @@
1
+ export declare function PersonalInformation(): import("react/jsx-runtime").JSX.Element;