@opexa/portal-components 0.0.794 → 0.0.796

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 (56) hide show
  1. package/dist/components/Banner/Banner.client.d.ts +12 -0
  2. package/dist/components/Banner/Banner.client.js +49 -0
  3. package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
  4. package/dist/components/DigitainLauncher/Loading.js +5 -0
  5. package/dist/components/KYC/BasicInformation.d.ts +1 -0
  6. package/dist/components/KYC/BasicInformation.js +101 -0
  7. package/dist/components/KYC/IdentityVerification.d.ts +1 -0
  8. package/dist/components/KYC/IdentityVerification.js +120 -0
  9. package/dist/components/KYC/Indicator.d.ts +1 -0
  10. package/dist/components/KYC/Indicator.js +8 -0
  11. package/dist/components/KYC/KYC.lazy.d.ts +6 -0
  12. package/dist/components/KYC/KYC.lazy.js +45 -0
  13. package/dist/components/KYC/KYCContext.d.ts +6 -0
  14. package/dist/components/KYC/KYCContext.js +2 -0
  15. package/dist/components/KYC/KYCVerificationStatus.lazy.js +7 -4
  16. package/dist/components/KYC/PersonalInformation.d.ts +1 -0
  17. package/dist/components/KYC/PersonalInformation.js +122 -0
  18. package/dist/components/KYC/useKYC.d.ts +25 -0
  19. package/dist/components/KYC/useKYC.js +38 -0
  20. package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +1 -0
  21. package/dist/components/PortalProvider/AndroidOnlyComponents.js +12 -0
  22. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
  23. package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
  24. package/dist/components/PortalProvider/SessionWatcher.js +13 -0
  25. package/dist/components/SignIn/FacebookSignInTrigger.js +1 -1
  26. package/dist/components/SignIn/GoogleSignInTrigger.js +1 -1
  27. package/dist/components/SignIn/utils.d.ts +8 -0
  28. package/dist/components/SignIn/utils.js +26 -0
  29. package/dist/constants/Branches.d.ts +2 -0
  30. package/dist/constants/Branches.js +42 -0
  31. package/dist/images/responsible-gaming-yellow.png +0 -0
  32. package/dist/services/queries.d.ts +1 -1
  33. package/dist/services/queries.js +7 -0
  34. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
  35. package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
  36. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  37. package/dist/third-parties/FacebookPixel/api.js +1 -0
  38. package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
  39. package/dist/third-parties/FacebookPixel/index.js +1 -0
  40. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
  41. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
  42. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  43. package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
  44. package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
  45. package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
  46. package/dist/third-parties/index.d.ts +2 -0
  47. package/dist/third-parties/index.js +2 -0
  48. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  49. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  50. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  51. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  52. package/dist/ui/Menu/Menu.d.ts +198 -198
  53. package/dist/ui/Menu/menu.recipe.d.ts +11 -11
  54. package/dist/ui/Select/Select.d.ts +45 -45
  55. package/dist/ui/Select/select.recipe.d.ts +3 -3
  56. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+ import { addHours } from 'date-fns';
3
+ import { clamp } from 'lodash-es';
4
+ import { useLocalStorage, useTimeout } from 'usehooks-ts';
5
+ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
6
+ export function CXDTokenObserver() {
7
+ const { data: account } = useAccountQuery();
8
+ const accountCxd = {
9
+ cxd: account?.cellxpertDetails?.cxd,
10
+ };
11
+ const [cxd, setCxd, removeCxd] = useLocalStorage('cxd', null);
12
+ const now = new Date();
13
+ const removeCxdUntilInMs = cxd?.timestamp
14
+ ? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
15
+ : 0;
16
+ useTimeout(() => {
17
+ const isSame = cxd?.cxd === accountCxd.cxd;
18
+ if (!isSame) {
19
+ const extendedTimestamp = addHours(new Date(), 6).getTime();
20
+ setCxd({
21
+ cxd: accountCxd.cxd,
22
+ timestamp: extendedTimestamp,
23
+ });
24
+ }
25
+ }, account ? 100 : null);
26
+ useTimeout(() => {
27
+ removeCxd();
28
+ }, account ? removeCxdUntilInMs : null);
29
+ return null;
30
+ }
@@ -1,6 +1,8 @@
1
1
  'use client';
2
2
  import { useRouter } from 'next/navigation';
3
3
  import { useTimeout } from 'usehooks-ts';
4
+ import { useShallow } from 'zustand/shallow';
5
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
4
6
  import { useSessionHealthQuery } from '../../client/hooks/useSessionHealthQuery.js';
5
7
  import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
6
8
  import { useSignOutMutation } from '../../client/hooks/useSignOutMutation.js';
