@opexa/portal-components 0.0.119 → 0.0.121

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 (228) hide show
  1. package/dist/client/hooks/useClaimSpotBonusMutation.js +2 -6
  2. package/dist/client/hooks/useGlobalStore.d.ts +1 -0
  3. package/dist/client/hooks/useGlobalStore.js +13 -0
  4. package/dist/components/BetRecords/BetRecords.client.js +3 -1
  5. package/dist/components/Bonus/Bonus.client.js +1 -1
  6. package/dist/components/Bonuses/Bonuses.client.js +24 -14
  7. package/dist/components/Bonuses/ClaimSpotBonus.d.ts +1 -0
  8. package/dist/components/Bonuses/ClaimSpotBonus.js +13 -0
  9. package/dist/components/Bonuses/ClaimSpotBonus.lazy.d.ts +1 -0
  10. package/dist/components/Bonuses/ClaimSpotBonus.lazy.js +50 -0
  11. package/dist/components/Cashback/Cashback.client.js +1 -1
  12. package/dist/components/CustomPromo/CustomPromo.js +1 -1
  13. package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
  14. package/dist/components/GamesSearch/GamesSearch.js +1 -1
  15. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  16. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  17. package/dist/components/KYC/CaptureIdDocument.js +1 -2
  18. package/dist/components/KYC/CaptureSelfie.js +226 -1
  19. package/dist/components/KYC/DisplayImage.d.ts +4 -1
  20. package/dist/components/KYC/DisplayImage.js +2 -4
  21. package/dist/components/KYC/IdentityVerification.js +2 -2
  22. package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
  23. package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
  24. package/dist/components/KYC/loadModels.d.ts +1 -0
  25. package/dist/components/KYC/loadModels.js +9 -0
  26. package/dist/components/KYC/useKYC.d.ts +2 -0
  27. package/dist/components/KYC/useKYC.js +3 -0
  28. package/dist/components/KYC/utils.d.ts +2 -0
  29. package/dist/components/KYC/utils.js +17 -0
  30. package/dist/components/News/News.js +1 -1
  31. package/dist/components/Promo/Promo.client.js +1 -1
  32. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -4
  33. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +28 -25
  34. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +6 -0
  35. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +15 -0
  36. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -4
  37. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +27 -3
  38. package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +6 -0
  39. package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +15 -0
  40. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -4
  41. package/dist/components/Quests/WageringQuest/WageringQuest.js +12 -9
  42. package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +7 -0
  43. package/dist/components/Quests/WageringQuest/WageringQuestRules.js +17 -0
  44. package/dist/components/Search/Search.lazy.js +1 -1
  45. package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -0
  46. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  47. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  48. package/dist/images/ribbon-envelope.png +0 -0
  49. package/dist/services/queries.js +2369 -2369
  50. package/dist/styles/theme.css +699 -699
  51. package/dist/ui/AlertDialog/AlertDialog.d.ts +187 -187
  52. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
  53. package/dist/ui/Avatar/Avatar.d.ts +9 -9
  54. package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
  55. package/dist/ui/Badge/Badge.d.ts +12 -12
  56. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  57. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  58. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  59. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  60. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  61. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  62. package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
  63. package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
  64. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  65. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  66. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  67. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  68. package/dist/ui/Dialog/Dialog.d.ts +187 -187
  69. package/dist/ui/Dialog/dialog.recipe.d.ts +17 -17
  70. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  71. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  72. package/dist/ui/Field/Field.d.ts +105 -0
  73. package/dist/ui/Field/field.recipe.d.ts +15 -0
  74. package/dist/ui/Field/field.recipe.js +5 -0
  75. package/dist/ui/Menu/Menu.d.ts +307 -307
  76. package/dist/ui/Menu/menu.recipe.d.ts +14 -14
  77. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  78. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  79. package/dist/ui/Popover/Popover.d.ts +121 -121
  80. package/dist/ui/Popover/popover.recipe.d.ts +11 -11
  81. package/dist/ui/Progress/Progress.d.ts +27 -27
  82. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  83. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  84. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  85. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  86. package/dist/ui/Select/Select.d.ts +45 -45
  87. package/dist/ui/Select/select.recipe.d.ts +3 -3
  88. package/dist/ui/Table/Table.d.ts +21 -21
  89. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  90. package/dist/ui/Table/table.recipe.d.ts +3 -3
  91. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  92. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  93. package/dist/utils/getQueryClient.js +1 -1
  94. package/package.json +164 -163
  95. package/dist/client/hooks/index.d.ts +0 -65
  96. package/dist/client/hooks/index.js +0 -65
  97. package/dist/client/services/index.d.ts +0 -4
  98. package/dist/client/services/index.js +0 -4
  99. package/dist/client/utils/index.d.ts +0 -3
  100. package/dist/client/utils/index.js +0 -3
  101. package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
  102. package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
  103. package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
  104. package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
  105. package/dist/components/CashbackBonus/index.d.ts +0 -1
  106. package/dist/components/CashbackBonus/index.js +0 -1
  107. package/dist/components/Empty.d.ts +0 -9
  108. package/dist/components/Empty.js +0 -7
  109. package/dist/components/Games/GameContext.d.ts +0 -2
  110. package/dist/components/Games/GameContext.js +0 -2
  111. package/dist/components/InfiniteScroll.d.ts +0 -10
  112. package/dist/components/InfiniteScroll.js +0 -25
  113. package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
  114. package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
  115. package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
  116. package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
  117. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
  118. package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
  119. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
  120. package/dist/components/JackpotCounter/index.d.ts +0 -1
  121. package/dist/components/JackpotCounter/index.js +0 -1
  122. package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
  123. package/dist/components/Jackpots/JackpotDesktop.js +0 -45
  124. package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
  125. package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
  126. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
  127. package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
  128. package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
  129. package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
  130. package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
  131. package/dist/components/Jackpots/JackpotMobile.js +0 -46
  132. package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
  133. package/dist/components/Jackpots/JackpotRules.js +0 -11
  134. package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
  135. package/dist/components/Jackpots/Jackpots.client.js +0 -29
  136. package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
  137. package/dist/components/Jackpots/JackpotsContext.js +0 -3
  138. package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
  139. package/dist/components/Jackpots/useJackpotData.js +0 -93
  140. package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
  141. package/dist/components/Jackpots/useJackpotItemData.js +0 -87
  142. package/dist/components/KYC/Header.d.ts +0 -1
  143. package/dist/components/KYC/Header.js +0 -8
  144. package/dist/components/KYC/Step1.d.ts +0 -1
  145. package/dist/components/KYC/Step1.js +0 -13
  146. package/dist/components/KYC/Step2.d.ts +0 -1
  147. package/dist/components/KYC/Step2.js +0 -13
  148. package/dist/components/KYC/Step3.d.ts +0 -1
  149. package/dist/components/KYC/Step3.js +0 -13
  150. package/dist/components/KYC/Step4.d.ts +0 -1
  151. package/dist/components/KYC/Step4.js +0 -7
  152. package/dist/components/Messages/MessageItem.d.ts +0 -4
  153. package/dist/components/Messages/MessageItem.js +0 -34
  154. package/dist/components/PortalProvider/WebVitals.d.ts +0 -1
  155. package/dist/components/PortalProvider/WebVitals.js +0 -8
  156. package/dist/components/Promo/PromoContent.d.ts +0 -2
  157. package/dist/components/Promo/PromoContent.js +0 -9
  158. package/dist/components/Promos/PromoCarousel.d.ts +0 -2
  159. package/dist/components/Promos/PromoCarousel.js +0 -41
  160. package/dist/components/Promos/PromoGrid.d.ts +0 -2
  161. package/dist/components/Promos/PromoGrid.js +0 -12
  162. package/dist/components/Promos/PromoItem.d.ts +0 -7
  163. package/dist/components/Promos/PromoItem.js +0 -10
  164. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  165. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  166. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  167. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  168. package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
  169. package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
  170. package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
  171. package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
  172. package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
  173. package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
  174. package/dist/components/TournamentCounter/index.d.ts +0 -1
  175. package/dist/components/TournamentCounter/index.js +0 -1
  176. package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
  177. package/dist/components/Tournaments/TournamentDesktop.js +0 -57
  178. package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
  179. package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
  180. package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
  181. package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
  182. package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
  183. package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
  184. package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
  185. package/dist/components/Tournaments/TournamentMobile.js +0 -55
  186. package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
  187. package/dist/components/Tournaments/TournamentRules.js +0 -11
  188. package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
  189. package/dist/components/Tournaments/Tournaments.client.js +0 -20
  190. package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
  191. package/dist/components/Tournaments/TournamentsContext.js +0 -3
  192. package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
  193. package/dist/components/Tournaments/useTournamentData.js +0 -72
  194. package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
  195. package/dist/components/Tournaments/useTournamentItemData.js +0 -64
  196. package/dist/components/index.d.ts +0 -33
  197. package/dist/components/index.js +0 -33
  198. package/dist/constants/endpoints.d.ts +0 -10
  199. package/dist/constants/endpoints.js +0 -41
  200. package/dist/constants/envVars.d.ts +0 -5
  201. package/dist/constants/envVars.js +0 -28
  202. package/dist/constants/gameProviders.d.ts +0 -4
  203. package/dist/constants/gameProviders.js +0 -368
  204. package/dist/constants/gameTypes.d.ts +0 -3
  205. package/dist/constants/gameTypes.js +0 -64
  206. package/dist/constants/headerKeys.d.ts +0 -2
  207. package/dist/constants/headerKeys.js +0 -2
  208. package/dist/constants/secretQuestions.d.ts +0 -3
  209. package/dist/constants/secretQuestions.js +0 -24
  210. package/dist/constants/storageKeys.d.ts +0 -2
  211. package/dist/constants/storageKeys.js +0 -2
  212. package/dist/icons/index.d.ts +0 -65
  213. package/dist/icons/index.js +0 -65
  214. package/dist/images/hacksaw-gaming.png +0 -0
  215. package/dist/server/services/index.d.ts +0 -4
  216. package/dist/server/services/index.js +0 -4
  217. package/dist/server/utils/index.d.ts +0 -29
  218. package/dist/server/utils/index.js +0 -29
  219. package/dist/ui/Presence.d.ts +0 -2
  220. package/dist/ui/Presence.js +0 -7
  221. package/dist/ui/Prose.d.ts +0 -2
  222. package/dist/ui/Prose.js +0 -5
  223. package/dist/ui/index.d.ts +0 -26
  224. package/dist/ui/index.js +0 -26
  225. package/dist/utils/index.d.ts +0 -17
  226. package/dist/utils/index.js +0 -17
  227. package/dist/utils/isMobile.d.ts +0 -5
  228. package/dist/utils/isMobile.js +0 -9
