react-native-monflowts 0.0.0-stage → 0.5.0

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 (479) hide show
  1. package/LICENSE +20 -0
  2. package/Monflowts.podspec +22 -0
  3. package/README.md +229 -2
  4. package/android/build.gradle +58 -0
  5. package/android/src/main/AndroidManifest.xml +8 -0
  6. package/android/src/main/java/com/monflowts/MonflowtsAssetsModule.kt +219 -0
  7. package/android/src/main/java/com/monflowts/MonflowtsCrashFeedModule.kt +175 -0
  8. package/android/src/main/java/com/monflowts/MonflowtsHapticModule.kt +170 -0
  9. package/android/src/main/java/com/monflowts/MonflowtsLottieView.kt +96 -0
  10. package/android/src/main/java/com/monflowts/MonflowtsLottieViewManager.kt +53 -0
  11. package/android/src/main/java/com/monflowts/MonflowtsPackage.kt +70 -0
  12. package/android/src/main/java/com/monflowts/MonflowtsSoundModule.kt +132 -0
  13. package/android/src/main/java/com/monflowts/MonflowtsSpeechModule.kt +81 -0
  14. package/android/src/main/java/com/monflowts/MonflowtsSvgView.kt +355 -0
  15. package/android/src/main/java/com/monflowts/MonflowtsSvgViewManager.kt +59 -0
  16. package/android/src/main/java/com/monflowts/MonflowtsWebView.kt +86 -0
  17. package/android/src/main/java/com/monflowts/MonflowtsWebViewManager.kt +33 -0
  18. package/android/src/main/java/com/monflowts/MonflowtsWheelView.kt +98 -0
  19. package/android/src/main/java/com/monflowts/MonflowtsWheelViewManager.kt +46 -0
  20. package/ios/Monflowts-Bridging-Header.h +5 -0
  21. package/ios/MonflowtsAssetsBridge.m +14 -0
  22. package/ios/MonflowtsAssetsModule.swift +217 -0
  23. package/ios/MonflowtsCrashFeedBridge.m +9 -0
  24. package/ios/MonflowtsCrashFeedModule.swift +88 -0
  25. package/ios/MonflowtsHTTP1EventSource.swift +296 -0
  26. package/ios/MonflowtsHapticBridge.m +8 -0
  27. package/ios/MonflowtsHapticModule.swift +55 -0
  28. package/ios/MonflowtsLottieBridge.m +12 -0
  29. package/ios/MonflowtsLottieUIView.swift +95 -0
  30. package/ios/MonflowtsLottieViewManager.swift +13 -0
  31. package/ios/MonflowtsSSEParser.swift +58 -0
  32. package/ios/MonflowtsSoundBridge.m +8 -0
  33. package/ios/MonflowtsSoundModule.swift +100 -0
  34. package/ios/MonflowtsSpeechBridge.m +9 -0
  35. package/ios/MonflowtsSpeechModule.swift +61 -0
  36. package/ios/MonflowtsSvgBridge.m +11 -0
  37. package/ios/MonflowtsSvgUIView.swift +431 -0
  38. package/ios/MonflowtsSvgViewManager.swift +13 -0
  39. package/ios/MonflowtsWebBridge.m +8 -0
  40. package/ios/MonflowtsWebUIView.swift +92 -0
  41. package/ios/MonflowtsWebViewManager.swift +14 -0
  42. package/ios/MonflowtsWheelBridge.m +7 -0
  43. package/ios/MonflowtsWheelUIView.swift +126 -0
  44. package/ios/MonflowtsWheelViewManager.swift +14 -0
  45. package/lib/module/HapticsManager.js +93 -0
  46. package/lib/module/HapticsManager.js.map +1 -0
  47. package/lib/module/HubContent.js +642 -0
  48. package/lib/module/HubContent.js.map +1 -0
  49. package/lib/module/Icons.js +64 -0
  50. package/lib/module/Icons.js.map +1 -0
  51. package/lib/module/MonflowtsHub.js +233 -0
  52. package/lib/module/MonflowtsHub.js.map +1 -0
  53. package/lib/module/NativeLottieView.js +6 -0
  54. package/lib/module/NativeLottieView.js.map +1 -0
  55. package/lib/module/NativeSvgView.js +6 -0
  56. package/lib/module/NativeSvgView.js.map +1 -0
  57. package/lib/module/NativeWebView.js +14 -0
  58. package/lib/module/NativeWebView.js.map +1 -0
  59. package/lib/module/NativeWheelView.js +6 -0
  60. package/lib/module/NativeWheelView.js.map +1 -0
  61. package/lib/module/SoundManager.js +120 -0
  62. package/lib/module/SoundManager.js.map +1 -0
  63. package/lib/module/SpeechManager.js +40 -0
  64. package/lib/module/SpeechManager.js.map +1 -0
  65. package/lib/module/api/client.js +109 -0
  66. package/lib/module/api/client.js.map +1 -0
  67. package/lib/module/api/gameTypes.js +2 -0
  68. package/lib/module/api/gameTypes.js.map +1 -0
  69. package/lib/module/api/http.js +252 -0
  70. package/lib/module/api/http.js.map +1 -0
  71. package/lib/module/api/mutations.js +359 -0
  72. package/lib/module/api/mutations.js.map +1 -0
  73. package/lib/module/api/playerTypes.js +2 -0
  74. package/lib/module/api/playerTypes.js.map +1 -0
  75. package/lib/module/api/queries.js +403 -0
  76. package/lib/module/api/queries.js.map +1 -0
  77. package/lib/module/api/sdkTypes.js +2 -0
  78. package/lib/module/api/sdkTypes.js.map +1 -0
  79. package/lib/module/assets/assetKeys.js +4 -0
  80. package/lib/module/assets/assetKeys.js.map +1 -0
  81. package/lib/module/assets/assetSync.js +61 -0
  82. package/lib/module/assets/assetSync.js.map +1 -0
  83. package/lib/module/assets/nativeAssets.js +25 -0
  84. package/lib/module/assets/nativeAssets.js.map +1 -0
  85. package/lib/module/assets/remote.js +47 -0
  86. package/lib/module/assets/remote.js.map +1 -0
  87. package/lib/module/components/AbandonPolicyNotice.js +200 -0
  88. package/lib/module/components/AbandonPolicyNotice.js.map +1 -0
  89. package/lib/module/components/AnimatedAmount.js +39 -0
  90. package/lib/module/components/AnimatedAmount.js.map +1 -0
  91. package/lib/module/components/CoinFlyOverlay.js +157 -0
  92. package/lib/module/components/CoinFlyOverlay.js.map +1 -0
  93. package/lib/module/components/GameCharacter.js +45 -0
  94. package/lib/module/components/GameCharacter.js.map +1 -0
  95. package/lib/module/components/GameRulesModal.js +279 -0
  96. package/lib/module/components/GameRulesModal.js.map +1 -0
  97. package/lib/module/components/HypeCallout.js +103 -0
  98. package/lib/module/components/HypeCallout.js.map +1 -0
  99. package/lib/module/components/InsufficientFundsOverlay.js +285 -0
  100. package/lib/module/components/InsufficientFundsOverlay.js.map +1 -0
  101. package/lib/module/components/JackpotNearMiss.js +89 -0
  102. package/lib/module/components/JackpotNearMiss.js.map +1 -0
  103. package/lib/module/components/JackpotTeaser.js +341 -0
  104. package/lib/module/components/JackpotTeaser.js.map +1 -0
  105. package/lib/module/components/MonflowtsButton.js +129 -0
  106. package/lib/module/components/MonflowtsButton.js.map +1 -0
  107. package/lib/module/components/MonflowtsChipGroup.js +40 -0
  108. package/lib/module/components/MonflowtsChipGroup.js.map +1 -0
  109. package/lib/module/components/MonflowtsPressable.js +42 -0
  110. package/lib/module/components/MonflowtsPressable.js.map +1 -0
  111. package/lib/module/components/QuitConfirmModal.js +180 -0
  112. package/lib/module/components/QuitConfirmModal.js.map +1 -0
  113. package/lib/module/components/SessionTimer.js +77 -0
  114. package/lib/module/components/SessionTimer.js.map +1 -0
  115. package/lib/module/components/SideDemoTab.js +110 -0
  116. package/lib/module/components/SideDemoTab.js.map +1 -0
  117. package/lib/module/components/StakeInput.js +138 -0
  118. package/lib/module/components/StakeInput.js.map +1 -0
  119. package/lib/module/constants.js +50 -0
  120. package/lib/module/constants.js.map +1 -0
  121. package/lib/module/content.js +21 -0
  122. package/lib/module/content.js.map +1 -0
  123. package/lib/module/effects/EffectBurst.js +56 -0
  124. package/lib/module/effects/EffectBurst.js.map +1 -0
  125. package/lib/module/effects/beaverStates.js +11 -0
  126. package/lib/module/effects/beaverStates.js.map +1 -0
  127. package/lib/module/effects/hypePhrases.js +67 -0
  128. package/lib/module/effects/hypePhrases.js.map +1 -0
  129. package/lib/module/effects/particleAnims.js +17 -0
  130. package/lib/module/effects/particleAnims.js.map +1 -0
  131. package/lib/module/hooks/useAvailableGames.js +29 -0
  132. package/lib/module/hooks/useAvailableGames.js.map +1 -0
  133. package/lib/module/hooks/useCrash.js +137 -0
  134. package/lib/module/hooks/useCrash.js.map +1 -0
  135. package/lib/module/hooks/useCrashFeed.js +49 -0
  136. package/lib/module/hooks/useCrashFeed.js.map +1 -0
  137. package/lib/module/hooks/useCurrency.js +13 -0
  138. package/lib/module/hooks/useCurrency.js.map +1 -0
  139. package/lib/module/hooks/useFairSeed.js +55 -0
  140. package/lib/module/hooks/useFairSeed.js.map +1 -0
  141. package/lib/module/hooks/useGameEvents.js +186 -0
  142. package/lib/module/hooks/useGameEvents.js.map +1 -0
  143. package/lib/module/hooks/useGameHistory.js +55 -0
  144. package/lib/module/hooks/useGameHistory.js.map +1 -0
  145. package/lib/module/hooks/useLeaderboard.js +83 -0
  146. package/lib/module/hooks/useLeaderboard.js.map +1 -0
  147. package/lib/module/hooks/useMines.js +166 -0
  148. package/lib/module/hooks/useMines.js.map +1 -0
  149. package/lib/module/hooks/useNotifications.js +66 -0
  150. package/lib/module/hooks/useNotifications.js.map +1 -0
  151. package/lib/module/hooks/usePlayGame.js +408 -0
  152. package/lib/module/hooks/usePlayGame.js.map +1 -0
  153. package/lib/module/hooks/usePlinko.js +75 -0
  154. package/lib/module/hooks/usePlinko.js.map +1 -0
  155. package/lib/module/hooks/useRaffleDrawState.js +57 -0
  156. package/lib/module/hooks/useRaffleDrawState.js.map +1 -0
  157. package/lib/module/hooks/useRefreshWallet.js +24 -0
  158. package/lib/module/hooks/useRefreshWallet.js.map +1 -0
  159. package/lib/module/hooks/useResponsive.js +16 -0
  160. package/lib/module/hooks/useResponsive.js.map +1 -0
  161. package/lib/module/hooks/useRevealWin.js +120 -0
  162. package/lib/module/hooks/useRevealWin.js.map +1 -0
  163. package/lib/module/hooks/useScreenShake.js +32 -0
  164. package/lib/module/hooks/useScreenShake.js.map +1 -0
  165. package/lib/module/hooks/useWallet.js +77 -0
  166. package/lib/module/hooks/useWallet.js.map +1 -0
  167. package/lib/module/i18n.js +104 -0
  168. package/lib/module/i18n.js.map +1 -0
  169. package/lib/module/index.js +22 -0
  170. package/lib/module/index.js.map +1 -0
  171. package/lib/module/lottieAnimations.js +15 -0
  172. package/lib/module/lottieAnimations.js.map +1 -0
  173. package/lib/module/package.json +1 -0
  174. package/lib/module/stores/assetStore.js +140 -0
  175. package/lib/module/stores/assetStore.js.map +1 -0
  176. package/lib/module/stores/authStore.js +47 -0
  177. package/lib/module/stores/authStore.js.map +1 -0
  178. package/lib/module/stores/gameStore.js +23 -0
  179. package/lib/module/stores/gameStore.js.map +1 -0
  180. package/lib/module/stores/sdkInitStore.js +155 -0
  181. package/lib/module/stores/sdkInitStore.js.map +1 -0
  182. package/lib/module/stores/settingsStore.js +40 -0
  183. package/lib/module/stores/settingsStore.js.map +1 -0
  184. package/lib/module/theme.js +160 -0
  185. package/lib/module/theme.js.map +1 -0
  186. package/lib/module/types.js +4 -0
  187. package/lib/module/types.js.map +1 -0
  188. package/lib/module/utils/apolloError.js +69 -0
  189. package/lib/module/utils/apolloError.js.map +1 -0
  190. package/lib/module/utils/crashMultiplier.js +8 -0
  191. package/lib/module/utils/crashMultiplier.js.map +1 -0
  192. package/lib/module/utils/crashMultiplier.test.js +34 -0
  193. package/lib/module/utils/crashMultiplier.test.js.map +1 -0
  194. package/lib/module/utils/deviceAnalytics.js +51 -0
  195. package/lib/module/utils/deviceAnalytics.js.map +1 -0
  196. package/lib/module/utils/idempotency.js +66 -0
  197. package/lib/module/utils/idempotency.js.map +1 -0
  198. package/lib/module/utils/layout.js +14 -0
  199. package/lib/module/utils/layout.js.map +1 -0
  200. package/lib/module/utils/safeInlineScript.js +12 -0
  201. package/lib/module/utils/safeInlineScript.js.map +1 -0
  202. package/lib/module/utils/sseClient.js +40 -0
  203. package/lib/module/utils/sseClient.js.map +1 -0
  204. package/lib/module/views/DepositSelect.js +275 -0
  205. package/lib/module/views/DepositSelect.js.map +1 -0
  206. package/lib/module/views/Dice.js +111 -0
  207. package/lib/module/views/Dice.js.map +1 -0
  208. package/lib/module/views/DiceBattle.js +815 -0
  209. package/lib/module/views/DiceBattle.js.map +1 -0
  210. package/lib/module/views/DiceLobby.js +577 -0
  211. package/lib/module/views/DiceLobby.js.map +1 -0
  212. package/lib/module/views/FortuneWheel.js +892 -0
  213. package/lib/module/views/FortuneWheel.js.map +1 -0
  214. package/lib/module/views/Freefall.js +808 -0
  215. package/lib/module/views/Freefall.js.map +1 -0
  216. package/lib/module/views/History.js +366 -0
  217. package/lib/module/views/History.js.map +1 -0
  218. package/lib/module/views/Home.js +554 -0
  219. package/lib/module/views/Home.js.map +1 -0
  220. package/lib/module/views/Jetstream.js +889 -0
  221. package/lib/module/views/Jetstream.js.map +1 -0
  222. package/lib/module/views/Leaderboard.js +1206 -0
  223. package/lib/module/views/Leaderboard.js.map +1 -0
  224. package/lib/module/views/MillionaireHunter.js +1697 -0
  225. package/lib/module/views/MillionaireHunter.js.map +1 -0
  226. package/lib/module/views/Minefield.js +826 -0
  227. package/lib/module/views/Minefield.js.map +1 -0
  228. package/lib/module/views/PaymentWebView.js +546 -0
  229. package/lib/module/views/PaymentWebView.js.map +1 -0
  230. package/lib/module/views/PlayerCard.js +184 -0
  231. package/lib/module/views/PlayerCard.js.map +1 -0
  232. package/lib/module/views/Profile.js +531 -0
  233. package/lib/module/views/Profile.js.map +1 -0
  234. package/lib/module/views/RaffleDraw.js +1242 -0
  235. package/lib/module/views/RaffleDraw.js.map +1 -0
  236. package/lib/module/views/RevealWin.js +1267 -0
  237. package/lib/module/views/RevealWin.js.map +1 -0
  238. package/lib/module/views/Splash.js +363 -0
  239. package/lib/module/views/Splash.js.map +1 -0
  240. package/lib/module/views/Success.js +363 -0
  241. package/lib/module/views/Success.js.map +1 -0
  242. package/lib/module/views/TicketShop.js +372 -0
  243. package/lib/module/views/TicketShop.js.map +1 -0
  244. package/lib/module/views/TriviaLobby.js +582 -0
  245. package/lib/module/views/TriviaLobby.js.map +1 -0
  246. package/lib/module/views/TriviaMaster.js +884 -0
  247. package/lib/module/views/TriviaMaster.js.map +1 -0
  248. package/lib/module/views/Wallet.js +622 -0
  249. package/lib/module/views/Wallet.js.map +1 -0
  250. package/lib/module/views/WithdrawFlow.js +445 -0
  251. package/lib/module/views/WithdrawFlow.js.map +1 -0
  252. package/lib/module/views/gridGeometry.js +26 -0
  253. package/lib/module/views/gridGeometry.js.map +1 -0
  254. package/lib/module/views/revealWinHelpers.js +29 -0
  255. package/lib/module/views/revealWinHelpers.js.map +1 -0
  256. package/lib/module/views/ticketBundlePresets.js +29 -0
  257. package/lib/module/views/ticketBundlePresets.js.map +1 -0
  258. package/lib/module/views/triviaHelpers.js +78 -0
  259. package/lib/module/views/triviaHelpers.js.map +1 -0
  260. package/lib/module/voiceClips.js +16 -0
  261. package/lib/module/voiceClips.js.map +1 -0
  262. package/lib/typescript/package.json +1 -0
  263. package/lib/typescript/src/HapticsManager.d.ts +28 -0
  264. package/lib/typescript/src/HapticsManager.d.ts.map +1 -0
  265. package/lib/typescript/src/HubContent.d.ts +7 -0
  266. package/lib/typescript/src/HubContent.d.ts.map +1 -0
  267. package/lib/typescript/src/Icons.d.ts +14 -0
  268. package/lib/typescript/src/Icons.d.ts.map +1 -0
  269. package/lib/typescript/src/MonflowtsHub.d.ts +5 -0
  270. package/lib/typescript/src/MonflowtsHub.d.ts.map +1 -0
  271. package/lib/typescript/src/NativeLottieView.d.ts +13 -0
  272. package/lib/typescript/src/NativeLottieView.d.ts.map +1 -0
  273. package/lib/typescript/src/NativeSvgView.d.ts +12 -0
  274. package/lib/typescript/src/NativeSvgView.d.ts.map +1 -0
  275. package/lib/typescript/src/NativeWebView.d.ts +22 -0
  276. package/lib/typescript/src/NativeWebView.d.ts.map +1 -0
  277. package/lib/typescript/src/NativeWheelView.d.ts +9 -0
  278. package/lib/typescript/src/NativeWheelView.d.ts.map +1 -0
  279. package/lib/typescript/src/SoundManager.d.ts +29 -0
  280. package/lib/typescript/src/SoundManager.d.ts.map +1 -0
  281. package/lib/typescript/src/SpeechManager.d.ts +10 -0
  282. package/lib/typescript/src/SpeechManager.d.ts.map +1 -0
  283. package/lib/typescript/src/api/client.d.ts +7 -0
  284. package/lib/typescript/src/api/client.d.ts.map +1 -0
  285. package/lib/typescript/src/api/gameTypes.d.ts +326 -0
  286. package/lib/typescript/src/api/gameTypes.d.ts.map +1 -0
  287. package/lib/typescript/src/api/http.d.ts +61 -0
  288. package/lib/typescript/src/api/http.d.ts.map +1 -0
  289. package/lib/typescript/src/api/mutations.d.ts +22 -0
  290. package/lib/typescript/src/api/mutations.d.ts.map +1 -0
  291. package/lib/typescript/src/api/playerTypes.d.ts +53 -0
  292. package/lib/typescript/src/api/playerTypes.d.ts.map +1 -0
  293. package/lib/typescript/src/api/queries.d.ts +21 -0
  294. package/lib/typescript/src/api/queries.d.ts.map +1 -0
  295. package/lib/typescript/src/api/sdkTypes.d.ts +87 -0
  296. package/lib/typescript/src/api/sdkTypes.d.ts.map +1 -0
  297. package/lib/typescript/src/assets/assetKeys.d.ts +3 -0
  298. package/lib/typescript/src/assets/assetKeys.d.ts.map +1 -0
  299. package/lib/typescript/src/assets/assetSync.d.ts +41 -0
  300. package/lib/typescript/src/assets/assetSync.d.ts.map +1 -0
  301. package/lib/typescript/src/assets/nativeAssets.d.ts +30 -0
  302. package/lib/typescript/src/assets/nativeAssets.d.ts.map +1 -0
  303. package/lib/typescript/src/assets/remote.d.ts +8 -0
  304. package/lib/typescript/src/assets/remote.d.ts.map +1 -0
  305. package/lib/typescript/src/components/AbandonPolicyNotice.d.ts +16 -0
  306. package/lib/typescript/src/components/AbandonPolicyNotice.d.ts.map +1 -0
  307. package/lib/typescript/src/components/AnimatedAmount.d.ts +12 -0
  308. package/lib/typescript/src/components/AnimatedAmount.d.ts.map +1 -0
  309. package/lib/typescript/src/components/CoinFlyOverlay.d.ts +17 -0
  310. package/lib/typescript/src/components/CoinFlyOverlay.d.ts.map +1 -0
  311. package/lib/typescript/src/components/GameCharacter.d.ts +14 -0
  312. package/lib/typescript/src/components/GameCharacter.d.ts.map +1 -0
  313. package/lib/typescript/src/components/GameRulesModal.d.ts +10 -0
  314. package/lib/typescript/src/components/GameRulesModal.d.ts.map +1 -0
  315. package/lib/typescript/src/components/HypeCallout.d.ts +11 -0
  316. package/lib/typescript/src/components/HypeCallout.d.ts.map +1 -0
  317. package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts +12 -0
  318. package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts.map +1 -0
  319. package/lib/typescript/src/components/JackpotNearMiss.d.ts +8 -0
  320. package/lib/typescript/src/components/JackpotNearMiss.d.ts.map +1 -0
  321. package/lib/typescript/src/components/JackpotTeaser.d.ts +13 -0
  322. package/lib/typescript/src/components/JackpotTeaser.d.ts.map +1 -0
  323. package/lib/typescript/src/components/MonflowtsButton.d.ts +21 -0
  324. package/lib/typescript/src/components/MonflowtsButton.d.ts.map +1 -0
  325. package/lib/typescript/src/components/MonflowtsChipGroup.d.ts +18 -0
  326. package/lib/typescript/src/components/MonflowtsChipGroup.d.ts.map +1 -0
  327. package/lib/typescript/src/components/MonflowtsPressable.d.ts +39 -0
  328. package/lib/typescript/src/components/MonflowtsPressable.d.ts.map +1 -0
  329. package/lib/typescript/src/components/QuitConfirmModal.d.ts +11 -0
  330. package/lib/typescript/src/components/QuitConfirmModal.d.ts.map +1 -0
  331. package/lib/typescript/src/components/SessionTimer.d.ts +14 -0
  332. package/lib/typescript/src/components/SessionTimer.d.ts.map +1 -0
  333. package/lib/typescript/src/components/SideDemoTab.d.ts +18 -0
  334. package/lib/typescript/src/components/SideDemoTab.d.ts.map +1 -0
  335. package/lib/typescript/src/components/StakeInput.d.ts +16 -0
  336. package/lib/typescript/src/components/StakeInput.d.ts.map +1 -0
  337. package/lib/typescript/src/constants.d.ts +21 -0
  338. package/lib/typescript/src/constants.d.ts.map +1 -0
  339. package/lib/typescript/src/content.d.ts +53 -0
  340. package/lib/typescript/src/content.d.ts.map +1 -0
  341. package/lib/typescript/src/effects/EffectBurst.d.ts +20 -0
  342. package/lib/typescript/src/effects/EffectBurst.d.ts.map +1 -0
  343. package/lib/typescript/src/effects/beaverStates.d.ts +4 -0
  344. package/lib/typescript/src/effects/beaverStates.d.ts.map +1 -0
  345. package/lib/typescript/src/effects/hypePhrases.d.ts +11 -0
  346. package/lib/typescript/src/effects/hypePhrases.d.ts.map +1 -0
  347. package/lib/typescript/src/effects/particleAnims.d.ts +9 -0
  348. package/lib/typescript/src/effects/particleAnims.d.ts.map +1 -0
  349. package/lib/typescript/src/hooks/useAvailableGames.d.ts +14 -0
  350. package/lib/typescript/src/hooks/useAvailableGames.d.ts.map +1 -0
  351. package/lib/typescript/src/hooks/useCrash.d.ts +13 -0
  352. package/lib/typescript/src/hooks/useCrash.d.ts.map +1 -0
  353. package/lib/typescript/src/hooks/useCrashFeed.d.ts +22 -0
  354. package/lib/typescript/src/hooks/useCrashFeed.d.ts.map +1 -0
  355. package/lib/typescript/src/hooks/useCurrency.d.ts +6 -0
  356. package/lib/typescript/src/hooks/useCurrency.d.ts.map +1 -0
  357. package/lib/typescript/src/hooks/useFairSeed.d.ts +8 -0
  358. package/lib/typescript/src/hooks/useFairSeed.d.ts.map +1 -0
  359. package/lib/typescript/src/hooks/useGameEvents.d.ts +50 -0
  360. package/lib/typescript/src/hooks/useGameEvents.d.ts.map +1 -0
  361. package/lib/typescript/src/hooks/useGameHistory.d.ts +14 -0
  362. package/lib/typescript/src/hooks/useGameHistory.d.ts.map +1 -0
  363. package/lib/typescript/src/hooks/useLeaderboard.d.ts +71 -0
  364. package/lib/typescript/src/hooks/useLeaderboard.d.ts.map +1 -0
  365. package/lib/typescript/src/hooks/useMines.d.ts +11 -0
  366. package/lib/typescript/src/hooks/useMines.d.ts.map +1 -0
  367. package/lib/typescript/src/hooks/useNotifications.d.ts +26 -0
  368. package/lib/typescript/src/hooks/useNotifications.d.ts.map +1 -0
  369. package/lib/typescript/src/hooks/usePlayGame.d.ts +62 -0
  370. package/lib/typescript/src/hooks/usePlayGame.d.ts.map +1 -0
  371. package/lib/typescript/src/hooks/usePlinko.d.ts +8 -0
  372. package/lib/typescript/src/hooks/usePlinko.d.ts.map +1 -0
  373. package/lib/typescript/src/hooks/useRaffleDrawState.d.ts +50 -0
  374. package/lib/typescript/src/hooks/useRaffleDrawState.d.ts.map +1 -0
  375. package/lib/typescript/src/hooks/useRefreshWallet.d.ts +8 -0
  376. package/lib/typescript/src/hooks/useRefreshWallet.d.ts.map +1 -0
  377. package/lib/typescript/src/hooks/useResponsive.d.ts +8 -0
  378. package/lib/typescript/src/hooks/useResponsive.d.ts.map +1 -0
  379. package/lib/typescript/src/hooks/useRevealWin.d.ts +10 -0
  380. package/lib/typescript/src/hooks/useRevealWin.d.ts.map +1 -0
  381. package/lib/typescript/src/hooks/useScreenShake.d.ts +14 -0
  382. package/lib/typescript/src/hooks/useScreenShake.d.ts.map +1 -0
  383. package/lib/typescript/src/hooks/useWallet.d.ts +23 -0
  384. package/lib/typescript/src/hooks/useWallet.d.ts.map +1 -0
  385. package/lib/typescript/src/i18n.d.ts +29 -0
  386. package/lib/typescript/src/i18n.d.ts.map +1 -0
  387. package/lib/typescript/src/index.d.ts +12 -0
  388. package/lib/typescript/src/index.d.ts.map +1 -0
  389. package/lib/typescript/src/lottieAnimations.d.ts +2 -0
  390. package/lib/typescript/src/lottieAnimations.d.ts.map +1 -0
  391. package/lib/typescript/src/stores/assetStore.d.ts +17 -0
  392. package/lib/typescript/src/stores/assetStore.d.ts.map +1 -0
  393. package/lib/typescript/src/stores/authStore.d.ts +25 -0
  394. package/lib/typescript/src/stores/authStore.d.ts.map +1 -0
  395. package/lib/typescript/src/stores/gameStore.d.ts +14 -0
  396. package/lib/typescript/src/stores/gameStore.d.ts.map +1 -0
  397. package/lib/typescript/src/stores/sdkInitStore.d.ts +38 -0
  398. package/lib/typescript/src/stores/sdkInitStore.d.ts.map +1 -0
  399. package/lib/typescript/src/stores/settingsStore.d.ts +23 -0
  400. package/lib/typescript/src/stores/settingsStore.d.ts.map +1 -0
  401. package/lib/typescript/src/theme.d.ts +149 -0
  402. package/lib/typescript/src/theme.d.ts.map +1 -0
  403. package/lib/typescript/src/types.d.ts +49 -0
  404. package/lib/typescript/src/types.d.ts.map +1 -0
  405. package/lib/typescript/src/utils/apolloError.d.ts +12 -0
  406. package/lib/typescript/src/utils/apolloError.d.ts.map +1 -0
  407. package/lib/typescript/src/utils/crashMultiplier.d.ts +2 -0
  408. package/lib/typescript/src/utils/crashMultiplier.d.ts.map +1 -0
  409. package/lib/typescript/src/utils/crashMultiplier.test.d.ts +2 -0
  410. package/lib/typescript/src/utils/crashMultiplier.test.d.ts.map +1 -0
  411. package/lib/typescript/src/utils/deviceAnalytics.d.ts +3 -0
  412. package/lib/typescript/src/utils/deviceAnalytics.d.ts.map +1 -0
  413. package/lib/typescript/src/utils/idempotency.d.ts +14 -0
  414. package/lib/typescript/src/utils/idempotency.d.ts.map +1 -0
  415. package/lib/typescript/src/utils/layout.d.ts +10 -0
  416. package/lib/typescript/src/utils/layout.d.ts.map +1 -0
  417. package/lib/typescript/src/utils/safeInlineScript.d.ts +5 -0
  418. package/lib/typescript/src/utils/safeInlineScript.d.ts.map +1 -0
  419. package/lib/typescript/src/utils/sseClient.d.ts +5 -0
  420. package/lib/typescript/src/utils/sseClient.d.ts.map +1 -0
  421. package/lib/typescript/src/views/DepositSelect.d.ts +9 -0
  422. package/lib/typescript/src/views/DepositSelect.d.ts.map +1 -0
  423. package/lib/typescript/src/views/Dice.d.ts +10 -0
  424. package/lib/typescript/src/views/Dice.d.ts.map +1 -0
  425. package/lib/typescript/src/views/DiceBattle.d.ts +15 -0
  426. package/lib/typescript/src/views/DiceBattle.d.ts.map +1 -0
  427. package/lib/typescript/src/views/DiceLobby.d.ts +12 -0
  428. package/lib/typescript/src/views/DiceLobby.d.ts.map +1 -0
  429. package/lib/typescript/src/views/FortuneWheel.d.ts +13 -0
  430. package/lib/typescript/src/views/FortuneWheel.d.ts.map +1 -0
  431. package/lib/typescript/src/views/Freefall.d.ts +13 -0
  432. package/lib/typescript/src/views/Freefall.d.ts.map +1 -0
  433. package/lib/typescript/src/views/History.d.ts +7 -0
  434. package/lib/typescript/src/views/History.d.ts.map +1 -0
  435. package/lib/typescript/src/views/Home.d.ts +13 -0
  436. package/lib/typescript/src/views/Home.d.ts.map +1 -0
  437. package/lib/typescript/src/views/Jetstream.d.ts +14 -0
  438. package/lib/typescript/src/views/Jetstream.d.ts.map +1 -0
  439. package/lib/typescript/src/views/Leaderboard.d.ts +8 -0
  440. package/lib/typescript/src/views/Leaderboard.d.ts.map +1 -0
  441. package/lib/typescript/src/views/MillionaireHunter.d.ts +13 -0
  442. package/lib/typescript/src/views/MillionaireHunter.d.ts.map +1 -0
  443. package/lib/typescript/src/views/Minefield.d.ts +13 -0
  444. package/lib/typescript/src/views/Minefield.d.ts.map +1 -0
  445. package/lib/typescript/src/views/PaymentWebView.d.ts +29 -0
  446. package/lib/typescript/src/views/PaymentWebView.d.ts.map +1 -0
  447. package/lib/typescript/src/views/PlayerCard.d.ts +15 -0
  448. package/lib/typescript/src/views/PlayerCard.d.ts.map +1 -0
  449. package/lib/typescript/src/views/Profile.d.ts +9 -0
  450. package/lib/typescript/src/views/Profile.d.ts.map +1 -0
  451. package/lib/typescript/src/views/RaffleDraw.d.ts +12 -0
  452. package/lib/typescript/src/views/RaffleDraw.d.ts.map +1 -0
  453. package/lib/typescript/src/views/RevealWin.d.ts +13 -0
  454. package/lib/typescript/src/views/RevealWin.d.ts.map +1 -0
  455. package/lib/typescript/src/views/Splash.d.ts +10 -0
  456. package/lib/typescript/src/views/Splash.d.ts.map +1 -0
  457. package/lib/typescript/src/views/Success.d.ts +12 -0
  458. package/lib/typescript/src/views/Success.d.ts.map +1 -0
  459. package/lib/typescript/src/views/TicketShop.d.ts +15 -0
  460. package/lib/typescript/src/views/TicketShop.d.ts.map +1 -0
  461. package/lib/typescript/src/views/TriviaLobby.d.ts +12 -0
  462. package/lib/typescript/src/views/TriviaLobby.d.ts.map +1 -0
  463. package/lib/typescript/src/views/TriviaMaster.d.ts +16 -0
  464. package/lib/typescript/src/views/TriviaMaster.d.ts.map +1 -0
  465. package/lib/typescript/src/views/Wallet.d.ts +10 -0
  466. package/lib/typescript/src/views/Wallet.d.ts.map +1 -0
  467. package/lib/typescript/src/views/WithdrawFlow.d.ts +9 -0
  468. package/lib/typescript/src/views/WithdrawFlow.d.ts.map +1 -0
  469. package/lib/typescript/src/views/gridGeometry.d.ts +19 -0
  470. package/lib/typescript/src/views/gridGeometry.d.ts.map +1 -0
  471. package/lib/typescript/src/views/revealWinHelpers.d.ts +15 -0
  472. package/lib/typescript/src/views/revealWinHelpers.d.ts.map +1 -0
  473. package/lib/typescript/src/views/ticketBundlePresets.d.ts +18 -0
  474. package/lib/typescript/src/views/ticketBundlePresets.d.ts.map +1 -0
  475. package/lib/typescript/src/views/triviaHelpers.d.ts +31 -0
  476. package/lib/typescript/src/views/triviaHelpers.d.ts.map +1 -0
  477. package/lib/typescript/src/voiceClips.d.ts +4 -0
  478. package/lib/typescript/src/voiceClips.d.ts.map +1 -0
  479. package/package.json +160 -4