@@ -12,9 +14,20 @@ export function SessionWatcher() {
12
14
  enabled: sessionQuery.data?.status === 'authenticated',
13
15
  refetchInterval: 1000 * 5,
14
16
  });
17
+ const { gameLaunch } = useGlobalStore(useShallow((ctx) => ({
18
+ gameLaunch: ctx.gameLaunch,
19
+ })));
15
20
  const signOutMutation = useSignOutMutation({
16
21
  onSuccess() {
22
+ if (gameLaunch.details.status === 'PLAYING') {
23
+ gameLaunch.setDetails({
24
+ status: 'WAITING',
25
+ session: null,
26
+ game: null,
27
+ });
28
+ }
17
29
  router.refresh();
30
+ router.push('/');
18
31
  toaster.warning({
19
32
  title: 'Logged Out',
20
33
  description: 'Account accessed from a different device or browser.',
@@ -46,6 +46,6 @@ export const FacebookSignInTrigger = (props) => {
46
46
  description: 'Failed to sign in with Facebook. Please try again.',
47
47
  });
48
48
  }, render: ({ onClick }) => {
49
- return (_jsxs(Button, { variant: "outline", onClick: onClick, colorScheme: "gray", className: `mt-lg border-border-primary bg-bg-primary text-text-secondary-700 ${props.className}`, children: [_jsx(FacebookIcon, { className: "size-6" }), props.text ?? 'Continue with Facebook'] }));
49
+ return (_jsxs(Button, { variant: "outline", id: "fb-btn", onClick: onClick, colorScheme: "gray", className: `mt-lg border-border-primary bg-bg-primary text-text-secondary-700 ${props.className}`, children: [_jsx(FacebookIcon, { className: "size-6" }), props.text ?? 'Continue with Facebook'] }));
50
50
  } }));
51
51
  };
@@ -53,7 +53,7 @@ const Trigger = ({ children, disabled, asChild, onClick, text, className, ...pro
53
53
  }
54
54
  },
55
55
  });