@@ -1,24 +1,20 @@
1
1
  import { useMutation } from '@tanstack/react-query';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { claimSpotBonus } from '../../services/wallet.js';
4
- import { getQueryClient } from '../../utils/getQueryClient.js';
5
4
  import { getClaimSpotBonusMutationKey } from '../../utils/mutationKeys.js';
6
- import { getBonusesQueryKey } from '../../utils/queryKeys.js';
7
5
  import { getSession } from '../services/getSession.js';
8
6
  export const useClaimSpotBonusMutation = (config) => {
9
- const queryClient = getQueryClient();
10
7
  return useMutation({
11
8
  ...config,
12
9
  mutationKey: getClaimSpotBonusMutationKey(),
13
- mutationFn: async (id) => {
10
+ mutationFn: async (code) => {
14
11
  const session = await getSession();
15
12
  invariant(session.status === 'authenticated');
16
- await claimSpotBonus(id, {
13
+ await claimSpotBonus(code, {
17
14
  headers: {
18
15
  Authorization: `Bearer ${session.token}`,
19
16
  },
20
17
  });
21
- queryClient.setQueryData(getBonusesQueryKey(), (prev) => prev?.filter((bonus) => bonus.id !== id));
22
18
  },
23
19
  });
24
20
  };
@@ -62,6 +62,7 @@ interface GlobalStore {
62
62
  message: MessageStore;
63
63
  sidebar: CollapsibleStore;
64
64
  kyc: PopupStore;
65
+ spotBonus: PopupStore;
65
66
  }
66
67
  export declare const useGlobalStore: import("zustand").UseBoundStore<import("zustand").StoreApi<GlobalStore>>;
67
68
  export {};
@@ -208,4 +208,17 @@ export const useGlobalStore = create((set) => ({
208
208
  },
209
209
  '~touched': false,
210
210
  },
211
+ spotBonus: {
212
+ open: false,
213
+ setOpen(open) {
214
+ set((prev) => ({
215
+ spotBonus: {
216
+ ...prev.spotBonus,
217
+ open,
218
+ '~touched': true,
219
+ },
220
+ }));
221
+ },
222
+ '~touched': false,
223
+ },
211
224
  }));
@@ -54,7 +54,9 @@ export function BetRecords__client(props) {
54
54
  }),
