be-components 0.7.3 → 0.7.5

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 (450) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +18 -0
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Authenticator/Components/AuthStrategyIdentifier.js +113 -0
  4. package/lib/commonjs/Authenticator/Components/AuthStrategyIdentifier.js.map +1 -0
  5. package/lib/commonjs/Authenticator/Components/StrategyForm.js +238 -71
  6. package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
  7. package/lib/commonjs/Authenticator/index.js +7 -4
  8. package/lib/commonjs/Authenticator/index.js.map +1 -1
  9. package/lib/commonjs/Checkout/api/index.js.map +1 -1
  10. package/lib/commonjs/Checkout/index.js.map +1 -1
  11. package/lib/commonjs/Competition/api/index.js +655 -0
  12. package/lib/commonjs/Competition/api/index.js.map +1 -0
  13. package/lib/commonjs/Competition/components/AthleteMarketCard.js +168 -0
  14. package/lib/commonjs/Competition/components/AthleteMarketCard.js.map +1 -0
  15. package/lib/commonjs/Competition/components/CompetitionCard.js +180 -0
  16. package/lib/commonjs/Competition/components/CompetitionCard.js.map +1 -0
  17. package/lib/commonjs/Competition/components/CompetitionInfoCard.js +264 -0
  18. package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -0
  19. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +281 -0
  20. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -0
  21. package/lib/commonjs/Competition/components/CompetitionPlay.js +1269 -0
  22. package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -0
  23. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +111 -0
  24. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -0
  25. package/lib/commonjs/Competition/components/CompetitionSelector.js +122 -0
  26. package/lib/commonjs/Competition/components/CompetitionSelector.js.map +1 -0
  27. package/lib/commonjs/Competition/components/CompetitionTypeCard.js +380 -0
  28. package/lib/commonjs/Competition/components/CompetitionTypeCard.js.map +1 -0
  29. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +237 -0
  30. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -0
  31. package/lib/commonjs/Competition/components/LeaderPicks.js +322 -0
  32. package/lib/commonjs/Competition/components/LeaderPicks.js.map +1 -0
  33. package/lib/commonjs/Competition/components/ManageSeasonForm.js +605 -0
  34. package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +1 -0
  35. package/lib/commonjs/Competition/components/MarketsCard.js +148 -0
  36. package/lib/commonjs/Competition/components/MarketsCard.js.map +1 -0
  37. package/lib/commonjs/Competition/components/MatchMarketCard.js +199 -0
  38. package/lib/commonjs/Competition/components/MatchMarketCard.js.map +1 -0
  39. package/lib/commonjs/Competition/components/NavOutPrompt.js +159 -0
  40. package/lib/commonjs/Competition/components/NavOutPrompt.js.map +1 -0
  41. package/lib/commonjs/Competition/components/SeasonInfoModal.js +400 -0
  42. package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +1 -0
  43. package/lib/commonjs/Competition/components/TeamEventCard.js +217 -0
  44. package/lib/commonjs/Competition/components/TeamEventCard.js.map +1 -0
  45. package/lib/commonjs/Competition/components/WagerPickForm.js +278 -0
  46. package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -0
  47. package/lib/commonjs/Competition/index.js +42 -0
  48. package/lib/commonjs/Competition/index.js.map +1 -0
  49. package/lib/commonjs/Components/Icons.js.map +1 -1
  50. package/lib/commonjs/Components/Jerseys.js +713 -0
  51. package/lib/commonjs/Components/Jerseys.js.map +1 -0
  52. package/lib/commonjs/Components/LinearDiagnal.js +1 -1
  53. package/lib/commonjs/Components/LinearDiagnal.js.map +1 -1
  54. package/lib/commonjs/Components/Switch.js +81 -0
  55. package/lib/commonjs/Components/Switch.js.map +1 -0
  56. package/lib/commonjs/Components/index.js +14 -0
  57. package/lib/commonjs/Components/index.js.map +1 -1
  58. package/lib/commonjs/Poll/api/index.js +277 -0
  59. package/lib/commonjs/Poll/api/index.js.map +1 -0
  60. package/lib/commonjs/Poll/components/CampaignPlay.js +553 -0
  61. package/lib/commonjs/Poll/components/CampaignPlay.js.map +1 -0
  62. package/lib/commonjs/Poll/components/CampaignProgressBar.js +118 -0
  63. package/lib/commonjs/Poll/components/CampaignProgressBar.js.map +1 -0
  64. package/lib/commonjs/Poll/components/CampaignResult.js +382 -0
  65. package/lib/commonjs/Poll/components/CampaignResult.js.map +1 -0
  66. package/lib/commonjs/Poll/components/CampaignSelector.js +124 -0
  67. package/lib/commonjs/Poll/components/CampaignSelector.js.map +1 -0
  68. package/lib/commonjs/Poll/components/PollCampaignCard.js +66 -0
  69. package/lib/commonjs/Poll/components/PollCampaignCard.js.map +1 -0
  70. package/lib/commonjs/Poll/components/PollCard.js +480 -0
  71. package/lib/commonjs/Poll/components/PollCard.js.map +1 -0
  72. package/lib/commonjs/Poll/components/PollOptionCard.js +158 -0
  73. package/lib/commonjs/Poll/components/PollOptionCard.js.map +1 -0
  74. package/lib/commonjs/Poll/components/PollSelectCard.js +189 -0
  75. package/lib/commonjs/Poll/components/PollSelectCard.js.map +1 -0
  76. package/lib/commonjs/Poll/components/ResponseTimer.js +48 -0
  77. package/lib/commonjs/Poll/components/ResponseTimer.js.map +1 -0
  78. package/lib/commonjs/Poll/components/WidgetHeader.js +83 -0
  79. package/lib/commonjs/Poll/components/WidgetHeader.js.map +1 -0
  80. package/lib/commonjs/Poll/flashmarket/index.js +354 -0
  81. package/lib/commonjs/Poll/flashmarket/index.js.map +1 -0
  82. package/lib/commonjs/Poll/index.js +46 -0
  83. package/lib/commonjs/Poll/index.js.map +1 -0
  84. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  85. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  86. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +3 -1
  87. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  88. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  89. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  90. package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
  91. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  92. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  93. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  94. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +5 -0
  95. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  96. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  97. package/lib/commonjs/ProfileManager/index.js +2 -0
  98. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  99. package/lib/commonjs/Wallet/api/index.js +4 -1
  100. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  101. package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -1
  102. package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -1
  103. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
  104. package/lib/commonjs/Wallet/components/FundAccountCard.js.map +1 -1
  105. package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -1
  106. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -1
  107. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -1
  108. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -1
  109. package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
  110. package/lib/commonjs/Wallet/components/WalletSettings.js.map +1 -1
  111. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
  112. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
  113. package/lib/commonjs/Wallet/index.js.map +1 -1
  114. package/lib/commonjs/index.js +14 -0
  115. package/lib/commonjs/index.js.map +1 -1
  116. package/lib/module/ApiOverrides/index.js +18 -0
  117. package/lib/module/ApiOverrides/index.js.map +1 -1
  118. package/lib/module/Authenticator/Components/AuthStrategyIdentifier.js +106 -0
  119. package/lib/module/Authenticator/Components/AuthStrategyIdentifier.js.map +1 -0
  120. package/lib/module/Authenticator/Components/StrategyForm.js +239 -72
  121. package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
  122. package/lib/module/Authenticator/index.js +7 -4
  123. package/lib/module/Authenticator/index.js.map +1 -1
  124. package/lib/module/Checkout/api/index.js.map +1 -1
  125. package/lib/module/Checkout/index.js.map +1 -1
  126. package/lib/module/Competition/api/index.js +649 -0
  127. package/lib/module/Competition/api/index.js.map +1 -0
  128. package/lib/module/Competition/components/AthleteMarketCard.js +161 -0
  129. package/lib/module/Competition/components/AthleteMarketCard.js.map +1 -0
  130. package/lib/module/Competition/components/CompetitionCard.js +173 -0
  131. package/lib/module/Competition/components/CompetitionCard.js.map +1 -0
  132. package/lib/module/Competition/components/CompetitionInfoCard.js +257 -0
  133. package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -0
  134. package/lib/module/Competition/components/CompetitionLeaderboard.js +272 -0
  135. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -0
  136. package/lib/module/Competition/components/CompetitionPlay.js +1260 -0
  137. package/lib/module/Competition/components/CompetitionPlay.js.map +1 -0
  138. package/lib/module/Competition/components/CompetitionSeasonCard.js +104 -0
  139. package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -0
  140. package/lib/module/Competition/components/CompetitionSelector.js +113 -0
  141. package/lib/module/Competition/components/CompetitionSelector.js.map +1 -0
  142. package/lib/module/Competition/components/CompetitionTypeCard.js +371 -0
  143. package/lib/module/Competition/components/CompetitionTypeCard.js.map +1 -0
  144. package/lib/module/Competition/components/EnterCompetitionPrompt.js +228 -0
  145. package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -0
  146. package/lib/module/Competition/components/LeaderPicks.js +313 -0
  147. package/lib/module/Competition/components/LeaderPicks.js.map +1 -0
  148. package/lib/module/Competition/components/ManageSeasonForm.js +596 -0
  149. package/lib/module/Competition/components/ManageSeasonForm.js.map +1 -0
  150. package/lib/module/Competition/components/MarketsCard.js +139 -0
  151. package/lib/module/Competition/components/MarketsCard.js.map +1 -0
  152. package/lib/module/Competition/components/MatchMarketCard.js +192 -0
  153. package/lib/module/Competition/components/MatchMarketCard.js.map +1 -0
  154. package/lib/module/Competition/components/NavOutPrompt.js +152 -0
  155. package/lib/module/Competition/components/NavOutPrompt.js.map +1 -0
  156. package/lib/module/Competition/components/SeasonInfoModal.js +391 -0
  157. package/lib/module/Competition/components/SeasonInfoModal.js.map +1 -0
  158. package/lib/module/Competition/components/TeamEventCard.js +210 -0
  159. package/lib/module/Competition/components/TeamEventCard.js.map +1 -0
  160. package/lib/module/Competition/components/WagerPickForm.js +269 -0
  161. package/lib/module/Competition/components/WagerPickForm.js.map +1 -0
  162. package/lib/module/Competition/index.js +33 -0
  163. package/lib/module/Competition/index.js.map +1 -0
  164. package/lib/module/Components/Icons.js.map +1 -1
  165. package/lib/module/Components/Jerseys.js +705 -0
  166. package/lib/module/Components/Jerseys.js.map +1 -0
  167. package/lib/module/Components/LinearDiagnal.js +2 -3
  168. package/lib/module/Components/LinearDiagnal.js.map +1 -1
  169. package/lib/module/Components/Switch.js +74 -0
  170. package/lib/module/Components/Switch.js.map +1 -0
  171. package/lib/module/Components/index.js +3 -1
  172. package/lib/module/Components/index.js.map +1 -1
  173. package/lib/module/Poll/api/index.js +271 -0
  174. package/lib/module/Poll/api/index.js.map +1 -0
  175. package/lib/module/Poll/components/CampaignPlay.js +545 -0
  176. package/lib/module/Poll/components/CampaignPlay.js.map +1 -0
  177. package/lib/module/Poll/components/CampaignProgressBar.js +110 -0
  178. package/lib/module/Poll/components/CampaignProgressBar.js.map +1 -0
  179. package/lib/module/Poll/components/CampaignResult.js +374 -0
  180. package/lib/module/Poll/components/CampaignResult.js.map +1 -0
  181. package/lib/module/Poll/components/CampaignSelector.js +115 -0
  182. package/lib/module/Poll/components/CampaignSelector.js.map +1 -0
  183. package/lib/module/Poll/components/PollCampaignCard.js +59 -0
  184. package/lib/module/Poll/components/PollCampaignCard.js.map +1 -0
  185. package/lib/module/Poll/components/PollCard.js +472 -0
  186. package/lib/module/Poll/components/PollCard.js.map +1 -0
  187. package/lib/module/Poll/components/PollOptionCard.js +149 -0
  188. package/lib/module/Poll/components/PollOptionCard.js.map +1 -0
  189. package/lib/module/Poll/components/PollSelectCard.js +182 -0
  190. package/lib/module/Poll/components/PollSelectCard.js.map +1 -0
  191. package/lib/module/Poll/components/ResponseTimer.js +39 -0
  192. package/lib/module/Poll/components/ResponseTimer.js.map +1 -0
  193. package/lib/module/Poll/components/WidgetHeader.js +76 -0
  194. package/lib/module/Poll/components/WidgetHeader.js.map +1 -0
  195. package/lib/module/Poll/flashmarket/index.js +345 -0
  196. package/lib/module/Poll/flashmarket/index.js.map +1 -0
  197. package/lib/module/Poll/index.js +37 -0
  198. package/lib/module/Poll/index.js.map +1 -0
  199. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  200. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  201. package/lib/module/ProfileManager/Components/CodeRedeem.js +3 -1
  202. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  203. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  204. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  205. package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
  206. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  207. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  208. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  209. package/lib/module/ProfileManager/Components/ProfileWizard.js +5 -0
  210. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  211. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  212. package/lib/module/ProfileManager/index.js +2 -0
  213. package/lib/module/ProfileManager/index.js.map +1 -1
  214. package/lib/module/Wallet/api/index.js +4 -1
  215. package/lib/module/Wallet/api/index.js.map +1 -1
  216. package/lib/module/Wallet/components/ACHAddCard.js.map +1 -1
  217. package/lib/module/Wallet/components/AddressManager.js.map +1 -1
  218. package/lib/module/Wallet/components/DepositCard.js.map +1 -1
  219. package/lib/module/Wallet/components/FundAccountCard.js.map +1 -1
  220. package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -1
  221. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -1
  222. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -1
  223. package/lib/module/Wallet/components/MyBalance.js.map +1 -1
  224. package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
  225. package/lib/module/Wallet/components/WalletSettings.js.map +1 -1
  226. package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
  227. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
  228. package/lib/module/Wallet/index.js.map +1 -1
  229. package/lib/module/index.js +3 -1
  230. package/lib/module/index.js.map +1 -1
  231. package/lib/typescript/src/ApiOverrides/index.d.ts +1 -0
  232. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  233. package/lib/typescript/src/Authenticator/Components/AuthStrategyIdentifier.d.ts +11 -0
  234. package/lib/typescript/src/Authenticator/Components/AuthStrategyIdentifier.d.ts.map +1 -0
  235. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts +4 -1
  236. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  237. package/lib/typescript/src/Authenticator/api/index.d.ts +2 -2
  238. package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
  239. package/lib/typescript/src/Authenticator/index.d.ts +2 -1
  240. package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
  241. package/lib/typescript/src/Checkout/api/index.d.ts +1 -2
  242. package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -1
  243. package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
  244. package/lib/typescript/src/Competition/api/index.d.ts +128 -0
  245. package/lib/typescript/src/Competition/api/index.d.ts.map +1 -0
  246. package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts +19 -0
  247. package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts.map +1 -0
  248. package/lib/typescript/src/Competition/components/CompetitionCard.d.ts +12 -0
  249. package/lib/typescript/src/Competition/components/CompetitionCard.d.ts.map +1 -0
  250. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts +16 -0
  251. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -0
  252. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts +14 -0
  253. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -0
  254. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts +20 -0
  255. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts.map +1 -0
  256. package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts +10 -0
  257. package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts.map +1 -0
  258. package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts +11 -0
  259. package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts.map +1 -0
  260. package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts +14 -0
  261. package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts.map +1 -0
  262. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +16 -0
  263. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -0
  264. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts +22 -0
  265. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts.map +1 -0
  266. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +10 -0
  267. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +1 -0
  268. package/lib/typescript/src/Competition/components/MarketsCard.d.ts +15 -0
  269. package/lib/typescript/src/Competition/components/MarketsCard.d.ts.map +1 -0
  270. package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts +21 -0
  271. package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts.map +1 -0
  272. package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts +23 -0
  273. package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts.map +1 -0
  274. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +14 -0
  275. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +1 -0
  276. package/lib/typescript/src/Competition/components/TeamEventCard.d.ts +17 -0
  277. package/lib/typescript/src/Competition/components/TeamEventCard.d.ts.map +1 -0
  278. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +15 -0
  279. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -0
  280. package/lib/typescript/src/Competition/index.d.ts +11 -0
  281. package/lib/typescript/src/Competition/index.d.ts.map +1 -0
  282. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  283. package/lib/typescript/src/Components/Jerseys.d.ts +16 -0
  284. package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -0
  285. package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -1
  286. package/lib/typescript/src/Components/Switch.d.ts +9 -0
  287. package/lib/typescript/src/Components/Switch.d.ts.map +1 -0
  288. package/lib/typescript/src/Components/index.d.ts +3 -1
  289. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  290. package/lib/typescript/src/Poll/api/index.d.ts +65 -0
  291. package/lib/typescript/src/Poll/api/index.d.ts.map +1 -0
  292. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts +14 -0
  293. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts.map +1 -0
  294. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts +12 -0
  295. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts.map +1 -0
  296. package/lib/typescript/src/Poll/components/CampaignResult.d.ts +13 -0
  297. package/lib/typescript/src/Poll/components/CampaignResult.d.ts.map +1 -0
  298. package/lib/typescript/src/Poll/components/CampaignSelector.d.ts +9 -0
  299. package/lib/typescript/src/Poll/components/CampaignSelector.d.ts.map +1 -0
  300. package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts +10 -0
  301. package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts.map +1 -0
  302. package/lib/typescript/src/Poll/components/PollCard.d.ts +16 -0
  303. package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -0
  304. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts +14 -0
  305. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts.map +1 -0
  306. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts +16 -0
  307. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts.map +1 -0
  308. package/lib/typescript/src/Poll/components/ResponseTimer.d.ts +9 -0
  309. package/lib/typescript/src/Poll/components/ResponseTimer.d.ts.map +1 -0
  310. package/lib/typescript/src/Poll/components/WidgetHeader.d.ts +13 -0
  311. package/lib/typescript/src/Poll/components/WidgetHeader.d.ts.map +1 -0
  312. package/lib/typescript/src/Poll/flashmarket/index.d.ts +10 -0
  313. package/lib/typescript/src/Poll/flashmarket/index.d.ts.map +1 -0
  314. package/lib/typescript/src/Poll/index.d.ts +13 -0
  315. package/lib/typescript/src/Poll/index.d.ts.map +1 -0
  316. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts +1 -1
  317. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  318. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +1 -2
  319. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  320. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts +9 -2
  321. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  322. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts +1 -1
  323. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  324. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts +1 -1
  325. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  326. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts +1 -1
  327. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  328. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts +1 -1
  329. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  330. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +1 -1
  331. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  332. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +1 -2
  333. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  334. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +10 -3
  335. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  336. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts +2 -2
  337. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
  338. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts +1 -2
  339. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  340. package/lib/typescript/src/ProfileManager/api/index.d.ts +2 -2
  341. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  342. package/lib/typescript/src/ProfileManager/index.d.ts +9 -2
  343. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  344. package/lib/typescript/src/Wallet/api/index.d.ts +2 -3
  345. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  346. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts +1 -2
  347. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -1
  348. package/lib/typescript/src/Wallet/components/AddressManager.d.ts +1 -2
  349. package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -1
  350. package/lib/typescript/src/Wallet/components/DepositCard.d.ts +1 -2
  351. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
  352. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts +1 -2
  353. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts.map +1 -1
  354. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +1 -2
  355. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -1
  356. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +1 -2
  357. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  358. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +1 -2
  359. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -1
  360. package/lib/typescript/src/Wallet/components/MyBalance.d.ts +1 -2
  361. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -1
  362. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts +1 -2
  363. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  364. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts +1 -2
  365. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts.map +1 -1
  366. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +1 -2
  367. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
  368. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +1 -2
  369. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -1
  370. package/lib/typescript/src/Wallet/index.d.ts +1 -2
  371. package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
  372. package/lib/typescript/src/index.d.ts +3 -1
  373. package/lib/typescript/src/index.d.ts.map +1 -1
  374. package/package.json +1 -1
  375. package/src/ApiOverrides/index.ts +19 -0
  376. package/src/Authenticator/Components/AuthStrategyIdentifier.tsx +72 -0
  377. package/src/Authenticator/Components/StrategyForm.tsx +208 -53
  378. package/src/Authenticator/api/index.ts +2 -2
  379. package/src/Authenticator/api/types.d.ts +3 -26
  380. package/src/Authenticator/index.tsx +10 -4
  381. package/src/Checkout/api/index.tsx +1 -2
  382. package/src/Checkout/index.tsx +1 -2
  383. package/src/Competition/api/index.ts +568 -0
  384. package/src/Competition/components/AthleteMarketCard.tsx +116 -0
  385. package/src/Competition/components/CompetitionCard.tsx +82 -0
  386. package/src/Competition/components/CompetitionInfoCard.tsx +149 -0
  387. package/src/Competition/components/CompetitionLeaderboard.tsx +183 -0
  388. package/src/Competition/components/CompetitionPlay.tsx +936 -0
  389. package/src/Competition/components/CompetitionSeasonCard.tsx +48 -0
  390. package/src/Competition/components/CompetitionSelector.tsx +91 -0
  391. package/src/Competition/components/CompetitionTypeCard.tsx +211 -0
  392. package/src/Competition/components/EnterCompetitionPrompt.tsx +127 -0
  393. package/src/Competition/components/LeaderPicks.tsx +214 -0
  394. package/src/Competition/components/ManageSeasonForm.tsx +271 -0
  395. package/src/Competition/components/MarketsCard.tsx +108 -0
  396. package/src/Competition/components/MatchMarketCard.tsx +126 -0
  397. package/src/Competition/components/NavOutPrompt.tsx +87 -0
  398. package/src/Competition/components/SeasonInfoModal.tsx +212 -0
  399. package/src/Competition/components/TeamEventCard.tsx +136 -0
  400. package/src/Competition/components/WagerPickForm.tsx +114 -0
  401. package/src/Competition/index.tsx +36 -0
  402. package/src/Components/Icons.tsx +0 -2
  403. package/src/Components/Jerseys.tsx +268 -0
  404. package/src/Components/LinearDiagnal.tsx +2 -3
  405. package/src/Components/Switch.tsx +55 -0
  406. package/src/Components/index.tsx +5 -1
  407. package/src/Poll/api/index.ts +212 -0
  408. package/src/Poll/components/CampaignPlay.tsx +407 -0
  409. package/src/Poll/components/CampaignProgressBar.tsx +70 -0
  410. package/src/Poll/components/CampaignResult.tsx +180 -0
  411. package/src/Poll/components/CampaignSelector.tsx +96 -0
  412. package/src/Poll/components/PollCampaignCard.tsx +35 -0
  413. package/src/Poll/components/PollCard.tsx +335 -0
  414. package/src/Poll/components/PollOptionCard.tsx +110 -0
  415. package/src/Poll/components/PollSelectCard.tsx +106 -0
  416. package/src/Poll/components/ResponseTimer.tsx +37 -0
  417. package/src/Poll/components/WidgetHeader.tsx +46 -0
  418. package/src/Poll/flashmarket/index.tsx +231 -0
  419. package/src/Poll/index.tsx +45 -0
  420. package/src/ProfileManager/Components/BasicInfoManager.tsx +1 -1
  421. package/src/ProfileManager/Components/BasicStatus.tsx +1 -2
  422. package/src/ProfileManager/Components/CodeRedeem.tsx +10 -3
  423. package/src/ProfileManager/Components/DOBManager.tsx +1 -1
  424. package/src/ProfileManager/Components/EmailManager.tsx +1 -1
  425. package/src/ProfileManager/Components/PasswordManager.tsx +2 -1
  426. package/src/ProfileManager/Components/PhoneManager.tsx +1 -1
  427. package/src/ProfileManager/Components/ProfilePicManager.tsx +1 -1
  428. package/src/ProfileManager/Components/ProfileWelcome.tsx +1 -2
  429. package/src/ProfileManager/Components/ProfileWizard.tsx +14 -3
  430. package/src/ProfileManager/Components/SettingsManager.tsx +2 -2
  431. package/src/ProfileManager/Components/VouchCard.tsx +1 -2
  432. package/src/ProfileManager/api/index.ts +2 -2
  433. package/src/ProfileManager/api/types.d.ts +0 -35
  434. package/src/ProfileManager/index.tsx +11 -3
  435. package/src/Wallet/api/index.ts +6 -4
  436. package/src/Wallet/components/ACHAddCard.tsx +1 -2
  437. package/src/Wallet/components/AddressManager.tsx +1 -2
  438. package/src/Wallet/components/DepositCard.tsx +1 -2
  439. package/src/Wallet/components/FundAccountCard.tsx +1 -2
  440. package/src/Wallet/components/ManageAccountCard.tsx +1 -2
  441. package/src/Wallet/components/ManualACHAdd.tsx +1 -2
  442. package/src/Wallet/components/ManualCardAdd.tsx +1 -2
  443. package/src/Wallet/components/MyBalance.tsx +1 -2
  444. package/src/Wallet/components/WalletActionSelector.tsx +1 -2
  445. package/src/Wallet/components/WalletSettings.tsx +1 -2
  446. package/src/Wallet/components/WalletSetup.tsx +1 -2
  447. package/src/Wallet/components/WithdrawCard.tsx +1 -2
  448. package/src/Wallet/index.tsx +1 -2
  449. package/src/index.tsx +5 -2
  450. package/src/types.d.ts +486 -1