56
- return (_jsx(ark.button, { type: "button", onClick: (e) => {
56
+ return (_jsx(ark.button, { type: "button", id: "google-btn", onClick: (e) => {
57
57
  onClick?.(e);
58
58
  signInGoogle();
59
59
  }, asChild: !children ? true : asChild, disabled: signIn.isPending || disabled, ...props, children: children ?? (_jsxs(Button, { variant: "outline", colorScheme: "gray", className: `bg-bg-primary ${className}`, children: [_jsx(GoogleIcon, { className: "size-6" }), text ?? 'Continue with Google'] })) }));
@@ -0,0 +1,8 @@
1
+ type Options = {
2
+ accountName?: string;
3
+ siteName?: string;
4
+ signInOptions?: 'MOBILE_NUMBER' | 'NAME_AND_PASSWORD';
5
+ };
6
+ export type ErrorCode = 'MEMBER_ACCOUNT_BLACKLISTED' | 'MEMBER_ACCOUNT_SUSPENDED' | 'INVALID_RECAPTCHA_RESPONSE' | 'MEMBER_NOT_FOUND' | 'RATE_LIMIT_REACH' | 'NOT_READY_TO_SEND_VERIFICATION_ERROR' | 'Forbidden';
7
+ export declare function getFriendlyErrorMessage(code: ErrorCode, options?: Options): string;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ export function getFriendlyErrorMessage(code, options) {
2
+ const accountName = options?.accountName ?? '';
3
+ const siteName = options?.siteName ?? '';
4
+ const signInOptions = options?.signInOptions ?? 'NAME_AND_PASSWORD';
5
+ switch (code) {
6
+ case 'MEMBER_ACCOUNT_BLACKLISTED':
7
+ return `Your account ${accountName} has been blacklisted due to a serious violation of our policies. For more information or to appeal, please contact the ${siteName} Chat Support team.`;
8
+ case 'MEMBER_ACCOUNT_SUSPENDED':
9
+ return `Your account ${accountName} has been temporarily suspended. Please reach out to the ${siteName} Chat Support team to learn more and get help with resolving the issue.`;
10
+ case 'INVALID_RECAPTCHA_RESPONSE':
11
+ return 'Invalid reCAPTCHA response';
12
+ case 'MEMBER_NOT_FOUND':
13
+ return 'Account not found. Please check your username and try again.';
14
+ case 'RATE_LIMIT_REACH':
15
+ return 'Rate limit exceeded';
16
+ case 'NOT_READY_TO_SEND_VERIFICATION_ERROR':
17
+ return 'Your account is not ready to send verification requests. Please try again later.';
18
+ case 'Forbidden':
19
+ if (signInOptions === 'MOBILE_NUMBER') {
20
+ return 'Invalid verification code. Please check the code and try again.';
21
+ }
22
+ return 'Invalid username or password, please try again.';
23
+ default:
24
+ return 'Something went wrong. Please try again later.';
25
+ }
26
+ }
@@ -0,0 +1,2 @@
1
+ import type { Branch } from '../types';
2
+ export declare const BRANCHES: Branch[];
@@ -0,0 +1,42 @@
1
+ export const BRANCHES = [
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
+ ];
@@ -44,7 +44,7 @@ export declare const CREATE_AIO_QRPH_DEPOSIT = "\n mutation CreateAIOQRPHDeposi
44
44
  export declare const CREATE_AIO_ONLINE_BANK_DEPOSIT = "\n mutation CreateAIOOnlineBankDeposit(\n $input: CreateAIOOnlineBankDepositInput!\n ) {\n createAIOOnlineBankDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
45
45
  export declare const CREATE_MANUAL_BANK_DEPOSIT = "\n mutation CreateManualBankDeposit($input: CreateManualBankDepositInput!) {\n createManualBankDeposit(input: $input) {\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on FileDoesNotExistError {\n name: __typename\n message\n }\n ... on FileNotReadyError {\n name: __typename\n message\n }\n }\n }\n";
46
46
  export declare const CREATE_MANUAL_UPI_DEPOSIT = "\n mutation CreateManualUPIDeposit($input: CreateManualUPIDepositInput!) {\n createManualUPIDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on UPIReferenceNotAvailableError {\n name: __typename\n message\n }\n }\n }\n";
47
- export declare const DEPOSIT = "\n query Deposit($id: ObjectId!) {\n node(id: $id) {\n ... on GCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaDeposit {\n id\n type\n status\n checkoutUrl\n }\n ... on MayaAppDeposit {\n id\n type\n status\n error\n }\n ... on BankDeposit {\n id\n type\n status\n error\n }\n ... on ManualDeposit {\n id\n type\n status\n error\n }\n ... on QRPHDeposit {\n id\n type\n status\n qrCode\n error\n }\n ... on OnlineBankDeposit {\n id\n type\n status\n vca\n error\n }\n ... on GCashWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on LibanganPayInDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on PisoPayCheckoutDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on AiOGCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOGrabPayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOPalawanPayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOPayMayaDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n }\n }\n";
47
+ export declare const DEPOSIT = "\n query Deposit($id: ObjectId!) {\n node(id: $id) {\n ... on GCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaDeposit {\n id\n type\n status\n checkoutUrl\n }\n ... on MayaAppDeposit {\n id\n type\n status\n error\n }\n ... on BankDeposit {\n id\n type\n status\n error\n }\n ... on ManualDeposit {\n id\n type\n status\n error\n }\n ... on QRPHDeposit {\n id\n type\n status\n qrCode\n error\n }\n ... on OnlineBankDeposit {\n id\n type\n status\n vca\n error\n }\n ... on GCashWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on LibanganPayInDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on PisoPayCheckoutDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on AiOGCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOGrabPayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOPalawanPayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n ... on AiOPayMayaDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n } \n }\n }\n";
48
48
  export declare const DEPOSITS_COUNT = "\n query DepositsCount {\n member {\n depositsCount\n }\n }\n";
49
49
  export declare const TOUCH_GCASH_DEPOSIT = "\n mutation TouchGCashDeposit($input: TouchGCashDepositInput!) {\n touchGCashDeposit(input: $input)\n }\n";
50
50
  export declare const TOUCH_QRPH_DEPOSIT = "\n mutation TouchQRPHDeposit($input: TouchQRPHDepositInput!) {\n touchQRPHDeposit(input: $input)\n }\n";
@@ -1545,6 +1545,13 @@ export const DEPOSIT = /* GraphQL */ `
1545
1545
  status
1546
1546
  checkoutUrl
1547
1547
  error
1548
+ }
1549
+ ... on MayaWebpayDeposit {
1550
+ id
1551
+ type
1552
+ status
1553
+ checkoutUrl
1554
+ error
1548
1555
  }
1549
1556
  }
1550
1557
  }
@@ -0,0 +1,4 @@
1
+ export interface FacebookPixelProps {
2
+ fbId: string;
3
+ }
4
+ export declare function FacebookPixel(props: FacebookPixelProps): null;
@@ -0,0 +1,4 @@
1
+ export function FacebookPixel(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel';
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel.js';
@@ -0,0 +1,4 @@
1
+ export interface GoogleRecaptchaProps {
2
+ siteKey: string;
3
+ }
4
+ export declare function GoogleRecaptcha(props: GoogleRecaptchaProps): null;
@@ -0,0 +1,4 @@
1
+ export function GoogleRecaptcha(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha';
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha.js';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel';
2
+ export * from './GoogleRecaptcha';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel/index.js';
2
+ export * from './GoogleRecaptcha/index.js';