55
55
  ...(state.provider && {
56
56
  game__provider: {
57
- equal: state.provider,
57
+ in: state.provider === 'JILI' || state.provider === 'JILI_BINGO'
58
+ ? ['JILI', 'JILI_BINGO']
59
+ : [state.provider],
58
60
  },
59
61
  }),
60
62
  ...(state.status && {
@@ -13,7 +13,7 @@ import piggyBank from '../../images/piggy-bank.png';
13
13
  import { Badge } from '../../ui/Badge/index.js';
14
14
  import { Collapsible } from '../../ui/Collapsible/index.js';
15
15
  import { Progress } from '../../ui/Progress/index.js';
16
- import { Prose } from '../../ui/Prose.js';
16
+ import { Prose } from '../../ui/Prose/index.js';
17
17
  import { capitalize } from '../../utils/capitalize.js';
18
18
  import { formatNumber } from '../../utils/formatNumber.js';
19
19
  import { parseDecimal } from '../../utils/parseDecimal.js';
@@ -6,15 +6,17 @@ import Image from 'next/image';
6
6
  import Link from 'next/link';
7
7
  import { useState } from 'react';
8
8
  import { z } from 'zod';
9
+ import { useShallow } from 'zustand/shallow';
9
10
  import { useBonusesQuery } from '../../client/hooks/useBonusesQuery.js';
10
11
  import { useCashbackBonusesQuery } from '../../client/hooks/useCashbackBonusesQuery.js';
11
12
  import { useClaimCashbackBonusMutation } from '../../client/hooks/useClaimCashbackBonusMutation.js';
13
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
12
14
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
13
15
  import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
14
- import { Gift01Icon } from '../../icons/Gift01Icon.js';
15
16
  import { StopWatchIcon } from '../../icons/StopWatchIcon.js';
16
17
  import moneyOnHand from '../../images/money-on-hand.png';
17
18
  import piggyBank from '../../images/piggy-bank.png';
19
+ import ribbonEnvelope from '../../images/ribbon-envelope.png';
18
20
  import { Badge } from '../../ui/Badge/index.js';
19
21
  import { Button } from '../../ui/Button/index.js';
20
22
  import { Progress } from '../../ui/Progress/index.js';
@@ -22,7 +24,7 @@ import { SegmentGroup } from '../../ui/SegmentGroup/index.js';
22
24
  import { capitalize } from '../../utils/capitalize.js';
23
25
  import { formatNumber } from '../../utils/formatNumber.js';
24
26
  import { parseDecimal } from '../../utils/parseDecimal.js';
25
- import { Empty } from '../shared/Empty.js';
27
+ import { ClaimSpotBonus } from './ClaimSpotBonus.js';
26
28
  const TABS = ['ALL', 'ACTIVE', 'CASHBACKS'];
27
29
  export function Bonuses__client(props) {
28
30
  const [tab, setTab] = useState(TABS[0]);
@@ -38,10 +40,9 @@ export function Bonuses__client(props) {
38
40
  ? isAfter(new Date(), bonus.cashback.activationEndDateTime)
39
41
  : true;
40
42
  });
41
- const empty = bonuses.length === 0 && cashbackBonuses.length === 0;
42
- return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Rewards' }), _jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
43
- setTab(z.enum(TABS).parse(details.value));
44
- }, className: "mt-3", children: [TABS.map((value) => (_jsxs(SegmentGroup.Item, { value: value, children: [_jsxs(SegmentGroup.ItemText, { children: [" ", capitalize(value)] }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }, value))), _jsx(SegmentGroup.Indicator, {})] }), empty && (_jsx(Empty, { className: "mt-8", icon: Gift01Icon, title: "No Rewards", message: "No reward is currently available." })), !empty && (_jsxs("div", { className: "mt-3xl grid gap-3xl lg:mt-lg lg:grid-cols-3", children: [tab !== 'CASHBACKS' && (_jsx(_Fragment, { children: bonuses.map((bonus) => (_jsx(Bonus, { data: bonus, viewDetailsUrl: props.viewBonusDetailsUrl ?? '/rewards' }, bonus.id))) })), cashbackBonuses.map((cashbackBonus) => (_jsx(CashbackBonus, { data: cashbackBonus }, cashbackBonus.id)))] }))] }));
43
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Rewards' }), _jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
44
+ setTab(z.enum(TABS).parse(details.value));
45
+ }, className: "mt-3", children: [TABS.map((value) => (_jsxs(SegmentGroup.Item, { value: value, children: [_jsx(SegmentGroup.ItemText, { children: capitalize(value) }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }, value))), _jsx(SegmentGroup.Indicator, {})] }), _jsxs("div", { className: "mt-3xl grid gap-3xl lg:mt-lg lg:grid-cols-3", children: [tab === 'ALL' && _jsx(SpotBonus, {}), tab !== 'CASHBACKS' && (_jsx(_Fragment, { children: bonuses.map((bonus) => (_jsx(Bonus, { data: bonus, viewDetailsUrl: props.viewBonusDetailsUrl ?? '/rewards' }, bonus.id))) })), cashbackBonuses.map((cashbackBonus) => (_jsx(CashbackBonus, { data: cashbackBonus }, cashbackBonus.id)))] })] }), _jsx(ClaimSpotBonus, {})] }));
45
46
  }