@@ -0,0 +1,1697 @@
1
+ "use strict";
2
+
3
+ import React, { useState, useRef, useCallback, useEffect, useMemo } from 'react';
4
+ import { View, Text, StyleSheet, Alert, Animated, KeyboardAvoidingView, Platform, ScrollView, BackHandler } from 'react-native';
5
+ import { COLORS } from "../constants.js";
6
+ import QuitConfirmModal from "../components/QuitConfirmModal.js";
7
+ import SideDemoTab from "../components/SideDemoTab.js";
8
+ import HypeCallout from "../components/HypeCallout.js";
9
+ import { HYPE_PHRASES, pickPhrase } from "../effects/hypePhrases.js";
10
+ import { sounds } from "../SoundManager.js";
11
+ import SvgIcon from "../Icons.js";
12
+ import MonflowtsButton from "../components/MonflowtsButton.js";
13
+ import MonflowtsPressable from "../components/MonflowtsPressable.js";
14
+ import MonflowtsChipGroup from "../components/MonflowtsChipGroup.js";
15
+ import MonflowtsLottieView from "../NativeLottieView.js";
16
+ import SessionTimer from "../components/SessionTimer.js";
17
+ import AbandonPolicyNotice from "../components/AbandonPolicyNotice.js";
18
+ import InsufficientFundsOverlay from "../components/InsufficientFundsOverlay.js";
19
+ import StakeInput from "../components/StakeInput.js";
20
+ import GameRulesModal from "../components/GameRulesModal.js";
21
+ import JackpotNearMiss from "../components/JackpotNearMiss.js";
22
+ import { confettiAnim, dustAnim } from "../effects/particleAnims.js";
23
+ import { lottie } from "../assets/remote.js";
24
+ import { computeGridGeometry } from "./gridGeometry.js";
25
+ import { usePlayGame, useInitPlay } from "../hooks/usePlayGame.js";
26
+ import { useCurrency } from "../hooks/useCurrency.js";
27
+ import { useResponsive } from "../hooks/useResponsive.js";
28
+ import { useGameStore } from "../stores/gameStore.js";
29
+ import { gameRules, randomMessageKey } from "../content.js";
30
+ import { t, formatNumber, errorText } from "../i18n.js";
31
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
32
+ const COIN_COUNT = 6;
33
+ const COIN_FLY_DURATION = 600;
34
+ const COIN_STAGGER = 80;
35
+ const GRID_PADDING = 20;
36
+ const GRID_GAP = 10;
37
+ const GRID_MAX_CONTENT = 420;
38
+ const MillionaireHunter = ({
39
+ onBack,
40
+ onWin,
41
+ onLose,
42
+ balance,
43
+ game,
44
+ onTopUp
45
+ }) => {
46
+ const currency = useCurrency();
47
+ const demoMode = useGameStore(s => s.demoMode);
48
+ const {
49
+ columnWidth
50
+ } = useResponsive();
51
+ const gridContent = Math.min(columnWidth - GRID_PADDING * 2, GRID_MAX_CONTENT);
52
+ // ── Core game state ──
53
+ const [gameState, setGameState] = useState('LOBBY');
54
+ const fallbackRules = gameRules('MILLIONAIRE_HUNTER');
55
+ const maxPicks = game?.gameplayRules?.maxPicks ?? fallbackRules.maxPicks ?? 0;
56
+ // Board size comes from the published config (total cells). The server validates every
57
+ // pick as 0 ≤ pick < gridSize, so the rendered board MUST match gridSize — otherwise a
58
+ // configured grid smaller than 9 would let the player tap cells the server rejects, and
59
+ // a larger grid (the seeded 5×5 = 25) would hide most of the board. Falls back to the
60
+ // engine's own default (9) when unconfigured.
61
+ const gridSize = Math.max(1, game?.gameplayRules?.gridSize ?? fallbackRules.gridSize ?? 1);
62
+ const {
63
+ cols: gridCols,
64
+ cellSize: chestCellSize,
65
+ gridWidth: gridPixelWidth
66
+ } = useMemo(() => computeGridGeometry(gridSize, gridContent, GRID_GAP), [gridSize, gridContent]);
67
+ const [picksRemaining, setPicksRemaining] = useState(maxPicks);
68
+ const picksRef = useRef(maxPicks);
69
+ const [openedChests, setOpenedChests] = useState(new Map());
70
+ const [currentPick, setCurrentPick] = useState(null);
71
+ const [processingChests, setProcessingChests] = useState(new Set());
72
+ const [totalWonThisRound, setTotalWonThisRound] = useState(0);
73
+ const totalWonRef = useRef(0);
74
+ const [displayBalance, setDisplayBalance] = useState(balance);
75
+ const displayBalanceRef = useRef(balance);
76
+ const [showFundsOverlay, setShowFundsOverlay] = useState(false);
77
+ const [rulesVisible, setRulesVisible] = useState(false);
78
+ const [lottieKey, setLottieKey] = useState(0);
79
+
80
+ // Keep refs in sync with state
81
+ useEffect(() => {
82
+ displayBalanceRef.current = displayBalance;
83
+ }, [displayBalance]);
84
+
85
+ // Sync displayBalance from prop when in LOBBY or when balance prop changes (wallet refresh)
86
+ const prevBalanceRef = useRef(balance);
87
+ useEffect(() => {
88
+ const balanceChanged = prevBalanceRef.current !== balance;
89
+ prevBalanceRef.current = balance;
90
+ if (gameState === 'LOBBY' || balanceChanged) {
91
+ setDisplayBalance(balance);
92
+ displayBalanceRef.current = balance;
93
+ }
94
+ }, [balance, gameState]);
95
+
96
+ // Derive the actual play cost from game config (kobo → VG)
97
+ const actualCostVG = useMemo(() => {
98
+ if (!game?.playCost) return 0;
99
+ if (game.playCost.type === 'BY_CHANNEL' && game.playCost.channelPricing?.length) {
100
+ const mobile = game.playCost.channelPricing.find(cp => cp.channel === 'MOBILE');
101
+ if (mobile) return Math.round(mobile.amountKobo / 100);
102
+ }
103
+ return Math.round((game.playCost.fixedAmountKobo ?? 0) / 100);
104
+ }, [game?.playCost]);
105
+
106
+ // Use stakeOptions from config if available; otherwise fixed cost (no selector)
107
+ const hasStakeOptions = !!game?.gameplayRules?.stakeOptions?.length;
108
+ const stakeOptions = (hasStakeOptions ? game.gameplayRules.stakeOptions : fallbackRules.stakeOptions ?? []).map(s => Math.round(s / 100));
109
+ const [activeStake, setActiveStake] = useState(hasStakeOptions ? stakeOptions[Math.floor(stakeOptions.length / 2)] ?? 500 : actualCostVG || (stakeOptions[Math.floor(stakeOptions.length / 2)] ?? 500));
110
+
111
+ // The effective cost sent to the server — if no stake options, use the actual config cost
112
+ const effectiveCostVG = hasStakeOptions ? activeStake : actualCostVG || activeStake;
113
+
114
+ // Multi-play session support
115
+ const stakeCountOptions = game?.gameplayRules?.stakeCountOptions ?? [];
116
+ const hasStakeCount = stakeCountOptions.length > 1;
117
+ const [selectedStakeCount, setSelectedStakeCount] = useState(stakeCountOptions[0] ?? 1);
118
+ const isMultiHunt = selectedStakeCount > 1;
119
+ const totalSessionCostVG = effectiveCostVG * maxPicks * selectedStakeCount;
120
+ const [currentHunt, setCurrentHunt] = useState(1);
121
+ const [sessionTotalWon, setSessionTotalWon] = useState(0);
122
+ const sessionTotalWonRef = useRef(0);
123
+ const [sessionHuntWins, setSessionHuntWins] = useState(0);
124
+ const [_sessionComplete, setSessionComplete] = useState(false);
125
+ const {
126
+ play
127
+ } = usePlayGame();
128
+
129
+ // Two-phase play support
130
+ const abandonPolicy = game?.gameplayRules?.abandonPolicy ?? null;
131
+ const initPlay = useInitPlay(game?.gameCode ?? 'MILLIONAIRE_HUNTER', abandonPolicy);
132
+
133
+ // Reset session + game state when demo mode toggles
134
+ const prevDemoRef = useRef(demoMode);
135
+ useEffect(() => {
136
+ if (prevDemoRef.current !== demoMode) {
137
+ prevDemoRef.current = demoMode;
138
+ if (initPlay.enabled) initPlay.reset();
139
+ // Reset round state and re-sync balance from prop
140
+ resetAllAnims();
141
+ setOpenedChests(new Map());
142
+ setPicksRemaining(maxPicks);
143
+ picksRef.current = maxPicks;
144
+ setTotalWonThisRound(0);
145
+ totalWonRef.current = 0;
146
+ setCurrentPick(null);
147
+ setProcessingChests(new Set());
148
+ setFlyingCoins([]);
149
+ setGameState('LOBBY');
150
+ setDisplayBalance(balance);
151
+ displayBalanceRef.current = balance;
152
+ setLottieKey(k => k + 1);
153
+ setCurrentHunt(1);
154
+ setSessionTotalWon(0);
155
+ sessionTotalWonRef.current = 0;
156
+ setSessionHuntWins(0);
157
+ setSessionComplete(false);
158
+ }
159
+ }, [demoMode]); // eslint-disable-line react-hooks/exhaustive-deps
160
+
161
+ // Memoize JSON strings so they stay referentially stable
162
+ const chestOpenJson = useMemo(() => lottie('lottie/treasure'), []);
163
+ const confettiJson = useMemo(() => confettiAnim(), []);
164
+ const dustJson = useMemo(() => dustAnim(), []);
165
+
166
+ // ── Per-chest animations ──
167
+ const chestScaleAnims = useRef(Array.from({
168
+ length: gridSize
169
+ }, () => new Animated.Value(1))).current;
170
+ const chestGlowAnims = useRef(Array.from({
171
+ length: gridSize
172
+ }, () => new Animated.Value(0))).current;
173
+ const resultBadgeOpacity = useRef(Array.from({
174
+ length: gridSize
175
+ }, () => new Animated.Value(0))).current;
176
+ const resultBadgeTranslateY = useRef(Array.from({
177
+ length: gridSize
178
+ }, () => new Animated.Value(10))).current;
179
+
180
+ // ── Shuffle animations (one per chest) ──
181
+ const shuffleTranslateX = useRef(Array.from({
182
+ length: gridSize
183
+ }, () => new Animated.Value(0))).current;
184
+ const shuffleTranslateY = useRef(Array.from({
185
+ length: gridSize
186
+ }, () => new Animated.Value(0))).current;
187
+ const shuffleScale = useRef(Array.from({
188
+ length: gridSize
189
+ }, () => new Animated.Value(1))).current;
190
+ const shuffleRotate = useRef(Array.from({
191
+ length: gridSize
192
+ }, () => new Animated.Value(0))).current;
193
+
194
+ // ── Summary overlay animations ──
195
+ const overlayOpacity = useRef(new Animated.Value(0)).current;
196
+ const overlayScale = useRef(new Animated.Value(0.8)).current;
197
+ const iconBounce = useRef(new Animated.Value(0)).current;
198
+
199
+ // ── Balance pill pulse ──
200
+ const balancePulse = useRef(new Animated.Value(1)).current;
201
+
202
+ // ── Coin fly state ──
203
+ const [flyingCoins, setFlyingCoins] = useState([]);
204
+
205
+ // ── Position refs for coin animation ──
206
+ const balancePillRef = useRef(null);
207
+ const chestRefs = useRef({});
208
+ const containerRef = useRef(null);
209
+ const hypeRef = useRef(null);
210
+ const balancePos = useRef({
211
+ x: 0,
212
+ y: 0,
213
+ w: 0,
214
+ h: 0
215
+ });
216
+ const containerOffset = useRef({
217
+ x: 0,
218
+ y: 0
219
+ });
220
+ const chestPositions = useRef({});
221
+ const measureContainer = useCallback(() => {
222
+ containerRef.current?.measureInWindow?.((x, y) => {
223
+ containerOffset.current = {
224
+ x,
225
+ y
226
+ };
227
+ });
228
+ }, []);
229
+ const measureBalancePill = useCallback(() => {
230
+ balancePillRef.current?.measureInWindow?.((x, y, w, h) => {
231
+ balancePos.current = {
232
+ x: x + w / 2,
233
+ y: y + h / 2,
234
+ w,
235
+ h
236
+ };
237
+ });
238
+ }, []);
239
+ const measureChest = useCallback(index => {
240
+ chestRefs.current[index]?.measureInWindow?.((x, y, w, h) => {
241
+ chestPositions.current[index] = {
242
+ x: x + w / 2,
243
+ y: y + h / 2
244
+ };
245
+ });
246
+ }, []);
247
+
248
+ // Icon bounce loop for summary
249
+ useEffect(() => {
250
+ if (gameState === 'SUMMARY') {
251
+ const bounce = Animated.loop(Animated.sequence([Animated.timing(iconBounce, {
252
+ toValue: -12,
253
+ duration: 500,
254
+ useNativeDriver: true
255
+ }), Animated.timing(iconBounce, {
256
+ toValue: 0,
257
+ duration: 500,
258
+ useNativeDriver: true
259
+ })]));
260
+ bounce.start();
261
+ return () => bounce.stop();
262
+ }
263
+ iconBounce.setValue(0);
264
+ return undefined;
265
+ }, [gameState, iconBounce]);
266
+ const resetAllAnims = useCallback(() => {
267
+ chestScaleAnims.forEach(v => v.setValue(1));
268
+ chestGlowAnims.forEach(v => v.setValue(0));
269
+ resultBadgeOpacity.forEach(v => v.setValue(0));
270
+ resultBadgeTranslateY.forEach(v => v.setValue(10));
271
+ overlayOpacity.setValue(0);
272
+ overlayScale.setValue(0.8);
273
+ iconBounce.setValue(0);
274
+ balancePulse.setValue(1);
275
+ shuffleTranslateX.forEach(v => v.setValue(0));
276
+ shuffleTranslateY.forEach(v => v.setValue(0));
277
+ shuffleScale.forEach(v => v.setValue(1));
278
+ shuffleRotate.forEach(v => v.setValue(0));
279
+ }, [chestScaleAnims, chestGlowAnims, resultBadgeOpacity, resultBadgeTranslateY, overlayOpacity, overlayScale, iconBounce, balancePulse, shuffleTranslateX, shuffleTranslateY, shuffleScale, shuffleRotate]);
280
+
281
+ /**
282
+ * Shell-game style shuffle:
283
+ * 1. Close all chests, shrink the grid
284
+ * 2. Perform 6 rapid pair-swap rounds (two chests physically swap positions
285
+ * via arced paths). Each round picks 2–3 random pairs and runs them
286
+ * simultaneously. Speed increases each round.
287
+ * 3. After all swaps, spring everything back to the home position.
288
+ */
289
+ const animateShuffle = useCallback(() => {
290
+ // Step between adjacent cells, derived from the actual (config-driven) cell size so
291
+ // chests swap across real grid distances regardless of how many columns are rendered.
292
+ const STEP = chestCellSize + GRID_GAP;
293
+
294
+ // Grid position for each chest index (col, row) using the dynamic column count.
295
+ const gridPos = idx => ({
296
+ col: idx % gridCols,
297
+ row: Math.floor(idx / gridCols)
298
+ });
299
+
300
+ // Pick N random non-overlapping pairs
301
+ const pickPairs = count => {
302
+ const indices = Array.from({
303
+ length: gridSize
304
+ }, (_, i) => i);
305
+ // Fisher-Yates shuffle
306
+ for (let i = indices.length - 1; i > 0; i--) {
307
+ const j = Math.floor(Math.random() * (i + 1));
308
+ [indices[i], indices[j]] = [indices[j], indices[i]];
309
+ }
310
+ const pairs = [];
311
+ for (let i = 0; i + 1 < indices.length && pairs.length < count; i += 2) {
312
+ pairs.push([indices[i], indices[i + 1]]);
313
+ }
314
+ return pairs;
315
+ };
316
+ return new Promise(resolve => {
317
+ // Step 1: Reset Lottie (close chests) and shrink
318
+ setLottieKey(k => k + 1);
319
+ const shrink = shuffleScale.map(sv => Animated.timing(sv, {
320
+ toValue: 0.75,
321
+ duration: 200,
322
+ useNativeDriver: true
323
+ }));
324
+ Animated.parallel(shrink).start(() => {
325
+ // Track cumulative offsets so positions stay consistent across rounds
326
+ const offsets = Array.from({
327
+ length: gridSize
328
+ }, () => ({
329
+ x: 0,
330
+ y: 0
331
+ }));
332
+
333
+ // Step 2: Run 6 swap rounds with accelerating speed
334
+ const TOTAL_ROUNDS = 6;
335
+ const runRound = round => {
336
+ if (round >= TOTAL_ROUNDS) {
337
+ // Step 3: Spring everything back home
338
+ const settle = [...shuffleTranslateX.map(v => Animated.spring(v, {
339
+ toValue: 0,
340
+ friction: 5,
341
+ tension: 140,
342
+ useNativeDriver: true
343
+ })), ...shuffleTranslateY.map(v => Animated.spring(v, {
344
+ toValue: 0,
345
+ friction: 5,
346
+ tension: 140,
347
+ useNativeDriver: true
348
+ })), ...shuffleScale.map(v => Animated.spring(v, {
349
+ toValue: 1,
350
+ friction: 5,
351
+ tension: 100,
352
+ useNativeDriver: true
353
+ })), ...shuffleRotate.map(v => Animated.timing(v, {
354
+ toValue: 0,
355
+ duration: 150,
356
+ useNativeDriver: true
357
+ }))];
358
+ Animated.parallel(settle).start(() => resolve());
359
+ return;
360
+ }
361
+
362
+ // More pairs per round as it speeds up; duration decreases
363
+ const pairsCount = round < 2 ? 2 : round < 4 ? 3 : 4;
364
+ const duration = Math.max(120, 300 - round * 30);
365
+ const pairs = pickPairs(pairsCount);
366
+ const swaps = pairs.map(([a, b]) => {
367
+ // Calculate swap delta from current offset
368
+ const posA = gridPos(a);
369
+ const posB = gridPos(b);
370
+ const dx = (posB.col - posA.col) * STEP;
371
+ const dy = (posB.row - posA.row) * STEP;
372
+
373
+ // Target offsets after swap
374
+ const newAx = offsets[a].x + dx;
375
+ const newAy = offsets[a].y + dy;
376
+ const newBx = offsets[b].x - dx;
377
+ const newBy = offsets[b].y - dy;
378
+ const arcMag = 25 + Math.random() * 25;
379
+ const rotAngle = (Math.random() - 0.5) * 40;
380
+ const anim = Animated.parallel([
381
+ // A arcs to B's position
382
+ Animated.sequence([Animated.parallel([Animated.timing(shuffleTranslateX[a], {
383
+ toValue: (offsets[a].x + newAx) / 2,
384
+ duration: duration / 2,
385
+ useNativeDriver: true
386
+ }), Animated.timing(shuffleTranslateY[a], {
387
+ toValue: (offsets[a].y + newAy) / 2 - arcMag,
388
+ duration: duration / 2,
389
+ useNativeDriver: true
390
+ }), Animated.timing(shuffleRotate[a], {
391
+ toValue: rotAngle,
392
+ duration: duration / 2,
393
+ useNativeDriver: true
394
+ })]), Animated.parallel([Animated.timing(shuffleTranslateX[a], {
395
+ toValue: newAx,
396
+ duration: duration / 2,
397
+ useNativeDriver: true
398
+ }), Animated.timing(shuffleTranslateY[a], {
399
+ toValue: newAy,
400
+ duration: duration / 2,
401
+ useNativeDriver: true
402
+ }), Animated.timing(shuffleRotate[a], {
403
+ toValue: 0,
404
+ duration: duration / 2,
405
+ useNativeDriver: true
406
+ })])]),
407
+ // B arcs to A's position
408
+ Animated.sequence([Animated.parallel([Animated.timing(shuffleTranslateX[b], {
409
+ toValue: (offsets[b].x + newBx) / 2,
410
+ duration: duration / 2,
411
+ useNativeDriver: true
412
+ }), Animated.timing(shuffleTranslateY[b], {
413
+ toValue: (offsets[b].y + newBy) / 2 + arcMag,
414
+ duration: duration / 2,
415
+ useNativeDriver: true
416
+ }), Animated.timing(shuffleRotate[b], {
417
+ toValue: -rotAngle,
418
+ duration: duration / 2,
419
+ useNativeDriver: true
420
+ })]), Animated.parallel([Animated.timing(shuffleTranslateX[b], {
421
+ toValue: newBx,
422
+ duration: duration / 2,
423
+ useNativeDriver: true
424
+ }), Animated.timing(shuffleTranslateY[b], {
425
+ toValue: newBy,
426
+ duration: duration / 2,
427
+ useNativeDriver: true
428
+ }), Animated.timing(shuffleRotate[b], {
429
+ toValue: 0,
430
+ duration: duration / 2,
431
+ useNativeDriver: true
432
+ })])])]);
433
+
434
+ // Commit offset changes
435
+ offsets[a].x = newAx;
436
+ offsets[a].y = newAy;
437
+ offsets[b].x = newBx;
438
+ offsets[b].y = newBy;
439
+ return anim;
440
+ });
441
+ Animated.parallel(swaps).start(() => runRound(round + 1));
442
+ };
443
+ runRound(0);
444
+ });
445
+ });
446
+ }, [shuffleTranslateX, shuffleTranslateY, shuffleScale, shuffleRotate, gridCols, chestCellSize]);
447
+ const animateOverlayIn = useCallback(() => {
448
+ Animated.parallel([Animated.timing(overlayOpacity, {
449
+ toValue: 1,
450
+ duration: 350,
451
+ useNativeDriver: true
452
+ }), Animated.spring(overlayScale, {
453
+ toValue: 1,
454
+ friction: 6,
455
+ tension: 80,
456
+ useNativeDriver: true
457
+ })]).start();
458
+ }, [overlayOpacity, overlayScale]);
459
+
460
+ // ── Coin fly animation ──
461
+ const animateCoinFly = useCallback((chestIndex, amount) => {
462
+ const source = chestPositions.current[chestIndex];
463
+ const target = balancePos.current;
464
+ const offset = containerOffset.current;
465
+ if (!source || target.x === 0 && target.y === 0) {
466
+ setDisplayBalance(prev => prev + amount);
467
+ displayBalanceRef.current += amount;
468
+ return;
469
+ }
470
+ // Convert to container-relative coordinates
471
+ const sx = source.x - offset.x;
472
+ const sy = source.y - offset.y;
473
+ const tx = target.x - offset.x;
474
+ const ty = target.y - offset.y;
475
+ const newCoins = [];
476
+ for (let i = 0; i < COIN_COUNT; i++) {
477
+ newCoins.push({
478
+ id: Date.now() + i,
479
+ translateX: new Animated.Value(sx - 6 + (Math.random() - 0.5) * 20),
480
+ translateY: new Animated.Value(sy - 6),
481
+ opacity: new Animated.Value(0),
482
+ scale: new Animated.Value(0.3)
483
+ });
484
+ }
485
+ setFlyingCoins(prev => [...prev, ...newCoins]);
486
+ newCoins.forEach((coin, i) => {
487
+ const arrivalTime = i * COIN_STAGGER + COIN_FLY_DURATION;
488
+ setTimeout(() => {
489
+ Animated.parallel([Animated.timing(coin.translateX, {
490
+ toValue: tx - 6,
491
+ duration: COIN_FLY_DURATION,
492
+ useNativeDriver: true
493
+ }), Animated.sequence([Animated.timing(coin.translateY, {
494
+ toValue: sy - 60 - Math.random() * 40,
495
+ duration: COIN_FLY_DURATION * 0.35,
496
+ useNativeDriver: true
497
+ }), Animated.timing(coin.translateY, {
498
+ toValue: ty - 6,
499
+ duration: COIN_FLY_DURATION * 0.65,
500
+ useNativeDriver: true
501
+ })]), Animated.sequence([Animated.timing(coin.opacity, {
502
+ toValue: 1,
503
+ duration: 80,
504
+ useNativeDriver: true
505
+ }), Animated.delay(COIN_FLY_DURATION - 160), Animated.timing(coin.opacity, {
506
+ toValue: 0,
507
+ duration: 80,
508
+ useNativeDriver: true
509
+ })]), Animated.sequence([Animated.timing(coin.scale, {
510
+ toValue: 1,
511
+ duration: COIN_FLY_DURATION * 0.3,
512
+ useNativeDriver: true
513
+ }), Animated.timing(coin.scale, {
514
+ toValue: 0.4,
515
+ duration: COIN_FLY_DURATION * 0.7,
516
+ useNativeDriver: true
517
+ })])]).start();
518
+ }, i * COIN_STAGGER);
519
+
520
+ // Play coin-drop sound as each coin arrives
521
+ setTimeout(() => {
522
+ sounds.playCoinDrop(i);
523
+ }, arrivalTime);
524
+ });
525
+
526
+ // After all coins arrive, pulse balance and update
527
+ const totalFlightTime = (COIN_COUNT - 1) * COIN_STAGGER + COIN_FLY_DURATION + 50;
528
+ setTimeout(() => {
529
+ setDisplayBalance(prev => prev + amount);
530
+ displayBalanceRef.current += amount;
531
+ Animated.sequence([Animated.timing(balancePulse, {
532
+ toValue: 1.2,
533
+ duration: 150,
534
+ useNativeDriver: true
535
+ }), Animated.spring(balancePulse, {
536
+ toValue: 1,
537
+ friction: 4,
538
+ useNativeDriver: true
539
+ })]).start();
540
+ setFlyingCoins(prev => prev.filter(c => !newCoins.some(nc => nc.id === c.id)));
541
+ }, totalFlightTime);
542
+ }, [balancePulse]);
543
+
544
+ // ── Inline chest result animation ──
545
+ const animateChestResult = useCallback((index, isWin) => {
546
+ Animated.sequence([Animated.spring(chestScaleAnims[index], {
547
+ toValue: 1.15,
548
+ friction: 4,
549
+ tension: 100,
550
+ useNativeDriver: true
551
+ }), Animated.spring(chestScaleAnims[index], {
552
+ toValue: 1,
553
+ friction: 5,
554
+ useNativeDriver: true
555
+ })]).start();
556
+ if (isWin) {
557
+ Animated.timing(chestGlowAnims[index], {
558
+ toValue: 1,
559
+ duration: 300,
560
+ useNativeDriver: true
561
+ }).start();
562
+ }
563
+ Animated.parallel([Animated.timing(resultBadgeOpacity[index], {
564
+ toValue: 1,
565
+ duration: 300,
566
+ useNativeDriver: true
567
+ }), Animated.spring(resultBadgeTranslateY[index], {
568
+ toValue: 0,
569
+ friction: 6,
570
+ tension: 80,
571
+ useNativeDriver: true
572
+ })]).start();
573
+ }, [chestScaleAnims, chestGlowAnims, resultBadgeOpacity, resultBadgeTranslateY]);
574
+
575
+ // ── Handle chest tap ──
576
+ const handleOpenChest = useCallback(async index => {
577
+ if (gameState !== 'LOBBY' && gameState !== 'PICKING' && gameState !== 'CHEST_ANIMATING') return;
578
+ if (!game) return;
579
+ if (openedChests.has(index)) return;
580
+ if (processingChests.has(index)) return;
581
+ if (initPlay.enabled && initPlay.isExpired) return;
582
+
583
+ // Balance check
584
+ if (!demoMode && !initPlay.session && displayBalanceRef.current < effectiveCostVG) {
585
+ setShowFundsOverlay(true);
586
+ return;
587
+ }
588
+
589
+ // Check if all picks spent
590
+ if (picksRef.current <= 0) return;
591
+ sounds.resume();
592
+ sounds.playChestOpen();
593
+ setCurrentPick(index);
594
+ setGameState('CHEST_ANIMATING');
595
+
596
+ // Mark chest as processing (pulsing indicator)
597
+ setProcessingChests(prev => new Set(prev).add(index));
598
+
599
+ // Optimistic balance debit
600
+ setDisplayBalance(prev => prev - effectiveCostVG);
601
+ displayBalanceRef.current -= effectiveCostVG;
602
+
603
+ // Eagerly deduct picks so other taps respect the limit
604
+ const newPicksRemaining = picksRef.current - 1;
605
+ setPicksRemaining(newPicksRemaining);
606
+ picksRef.current = newPicksRemaining;
607
+
608
+ // Measure positions for coin animation
609
+ chestRefs.current[index]?.measureInWindow?.((x, y, w, h) => {
610
+ chestPositions.current[index] = {
611
+ x: x + w / 2,
612
+ y: y + h / 2
613
+ };
614
+ });
615
+ measureBalancePill();
616
+ measureContainer();
617
+
618
+ // ── Server call ──
619
+ let serverResult = null;
620
+ try {
621
+ if (initPlay.enabled) {
622
+ const activeSession = initPlay.session ?? (await initPlay.startSession(effectiveCostVG * 100));
623
+ serverResult = await initPlay.completeSession({
624
+ picks: [index]
625
+ }, activeSession);
626
+ } else {
627
+ serverResult = await play(game.gameCode, {
628
+ picks: [index]
629
+ }, undefined, effectiveCostVG * 100);
630
+ }
631
+ } catch (e) {
632
+ console.warn('[MillionaireHunter] play failed:', e?.message ?? e);
633
+ setDisplayBalance(prev => prev + effectiveCostVG);
634
+ displayBalanceRef.current += effectiveCostVG;
635
+ picksRef.current += 1;
636
+ setPicksRemaining(picksRef.current);
637
+ setProcessingChests(prev => {
638
+ const s = new Set(prev);
639
+ s.delete(index);
640
+ return s;
641
+ });
642
+ const msg = (e?.message || '').toLowerCase();
643
+ if (msg.includes('insufficient') || msg.includes('balance')) {
644
+ setShowFundsOverlay(true);
645
+ } else {
646
+ Alert.alert(t('hunter.playErrorTitle'), errorText(e, 'hunter.playFailed'));
647
+ }
648
+ if (picksRef.current === maxPicks) setGameState('LOBBY');else setGameState('PICKING');
649
+ setCurrentPick(null);
650
+ return;
651
+ }
652
+ const amountWon = (serverResult?.amountWonKobo ?? 0) / 100;
653
+ const isWin = amountWon > 0;
654
+
655
+ // Update state
656
+ setOpenedChests(prev => {
657
+ const m = new Map(prev);
658
+ m.set(index, {
659
+ won: isWin,
660
+ amount: amountWon
661
+ });
662
+ return m;
663
+ });
664
+ totalWonRef.current += amountWon;
665
+ setTotalWonThisRound(totalWonRef.current);
666
+ sessionTotalWonRef.current += amountWon;
667
+ setSessionTotalWon(sessionTotalWonRef.current);
668
+
669
+ // Remove from processing
670
+ setProcessingChests(prev => {
671
+ const s = new Set(prev);
672
+ s.delete(index);
673
+ return s;
674
+ });
675
+
676
+ // Show inline result immediately
677
+ animateChestResult(index, isWin);
678
+ if (isWin) {
679
+ sounds.playWinChime();
680
+ animateCoinFly(index, amountWon);
681
+ hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.hunter.bigWin : HYPE_PHRASES.hunter.win), amountWon >= 5000 ? 'boost' : 'win');
682
+ } else {
683
+ sounds.playDrawSound();
684
+ hypeRef.current?.show(pickPhrase(HYPE_PHRASES.hunter.loss), 'loss');
685
+ }
686
+
687
+ // Decide next state after a short delay for the result to register visually
688
+ const delay = isWin ? 1200 : 600;
689
+ setTimeout(() => {
690
+ setCurrentPick(cur => cur === index ? null : cur);
691
+ if (picksRef.current > 0) {
692
+ // Check if player can afford next pick
693
+ if (!demoMode && displayBalanceRef.current < effectiveCostVG) {
694
+ if (isMultiHunt && totalWonRef.current > 0) setSessionHuntWins(w => w + 1);
695
+ setSessionComplete(true);
696
+ setGameState('SUMMARY');
697
+ animateOverlayIn();
698
+ setLottieKey(k => k + 1);
699
+ return;
700
+ }
701
+ setGameState('PICKING');
702
+ if (initPlay.enabled) initPlay.reset();
703
+ } else {
704
+ // All picks used
705
+ if (isMultiHunt && currentHunt < selectedStakeCount) {
706
+ // Track hunt wins
707
+ if (totalWonRef.current > 0) setSessionHuntWins(w => w + 1);
708
+ onLose?.(); // Refresh wallet between hunts
709
+ setTimeout(() => {
710
+ setCurrentHunt(h => h + 1);
711
+ resetAllAnims();
712
+ setOpenedChests(new Map());
713
+ setPicksRemaining(maxPicks);
714
+ picksRef.current = maxPicks;
715
+ setTotalWonThisRound(0);
716
+ totalWonRef.current = 0;
717
+ setCurrentPick(null);
718
+ setProcessingChests(new Set());
719
+ setFlyingCoins([]);
720
+ setGameState('SHUFFLING');
721
+ animateShuffle().then(() => {
722
+ setLottieKey(k => k + 1);
723
+ setGameState('PICKING');
724
+ });
725
+ }, 800);
726
+ } else {
727
+ // Last hunt or single → summary
728
+ if (isMultiHunt && totalWonRef.current > 0) setSessionHuntWins(w => w + 1);
729
+ setSessionComplete(true);
730
+ setGameState('SUMMARY');
731
+ animateOverlayIn();
732
+ setLottieKey(k => k + 1);
733
+ }
734
+ }
735
+ }, delay);
736
+ }, [gameState, game, openedChests, processingChests, effectiveCostVG, play, maxPicks, initPlay, demoMode, animateChestResult, animateCoinFly, measureBalancePill, measureContainer, animateOverlayIn, isMultiHunt, currentHunt, selectedStakeCount, resetAllAnims, animateShuffle, onLose]);
737
+
738
+ // ── Reset for new round ──
739
+ const resetGame = useCallback(() => {
740
+ resetAllAnims();
741
+ setOpenedChests(new Map());
742
+ setPicksRemaining(maxPicks);
743
+ picksRef.current = maxPicks;
744
+ setTotalWonThisRound(0);
745
+ totalWonRef.current = 0;
746
+ setCurrentPick(null);
747
+ setProcessingChests(new Set());
748
+ setFlyingCoins([]);
749
+ setCurrentHunt(1);
750
+ setSessionTotalWon(0);
751
+ sessionTotalWonRef.current = 0;
752
+ setSessionHuntWins(0);
753
+ setSessionComplete(false);
754
+ setGameState('SHUFFLING');
755
+ animateShuffle().then(() => {
756
+ setLottieKey(k => k + 1);
757
+ setGameState('LOBBY');
758
+ });
759
+ }, [resetAllAnims, animateShuffle, maxPicks]);
760
+ const handleCollect = useCallback(() => {
761
+ const total = isMultiHunt ? sessionTotalWonRef.current : totalWonRef.current;
762
+ if (total > 0) {
763
+ onWin(total);
764
+ } else {
765
+ onBack();
766
+ }
767
+ }, [onWin, onBack, isMultiHunt]);
768
+ const handlePlayAgain = useCallback(() => {
769
+ onLose?.(); // refresh wallet
770
+ resetGame();
771
+ }, [onLose, resetGame]);
772
+ const isActive = gameState === 'PICKING' || gameState === 'CHEST_ANIMATING';
773
+ const hasProcessing = processingChests.size > 0;
774
+ const isSummary = gameState === 'SUMMARY';
775
+ const gameLive = gameState !== 'LOBBY' && gameState !== 'SUMMARY';
776
+ const [quitVisible, setQuitVisible] = useState(false);
777
+ const handleBack = useCallback(() => {
778
+ if (!gameLive) {
779
+ onBack();
780
+ return;
781
+ }
782
+ setQuitVisible(true);
783
+ }, [gameLive, onBack]);
784
+ useEffect(() => {
785
+ const sub = BackHandler.addEventListener('hardwareBackPress', () => {
786
+ handleBack();
787
+ return true;
788
+ });
789
+ return () => sub.remove();
790
+ }, [handleBack]);
791
+ const isShuffling = gameState === 'SHUFFLING';
792
+
793
+ // Pick a random summary message once when entering SUMMARY
794
+ const displayWon = isMultiHunt ? sessionTotalWon : totalWonThisRound;
795
+ const summaryMsg = useMemo(() => randomMessageKey(displayWon > 0 ? 'hunter.win' : 'hunter.loss'),
796
+ // eslint-disable-next-line react-hooks/exhaustive-deps
797
+ [isSummary]);
798
+ return /*#__PURE__*/_jsx(KeyboardAvoidingView, {
799
+ style: {
800
+ flex: 1
801
+ },
802
+ behavior: Platform.OS === 'ios' ? 'padding' : undefined,
803
+ children: /*#__PURE__*/_jsxs(View, {
804
+ style: styles.container,
805
+ ref: containerRef,
806
+ onLayout: measureContainer,
807
+ children: [/*#__PURE__*/_jsx(HypeCallout, {
808
+ ref: hypeRef,
809
+ style: {
810
+ top: 230
811
+ }
812
+ }), /*#__PURE__*/_jsx(SideDemoTab, {
813
+ enabled: !!game?.demoConfig?.enabled
814
+ }), /*#__PURE__*/_jsxs(ScrollView, {
815
+ contentContainerStyle: {
816
+ flexGrow: 1
817
+ },
818
+ keyboardShouldPersistTaps: "handled",
819
+ bounces: false,
820
+ children: [initPlay.enabled && initPlay.session && /*#__PURE__*/_jsx(SessionTimer, {
821
+ secondsLeft: initPlay.secondsLeft,
822
+ isExpired: initPlay.isExpired
823
+ }), /*#__PURE__*/_jsxs(View, {
824
+ style: styles.header,
825
+ children: [/*#__PURE__*/_jsx(QuitConfirmModal, {
826
+ visible: quitVisible,
827
+ message: t('hunter.quitMessage'),
828
+ onKeepPlaying: () => setQuitVisible(false),
829
+ onQuit: () => {
830
+ setQuitVisible(false);
831
+ onBack();
832
+ }
833
+ }), /*#__PURE__*/_jsx(MonflowtsPressable, {
834
+ style: styles.circleBtn,
835
+ onPress: handleBack,
836
+ children: /*#__PURE__*/_jsx(Text, {
837
+ style: styles.btnText,
838
+ children: "\u2039"
839
+ })
840
+ }), /*#__PURE__*/_jsx(View, {
841
+ ref: balancePillRef,
842
+ onLayout: measureBalancePill,
843
+ children: /*#__PURE__*/_jsxs(Animated.View, {
844
+ style: [styles.balancePill, {
845
+ transform: [{
846
+ scale: balancePulse
847
+ }]
848
+ }],
849
+ children: [/*#__PURE__*/_jsx(View, {
850
+ style: styles.diamondIcon,
851
+ children: /*#__PURE__*/_jsx(SvgIcon, {
852
+ name: "diamond",
853
+ size: 14,
854
+ color: COLORS.gold
855
+ })
856
+ }), /*#__PURE__*/_jsx(Text, {
857
+ style: styles.balanceText,
858
+ children: formatNumber(displayBalance)
859
+ })]
860
+ })
861
+ }), /*#__PURE__*/_jsx(MonflowtsPressable, {
862
+ style: styles.circleBtn,
863
+ onPress: () => setRulesVisible(true),
864
+ children: /*#__PURE__*/_jsx(Text, {
865
+ style: styles.btnText,
866
+ children: "?"
867
+ })
868
+ })]
869
+ }), /*#__PURE__*/_jsxs(View, {
870
+ style: styles.titleArea,
871
+ children: [/*#__PURE__*/_jsxs(View, {
872
+ style: styles.badgeRow,
873
+ children: [isMultiHunt && gameState !== 'LOBBY' && /*#__PURE__*/_jsx(View, {
874
+ style: styles.roundBadge,
875
+ children: /*#__PURE__*/_jsxs(Text, {
876
+ style: styles.roundText,
877
+ children: ["Hunt ", currentHunt, "/", selectedStakeCount]
878
+ })
879
+ }), /*#__PURE__*/_jsxs(View, {
880
+ style: styles.liveBadge,
881
+ children: [/*#__PURE__*/_jsx(View, {
882
+ style: styles.liveIndicator
883
+ }), /*#__PURE__*/_jsx(Text, {
884
+ style: styles.liveText,
885
+ children: demoMode ? t('hunter.demo') : t('hunter.live')
886
+ })]
887
+ })]
888
+ }), isActive ? /*#__PURE__*/_jsxs(_Fragment, {
889
+ children: [/*#__PURE__*/_jsx(Text, {
890
+ style: styles.mainTitle,
891
+ children: picksRemaining === 1 ? t('hunter.pickLeft_one', {
892
+ count: picksRemaining
893
+ }) : t('hunter.pickLeft_other', {
894
+ count: picksRemaining
895
+ })
896
+ }), /*#__PURE__*/_jsx(Text, {
897
+ style: styles.mainSubtitle,
898
+ children: hasProcessing ? t('hunter.opening') : t('hunter.tapChest')
899
+ })]
900
+ }) : gameState === 'LOBBY' ? /*#__PURE__*/_jsxs(_Fragment, {
901
+ children: [/*#__PURE__*/_jsx(Text, {
902
+ style: styles.mainTitle,
903
+ children: t('hunter.pickChest')
904
+ }), /*#__PURE__*/_jsx(Text, {
905
+ style: styles.mainSubtitle,
906
+ children: t('hunter.lobbySubtitle', {
907
+ count: maxPicks
908
+ })
909
+ })]
910
+ }) : null]
911
+ }), /*#__PURE__*/_jsx(AbandonPolicyNotice, {
912
+ abandonPolicy: abandonPolicy
913
+ }), initPlay.enabled && initPlay.error && !initPlay.session && /*#__PURE__*/_jsxs(View, {
914
+ style: {
915
+ padding: 12,
916
+ backgroundColor: '#fef2f2',
917
+ borderRadius: 8,
918
+ margin: 8,
919
+ alignItems: 'center'
920
+ },
921
+ children: [/*#__PURE__*/_jsx(Text, {
922
+ style: {
923
+ color: '#b91c1c',
924
+ fontSize: 13,
925
+ marginBottom: 8,
926
+ textAlign: 'center'
927
+ },
928
+ children: initPlay.error
929
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
930
+ title: t('hunter.retry'),
931
+ onPress: () => initPlay.reset()
932
+ })]
933
+ }), /*#__PURE__*/_jsx(View, {
934
+ style: styles.gridArea,
935
+ children: /*#__PURE__*/_jsx(View, {
936
+ style: [styles.grid, {
937
+ width: gridPixelWidth
938
+ }],
939
+ children: Array.from({
940
+ length: gridSize
941
+ }).map((_, i) => {
942
+ const isProcessing = processingChests.has(i);
943
+ const isCurrentlyOpening = isProcessing || currentPick === i && gameState === 'CHEST_ANIMATING';
944
+ const chestResult = openedChests.get(i);
945
+ const isOpened = !!chestResult;
946
+ const canTap = (gameState === 'LOBBY' || gameState === 'PICKING' || gameState === 'CHEST_ANIMATING') && !isOpened && !isProcessing && picksRemaining > 0;
947
+ return /*#__PURE__*/_jsxs(Animated.View, {
948
+ ref: r => {
949
+ chestRefs.current[i] = r;
950
+ },
951
+ onLayout: () => measureChest(i),
952
+ style: [styles.chestCell, {
953
+ width: chestCellSize,
954
+ height: chestCellSize
955
+ }, {
956
+ transform: [{
957
+ scale: chestScaleAnims[i]
958
+ }, {
959
+ translateX: shuffleTranslateX[i]
960
+ }, {
961
+ translateY: shuffleTranslateY[i]
962
+ }, {
963
+ scale: shuffleScale[i]
964
+ }, {
965
+ rotate: shuffleRotate[i].interpolate({
966
+ inputRange: [-360, 360],
967
+ outputRange: ['-360deg', '360deg']
968
+ })
969
+ }]
970
+ }, isOpened && chestResult?.won && styles.chestCellWin, isOpened && !chestResult?.won && styles.chestCellLoss, isProcessing && styles.chestCellProcessing],
971
+ children: [/*#__PURE__*/_jsx(MonflowtsPressable, {
972
+ style: styles.chestTouchable,
973
+ onPress: () => handleOpenChest(i),
974
+ activeOpacity: 0.8,
975
+ disabled: !canTap,
976
+ children: /*#__PURE__*/_jsx(MonflowtsLottieView, {
977
+ sourceJson: chestOpenJson,
978
+ autoPlay: false,
979
+ loop: false,
980
+ speed: 1,
981
+ playing: (isCurrentlyOpening || isOpened) && !isShuffling,
982
+ style: styles.chestLottie
983
+ }, `chest-${i}-${lottieKey}`)
984
+ }), isOpened && chestResult?.won && /*#__PURE__*/_jsx(Animated.View, {
985
+ style: [styles.glowRing, styles.goldGlow, {
986
+ opacity: chestGlowAnims[i]
987
+ }],
988
+ pointerEvents: "none"
989
+ }), isOpened && !chestResult?.won && /*#__PURE__*/_jsx(View, {
990
+ style: styles.dustOverlay,
991
+ pointerEvents: "none",
992
+ children: /*#__PURE__*/_jsx(MonflowtsLottieView, {
993
+ sourceJson: dustJson,
994
+ autoPlay: true,
995
+ loop: false,
996
+ speed: 0.8,
997
+ style: {
998
+ width: '100%',
999
+ height: '100%'
1000
+ }
1001
+ })
1002
+ }), isOpened && /*#__PURE__*/_jsx(Animated.View, {
1003
+ style: [styles.resultBadge, chestResult?.won ? styles.resultBadgeWin : styles.resultBadgeLoss, {
1004
+ opacity: resultBadgeOpacity[i],
1005
+ transform: [{
1006
+ translateY: resultBadgeTranslateY[i]
1007
+ }]
1008
+ }],
1009
+ pointerEvents: "none",
1010
+ children: /*#__PURE__*/_jsx(Text, {
1011
+ style: [styles.resultBadgeText, chestResult?.won ? styles.resultBadgeTextWin : styles.resultBadgeTextLoss],
1012
+ children: chestResult?.won ? t('hunter.chestWin', {
1013
+ amount: formatNumber(chestResult.amount)
1014
+ }) : t('hunter.empty')
1015
+ })
1016
+ })]
1017
+ }, i);
1018
+ })
1019
+ })
1020
+ }), gameState === 'LOBBY' && /*#__PURE__*/_jsxs(View, {
1021
+ style: styles.footer,
1022
+ children: [hasStakeOptions || !actualCostVG ? /*#__PURE__*/_jsxs(_Fragment, {
1023
+ children: [/*#__PURE__*/_jsx(Text, {
1024
+ style: styles.footerLabel,
1025
+ children: t('hunter.selectBet')
1026
+ }), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
1027
+ options: stakeOptions,
1028
+ selectedValue: activeStake,
1029
+ onSelect: stake => {
1030
+ sounds.playSelect();
1031
+ setActiveStake(stake);
1032
+ },
1033
+ containerStyle: styles.stakeRow
1034
+ }), /*#__PURE__*/_jsx(StakeInput, {
1035
+ value: activeStake,
1036
+ min: stakeOptions[0] ?? 100,
1037
+ onConfirm: stake => setActiveStake(stake),
1038
+ currency: currency
1039
+ })]
1040
+ }) : /*#__PURE__*/_jsx(Text, {
1041
+ style: styles.footerLabel,
1042
+ children: t('hunter.playFee', {
1043
+ amount: formatNumber(effectiveCostVG),
1044
+ currency
1045
+ })
1046
+ }), hasStakeCount && /*#__PURE__*/_jsxs(View, {
1047
+ style: {
1048
+ marginBottom: 16
1049
+ },
1050
+ children: [/*#__PURE__*/_jsx(Text, {
1051
+ style: styles.footerLabel,
1052
+ children: t('hunter.huntsPerSession')
1053
+ }), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
1054
+ options: stakeCountOptions,
1055
+ selectedValue: selectedStakeCount,
1056
+ onSelect: count => {
1057
+ sounds.playSelect();
1058
+ setSelectedStakeCount(count);
1059
+ },
1060
+ containerStyle: styles.stakeRow,
1061
+ getLabel: v => t('hunter.roundsShort', {
1062
+ count: v
1063
+ })
1064
+ }), isMultiHunt && /*#__PURE__*/_jsx(Text, {
1065
+ style: {
1066
+ color: COLORS.slateLight,
1067
+ fontSize: 11,
1068
+ textAlign: 'center',
1069
+ marginTop: 6
1070
+ },
1071
+ children: t('hunter.huntsSummary', {
1072
+ hunts: selectedStakeCount,
1073
+ picks: maxPicks
1074
+ })
1075
+ })]
1076
+ }), /*#__PURE__*/_jsxs(View, {
1077
+ style: styles.statsRow,
1078
+ children: [/*#__PURE__*/_jsxs(View, {
1079
+ style: styles.stat,
1080
+ children: [/*#__PURE__*/_jsx(Text, {
1081
+ style: styles.statLabel,
1082
+ children: t('hunter.costPerChest')
1083
+ }), /*#__PURE__*/_jsxs(View, {
1084
+ style: {
1085
+ flexDirection: 'row',
1086
+ alignItems: 'center'
1087
+ },
1088
+ children: [/*#__PURE__*/_jsx(SvgIcon, {
1089
+ name: "moneyBag",
1090
+ size: 16,
1091
+ color: COLORS.gold
1092
+ }), /*#__PURE__*/_jsx(Text, {
1093
+ style: [styles.statValue, {
1094
+ marginLeft: 4
1095
+ }],
1096
+ children: effectiveCostVG
1097
+ })]
1098
+ })]
1099
+ }), /*#__PURE__*/_jsx(View, {
1100
+ style: styles.divider
1101
+ }), /*#__PURE__*/_jsxs(View, {
1102
+ style: styles.stat,
1103
+ children: [/*#__PURE__*/_jsx(Text, {
1104
+ style: [styles.statLabel, {
1105
+ color: COLORS.primary
1106
+ }],
1107
+ children: isMultiHunt ? t('hunter.totalMulti', {
1108
+ hunts: selectedStakeCount,
1109
+ picks: maxPicks
1110
+ }) : t('hunter.totalSingle', {
1111
+ picks: maxPicks
1112
+ })
1113
+ }), /*#__PURE__*/_jsxs(View, {
1114
+ style: {
1115
+ flexDirection: 'row',
1116
+ alignItems: 'center'
1117
+ },
1118
+ children: [/*#__PURE__*/_jsx(SvgIcon, {
1119
+ name: "trophy",
1120
+ size: 16,
1121
+ color: COLORS.gold
1122
+ }), /*#__PURE__*/_jsx(Text, {
1123
+ style: [styles.statValue, {
1124
+ marginLeft: 4
1125
+ }],
1126
+ children: isMultiHunt ? formatNumber(totalSessionCostVG) : formatNumber(effectiveCostVG * maxPicks)
1127
+ })]
1128
+ })]
1129
+ })]
1130
+ })]
1131
+ }), isActive && /*#__PURE__*/_jsxs(View, {
1132
+ style: styles.activeFooter,
1133
+ children: [/*#__PURE__*/_jsxs(View, {
1134
+ style: styles.activeFooterRow,
1135
+ children: [/*#__PURE__*/_jsx(Text, {
1136
+ style: styles.activeFooterLabel,
1137
+ children: isMultiHunt ? t('hunter.thisHunt') : t('hunter.wonSoFar')
1138
+ }), /*#__PURE__*/_jsx(Text, {
1139
+ style: [styles.activeFooterValue, totalWonThisRound > 0 && {
1140
+ color: COLORS.gold
1141
+ }],
1142
+ children: t('hunter.amountWithCurrency', {
1143
+ amount: totalWonThisRound > 0 ? `+${formatNumber(totalWonThisRound)}` : '0',
1144
+ currency
1145
+ })
1146
+ })]
1147
+ }), /*#__PURE__*/_jsx(View, {
1148
+ style: styles.activeFooterDivider
1149
+ }), isMultiHunt && /*#__PURE__*/_jsxs(_Fragment, {
1150
+ children: [/*#__PURE__*/_jsxs(View, {
1151
+ style: styles.activeFooterRow,
1152
+ children: [/*#__PURE__*/_jsx(Text, {
1153
+ style: styles.activeFooterLabel,
1154
+ children: t('hunter.session')
1155
+ }), /*#__PURE__*/_jsx(Text, {
1156
+ style: [styles.activeFooterValue, sessionTotalWon > 0 && {
1157
+ color: COLORS.gold
1158
+ }],
1159
+ children: t('hunter.amountWithCurrency', {
1160
+ amount: sessionTotalWon > 0 ? `+${formatNumber(sessionTotalWon)}` : '0',
1161
+ currency
1162
+ })
1163
+ })]
1164
+ }), /*#__PURE__*/_jsx(View, {
1165
+ style: styles.activeFooterDivider
1166
+ })]
1167
+ }), /*#__PURE__*/_jsxs(View, {
1168
+ style: styles.activeFooterRow,
1169
+ children: [/*#__PURE__*/_jsx(Text, {
1170
+ style: styles.activeFooterLabel,
1171
+ children: t('hunter.costPerChest')
1172
+ }), /*#__PURE__*/_jsx(Text, {
1173
+ style: styles.activeFooterValue,
1174
+ children: t('hunter.amountWithCurrency', {
1175
+ amount: effectiveCostVG,
1176
+ currency
1177
+ })
1178
+ })]
1179
+ })]
1180
+ })]
1181
+ }), isSummary && /*#__PURE__*/_jsxs(Animated.View, {
1182
+ style: [styles.overlay, {
1183
+ opacity: overlayOpacity
1184
+ }],
1185
+ children: [displayWon > 0 && /*#__PURE__*/_jsx(View, {
1186
+ style: styles.lottieOverlay,
1187
+ pointerEvents: "none",
1188
+ children: /*#__PURE__*/_jsx(MonflowtsLottieView, {
1189
+ sourceJson: confettiJson,
1190
+ autoPlay: true,
1191
+ loop: false,
1192
+ speed: 1,
1193
+ style: StyleSheet.absoluteFill
1194
+ }, `confetti-${lottieKey}`)
1195
+ }), /*#__PURE__*/_jsx(ScrollView, {
1196
+ contentContainerStyle: styles.overlayScrollContent,
1197
+ showsVerticalScrollIndicator: false,
1198
+ children: /*#__PURE__*/_jsxs(Animated.View, {
1199
+ style: [styles.overlayContent, {
1200
+ transform: [{
1201
+ scale: overlayScale
1202
+ }]
1203
+ }],
1204
+ children: [/*#__PURE__*/_jsx(Animated.View, {
1205
+ style: {
1206
+ transform: [{
1207
+ translateY: iconBounce
1208
+ }]
1209
+ },
1210
+ children: displayWon > 0 ? /*#__PURE__*/_jsx(View, {
1211
+ style: styles.iconGlow,
1212
+ children: /*#__PURE__*/_jsx(SvgIcon, {
1213
+ name: "trophy",
1214
+ size: 64,
1215
+ color: COLORS.gold
1216
+ })
1217
+ }) : /*#__PURE__*/_jsx(SvgIcon, {
1218
+ name: "sparkles",
1219
+ size: 64,
1220
+ color: COLORS.primary
1221
+ })
1222
+ }), /*#__PURE__*/_jsxs(Text, {
1223
+ style: styles.overlayTitle,
1224
+ children: [t(`${summaryMsg}.title`), /*#__PURE__*/_jsx(Text, {
1225
+ style: {
1226
+ color: displayWon > 0 ? COLORS.gold : COLORS.primary
1227
+ },
1228
+ children: t(`${summaryMsg}.highlight`)
1229
+ })]
1230
+ }), displayWon > 0 && /*#__PURE__*/_jsx(Text, {
1231
+ style: styles.overlayAmount,
1232
+ children: t('hunter.winAmount', {
1233
+ amount: formatNumber(displayWon),
1234
+ currency
1235
+ })
1236
+ }), isMultiHunt && /*#__PURE__*/_jsx(Text, {
1237
+ style: {
1238
+ color: COLORS.slateLight,
1239
+ fontSize: 12,
1240
+ marginBottom: 4
1241
+ },
1242
+ children: t('hunter.huntsWon', {
1243
+ wins: sessionHuntWins,
1244
+ total: selectedStakeCount
1245
+ })
1246
+ }), /*#__PURE__*/_jsx(Text, {
1247
+ style: styles.overlaySubtitle,
1248
+ children: t(`${summaryMsg}.sub`)
1249
+ }), /*#__PURE__*/_jsx(JackpotNearMiss, {
1250
+ jackpotAmountKobo: game?.gameplayRules?.jackpotAmountKobo ?? 0,
1251
+ currency: currency
1252
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
1253
+ title: displayWon > 0 ? t('hunter.collectHuntAgain') : t('hunter.huntAgain'),
1254
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
1255
+ name: "refresh",
1256
+ size: 16,
1257
+ color: "#ffffff"
1258
+ }),
1259
+ onPress: handlePlayAgain
1260
+ }), displayWon > 0 && /*#__PURE__*/_jsx(MonflowtsButton, {
1261
+ title: t('hunter.collectExit'),
1262
+ variant: "outline",
1263
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
1264
+ name: "sparkles",
1265
+ size: 16,
1266
+ color: "#ffffff"
1267
+ }),
1268
+ onPress: handleCollect,
1269
+ style: {
1270
+ marginTop: 12
1271
+ }
1272
+ }), /*#__PURE__*/_jsx(MonflowtsPressable, {
1273
+ onPress: onBack,
1274
+ style: {
1275
+ marginTop: 8
1276
+ },
1277
+ children: /*#__PURE__*/_jsx(Text, {
1278
+ style: styles.linkText,
1279
+ children: t('hunter.returnToMenu')
1280
+ })
1281
+ })]
1282
+ })
1283
+ })]
1284
+ }), initPlay.enabled && initPlay.isExpired && /*#__PURE__*/_jsxs(View, {
1285
+ style: styles.expiredOverlay,
1286
+ children: [/*#__PURE__*/_jsx(Text, {
1287
+ style: styles.expiredTitle,
1288
+ children: t('hunter.timesUp')
1289
+ }), /*#__PURE__*/_jsx(Text, {
1290
+ style: styles.expiredText,
1291
+ children: t('hunter.stakeForfeited')
1292
+ }), /*#__PURE__*/_jsx(MonflowtsButton, {
1293
+ title: t('hunter.goBack'),
1294
+ onPress: onBack
1295
+ })]
1296
+ }), flyingCoins.length > 0 && /*#__PURE__*/_jsx(View, {
1297
+ style: styles.coinOverlay,
1298
+ pointerEvents: "none",
1299
+ children: flyingCoins.map(coin => /*#__PURE__*/_jsx(Animated.View, {
1300
+ style: [styles.coin, {
1301
+ transform: [{
1302
+ translateX: coin.translateX
1303
+ }, {
1304
+ translateY: coin.translateY
1305
+ }, {
1306
+ scale: coin.scale
1307
+ }],
1308
+ opacity: coin.opacity
1309
+ }]
1310
+ }, coin.id))
1311
+ }), /*#__PURE__*/_jsx(InsufficientFundsOverlay, {
1312
+ visible: showFundsOverlay,
1313
+ balance: balance,
1314
+ required: effectiveCostVG,
1315
+ currency: currency,
1316
+ onDismiss: () => setShowFundsOverlay(false),
1317
+ onTopUp: onTopUp
1318
+ }), /*#__PURE__*/_jsx(GameRulesModal, {
1319
+ visible: rulesVisible,
1320
+ onClose: () => setRulesVisible(false),
1321
+ gameCode: game?.gameCode ?? 'MILLIONAIRE_HUNTER'
1322
+ })]
1323
+ })
1324
+ });
1325
+ };
1326
+ const styles = StyleSheet.create({
1327
+ container: {
1328
+ flex: 1,
1329
+ backgroundColor: COLORS.backgroundDark,
1330
+ paddingTop: 50
1331
+ },
1332
+ // ── Header ──
1333
+ header: {
1334
+ flexDirection: 'row',
1335
+ justifyContent: 'space-between',
1336
+ alignItems: 'center',
1337
+ paddingHorizontal: 20
1338
+ },
1339
+ circleBtn: {
1340
+ width: 36,
1341
+ height: 36,
1342
+ borderRadius: 18,
1343
+ backgroundColor: COLORS.white05,
1344
+ borderWidth: 1,
1345
+ borderColor: COLORS.white10,
1346
+ alignItems: 'center',
1347
+ justifyContent: 'center'
1348
+ },
1349
+ btnText: {
1350
+ color: '#fff',
1351
+ fontSize: 18
1352
+ },
1353
+ balancePill: {
1354
+ flexDirection: 'row',
1355
+ alignItems: 'center',
1356
+ backgroundColor: 'rgba(30, 41, 59, 0.5)',
1357
+ borderRadius: 20,
1358
+ paddingRight: 14,
1359
+ paddingLeft: 4,
1360
+ paddingVertical: 4,
1361
+ borderWidth: 1,
1362
+ borderColor: 'rgba(71, 85, 105, 0.5)'
1363
+ },
1364
+ diamondIcon: {
1365
+ width: 28,
1366
+ height: 28,
1367
+ borderRadius: 14,
1368
+ backgroundColor: '#eab308',
1369
+ alignItems: 'center',
1370
+ justifyContent: 'center',
1371
+ marginRight: 6
1372
+ },
1373
+ balanceText: {
1374
+ color: COLORS.gold,
1375
+ fontWeight: '700',
1376
+ fontSize: 15
1377
+ },
1378
+ badgeRow: {
1379
+ flexDirection: 'row',
1380
+ alignItems: 'center',
1381
+ justifyContent: 'center',
1382
+ gap: 8,
1383
+ marginBottom: 6
1384
+ },
1385
+ liveBadge: {
1386
+ flexDirection: 'row',
1387
+ alignItems: 'center',
1388
+ gap: 4,
1389
+ backgroundColor: 'rgba(127,19,236,0.2)',
1390
+ borderWidth: 1,
1391
+ borderColor: 'rgba(127,19,236,0.3)',
1392
+ borderRadius: 12,
1393
+ paddingHorizontal: 10,
1394
+ paddingVertical: 4
1395
+ },
1396
+ liveIndicator: {
1397
+ width: 5,
1398
+ height: 5,
1399
+ borderRadius: 3,
1400
+ backgroundColor: COLORS.primary
1401
+ },
1402
+ liveText: {
1403
+ fontSize: 9,
1404
+ fontWeight: '800',
1405
+ color: '#fff',
1406
+ letterSpacing: 1.5
1407
+ },
1408
+ // ── Title ──
1409
+ titleArea: {
1410
+ alignItems: 'center',
1411
+ paddingTop: 10,
1412
+ paddingBottom: 8
1413
+ },
1414
+ mainTitle: {
1415
+ fontSize: 26,
1416
+ fontWeight: '800',
1417
+ color: COLORS.gold,
1418
+ letterSpacing: 1
1419
+ },
1420
+ mainSubtitle: {
1421
+ fontSize: 11,
1422
+ fontWeight: '700',
1423
+ color: 'rgba(127,19,236,0.7)',
1424
+ letterSpacing: 3,
1425
+ marginTop: 4
1426
+ },
1427
+ // ── Grid ──
1428
+ gridArea: {
1429
+ flex: 1,
1430
+ alignItems: 'center',
1431
+ justifyContent: 'center',
1432
+ paddingHorizontal: GRID_PADDING
1433
+ },
1434
+ grid: {
1435
+ flexDirection: 'row',
1436
+ flexWrap: 'wrap',
1437
+ gap: GRID_GAP
1438
+ },
1439
+ chestCell: {
1440
+ borderRadius: 20,
1441
+ backgroundColor: 'rgba(42,31,54,0.4)',
1442
+ borderWidth: 1,
1443
+ borderColor: 'rgba(255,255,255,0.05)',
1444
+ alignItems: 'center',
1445
+ justifyContent: 'center'
1446
+ },
1447
+ chestCellWin: {
1448
+ borderColor: 'rgba(234, 179, 8, 0.4)',
1449
+ backgroundColor: 'rgba(234, 179, 8, 0.08)'
1450
+ },
1451
+ chestCellLoss: {
1452
+ opacity: 0.5
1453
+ },
1454
+ chestCellProcessing: {
1455
+ borderColor: 'rgba(127,19,236,0.6)',
1456
+ borderWidth: 2
1457
+ },
1458
+ chestTouchable: {
1459
+ width: '100%',
1460
+ height: '100%',
1461
+ alignItems: 'center',
1462
+ justifyContent: 'center'
1463
+ },
1464
+ chestLottie: {
1465
+ width: '100%',
1466
+ height: '100%'
1467
+ },
1468
+ glowRing: {
1469
+ ...StyleSheet.absoluteFill,
1470
+ borderRadius: 20,
1471
+ borderWidth: 2,
1472
+ borderColor: COLORS.primary,
1473
+ shadowColor: COLORS.primary,
1474
+ shadowOffset: {
1475
+ width: 0,
1476
+ height: 0
1477
+ },
1478
+ shadowOpacity: 0.8,
1479
+ shadowRadius: 12
1480
+ },
1481
+ goldGlow: {
1482
+ borderColor: COLORS.gold,
1483
+ shadowColor: COLORS.gold
1484
+ },
1485
+ dustOverlay: {
1486
+ ...StyleSheet.absoluteFill,
1487
+ borderRadius: 20,
1488
+ overflow: 'hidden'
1489
+ },
1490
+ resultBadge: {
1491
+ position: 'absolute',
1492
+ bottom: -6,
1493
+ alignSelf: 'center',
1494
+ paddingHorizontal: 8,
1495
+ paddingVertical: 3,
1496
+ borderRadius: 8
1497
+ },
1498
+ resultBadgeWin: {
1499
+ backgroundColor: 'rgba(234, 179, 8, 0.9)'
1500
+ },
1501
+ resultBadgeLoss: {
1502
+ backgroundColor: 'rgba(71, 85, 105, 0.7)'
1503
+ },
1504
+ resultBadgeText: {
1505
+ fontSize: 11,
1506
+ fontWeight: '800'
1507
+ },
1508
+ resultBadgeTextWin: {
1509
+ color: '#000'
1510
+ },
1511
+ resultBadgeTextLoss: {
1512
+ color: 'rgba(255,255,255,0.6)'
1513
+ },
1514
+ // ── Footer ──
1515
+ footer: {
1516
+ paddingHorizontal: 20,
1517
+ paddingBottom: 32,
1518
+ alignItems: 'center'
1519
+ },
1520
+ footerLabel: {
1521
+ fontSize: 10,
1522
+ fontWeight: '800',
1523
+ color: COLORS.slateDark,
1524
+ letterSpacing: 2,
1525
+ marginBottom: 10
1526
+ },
1527
+ stakeRow: {
1528
+ flexDirection: 'row',
1529
+ flexWrap: 'wrap',
1530
+ justifyContent: 'center',
1531
+ gap: 8,
1532
+ marginBottom: 16
1533
+ },
1534
+ statsRow: {
1535
+ flexDirection: 'row',
1536
+ gap: 32,
1537
+ alignItems: 'center'
1538
+ },
1539
+ stat: {
1540
+ alignItems: 'center'
1541
+ },
1542
+ statLabel: {
1543
+ fontSize: 10,
1544
+ fontWeight: '800',
1545
+ color: COLORS.slateDark,
1546
+ letterSpacing: 2,
1547
+ marginBottom: 4
1548
+ },
1549
+ statValue: {
1550
+ fontSize: 18,
1551
+ fontWeight: '800',
1552
+ color: '#fff'
1553
+ },
1554
+ divider: {
1555
+ width: 1,
1556
+ height: 40,
1557
+ backgroundColor: COLORS.white10
1558
+ },
1559
+ // ── Hunt badge ──
1560
+ roundBadge: {
1561
+ backgroundColor: COLORS.white05,
1562
+ borderWidth: 1,
1563
+ borderColor: COLORS.white10,
1564
+ borderRadius: 20,
1565
+ paddingHorizontal: 10,
1566
+ paddingVertical: 4
1567
+ },
1568
+ roundText: {
1569
+ fontSize: 11,
1570
+ fontWeight: '700',
1571
+ color: COLORS.primary
1572
+ },
1573
+ // ── Active footer ──
1574
+ activeFooter: {
1575
+ flexDirection: 'row',
1576
+ justifyContent: 'center',
1577
+ alignItems: 'center',
1578
+ paddingHorizontal: 20,
1579
+ paddingVertical: 16,
1580
+ paddingBottom: 32,
1581
+ gap: 20
1582
+ },
1583
+ activeFooterRow: {
1584
+ alignItems: 'center'
1585
+ },
1586
+ activeFooterLabel: {
1587
+ fontSize: 10,
1588
+ fontWeight: '800',
1589
+ color: COLORS.slateDark,
1590
+ letterSpacing: 2,
1591
+ marginBottom: 4
1592
+ },
1593
+ activeFooterValue: {
1594
+ fontSize: 16,
1595
+ fontWeight: '800',
1596
+ color: '#fff'
1597
+ },
1598
+ activeFooterDivider: {
1599
+ width: 1,
1600
+ height: 32,
1601
+ backgroundColor: COLORS.white10
1602
+ },
1603
+ // ── Overlay ──
1604
+ overlay: {
1605
+ ...StyleSheet.absoluteFill,
1606
+ backgroundColor: 'rgba(5,11,24,0.97)',
1607
+ zIndex: 20
1608
+ },
1609
+ overlayScrollContent: {
1610
+ flexGrow: 1,
1611
+ alignItems: 'center',
1612
+ justifyContent: 'center',
1613
+ paddingVertical: 40
1614
+ },
1615
+ overlayContent: {
1616
+ alignItems: 'center',
1617
+ paddingHorizontal: 32,
1618
+ width: '100%',
1619
+ maxWidth: 360
1620
+ },
1621
+ overlayTitle: {
1622
+ fontSize: 32,
1623
+ fontWeight: '800',
1624
+ color: '#fff',
1625
+ marginTop: 16,
1626
+ marginBottom: 8
1627
+ },
1628
+ overlayAmount: {
1629
+ fontSize: 40,
1630
+ fontWeight: '900',
1631
+ color: '#fff',
1632
+ marginBottom: 4
1633
+ },
1634
+ overlaySubtitle: {
1635
+ fontSize: 14,
1636
+ color: 'rgba(255,255,255,0.6)',
1637
+ textAlign: 'center',
1638
+ marginBottom: 28,
1639
+ lineHeight: 20
1640
+ },
1641
+ iconGlow: {
1642
+ shadowColor: COLORS.gold,
1643
+ shadowOffset: {
1644
+ width: 0,
1645
+ height: 0
1646
+ },
1647
+ shadowOpacity: 0.6,
1648
+ shadowRadius: 20
1649
+ },
1650
+ linkText: {
1651
+ color: 'rgba(255,255,255,0.5)',
1652
+ fontSize: 14,
1653
+ paddingVertical: 8
1654
+ },
1655
+ // ── Lottie overlays ──
1656
+ lottieOverlay: {
1657
+ ...StyleSheet.absoluteFill,
1658
+ zIndex: 1
1659
+ },
1660
+ // ── Coin fly ──
1661
+ coinOverlay: {
1662
+ ...StyleSheet.absoluteFill,
1663
+ zIndex: 30
1664
+ },
1665
+ coin: {
1666
+ position: 'absolute',
1667
+ left: 0,
1668
+ top: 0,
1669
+ width: 12,
1670
+ height: 12,
1671
+ borderRadius: 6,
1672
+ backgroundColor: COLORS.gold
1673
+ },
1674
+ // ── Expired overlay (abandon policy) ──
1675
+ expiredOverlay: {
1676
+ ...StyleSheet.absoluteFill,
1677
+ backgroundColor: 'rgba(0,0,0,0.85)',
1678
+ zIndex: 200,
1679
+ alignItems: 'center',
1680
+ justifyContent: 'center',
1681
+ paddingHorizontal: 32
1682
+ },
1683
+ expiredTitle: {
1684
+ fontSize: 28,
1685
+ fontWeight: '800',
1686
+ color: COLORS.lossRed,
1687
+ marginBottom: 12
1688
+ },
1689
+ expiredText: {
1690
+ fontSize: 16,
1691
+ color: COLORS.slateLight,
1692
+ textAlign: 'center',
1693
+ marginBottom: 24
1694
+ }
1695
+ });
1696
+ export default MillionaireHunter;
1697
+ //# sourceMappingURL=MillionaireHunter.js.map