@@ -0,0 +1,568 @@
1
+ import axios from "axios";
2
+ import type { AthleteProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionRecordProps, CompetitionResultProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, CreateCompetitionProps, EventProps, LeagueProps, MarketProps, MatchProps, MyPlayerProps, PlayerBalanceProps, PlayerPickProps, PlayerReferralProps, PromoProps, PublicPlayerProps, TeamProps, TournamentProps, TradeProps } from "../../types";
3
+ import { APIOverrides } from "../../ApiOverrides";
4
+ import moment from "moment-mini";
5
+ import Colors from "../../constants/colors";
6
+
7
+ let AUTH_SVC_API = ''
8
+ let TP_SVC_API = ''
9
+ let EVENT_SVC_API = ''
10
+ let MK_SVC_API = ''
11
+ export { CompetitionSeasonApi, CompetitionApi, CompetitionHelpers, CompetitionPlayerApi, PlayerPicksApi, CompetitionResultApi, CompetitionMatchApi }
12
+
13
+ const CompetitionSeasonApi = {
14
+ createCompetitionSeason : async(competition_season:CompetitionSeasonProps):Promise<CompetitionSeasonProps> => {
15
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/season/create`, { competition_season })
16
+ return resp.data.competition_season
17
+ },
18
+ updateCompetitionSeason : async(competition_season:CompetitionSeasonProps):Promise<CompetitionSeasonProps> => {
19
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/season/update`, { competition_season })
20
+ return resp.data.competition_season
21
+ },
22
+ getCompetitionSeasonTemplates: async(league_id?:string):Promise<CompetitionSeasonProps[]> => {
23
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/templates?league_id=${league_id}`)
24
+ return resp.data.competition_seasons
25
+ },
26
+ getCompetitionSeasonsByAdminId: async(status?:string):Promise<CompetitionSeasonProps[]> => {
27
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/me?status=${status}`)
28
+ return resp.data.competition_seasons
29
+ },
30
+ getCompetitionSeasonById: async(competition_season_id:string):Promise<CompetitionSeasonProps> => {
31
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/season/${competition_season_id}`)
32
+ return resp.data.competition_season
33
+ },
34
+ getLeaderboardBySeasonId: async(competition_season_id:string):Promise<any> => {
35
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/leaderboard/season/${competition_season_id}`)
36
+ return resp.data.season_leaderboard
37
+ },
38
+ getSponsoredCompetitionSeasons: async(sponsor_id:string):Promise<CompetitionSeasonProps[]> => {
39
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/sponsored/${sponsor_id}`)
40
+ return resp.data.competition_seasons
41
+ },
42
+ }
43
+
44
+ const CompetitionApi = {
45
+ setEnvironment: () => {
46
+ const endpoints = APIOverrides.getEndpoints();
47
+ TP_SVC_API = endpoints['TP_SVC_API'] as string;
48
+ EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
49
+ MK_SVC_API = endpoints['MK_SVC_API'] as string;
50
+ AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
51
+ },
52
+ getPlayersByPlayerIds : async(player_ids:string[]):Promise<PublicPlayerProps[]> => {
53
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/players/bulk/get`, { player_ids })
54
+ return resp.data.players
55
+ },
56
+ getLeagues: async():Promise<LeagueProps[]> => {
57
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues?status=active`)
58
+ return resp.data.leagues
59
+ },
60
+ getMarkets: async():Promise<MarketProps[]> => {
61
+ const resp = await axios.get(`${MK_SVC_API}/v1/markets/all`)
62
+ return resp.data.markets
63
+ },
64
+ getLeagueById: async(league_id:string):Promise<LeagueProps> => {
65
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues/league/${league_id}`)
66
+ return resp.data.league
67
+ },
68
+ getCompetitionsByCompanyId: async(company_id:string, offset:number, status:'active'|'closed'):Promise<CompetitionProps[]> => {
69
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/company/${company_id}?offset=${offset}&status=${status}`)
70
+ return resp.data.competitions
71
+ },
72
+ getCompetitionById: async(competition_id:string):Promise<CompetitionProps> => {
73
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/competition/${competition_id}`)
74
+ return resp.data.competition
75
+ },
76
+ getCompetitionMatchesByCompetitionId: async(competition_id:string):Promise<{competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[]}> => {
77
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/matches/${competition_id}`)
78
+ return { competition_matches: resp.data.competition_matches, competition_match_markets: resp.data.competition_match_markets }
79
+ },
80
+ getEnteredCompetitions: async():Promise<{competitions: CompetitionProps[], competition_players:CompetitionPlayerProps[]}> => {
81
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/entered`)
82
+ return resp.data
83
+ },
84
+ getCompetitionsBySeasonId: async(competition_season_id:string):Promise<CompetitionProps[]> => {
85
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/season/${competition_season_id}`)
86
+ return resp.data.competitions
87
+ },
88
+ createCompetition: async(draft_competition:CreateCompetitionProps):Promise<{competition:CompetitionProps, competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[], competition_players:CompetitionPlayerProps[]}> => {
89
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/competition/create`, { draft_competition })
90
+ return resp.data
91
+ },
92
+ editCompetition: async(draft_competition:CreateCompetitionProps):Promise<{ competition:CompetitionProps, competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[] }> => {
93
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/competition/edit`, { draft_competition })
94
+ return resp.data
95
+ },
96
+ getPublicCompetitions: async(offset:number):Promise<CompetitionProps[]> => {
97
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/all?offset=${offset}&status=scheduled`)
98
+ return resp.data.competitions
99
+ },
100
+ getActiveSponsoredCompetitions: async(sponsor_id:string):Promise<CompetitionProps[]> => {
101
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/sponsored/${sponsor_id}`)
102
+ return resp.data.competitions
103
+ },
104
+ getCompetitionOptions: async():Promise<{competition_types:CompetitionTypeProps[], competition_result_types:CompetitionResultTypeProps[], competition_payout_types:CompetitionPayoutTypeProps[]}> => {
105
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/options`)
106
+ return resp.data
107
+ },
108
+ getMyDetails: async():Promise<MyPlayerProps> => {
109
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/me`)
110
+ return resp.data.player
111
+ },
112
+ getMyReferralCode: async():Promise<{ player_referral:PlayerReferralProps, promo:PromoProps }> => {
113
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/promos/referral/me`)
114
+ return resp.data
115
+ },
116
+ getMyBalance: async():Promise<PlayerBalanceProps> => {
117
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/balance/me`)
118
+ return resp.data.player_balance
119
+ },
120
+ }
121
+
122
+ const CompetitionMatchApi = {
123
+ getCompetitionMatchesByCompetitionId: async(competition_id:string, status:string):Promise<{competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[]}> => {
124
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/matches/${competition_id}?status=${status}`)
125
+ return resp.data
126
+ },
127
+ getEventsByEventIds: async(event_ids:string[]):Promise<EventProps[]> => {
128
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/events/bulk/get`, { attribute:'event_id', values: event_ids })
129
+ return resp.data.events
130
+ },
131
+ getMatchesByMatchIds: async(match_ids:string[]):Promise<MatchProps[]> => {
132
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/matches/bulk/get`, { attribute: 'match_id', values: match_ids })
133
+ return resp.data.matches
134
+ },
135
+ getAthletesByIds : async(athlete_ids:string[]) => {
136
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/athletes/bulk/get`, { attribute: 'athlete_id', values: athlete_ids })
137
+ return resp.data.athletes
138
+ },
139
+ getTournamentsByTournamentIds: async(tournament_ids:string[]):Promise<TournamentProps[]> => {
140
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/tournaments/bulk/get`, { attribute: 'event_id', values: tournament_ids })
141
+ return resp.data.tournaments
142
+ },
143
+ getTeamsByIds: async(team_ids:string[]) => {
144
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/teams/bulk/get`, { attribute:'team_id', values: team_ids })
145
+ return resp.data.teams
146
+ },
147
+ getExoticsByIds : async(exotic_ids:string[]):Promise<any[]> => {
148
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/exotics/bulk/get`, { attribute: 'exotic_id', values: exotic_ids })
149
+ return resp.data.athletes
150
+ },
151
+ }
152
+
153
+ const CompetitionPlayerApi = {
154
+ getCompetitionPlayersByCompetition: async(competition_id:string, offset:number, status?:string):Promise<CompetitionPlayerProps[]> => {
155
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/players/${competition_id}?offset=${offset}&status=${status}`)
156
+ return resp.data.competition_players
157
+ },
158
+ joinCompetition: async(competition_player:CompetitionPlayerProps):Promise<{ competition:CompetitionProps, competition_player:CompetitionPlayerProps, competition_result:CompetitionResultProps, competition_record:CompetitionRecordProps }> => {
159
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/player/join`, { competition_player });
160
+ return resp.data
161
+ },
162
+ leaveCompetition: async(competition_player:CompetitionPlayerProps):Promise<{competition:CompetitionProps, competition_player:CompetitionPlayerProps}> => {
163
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/player/leave`, { competition_player });
164
+ return resp.data
165
+ },
166
+ rejectCompetition: async(competition_player:CompetitionPlayerProps):Promise<CompetitionPlayerProps> => {
167
+ const resp = await axios.post(`${TP_SVC_API}/v1/competitions/player/leave`, { competition_player });
168
+ return resp.data.competition_player
169
+ }
170
+ }
171
+
172
+
173
+ const PlayerPicksApi = {
174
+ getPlayerPicksByCompetition: async(competition_id:string, player_id:string, offset:number):Promise<PlayerPickProps[]> => {
175
+ const resp = await axios.get(`${TP_SVC_API}/v1/picks/competition/${competition_id}?player_id=${player_id}&offset=${offset}`);
176
+ return resp.data.player_picks
177
+ },
178
+ createPlayerPick : async(player_pick:PlayerPickProps):Promise<{ player_pick: PlayerPickProps, competition_player:CompetitionPlayerProps }> => {
179
+ const resp = await axios.post(`${TP_SVC_API}/v1/picks/pick/create`, { player_pick });
180
+ return resp.data;
181
+ },
182
+ removePlayerPick: async(player_pick_id:string):Promise<{ player_pick: PlayerPickProps, competition_player:CompetitionPlayerProps }> => {
183
+ const resp = await axios.post(`${TP_SVC_API}/v1/picks/pick/remove`, { player_pick_id })
184
+ return resp.data
185
+ }
186
+ }
187
+
188
+
189
+ const CompetitionResultApi = {
190
+ getResultsByCompetition: async(competition_id:string, offset:number, player_id_override?:string):Promise<{competition_results:CompetitionResultProps[], competition_records:CompetitionRecordProps[]}> => {
191
+ const resp = await axios.get(`${TP_SVC_API}/v1/results/competition/${competition_id}?offset=${offset}&player_id=${player_id_override}`)
192
+ return resp.data
193
+ }
194
+ }
195
+
196
+ export const FINALIZED_STATUSES = [
197
+ 'closed',
198
+ 'complete',
199
+ 'cancelled',
200
+ 'unnecessary',
201
+ 'postponed',
202
+ 'suspended'
203
+ ]
204
+
205
+ export const IN_PROGRESS_STATUSES = [
206
+ 'inprogress',
207
+ 'halftime',
208
+ 'intermission'
209
+ ]
210
+
211
+ const CompetitionHelpers = {
212
+
213
+ getReferralDescription : (promo:PromoProps) => {
214
+ switch(promo.type){
215
+ case 'promo_code': return `Get ${promo.amount} promo bucks after you verify your account`
216
+ case 'promo_sweepstakes': return `Have a chance at UP TO 500 promo bucks after you verify your account`
217
+ case 'referral_code': return `Get ${promo.amount} promo bucks after you verify your account. Your referrer will get the same after you make your first deposit`
218
+ case 'referral_sweepstakes': return `Have a chance at UP TO 500 promo bucks after you verify your account. Your referrer will get the same after you make your first deposit`
219
+ default: return ''
220
+ }
221
+ },
222
+ getEmptyCompetitionSeason : ():CompetitionSeasonProps => {
223
+ return {
224
+ competition_season_id:'',
225
+ season_name:'',
226
+ season_description: '',
227
+ image: { url: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1635988385/be_notify_icon_nqplfc.png' },
228
+ payout_allocation:0,
229
+ payout_amt: 0,
230
+ allow_late_buy_in: false,
231
+ single_buy_in: true,
232
+ competition_result_type_id: '1',
233
+ admin_id:'',
234
+ status: 'active',
235
+ scheduled_datetime: moment().add(10, 'days'),
236
+ create_datetime:'',
237
+ last_update_datetime:'',
238
+ market_type: 'FOR_MONEY'
239
+ }
240
+ },
241
+
242
+ formatPlace :(place:number) => {
243
+ switch(place){
244
+ case 1:
245
+ return '1st'
246
+ case 2:
247
+ return '2nd'
248
+ case 3:
249
+ return '3rd'
250
+ case 4:
251
+ return '4th'
252
+ case 5:
253
+ return '5th'
254
+ case 6:
255
+ return '6th'
256
+ case 7:
257
+ return '7th'
258
+ case 8:
259
+ return '8th'
260
+ case 9:
261
+ return '9th'
262
+ default:
263
+ return `${place}`
264
+
265
+ }
266
+ },
267
+ isSeasonValid : (s:CompetitionSeasonProps) => {
268
+ if(!s.season_name){ return false }
269
+ if(!s.season_description){ return false }
270
+ if(!s.competition_result_type_id){ return false }
271
+ return true
272
+ },
273
+ getEmptyCompetition : ():CompetitionProps => {
274
+ return {
275
+ competition_id: '',
276
+ auth_strategy_id:'',
277
+ competition_name:'',
278
+ competition_description:'',
279
+ buy_in: 0,
280
+ admin_id:'',
281
+ image: { url: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1635988385/be_notify_icon_nqplfc.png' },
282
+ ticket_revenue:0,
283
+ tickets_sold:0,
284
+ available_tickets:10,
285
+ market_ids: [],
286
+ market_type: 'FOR_MONEY',
287
+ status: 'scheduled',
288
+ create_datetime:'',
289
+ last_update_datetime: '',
290
+ competition_type_id: '1',
291
+ competition_result_type_id:'1',
292
+ scheduled_datetime: '',
293
+ entered: false,
294
+ max_pick_count: 0,
295
+ leagues: [],
296
+ invite_only: false,
297
+ length_type: 'event',
298
+ competition_code: '',
299
+ initial_balance: 1000,
300
+ end_datetime: moment().add(1, 'week')
301
+ }
302
+ },
303
+ getClosestDay : (schedule_range:string[]):string => {
304
+ if(schedule_range.length == 0){ return moment().format('YYYY/MM/DD') }
305
+ let closest:any|undefined;
306
+ let exact_day = schedule_range.find(d => d == moment().format('YYYY/MM/DD'))
307
+ if(exact_day){ return exact_day }
308
+ schedule_range.map(d => {
309
+ if(!closest){
310
+ closest = moment(d)
311
+ }
312
+ if(moment(d).isBefore(moment())){ return } //Day is in the past
313
+ let new_range = moment(d).diff(moment(), 'days')
314
+ let closest_range = closest.diff(moment(), 'days')
315
+ if(Math.abs(new_range) < Math.abs(closest_range)){ closest = moment(d) }
316
+ })
317
+ return closest.format('YYYY/MM/DD')
318
+ },
319
+ getEventCompMatchFromEvent : (event_id:string, event_type:'team'|'tournament'|'match'):CompetitionMatchProps => {
320
+ return {
321
+ competition_id:'',
322
+ competition_match_id: '',
323
+ event_id,
324
+ event_type,
325
+ status: 'inprogress',
326
+ create_datetime:'',
327
+ last_update_datetime:'',
328
+ match_type: 'event'
329
+ }
330
+ },
331
+ getMatchMarketsFromEventAndTrades : (event_id:string, trades:TradeProps[], markets:MarketProps[]):CompetitionMatchMarketProps[] => {
332
+ let cmm:CompetitionMatchMarketProps[] = []
333
+ markets.map(m => {
334
+ let tst = trades.find(t => t.market_id == m.market_id && t.side == m.trade_side)
335
+ let ntst = trades.find(t => t.market_id == m.market_id && t.side != m.trade_side)
336
+ if(!tst || !ntst){ return }
337
+ let tscmm:CompetitionMatchMarketProps = {
338
+ competition_match_id: '',
339
+ competition_match_market_id: '',
340
+ var_1: tst.var_1,
341
+ odds: tst.odds,
342
+ event_id,
343
+ event_type: 'team',
344
+ probability: tst.probability,
345
+ side: tst.side,
346
+ side_id: tst.side_id,
347
+ market_id: tst.market_id,
348
+ status: 'active',
349
+ create_datetime: '',
350
+ last_update_datetime:''
351
+ }
352
+ cmm.push(tscmm)
353
+ let ntscmm:CompetitionMatchMarketProps = {
354
+ competition_match_id: '',
355
+ competition_match_market_id: '',
356
+ var_1: ntst.var_1,
357
+ odds: ntst.odds,
358
+ event_id,
359
+ event_type: 'team',
360
+ probability: ntst.probability,
361
+ side: ntst.side,
362
+ side_id: ntst.side_id,
363
+ market_id: ntst.market_id,
364
+ status: 'active',
365
+ create_datetime: '',
366
+ last_update_datetime:''
367
+ }
368
+ cmm.push(ntscmm)
369
+ })
370
+ return cmm
371
+ },
372
+ getStartTimeOptions : (draft_competition:CreateCompetitionProps, events:EventProps[]) => {
373
+ if(events.length == 0){ return [] }
374
+ let available_picks = (draft_competition.competition_match_markets.length / 2) + draft_competition.additional_markets.length
375
+ let included_events = events.filter(e => draft_competition.competition_matches.map(cm => cm.event_id.toString()).includes(e.event_id.toString()))
376
+ let additional_market_events = events.filter(e => draft_competition.additional_markets.map(m => m.event_id.toString()).includes(e.event_id.toString()))
377
+ included_events = included_events.concat(additional_market_events).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())
378
+ let start_time_options:{ start_time:string, label:string }[] = []
379
+ let earliest_event = included_events[0]
380
+ if(!earliest_event){ return [] }
381
+ start_time_options.push({ start_time: earliest_event.scheduled_datetime, label: `Start time of the earliest game` })
382
+ if(available_picks === draft_competition.competition.max_pick_count){
383
+ return start_time_options
384
+ }
385
+ let diff = available_picks - draft_competition.competition.max_pick_count
386
+ let picks_per_event = available_picks / included_events.length
387
+ let event_to_back = diff / picks_per_event
388
+ earliest_event = included_events[Math.ceil(event_to_back)]
389
+ if(!earliest_event){ return start_time_options }
390
+ start_time_options.push({ label: 'Latest start time possible based on max picks', start_time: earliest_event.scheduled_datetime })
391
+ return start_time_options
392
+ },
393
+ getEmptyCreateCompetition : ():CreateCompetitionProps => {
394
+ return {
395
+ competition: {
396
+ competition_id: '',
397
+ auth_strategy_id: '',
398
+ competition_name:'',
399
+ competition_description:'',
400
+ buy_in: 0,
401
+ admin_id:'',
402
+ ticket_revenue:0,
403
+ tickets_sold:0,
404
+ available_tickets:10,
405
+ market_ids: [],
406
+ market_type: 'FOR_MONEY',
407
+ status: 'scheduled',
408
+ create_datetime:'',
409
+ last_update_datetime: '',
410
+ competition_type_id: '',
411
+ competition_result_type_id:'',
412
+ scheduled_datetime: '',
413
+ entered: false,
414
+ max_pick_count: 0,
415
+ leagues: [],
416
+ invite_only: false,
417
+ length_type: 'event',
418
+ competition_code: '',
419
+ initial_balance: 1000,
420
+ end_datetime: ''
421
+ },
422
+ competition_match_markets:[],
423
+ competition_matches:[],
424
+ competition_players:[],
425
+ additional_markets:[]
426
+ }
427
+ },
428
+ getCompColors : (competition_type?:string) => {
429
+ switch(competition_type){
430
+ case 'pick': return { backgroundColor:'rgba(26,205,106,0.1)', borderColor:Colors.highlights.highlight400 }
431
+ case 'wager': return { backgroundColor:'rgba(59,26,205,0.1)', borderColor:Colors.highlights.highlight100 }
432
+ default: return { backgroundColor:Colors.brand.slate, borderColor:Colors.shades.black }
433
+ }
434
+ },
435
+ getOddsLabel :(odds:number):string => {
436
+ if(odds > 0){ return `+${odds.toFixed()}` }
437
+ return odds.toFixed()
438
+ },
439
+ getVar1Label :(var_1:number, market:MarketProps):string => {
440
+ if(market.type == 'Spread'){
441
+ if(var_1 > 0){ return `+${var_1}` }
442
+ }
443
+ return var_1.toString()
444
+ },
445
+ getUniqueDivisions : (events:EventProps[]):string[] => {
446
+ let away_divisions = events.map(e => e.away?.division ? e.away.division: '')
447
+ let home_divisions = events.map(e => e.home?.division ? e.home.division : '')
448
+ if(!away_divisions || !home_divisions){ return [] }
449
+ let divisions = away_divisions.concat(home_divisions)
450
+ let options = [ ...new Set(divisions.map(d => d)) ].sort((a,b) => a > b ? 1 : -1)
451
+ let ranks = events.find(e => e.away?.rank || e.home?.rank)
452
+ if(ranks){ options = ['Top25'].concat(options) }
453
+ return options
454
+ },
455
+ getUniqueSubDivisions : (events:EventProps[]):string[] => {
456
+ let away_divisions = events.map(e => e.away?.sub_division ? e.away.sub_division : '')
457
+ let home_divisions = events.map(e => e.home?.sub_division ? e.home.sub_division : '')
458
+ return [ ...new Set(away_divisions.concat(home_divisions).map(d => d)) ].sort((a,b) => a > b ? 1 : -1)
459
+ },
460
+
461
+ createPickFromMatchMarket : (competition_id:string, mm:CompetitionMatchMarketProps):PlayerPickProps => {
462
+
463
+ return {
464
+ player_id:'',
465
+ player_pick_id:'',
466
+ side: mm.side,
467
+ side_id: mm.side_id,
468
+ status: 'inprogress',
469
+ competition_id,
470
+ competition_match_id: mm.competition_match_id,
471
+ market_id: mm.market_id,
472
+ odds: mm.odds,
473
+ var_1: mm.var_1,
474
+ probability: mm.probability,
475
+ create_datetime:'',
476
+ last_update_datetime:'',
477
+ stake:0,
478
+ potential_winnings:0,
479
+ winnings: 0,
480
+ pick_title: ''
481
+ }
482
+ },
483
+
484
+ getCompetitionPlayer : (competition_id:string):CompetitionPlayerProps => {
485
+ return {
486
+ competition_id,
487
+ competition_player_id: '',
488
+ status: 'active',
489
+ create_datetime: '',
490
+ last_update_datetime: '',
491
+ player_id: '',
492
+ wager_based_balance: 1000,
493
+ accepted_ind: false
494
+ }
495
+ },
496
+
497
+
498
+ getCompTypeColor :(competition_type?:CompetitionTypeProps) => {
499
+ switch(competition_type?.type){
500
+ case 'pick':
501
+ return Colors.highlights.highlight400
502
+ case 'wager':
503
+ return Colors.highlights.highlight100
504
+ default:
505
+ return Colors.brand.midnight
506
+ }
507
+ },
508
+
509
+
510
+ calcPotentialWinnings : (amt:number, odds:number):number => {
511
+ if (odds > 0) {
512
+ var earningsMultiplyer = ((odds/100) + 1);
513
+ return earningsMultiplyer * amt;
514
+ } else {
515
+ var earningsMultiplyer = ((100/(Math.abs(odds))) + 1);
516
+ return earningsMultiplyer * amt
517
+ }
518
+ },
519
+
520
+
521
+ getPickTitleForTeamEvent : (pick:PlayerPickProps, market:MarketProps, event:EventProps, athlete?:AthleteProps):string => {
522
+ let market_side = market.side_options.find(o => o.side == pick.side)
523
+ if(!market_side){ return pick.side }
524
+ var re = /({.*?})/;
525
+ let parsed_text = market_side.parseable_title.split(re)
526
+ let new_title = '';
527
+ parsed_text.map((t:any) => {
528
+ if(t === ''){ return }
529
+ if(t[0] !== '{'){ return new_title += t }
530
+ let variable = t.slice(1)
531
+ variable = variable.slice(0, variable.length -1)
532
+ switch(variable){
533
+ case 'team':
534
+ let team = event[pick.side as keyof EventProps]
535
+ return new_title += team.market_name
536
+ case 'var_1': return new_title += CompetitionHelpers.getVar1Label(pick.var_1, market)
537
+ case 'athlete': return new_title += `${athlete?.first_name} ${athlete?.last_name}`
538
+ case 'stat': return new_title += market.stat_label ?? market.stat
539
+ default: return
540
+ }
541
+ })
542
+ return new_title
543
+ },
544
+
545
+ getPickTitleForMatch : (pick:PlayerPickProps, market:MarketProps, athlete?:AthleteProps, team?:TeamProps):string => {
546
+ let market_side = market.side_options.find(o => o.side == pick.side)
547
+ if(!market_side){ return pick.side }
548
+ var re = /({.*?})/;
549
+ let parsed_text = market_side.parseable_title.split(re)
550
+ let new_title = '';
551
+ parsed_text.map((t:any) => {
552
+ if(t === ''){ return }
553
+ if(t[0] !== '{'){ return new_title += t }
554
+ let variable = t.slice(1)
555
+ variable = variable.slice(0, variable.length -1)
556
+ switch(variable){
557
+ case 'team': return new_title += `${team?.market_name} ${team?.name}`
558
+ case 'var_1': return new_title += CompetitionHelpers.getVar1Label(pick.var_1, market)
559
+ case 'athlete': return new_title += athlete?.abbr_name
560
+ case 'stat': return new_title += market.stat
561
+ default: return
562
+
563
+ }
564
+ })
565
+ return new_title
566
+ }
567
+
568
+ }
@@ -0,0 +1,116 @@
1
+ import React from 'react';
2
+ import { ActivityIndicator, FlatList, View } from "react-native"
3
+ import MarketsCard from "./MarketsCard"
4
+ import type { AthleteProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionProps, CompetitionTypeProps, EventProps, MarketProps, PlayerPickProps } from '../../types';
5
+ import moment from 'moment-mini';
6
+ import { CompetitionHelpers, FINALIZED_STATUSES } from '../api';
7
+ import { Text } from '../../Components';
8
+ import Colors from '../../constants/colors';
9
+ import LinearDiagnal from '../../Components/LinearDiagnal';
10
+ import { AthleteImage } from '../../Components/Jerseys';
11
+
12
+ type AthleteMarketCardProps = {
13
+ competition:CompetitionProps,
14
+ competition_type:CompetitionTypeProps,
15
+ event:EventProps,
16
+ markets:MarketProps[],
17
+ athlete:AthleteProps,
18
+ onPick:(pp:PlayerPickProps, event_title:string, event_start:string) => void
19
+ mode: 'view'|'play'
20
+ loading?:boolean,
21
+ orientation:'horizontal'|'vertical',
22
+ player_picks:PlayerPickProps[],
23
+ competition_match:CompetitionMatchProps,
24
+ competition_match_markets:CompetitionMatchMarketProps[]
25
+ }
26
+
27
+ const AthleteMarketCard = ({ markets, competition_type, event, athlete, mode, loading, player_picks, orientation, competition_match, competition_match_markets, onPick }:AthleteMarketCardProps) => {
28
+
29
+ const market = markets.find(m => m.market_id == competition_match.market_id_override)
30
+ const wager_picks = player_picks.filter(pp => pp.stake > 0)
31
+
32
+ const handleMarketSelect = async(mm:CompetitionMatchMarketProps, player_pick?:PlayerPickProps) => {
33
+ let market = markets.find(m => m.market_id == mm.market_id)
34
+ if(!event || !competition_type || !market){ return alert('Unable to process') }
35
+ if(moment(event.scheduled_datetime).isBefore(moment())){ return alert('This event has already started') }
36
+ if(player_pick){
37
+ return onPick(player_pick, event.event_title, event.scheduled_datetime)
38
+ //await CompetitionStoreActions.removePlayerPick(player_pick.player_pick_id)
39
+ } else {
40
+ let pp = CompetitionHelpers.createPickFromMatchMarket(competition_match.competition_id, mm)
41
+ let pick_title = CompetitionHelpers.getPickTitleForTeamEvent(pp, market, event, athlete)
42
+ return onPick({ ...pp, pick_title }, event.event_title, event.scheduled_datetime)
43
+ }
44
+ }
45
+
46
+ const renderWagerPicks = (data: { item:PlayerPickProps, index:number }) => {
47
+ const locked = mode == 'view' && moment().isBefore(moment(event.scheduled_datetime)) ? true : false
48
+ return (
49
+ <View style={{ flexDirection:'row', marginTop:5 }}>
50
+ <Text style={{ flex:1 }} size={12} color={Colors.highlights.highlight200}>{locked?'WAGER LOCKED':data.item.pick_title}</Text>
51
+ <Text style={{ flex:1 }} size={12} color={Colors.highlights.highlight200} textAlign="right">{locked?'':`${data.item.stake.toFixed(2)} to win ${data.item.potential_winnings.toFixed(2)}`}</Text>
52
+ </View>
53
+ )
54
+ }
55
+
56
+ if(!athlete){ return <></> }
57
+ return (
58
+ <View style={{ flex:1 }}>
59
+ {market ?
60
+ <LinearDiagnal
61
+ label={market.stat_label ?? market.type}
62
+ label_size={10}
63
+ style={{ borderTopLeftRadius:8, padding:5 }}
64
+ left_color={Colors.incentive.gold}
65
+ right_color={'#ebd197'}
66
+ />
67
+ :<></>}
68
+ <View style={{ padding:10, flex:1, flexDirection:orientation=='horizontal'?'row':'column', alignItems:orientation=='horizontal'?'center':undefined }}>
69
+
70
+ <View nativeID="event_details" style={{ flex:1, flexGrow:1, flexDirection:orientation=='horizontal'?'row':'column', alignItems:'center' }}>
71
+ <View nativeID="athlete_image">
72
+ <AthleteImage athlete={athlete} size={38} number_size={10}/>
73
+ </View>
74
+ <View>
75
+ <Text size={16} color={Colors.brand.midnight} weight='bold' textAlign="center">{athlete.first_name} {athlete.last_name}</Text>
76
+ <Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular' textAlign="center">{athlete.team ? `${athlete.team.abbr} (${athlete.position})`:`${athlete.position}`}</Text>
77
+ </View>
78
+ </View>
79
+ <View nativeID="market_details" style={{flex:orientation=='horizontal'?1:undefined, margin:5 }}>
80
+ {orientation == 'horizontal' && market ?
81
+ <Text style={{ margin:2 }} size={14} color={Colors.shades.black} textAlign="center">{market.description}</Text>
82
+ :<></>}
83
+ <MarketsCard
84
+ player_picks={player_picks}
85
+ mode={mode}
86
+ markets={markets}
87
+ orientation="horizontal"
88
+ disabled={moment().isAfter(moment(event.scheduled_datetime)) || FINALIZED_STATUSES.includes(event.status) ? true : false}
89
+ locked={mode == 'view' && moment().isBefore(moment(event.scheduled_datetime)) ? true : false}
90
+ competition_match_markets={competition_match_markets}
91
+ onMarketSelect={(mm, player_pick) => handleMarketSelect(mm, player_pick)}
92
+ />
93
+ {loading ?
94
+ <View style={{ position:'absolute', top:0, right:0, left:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
95
+ <ActivityIndicator
96
+ size='large'
97
+ color={Colors.brand.midnight}
98
+ />
99
+ </View>
100
+ :<></>}
101
+ </View>
102
+ </View>
103
+ {wager_picks.length > 0 ?
104
+ <View nativeID="wager_picks">
105
+ <FlatList
106
+ data={wager_picks}
107
+ renderItem={renderWagerPicks}
108
+ keyExtractor={(item) => item.player_pick_id.toString()}
109
+ />
110
+ </View>
111
+ :<></>}
112
+ </View>
113
+ )
114
+ }
115
+
116
+ export default AthleteMarketCard