46
47
  function Bonus(props) {
47
48
  const bonus = props.data;
@@ -50,27 +51,36 @@ function Bonus(props) {
50
51
  const remainingTime = useRemainingTime(bonus.expiration);
51
52
  const currentTurnoverRequirementContributionPercentage = parseDecimal(bonus.currentTurnoverRequirementContributionPercentage, 0);
52
53
  const turnoverRequirement = parseDecimal(bonus.turnoverRequirement, 0);
53
- return (_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex flex-col overflow-hidden rounded-2xl border", children: [_jsxs("div", { className: "relative", children: [promo.banner?.url ? (_jsx(Image, { src: promo.banner.url, alt: "", width: 400, height: 200, className: "h-auto w-full" })) : (_jsx(DefaultImage, { type: "bonus" })), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'gray', className: "absolute right-4 top-4", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.expired ? 'Expired' : remainingTime.toString() })] })] }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("h2", { className: "text-center text-xl font-semibold text-white", children: promo.name }), _jsxs("div", { className: "mt-2 flex items-baseline justify-center gap-2", children: [_jsx("p", { className: "text-3xl font-semibold leading-none", children: formatNumber(bonus.balance, {
54
+ return (_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex flex-col overflow-hidden rounded-2xl border", children: [_jsxs("div", { className: "relative", children: [promo.banner?.url ? (_jsx(Image, { src: promo.banner.url, alt: "", width: 400, height: 200, className: "h-[11.25rem] w-full object-cover" })) : (_jsx("div", { style: {
55
+ background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
56
+ }, children: _jsx(Image, { src: piggyBank, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs(Badge.Root, { size: "lg", round: false, colorScheme: remainingTime.expired ? 'danger' : 'gray', className: "absolute right-4 top-4", children: [_jsx(Badge.Icon, { children: _jsx(StopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.expired ? 'Expired' : remainingTime.toString() })] })] }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("h2", { className: "line-clamp-1 text-center text-xl font-semibold text-white", children: promo.name }), _jsxs("div", { className: "mt-2 flex items-baseline justify-center gap-2", children: [_jsx("p", { className: "text-3xl font-semibold leading-none", children: formatNumber(bonus.balance, {
54
57
  currency: localeInfo.currency.code,
55
58
  }) }), _jsxs("p", { className: "text-text-secondary-700 text-xl font-semibold leading-none", children: ["/\u00A0", formatNumber(bonus.amount, {
56
59
  currency: localeInfo.currency.code,
57
- })] })] }), _jsxs("div", { className: "text-text-primary-brand mt-md flex justify-between", children: [_jsxs("p", { children: ["Wagering ", currentTurnoverRequirementContributionPercentage, "%"] }), _jsxs("p", { children: [currentTurnoverRequirementContributionPercentage, "/", turnoverRequirement] })] }), _jsx(Progress.Root, { min: 0, max: 100, value: clamp(currentTurnoverRequirementContributionPercentage, 0, 100), className: "mt-2", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("div", { className: "grow" }), _jsx(Button, { variant: "outline", className: "mt-6", asChild: true, children: _jsx(Link, { href: `${props.viewDetailsUrl}/${bonus.id}`, children: "See More" }) })] })] }));
60
+ })] })] }), _jsxs("div", { className: "text-text-primary-brand mt-md flex justify-between", children: [_jsxs("p", { children: ["Wagering ", currentTurnoverRequirementContributionPercentage, "%"] }), _jsxs("p", { children: [currentTurnoverRequirementContributionPercentage, "/", turnoverRequirement] })] }), _jsx(Progress.Root, { min: 0, max: 100, value: clamp(currentTurnoverRequirementContributionPercentage, 0, 100), className: "mt-2", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", variant: "outline", className: "mt-6", asChild: true, children: _jsx(Link, { href: `${props.viewDetailsUrl}/${bonus.id}`, children: "See More" }) })] })] }));
58
61
  }
59
62
  function CashbackBonus(props) {
60
63
  const bonus = props.data;
61
64
  const cashback = bonus.cashback;
62
65
  const localeInfo = useLocaleInfo();
63
66
  const claimCashbackBonusMutation = useClaimCashbackBonusMutation();
64
- return (_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex flex-col overflow-hidden rounded-2xl border", children: [cashback.banner?.url ? (_jsx(Image, { src: cashback.banner.url, alt: "", width: 400, height: 200, className: "h-auto w-full" })) : (_jsx(DefaultImage, { type: "cashback" })), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "text-center text-xl font-semibold text-white", children: cashback.name }), _jsx("h2", { className: "mt-2 text-center text-3xl font-semibold text-white", children: formatNumber(bonus.balance, {
67
+ return (_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex flex-col overflow-hidden rounded-2xl border", children: [cashback.banner?.url ? (_jsx(Image, { src: cashback.banner.url, alt: "", width: 400, height: 200, className: "h-[11.25rem] w-full object-cover" })) : (_jsx("div", { style: {
68
+ background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
69
+ }, children: _jsx(Image, { src: moneyOnHand, alt: "", className: "mx-auto h-[11.25rem] w-auto shrink-0 object-cover", draggable: false, width: 600, height: 600 }) })), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "line-clamp-1 text-center text-xl font-semibold text-white", children: cashback.name }), _jsx("h2", { className: "mt-2 text-center text-3xl font-semibold text-white", children: formatNumber(bonus.balance, {
65
70
  currency: localeInfo.currency.code,
66
71
  }) }), _jsx("div", { className: "text-text-secondary-700 mt-2 line-clamp-1 text-center text-sm", dangerouslySetInnerHTML: {
67
72
  __html: cashback.description,
68
- } }), _jsx("div", { className: "grow" }), _jsx(Button, { className: "mt-6", disabled: claimCashbackBonusMutation.isPending, onClick: () => {
73
+ } }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", className: "mt-6", disabled: claimCashbackBonusMutation.isPending, onClick: () => {
69
74
  claimCashbackBonusMutation.mutate(bonus.id);
70
75
  }, children: "Claim" })] })] }));
71
76
  }
72
- function DefaultImage({ type }) {
73
- return (_jsxs("div", { style: {
74
- background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
75
- }, children: [type === 'bonus' && (_jsx(Image, { src: piggyBank, alt: "", className: "mx-auto h-auto w-[50%] shrink-0", draggable: false, width: 600, height: 600 })), type === 'cashback' && (_jsx(Image, { src: moneyOnHand, alt: "", className: "mx-auto h-auto w-[50%] shrink-0", draggable: false, width: 600, height: 600 }))] }));
77
+ function SpotBonus() {
78
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
79
+ spotBonus: ctx.spotBonus,
80
+ })));
81
+ return (_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex flex-col overflow-hidden rounded-2xl border", children: [_jsx("div", { style: {
82
+ background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
83
+ }, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[11.25rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("div", { className: "flex grow flex-col px-xl py-3xl", children: [_jsx("p", { className: "text-center text-xl font-semibold text-white", children: "Special Rewards" }), _jsx("p", { className: "mt-2 text-center text-3xl font-semibold text-white", children: "Promo Code" }), _jsx("p", { className: "text-text-secondary-700 mt-2 text-center text-sm", children: "Have a promo code? Don\u2019t miss out, redeem it now\u00A0and\u00A0enjoy exclusive rewards!" }), _jsx("div", { className: "grow" }), _jsx(Button, { size: "sm", onClick: () => {
84
+ globalStore.spotBonus.setOpen(true);
85
+ }, className: "mt-6", children: "Enter Promo Code" })] })] }));
76
86
  }
@@ -0,0 +1 @@
1
+ export declare function ClaimSpotBonus(): import("react/jsx-runtime").JSX.Element | undefined;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import dynamic from 'next/dynamic';
3
+ import { useShallow } from 'zustand/shallow';
4
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
5
+ const Component = dynamic(() => import('./ClaimSpotBonus.lazy.js').then((m) => m.ClaimSpotBonus), {
6
+ ssr: false,
7
+ loading: () => null,
8
+ });
9
+ export function ClaimSpotBonus() {
10
+ const touched = useGlobalStore(useShallow((ctx) => ctx.spotBonus['~touched']));
11
+ if (touched)
12
+ return _jsx(Component, {});
13
+ }
@@ -0,0 +1 @@
1
+ export declare function ClaimSpotBonus(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Image from 'next/image';
4
+ import { useForm } from 'react-hook-form';
5
+ import { z } from 'zod';
6
+ import { useShallow } from 'zustand/shallow';
7
+ import { useClaimSpotBonusMutation } from '../../client/hooks/useClaimSpotBonusMutation.js';
8
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
9
+ import { toaster } from '../../client/utils/toaster.js';
10
+ import ribbonEnvelope from '../../images/ribbon-envelope.png';
11
+ import { Button } from '../../ui/Button/index.js';
12
+ import { Dialog } from '../../ui/Dialog/index.js';
13
+ import { Field } from '../../ui/Field/index.js';
14
+ import { Portal } from '../../ui/Portal/index.js';
15
+ const definition = z.object({
16
+ code: z.string().min(1, 'Code is required').trim(),
17
+ });
18
+ export function ClaimSpotBonus() {
19
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
20
+ spotBonus: ctx.spotBonus,
21
+ })));
22
+ const claimSpotBonusMutation = useClaimSpotBonusMutation({
23
+ onSuccess() {
24
+ form.reset();
25
+ globalStore.spotBonus.setOpen(false);
26
+ toaster.success({
27
+ description: 'You have successfully redeemed your bonus!!',
28
+ });
29
+ },
30
+ onError(error) {
31
+ toaster.error({
32
+ description: error.message,
33
+ });
34
+ },
35
+ });
36
+ const form = useForm({
37
+ resolver: zodResolver(definition),
38
+ defaultValues: {
39
+ code: '',
40
+ },
41
+ });
42
+ return (_jsx(Dialog.Root, { open: globalStore.spotBonus.open, onOpenChange: (details) => globalStore.spotBonus.setOpen(details.open), lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center lg:items-start", children: _jsxs(Dialog.Content, { className: "mx-auto w-[25rem] max-w-full rounded-xl p-3xl", children: [_jsx("div", { className: "overflow-hidden rounded-md", style: {
43
+ background: 'radial-gradient(75.21% 75.21% at 50% 50%, rgba(249, 163, 8, 0.3) 0%, rgba(0, 0, 0, 0) 100%), var(--color-bg-primary-alt)',
44
+ }, children: _jsx(Image, { src: ribbonEnvelope, alt: "", className: "mx-auto h-[12.5rem] w-[80%] object-cover", draggable: false, width: 600, height: 341 }) }), _jsxs("form", { className: "mt-3xl", onSubmit: form.handleSubmit((data) => {
45
+ claimSpotBonusMutation.mutate(data.code);
46
+ }), children: [_jsx("h2", { className: "text-center text-lg font-semibold", children: "Enter Promo Code" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-center text-sm", children: "Claim your reward by entering a promo or gift code!" }), _jsxs(Field.Root, { invalid: !!form.formState.errors.code, className: "mt-2xl", children: [_jsx(Field.Input, { size: "sm", placeholder: "Enter promo code", ...form.register('code') }), _jsx(Field.ErrorText, { children: form.formState.errors.code?.message })] }), _jsxs("div", { className: "mt-4xl flex gap-lg", children: [_jsx(Button, { variant: "outline", onClick: () => {
47
+ globalStore.spotBonus.setOpen(false);
48
+ form.reset();
49
+ }, disabled: claimSpotBonusMutation.isPending, children: "Cancel" }), _jsx(Button, { type: "submit", disabled: claimSpotBonusMutation.isPending, children: "Claim" })] })] })] }) })] }) }));
50
+ }
@@ -11,7 +11,7 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
11
11
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
12
12
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
13
13
  import { Button } from '../../ui/Button/index.js';
14
- import { Prose } from '../../ui/Prose.js';
14
+ import { Prose } from '../../ui/Prose/index.js';
15
15
  export function Cashback__client(props) {
16
16
  const availablePromosQuery = useAvailablePromosQuery();
17
17
  const cashbackQuery = useCashbackQuery(props.id);
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import Image from 'next/image';
4
4
  import Link from 'next/link';
5
5
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
6
- import { Prose } from '../../ui/Prose.js';
6
+ import { Prose } from '../../ui/Prose/index.js';
7
7
  export function CustomPromo(props) {
8
8
  return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
9
9
  __html: props.promo.description,
@@ -21,7 +21,7 @@ import { AlertDialog } from '../../ui/AlertDialog/index.js';
21
21
  import { Button } from '../../ui/Button/index.js';
22
22
  import { IconButton } from '../../ui/IconButton/index.js';
23
23
  import { Portal } from '../../ui/Portal/index.js';
24
- import { Presence } from '../../ui/Presence.js';
24
+ import { Presence } from '../../ui/Presence/index.js';
25
25
  export function GameLaunch() {
26
26
  const globalStore = useGlobalStore(useShallow((ctx) => ({
27
27
  gameLaunch: ctx.gameLaunch,
@@ -8,7 +8,7 @@ import { SearchLgIcon } from '../../icons/SearchLgIcon.js';
8
8
  import { Button } from '../../ui/Button/index.js';
9
9
  import { Combobox } from '../../ui/Combobox/index.js';
10
10
  import { Portal } from '../../ui/Portal/index.js';
11
- import { Presence } from '../../ui/Presence.js';
11
+ import { Presence } from '../../ui/Presence/index.js';
12
12
  import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
13
13
  import { GameLaunchTrigger } from '../GameLaunch/index.js';
14
14
  export function GamesSearch(props) {