@maestro_io/maestro-web-sdk 3.3.1 → 4.0.0-beta.2

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 (269) hide show
  1. package/dist/f8820fca3a2a7957f753167da0884f9d.png +0 -0
  2. package/dist/maestro-web-sdk.esm.js +12 -12
  3. package/dist/maestro-web-sdk.esm.js.map +1 -1
  4. package/dist/maestro-web-sdk.umd.js +12 -12
  5. package/dist/maestro-web-sdk.umd.js.map +1 -1
  6. package/dist/package.json +87 -0
  7. package/dist/src/__mocks__/sentry.d.ts +4 -0
  8. package/dist/src/components/atoms/BaseButton/BaseButton.js +11 -0
  9. package/dist/src/components/atoms/BaseButton/index.js +2 -0
  10. package/dist/src/components/atoms/Image/index.js +34 -0
  11. package/dist/src/components/atoms/Rive/index.js +53 -0
  12. package/dist/src/components/atoms/SvgIcon/BetGeneralIcon.js +9 -0
  13. package/dist/src/components/atoms/SvgIcon/BetsIcon.js +11 -0
  14. package/dist/src/components/atoms/SvgIcon/BetsWarningIcon.js +11 -0
  15. package/dist/src/components/atoms/SvgIcon/CheckmarkIcon.js +6 -0
  16. package/dist/src/components/atoms/SvgIcon/CollapseIcon.js +6 -0
  17. package/dist/src/components/atoms/SvgIcon/ExpandIcon.js +6 -0
  18. package/dist/src/components/atoms/SvgIcon/FantasyIcon.js +15 -0
  19. package/dist/src/components/atoms/SvgIcon/FlameIcon.js +11 -0
  20. package/dist/src/components/atoms/SvgIcon/Icon.js +44 -0
  21. package/dist/src/components/atoms/SvgIcon/KeyPlaysIcon.js +10 -0
  22. package/dist/src/components/atoms/SvgIcon/MobilePhoneIcon.js +11 -0
  23. package/dist/src/components/atoms/SvgIcon/PlayIcon.js +8 -0
  24. package/dist/src/components/atoms/SvgIcon/ShopIcon.js +7 -0
  25. package/dist/src/components/atoms/SvgIcon/StatsIcon.js +12 -0
  26. package/dist/src/components/atoms/SvgIcon/TimesIcon.js +6 -0
  27. package/dist/src/components/atoms/SvgIcon/WarningIcon.js +8 -0
  28. package/dist/src/components/atoms/SvgIcon/index.js +2 -0
  29. package/dist/src/components/core/App/App.js +35 -0
  30. package/dist/src/components/core/App/index.js +2 -0
  31. package/dist/src/components/core/OverlayContainer.js +58 -0
  32. package/dist/src/components/core/PanelManager/PanelManager.js +86 -0
  33. package/dist/src/components/core/PanelManager/index.js +2 -0
  34. package/dist/src/components/core/ScrollableContainer/FocusableItem.js +38 -0
  35. package/dist/src/components/core/ScrollableContainer/ScrollableContainer.js +168 -0
  36. package/dist/src/components/core/ScrollableContainer/index.js +2 -0
  37. package/dist/src/components/molecules/ActionButton/ActionButton.js +10 -0
  38. package/dist/src/components/molecules/ActionButton/index.js +2 -0
  39. package/dist/src/components/molecules/HeadshotImage/HeadshotImage.js +50 -0
  40. package/dist/src/components/molecules/HeadshotImage/index.js +2 -0
  41. package/dist/src/components/molecules/Overlay/Overlay.js +139 -0
  42. package/dist/src/components/molecules/Overlay/index.js +2 -0
  43. package/dist/src/components/molecules/PanelNavButton/PanelNavButton.js +27 -0
  44. package/dist/src/components/molecules/PanelNavButton/index.js +2 -0
  45. package/dist/src/components/molecules/SegmentButton/SegmentButton.js +10 -0
  46. package/dist/src/components/molecules/SegmentButton/index.js +2 -0
  47. package/dist/src/components/molecules/TabLoadError/TabLoadError.js +14 -0
  48. package/dist/src/components/molecules/TabLoadError/index.js +2 -0
  49. package/dist/src/components/molecules/WatchButton/WatchButton.js +15 -0
  50. package/dist/src/components/molecules/WatchButton/index.js +2 -0
  51. package/dist/src/components/organisms/PanelNavigation/PanelNavigation.js +60 -0
  52. package/dist/src/components/organisms/PanelNavigation/index.js +2 -0
  53. package/dist/src/components/organisms/SegmentController/SegmentController.js +76 -0
  54. package/dist/src/components/organisms/SegmentController/index.js +2 -0
  55. package/dist/src/development/MaestroEventDelegate.js +109 -0
  56. package/dist/src/development/TimeSeek.js +218 -0
  57. package/dist/src/development/development.js +33 -0
  58. package/dist/src/external/AxiosNetworkClient.js +110 -0
  59. package/dist/src/external/LocalStorageCacheManager.js +213 -0
  60. package/dist/src/external/ReactRenderer.js +53 -0
  61. package/dist/src/external/mocks/MockExternalNetworkClient.js +187 -0
  62. package/dist/src/external/ports/cacheManager.js +1 -0
  63. package/dist/src/external/ports/networkClient.js +1 -0
  64. package/dist/src/external/ports/renderer.d.ts +1 -2
  65. package/dist/src/external/ports/renderer.js +1 -0
  66. package/dist/src/external/spatial-navigation/__mocks__/withFocusable.d.ts +8 -0
  67. package/dist/src/external/spatial-navigation/__mocks__/withFocusable.js +7 -0
  68. package/dist/src/external/spatial-navigation/index.js +3 -0
  69. package/dist/src/external/spatial-navigation/measureLayout.js +30 -0
  70. package/dist/src/external/spatial-navigation/spatialNavigation.js +876 -0
  71. package/dist/src/external/spatial-navigation/utils.js +6 -0
  72. package/dist/src/external/spatial-navigation/visualDebugger.js +76 -0
  73. package/dist/src/external/spatial-navigation/withFocusable.js +245 -0
  74. package/dist/src/helpers/Observable.js +37 -0
  75. package/dist/src/helpers/strings.js +14 -0
  76. package/dist/src/helpers/url.js +12 -0
  77. package/dist/src/index.d.ts +5 -5
  78. package/dist/src/index.js +165 -0
  79. package/dist/src/interfaces/IMaestroEvent.d.ts +12 -0
  80. package/dist/src/interfaces/IMaestroEvent.js +18 -0
  81. package/dist/src/interfaces/IMaestroEventDelegate.js +1 -0
  82. package/dist/src/interfaces/IMaestroManager.js +1 -0
  83. package/dist/src/interfaces/IUserSettings.js +20 -0
  84. package/dist/src/models/IModel.js +1 -0
  85. package/dist/src/models/IPanel.js +40 -0
  86. package/dist/src/models/ITheme.js +20 -0
  87. package/dist/src/models/IWinningBet.js +1 -0
  88. package/dist/src/modules/bets/interfaces/IBets.js +1 -0
  89. package/dist/src/modules/bets/mocks.js +573 -0
  90. package/dist/src/modules/bets/types/BetsAnalyticsTypes.js +1 -0
  91. package/dist/src/modules/bets/view/BetsView.js +143 -0
  92. package/dist/src/modules/bets/view/HotProps/HotPropsView.js +150 -0
  93. package/dist/src/modules/bets/view/SixPack/SixPackView.js +110 -0
  94. package/dist/src/modules/bets/view/UserBets/BetResult/BetResult.js +6 -0
  95. package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCard.js +149 -0
  96. package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardEvent.js +34 -0
  97. package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardFooter.js +18 -0
  98. package/dist/src/modules/bets/view/UserBets/Boost/Boost.js +6 -0
  99. package/dist/src/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.js +9 -0
  100. package/dist/src/modules/bets/view/UserBets/Parlay/Parlay.js +13 -0
  101. package/dist/src/modules/bets/view/UserBets/Straight/Straight.js +6 -0
  102. package/dist/src/modules/bets/view/UserBets/Teaser/Teaser.js +13 -0
  103. package/dist/src/modules/bets/view/UserBets/UserBetsView.js +107 -0
  104. package/dist/src/modules/bets/view/components/Bet/Bet.js +32 -0
  105. package/dist/src/modules/bets/view/components/BetPill/BetPill.js +6 -0
  106. package/dist/src/modules/bets/view/components/BetsCard/BetsCard.js +15 -0
  107. package/dist/src/modules/bets/view/components/BetsCard/BetsCardHeader.js +20 -0
  108. package/dist/src/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.js +14 -0
  109. package/dist/src/modules/bets/view/components/LocationWarning/LocationWarning.js +16 -0
  110. package/dist/src/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.js +78 -0
  111. package/dist/src/modules/bets/view/components/PromoCodeBanner/index.js +1 -0
  112. package/dist/src/modules/bets/view-model/BetsViewModel.js +974 -0
  113. package/dist/src/modules/fantasy/components/ExpandedAthleteList/ExpandedAthletesList.js +107 -0
  114. package/dist/src/modules/fantasy/components/ExpandedAthleteList/index.js +1 -0
  115. package/dist/src/modules/fantasy/components/LeagueCard/LeagueCard.js +20 -0
  116. package/dist/src/modules/fantasy/components/LeagueCard/index.js +2 -0
  117. package/dist/src/modules/fantasy/components/TopPlayerCard/TopPlayerCard.js +29 -0
  118. package/dist/src/modules/fantasy/components/TopPlayerCard/index.js +2 -0
  119. package/dist/src/modules/fantasy/mocks.js +3682 -0
  120. package/dist/src/modules/fantasy/types.js +6 -0
  121. package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/ActiveAthletesMarquee.js +74 -0
  122. package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/index.js +2 -0
  123. package/dist/src/modules/fantasy/view/ErrorBoundary.d.ts +13 -0
  124. package/dist/src/modules/fantasy/view/FantasyItemView.js +74 -0
  125. package/dist/src/modules/fantasy/view/FantasyView.js +133 -0
  126. package/dist/src/modules/fantasy/view/InactiveLeague/DraftDateCountdown.js +95 -0
  127. package/dist/src/modules/fantasy/view/InactiveLeague/InactiveLeague.js +13 -0
  128. package/dist/src/modules/fantasy/view/InactiveLeague/index.js +2 -0
  129. package/dist/src/modules/fantasy/view/LoginView/LoginView.js +27 -0
  130. package/dist/src/modules/fantasy/view/LoginView/index.js +2 -0
  131. package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/DoubleAthleteCard.js +25 -0
  132. package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/index.js +2 -0
  133. package/dist/src/modules/fantasy/view/MatchupPair/ExpandedDoubleAthleteCards.js +9 -0
  134. package/dist/src/modules/fantasy/view/MatchupPair/MatchupPair.js +118 -0
  135. package/dist/src/modules/fantasy/view/MatchupPair/index.js +2 -0
  136. package/dist/src/modules/fantasy/view/MatchupSingle/ExpandedSingleAthleteCards.js +9 -0
  137. package/dist/src/modules/fantasy/view/MatchupSingle/MatchupSingle.js +108 -0
  138. package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/SingleAthleteCard.js +18 -0
  139. package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/index.js +2 -0
  140. package/dist/src/modules/fantasy/view/MatchupSingle/index.js +2 -0
  141. package/dist/src/modules/fantasy/view/PromoView/PromoView.js +12 -0
  142. package/dist/src/modules/fantasy/view/PromoView/index.js +2 -0
  143. package/dist/src/modules/fantasy/view/index.js +2 -0
  144. package/dist/src/modules/fantasy/view-model/FantasyViewModel.FantasyPolling.js +132 -0
  145. package/dist/src/modules/fantasy/view-model/FantasyViewModel.LeagueManagerPolling.js +141 -0
  146. package/dist/src/modules/fantasy/view-model/FantasyViewModel.js +534 -0
  147. package/dist/src/modules/key-plays/constants.js +292 -0
  148. package/dist/src/modules/key-plays/interfaces/IKeyPlays.js +14 -0
  149. package/dist/src/modules/key-plays/interfaces/IKeyPlaysResponse.js +1 -0
  150. package/dist/src/modules/key-plays/view/KeyPlayCardScoreTagView.js +16 -0
  151. package/dist/src/modules/key-plays/view/KeyPlayCardView.js +144 -0
  152. package/dist/src/modules/key-plays/view/KeyPlayErrorStateView.js +65 -0
  153. package/dist/src/modules/key-plays/view/KeyPlaysView.js +151 -0
  154. package/dist/src/modules/key-plays/view-model/KeyPlaysViewModel.js +246 -0
  155. package/dist/src/modules/shop/mocks.js +390 -0
  156. package/dist/src/modules/shop/types.js +7 -0
  157. package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.js +56 -0
  158. package/dist/src/modules/shop/view/ProductDetailView/index.js +2 -0
  159. package/dist/src/modules/shop/view/ShopView.js +182 -0
  160. package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.js +23 -0
  161. package/dist/src/modules/shop/view/components/BrowseCard/index.js +2 -0
  162. package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.js +26 -0
  163. package/dist/src/modules/shop/view/components/ProductSummaryCard/index.js +1 -0
  164. package/dist/src/modules/shop/view/components/ShopPromoView/ShopPromoView.js +19 -0
  165. package/dist/src/modules/shop/view/components/ShopPromoView/index.js +1 -0
  166. package/dist/src/modules/shop/view/components/ShopSection/ShopSection.d.ts +1 -0
  167. package/dist/src/modules/shop/view/components/ShopSection/ShopSection.js +61 -0
  168. package/dist/src/modules/shop/view/components/ShopSection/ShopSectionItem.d.ts +18 -0
  169. package/dist/src/modules/shop/view/components/ShopSection/ShopSectionItem.js +22 -0
  170. package/dist/src/modules/shop/view/components/ShopSection/index.js +1 -0
  171. package/dist/src/modules/shop/view/index.js +2 -0
  172. package/dist/src/modules/shop/view-model/ShopViewModel.ShopPolling.js +111 -0
  173. package/dist/src/modules/shop/view-model/ShopViewModel.js +353 -0
  174. package/dist/src/modules/stats/interfaces/IStats.js +1 -0
  175. package/dist/src/modules/stats/mocks.js +746 -0
  176. package/dist/src/modules/stats/utils/driveSummaryUtils.js +48 -0
  177. package/dist/src/modules/stats/utils/renderTeamStatistic.js +16 -0
  178. package/dist/src/modules/stats/utils.js +62 -0
  179. package/dist/src/modules/stats/view/ActiveAthletes/ActiveAthletes.js +98 -0
  180. package/dist/src/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.js +27 -0
  181. package/dist/src/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.js +89 -0
  182. package/dist/src/modules/stats/view/ActiveAthletes/index.js +2 -0
  183. package/dist/src/modules/stats/view/DriveSummary/DrivePlayCard.js +70 -0
  184. package/dist/src/modules/stats/view/DriveSummary/DriveSummary.js +87 -0
  185. package/dist/src/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.js +129 -0
  186. package/dist/src/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.js +26 -0
  187. package/dist/src/modules/stats/view/DriveSummary/MainStat/MainStat.js +24 -0
  188. package/dist/src/modules/stats/view/DriveSummary/index.js +2 -0
  189. package/dist/src/modules/stats/view/GameLeaders/GameLeaders.js +48 -0
  190. package/dist/src/modules/stats/view/GameLeaders/index.js +2 -0
  191. package/dist/src/modules/stats/view/MatchPredictor/DonutChart/DonutChart.js +55 -0
  192. package/dist/src/modules/stats/view/MatchPredictor/DonutChart/index.js +1 -0
  193. package/dist/src/modules/stats/view/MatchPredictor/MatchPredictorView.js +60 -0
  194. package/dist/src/modules/stats/view/MatchPredictor/index.js +2 -0
  195. package/dist/src/modules/stats/view/Penalties/Penalties.js +6 -0
  196. package/dist/src/modules/stats/view/Penalties/index.js +2 -0
  197. package/dist/src/modules/stats/view/RecentGames/RecentGames.js +23 -0
  198. package/dist/src/modules/stats/view/RecentGames/index.js +2 -0
  199. package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.js +121 -0
  200. package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/index.js +2 -0
  201. package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/ScoreItem.js +62 -0
  202. package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/index.js +2 -0
  203. package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/ScoresSection.js +23 -0
  204. package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/index.js +2 -0
  205. package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.js +106 -0
  206. package/dist/src/modules/stats/view/ScoringSummary/index.js +2 -0
  207. package/dist/src/modules/stats/view/StatsItemView.js +92 -0
  208. package/dist/src/modules/stats/view/StatsQRCode/StatsQRCodeView.js +36 -0
  209. package/dist/src/modules/stats/view/StatsQRCode/index.js +1 -0
  210. package/dist/src/modules/stats/view/StatsView.js +137 -0
  211. package/dist/src/modules/stats/view/TeamStats/TeamStatsView.js +43 -0
  212. package/dist/src/modules/stats/view/TeamStats/index.js +1 -0
  213. package/dist/src/modules/stats/view/Teams/StatsCarousel.js +83 -0
  214. package/dist/src/modules/stats/view/Teams/StatsProgressBar.js +19 -0
  215. package/dist/src/modules/stats/view/Teams/Teams.js +27 -0
  216. package/dist/src/modules/stats/view/Teams/index.js +2 -0
  217. package/dist/src/modules/stats/view/WinProbability/WinProbability.js +28 -0
  218. package/dist/src/modules/stats/view/WinProbability/index.js +2 -0
  219. package/dist/src/modules/stats/view/components/AthletesStatistics/AthletesStatistics.js +89 -0
  220. package/dist/src/modules/stats/view/components/AthletesStatistics/StatisticTable.js +12 -0
  221. package/dist/src/modules/stats/view/components/AthletesStatistics/index.js +2 -0
  222. package/dist/src/modules/stats/view/index.js +2 -0
  223. package/dist/src/modules/stats/view-model/StatsViewModel.d.ts +5 -0
  224. package/dist/src/modules/stats/view-model/StatsViewModel.js +989 -0
  225. package/dist/src/sentry.js +31 -0
  226. package/dist/src/services/AnalyticsService/AnalyticsService.d.ts +12 -7
  227. package/dist/src/services/AnalyticsService/AnalyticsService.js +402 -0
  228. package/dist/src/services/AnalyticsService/types.js +1 -0
  229. package/dist/src/services/BetsService.js +122 -0
  230. package/dist/src/services/FantasyService.js +92 -0
  231. package/dist/src/services/GlobalService/GlobalService.d.ts +9 -0
  232. package/dist/src/services/GlobalService/PageService.d.ts +9 -0
  233. package/dist/src/services/GlobalService/index.d.ts +2 -0
  234. package/dist/src/services/GlobalService/mocks.d.ts +2 -0
  235. package/dist/src/services/GlobalService/types.d.ts +11 -0
  236. package/dist/src/services/InsightsService/InsightsPayloadBuilder.d.ts +1 -2
  237. package/dist/src/services/InsightsService/InsightsPayloadBuilder.js +386 -0
  238. package/dist/src/services/InsightsService/InsightsService.js +74 -0
  239. package/dist/src/services/NetworkManager/NetworkManager.js +457 -0
  240. package/dist/src/services/NetworkManager/NetworkManagerFactory.js +101 -0
  241. package/dist/src/services/NetworkManager/errors.js +45 -0
  242. package/dist/src/services/NetworkManager/types.js +10 -0
  243. package/dist/src/services/PageService/PageService.d.ts +9 -0
  244. package/dist/src/services/PageService/PageService.js +39 -0
  245. package/dist/src/services/PageService/index.d.ts +2 -0
  246. package/dist/src/services/PageService/index.js +2 -0
  247. package/dist/src/services/PageService/mocks.d.ts +2 -0
  248. package/dist/src/services/PageService/mocks.js +104 -0
  249. package/dist/src/services/PageService/types.d.ts +76 -0
  250. package/dist/src/services/PageService/types.js +1 -0
  251. package/dist/src/services/ShopService.js +46 -0
  252. package/dist/src/services/StaticService/PageService.d.ts +9 -0
  253. package/dist/src/services/StaticService/StaticService.d.ts +3 -1
  254. package/dist/src/services/StaticService/StaticService.js +59 -0
  255. package/dist/src/services/StaticService/index.js +2 -0
  256. package/dist/src/services/StaticService/mocks.js +104 -0
  257. package/dist/src/services/StaticService/types.js +1 -0
  258. package/dist/src/services/StatsService.d.ts +1 -0
  259. package/dist/src/services/StatsService.js +147 -0
  260. package/dist/src/services/ThemeManager/constants.js +47 -0
  261. package/dist/src/services/UserSettingsManager.js +155 -0
  262. package/dist/src/test-polyfills.js +15 -0
  263. package/dist/src/types/OverlayTypes.js +4 -0
  264. package/dist/src/view-models/MaestroEventViewModel.d.ts +1 -2
  265. package/dist/src/view-models/MaestroEventViewModel.js +307 -0
  266. package/dist/src/view-models/OverlayViewModel.js +222 -0
  267. package/dist/src/view-models/PanelManagerViewModel.js +212 -0
  268. package/dist/src/view-models/ViewModel.js +32 -0
  269. package/package.json +1 -1
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { DEFAULT_SCROLLABLE_CONTAINER_CONTEXT, SCROLLABLE_CONTEXT_TYPE, } from './ScrollableContainer';
3
+ /**
4
+ * Component to be used as a child of `ScrollableContainer`.
5
+ * Wraps the focusable item and registers it in the context
6
+ */
7
+ class FocusableItem extends React.Component {
8
+ constructor() {
9
+ super(...arguments);
10
+ Object.defineProperty(this, "ref", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: null
15
+ });
16
+ Object.defineProperty(this, "context", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: DEFAULT_SCROLLABLE_CONTAINER_CONTEXT
21
+ });
22
+ }
23
+ componentDidMount() {
24
+ if (this.ref && this.context.setRef) {
25
+ this.context.setRef(this.ref);
26
+ }
27
+ }
28
+ render() {
29
+ return (React.createElement("div", { className: "focusable-item", ref: (e) => (this.ref = e) }, this.props.children));
30
+ }
31
+ }
32
+ Object.defineProperty(FocusableItem, "contextTypes", {
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true,
36
+ value: SCROLLABLE_CONTEXT_TYPE
37
+ });
38
+ export default FocusableItem;
@@ -0,0 +1,168 @@
1
+ import React from 'react';
2
+ import './ScrollableContainer.styles.css';
3
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
4
+ /**
5
+ * ScrollableContainer component provides a context for focusable items
6
+ * that allows them to register themselves and handle scrolling
7
+ * when they become focused.
8
+ * @example
9
+ * ```jsx
10
+ * <ScrollableContainer scrollableContainerRef={scrollableContainerRef}>
11
+ * <FocusableItem>Item 1</FocusableItem>
12
+ * <FocusableItem>Item 2</FocusableItem>
13
+ * <FocusableItem>Item 3</FocusableItem>
14
+ * </ScrollableContainer>
15
+ * ```
16
+ */
17
+ class ScrollableContainer extends React.Component {
18
+ constructor() {
19
+ super(...arguments);
20
+ Object.defineProperty(this, "refsMap", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: []
25
+ });
26
+ Object.defineProperty(this, "hash", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: ''
31
+ });
32
+ Object.defineProperty(this, "lastHash", {
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true,
36
+ value: ''
37
+ });
38
+ Object.defineProperty(this, "state", {
39
+ enumerable: true,
40
+ configurable: true,
41
+ writable: true,
42
+ value: {
43
+ scrolled: false,
44
+ }
45
+ });
46
+ Object.defineProperty(this, "setRef", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: (ref) => {
51
+ this.refsMap.push(ref);
52
+ this.hash = Math.random().toString(36).substring(2, 15);
53
+ }
54
+ });
55
+ Object.defineProperty(this, "getOrderedRefs", {
56
+ enumerable: true,
57
+ configurable: true,
58
+ writable: true,
59
+ value: () => {
60
+ if (this.hash === this.lastHash) {
61
+ return this.refsMap;
62
+ }
63
+ this.refsMap = this.refsMap.sort((a, b) => {
64
+ if (!this.props.scrollableContainerRef)
65
+ return 0;
66
+ const containerRect = this.props.scrollableContainerRef.getBoundingClientRect();
67
+ const aRect = a ? a.getBoundingClientRect() : { top: 0, bottom: 0 };
68
+ const bRect = b ? b.getBoundingClientRect() : { top: 0, bottom: 0 };
69
+ // Calculate the actual distance from container top (positive means below, negative means above)
70
+ const aDistance = aRect.top - containerRect.top;
71
+ const bDistance = bRect.top - containerRect.top;
72
+ return aDistance - bDistance;
73
+ });
74
+ this.lastHash = this.hash;
75
+ return this.refsMap;
76
+ }
77
+ });
78
+ /**
79
+ * @description - Scrolls the container to the focused element if necessary
80
+ */
81
+ Object.defineProperty(this, "scrollToFocusedElement", {
82
+ enumerable: true,
83
+ configurable: true,
84
+ writable: true,
85
+ value: async (layout, options) => {
86
+ if (!this.props.scrollableContainerRef || !layout.node)
87
+ return;
88
+ const offsetTop = options?.offsetTop || 0;
89
+ const refs = this.getOrderedRefs();
90
+ // Wait for the next frame to ensure the layout is updated
91
+ if (process.env.NODE_ENV !== 'test') {
92
+ await wait(0);
93
+ }
94
+ const containerRect = this.props.scrollableContainerRef.getBoundingClientRect();
95
+ const nodeRect = layout.node.getBoundingClientRect();
96
+ let index = -1;
97
+ for (let i = refs.length - 1; i >= 0; i--) {
98
+ if (refs[i].contains(layout.node)) {
99
+ index = i;
100
+ break;
101
+ }
102
+ }
103
+ if (index === -1) {
104
+ console.warn('Element not found in refsMap to focus to. Register the element wrapping it with <FocusableItem />');
105
+ return;
106
+ }
107
+ let hasOutside = false;
108
+ refs.slice(index).forEach((el) => {
109
+ const rect = el.getBoundingClientRect();
110
+ if (rect.bottom > containerRect.bottom || rect.top < containerRect.top) {
111
+ hasOutside = true;
112
+ }
113
+ });
114
+ if (!hasOutside)
115
+ return;
116
+ const target = index === 0
117
+ ? 0
118
+ : this.props.scrollableContainerRef.scrollTop +
119
+ (nodeRect.top -
120
+ containerRect.top -
121
+ (this.props.containerTopOffset || 0) -
122
+ offsetTop);
123
+ this.props.scrollableContainerRef.scrollTop = target;
124
+ const newScrolled = target > 0;
125
+ if (this.state.scrolled !== newScrolled) {
126
+ this.setState({ scrolled: newScrolled });
127
+ }
128
+ }
129
+ });
130
+ }
131
+ getChildContext() {
132
+ return {
133
+ refsMap: this.refsMap,
134
+ setRef: this.setRef,
135
+ scrollToFocusedElement: this.scrollToFocusedElement,
136
+ };
137
+ }
138
+ componentWillUnmount() {
139
+ this.refsMap = [];
140
+ this.hash = '';
141
+ this.lastHash = '';
142
+ }
143
+ render() {
144
+ const { scrollableContainerRef: _, containerTopOffset: __, ...rest } = this.props;
145
+ return (React.createElement("div", { className: "scrollable-container", "data-scrolled": this.state.scrolled, ...rest }, this.props.children));
146
+ }
147
+ }
148
+ Object.defineProperty(ScrollableContainer, "childContextTypes", {
149
+ enumerable: true,
150
+ configurable: true,
151
+ writable: true,
152
+ value: {
153
+ refsMap: React.PropTypes.arrayOf(React.PropTypes.instanceOf(HTMLElement)),
154
+ setRef: React.PropTypes.func,
155
+ scrollToFocusedElement: React.PropTypes.func,
156
+ }
157
+ });
158
+ export const DEFAULT_SCROLLABLE_CONTAINER_CONTEXT = {
159
+ setRef: (_) => { },
160
+ scrollToFocusedElement: () => { },
161
+ refsMap: [],
162
+ };
163
+ export const SCROLLABLE_CONTEXT_TYPE = {
164
+ refsMap: React.PropTypes.arrayOf(React.PropTypes.instanceOf(HTMLElement)),
165
+ setRef: React.PropTypes.func,
166
+ scrollToFocusedElement: React.PropTypes.func,
167
+ };
168
+ export default ScrollableContainer;
@@ -0,0 +1,2 @@
1
+ import ScrollableContainer from './ScrollableContainer';
2
+ export default ScrollableContainer;
@@ -0,0 +1,10 @@
1
+ import BaseButton from '@/components/atoms/BaseButton';
2
+ import './ActionButton.styles.css';
3
+ import { withFocusable, } from '@/external/spatial-navigation';
4
+ import React from 'react';
5
+ class ActionButton extends React.Component {
6
+ render() {
7
+ return (React.createElement(BaseButton, { className: "action-button T05_ALT", ...this.props }, this.props.children));
8
+ }
9
+ }
10
+ export default withFocusable()(ActionButton);
@@ -0,0 +1,2 @@
1
+ import ActionButton from './ActionButton';
2
+ export default ActionButton;
@@ -0,0 +1,50 @@
1
+ import Image from '@/components/atoms/Image';
2
+ import React from 'react';
3
+ export const BASE_64_HEADSHOT_THUMBNAIL_FALLBACK = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAg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NIVH96QgbY055eQqg7sM0fIL/ANf1/X6euaD8Iruby5/EF4trEQGaxsystyf9iW5Ia3hPXPki54OA6nkOwrnsWj+G9F0GIR6ZYQwNjDXBXzLuTPXzLmTdMQeuwMI1yQiKOKYjcoEFABQAUAFABQAUAFABQAUAFAGBrXhnRPEEZTU7GKWTbtS6QeVeRY+75dymJNqnny3Lwk/fjYcUDvY8c174R39v5k+gXa30Iyy2V2VhvFA6JHPhbadveQWnHHzHqrdh3PJr6wvtLuGtdQtLizuF5MVxE8bEdAy7gA6H+F0LI3VWIpev9f1/THdf1/X9eRS3f45/z/k0Bfy/r/gChv8AP4H/ABzRcPz/AK/rUN359/50XC+xX3e/+f0pBdCbvf05/wA9v8igD1zwN8N5dbji1bW/MttKfElrbITHc365BEjNjMFm4+66kTTqd0JjjKTPSXcTf9bn0Np+m2GlW62unWcFnboABHBGqAkcbnYfNI56tJIzOxJLMSSaYi9QIKACgAoAKACgAoAKACgAoAKACgAoAKACgChqGmafqtu1rqVnb3tuwP7ueNX2kjG+Nj88UgH3ZImSRTyrAjNAHzt46+HM2gpJqujmW60kZa4hfL3GnA8b2Ycz2vYykeZCP9duXM1S12KTPKN3+f8APP8An3oGJu9/8/596Xy/r8A/r+kQbvf/ADxRcNP6X6HoPw58KjxPrYe6TdpWmCO6vRj5bh2Y/ZrI9eLhkdpeObeGZAyO6MGtfkDZ9aKqoqoiqiIoVEUBVVVGFVVGAqqAAAAAAMCqIHUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFADWVXVkdVdHUq6MAysrDDKynIZWBIIIIIODxQB8k/ETwuPDGuH7MpGmakr3ViAPlhw/+kWYPf7O7IU/6YSwhizbyZenoUn/XyOA3/j3/AM/5/KkPRAD/2Q==';
4
+ class HeadshotImage extends React.Component {
5
+ constructor(props) {
6
+ super(props);
7
+ Object.defineProperty(this, "mounted", {
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true,
11
+ value: false
12
+ });
13
+ Object.defineProperty(this, "state", {
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true,
17
+ value: {
18
+ loaded: false,
19
+ }
20
+ });
21
+ Object.defineProperty(this, "onLoad", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: () => {
26
+ if (!this.mounted)
27
+ return;
28
+ this.setState({ loaded: true });
29
+ }
30
+ });
31
+ this.state = {
32
+ loaded: false,
33
+ };
34
+ }
35
+ componentDidMount() {
36
+ this.mounted = true;
37
+ }
38
+ componentWillUnmount() {
39
+ this.mounted = false;
40
+ }
41
+ render() {
42
+ return (React.createElement("div", null,
43
+ !this.state.loaded && (React.createElement(Image, { crossOrigin: "anonymous", ...this.props, src: BASE_64_HEADSHOT_THUMBNAIL_FALLBACK, alt: "Player Headshot Loading" })),
44
+ React.createElement(Image, { crossOrigin: "anonymous", onLoad: this.onLoad, alt: "Athlete Thumbnail", style: {
45
+ ...(this.props.style || {}),
46
+ display: this.state.loaded ? 'block' : 'none',
47
+ }, ...this.props })));
48
+ }
49
+ }
50
+ export default HeadshotImage;
@@ -0,0 +1,2 @@
1
+ import HeadshotImage from './HeadshotImage';
2
+ export default HeadshotImage;
@@ -0,0 +1,139 @@
1
+ // import { Rive as RiveCanvas } from '@rive-app/canvas';
2
+ import React from 'react';
3
+ import { OverlayType } from '@/types/OverlayTypes';
4
+ import Rive from '../../atoms/Rive';
5
+ export const WINNING_BET_RIVE_FILE_URL = 'https://static.gcp.maestro.io/media/664b9c57d59a7a431542d814/67db106027ddcdcd2ecb97d4.riv';
6
+ const AUTO_DISMISS_TIMEOUT = 10400;
7
+ class Overlay extends React.Component {
8
+ constructor(props) {
9
+ super(props);
10
+ Object.defineProperty(this, "autoDismissTimeout", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: null
15
+ });
16
+ Object.defineProperty(this, "handleOverlayAction", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: () => {
21
+ const { overlayType, onOverlayAction } = this.props;
22
+ this.setState({ autoDismiss: false });
23
+ switch (overlayType) {
24
+ case OverlayType.WinningBet:
25
+ break;
26
+ case OverlayType.FantasyPlayerEvent:
27
+ break;
28
+ }
29
+ // Call custom action handler if provided
30
+ if (onOverlayAction) {
31
+ onOverlayAction(overlayType);
32
+ }
33
+ }
34
+ });
35
+ Object.defineProperty(this, "trackOverlayViewed", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: () => {
40
+ if (this.state.hasTrackedView)
41
+ return;
42
+ this.setState({ hasTrackedView: true });
43
+ if (this.props.onOverlayViewed) {
44
+ this.props.onOverlayViewed(this.props.overlayType);
45
+ }
46
+ }
47
+ });
48
+ Object.defineProperty(this, "onLoadRiveInstance", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: (riveInstance) => {
53
+ if (!riveInstance)
54
+ return;
55
+ // Ensure the drawing surface matches the canvas size and device pixel ratio
56
+ riveInstance.resizeDrawingSurfaceToCanvas();
57
+ // Set text values after the file is loaded
58
+ try {
59
+ riveInstance.setTextRunValueAtPath('Title', this.overlayTitle, 'compNotification');
60
+ riveInstance.setTextRunValueAtPath('Metadata', this.overlayMetadata, 'compNotification');
61
+ }
62
+ catch (error) {
63
+ console.error('Error setting text values:', error);
64
+ }
65
+ // Get state machine inputs and trigger the play input specifically
66
+ try {
67
+ const inputs = riveInstance.stateMachineInputs('stateMachine');
68
+ const triggerPlayInput = inputs.find((input) => input.name === 'triggerPlay');
69
+ if (triggerPlayInput) {
70
+ triggerPlayInput.fire();
71
+ }
72
+ else if (inputs.length > 0) {
73
+ inputs[0].fire();
74
+ }
75
+ }
76
+ catch (error) {
77
+ console.error('Error with state machine inputs:', error);
78
+ }
79
+ this.trackOverlayViewed();
80
+ this.autoDismissTimeout = setTimeout(() => {
81
+ if (this.state.autoDismiss) {
82
+ this.handleOverlayAction();
83
+ }
84
+ }, AUTO_DISMISS_TIMEOUT);
85
+ }
86
+ });
87
+ this.state = {
88
+ autoDismiss: true,
89
+ hasTrackedView: false,
90
+ };
91
+ }
92
+ componentWillUnmount() {
93
+ if (this.autoDismissTimeout) {
94
+ clearTimeout(this.autoDismissTimeout);
95
+ }
96
+ }
97
+ get overlayTitle() {
98
+ const { overlayType, fantasy } = this.props;
99
+ switch (overlayType) {
100
+ case OverlayType.WinningBet:
101
+ return 'You won your bet!';
102
+ case OverlayType.FantasyPlayerEvent:
103
+ return fantasy?.title ?? 'Fantasy Update';
104
+ default:
105
+ return '';
106
+ }
107
+ }
108
+ get overlayMetadata() {
109
+ const { overlayType, winningBet, fantasy } = this.props;
110
+ switch (overlayType) {
111
+ case OverlayType.WinningBet:
112
+ return (winningBet?.notificationText ?? 'Click OK to view your winning bets.');
113
+ case OverlayType.FantasyPlayerEvent:
114
+ return fantasy?.metadata ?? 'New Player Activity';
115
+ default:
116
+ return '';
117
+ }
118
+ }
119
+ render() {
120
+ const style = {
121
+ position: 'fixed',
122
+ zIndex: 999999,
123
+ left: this.props.position?.left !== undefined
124
+ ? `${this.props.position.left}px`
125
+ : undefined,
126
+ right: this.props.position?.right !== undefined
127
+ ? `${this.props.position.right}px`
128
+ : undefined,
129
+ top: this.props.position?.top !== undefined
130
+ ? `${this.props.position.top}px`
131
+ : undefined,
132
+ bottom: this.props.position?.bottom !== undefined
133
+ ? `${this.props.position.bottom}px`
134
+ : undefined,
135
+ };
136
+ return (React.createElement(Rive, { id: this.props.id, onEnterPress: this.handleOverlayAction, focusKey: "maestro-overlay", autoFocus: true, autoPlay: true, onLoadRiveInstance: this.onLoadRiveInstance, src: WINNING_BET_RIVE_FILE_URL, style: style }));
137
+ }
138
+ }
139
+ export default Overlay;
@@ -0,0 +1,2 @@
1
+ import Overlay from './Overlay';
2
+ export default Overlay;
@@ -0,0 +1,27 @@
1
+ import BaseButton from '@/components/atoms/BaseButton/BaseButton';
2
+ import Icon from '@/components/atoms/SvgIcon/Icon';
3
+ import './PanelNavButton.styles.css';
4
+ import React from 'react';
5
+ import { withFocusable } from '@/external/spatial-navigation';
6
+ class PanelNavButton extends React.Component {
7
+ render() {
8
+ const { iconName, active, children, focused, width } = this.props;
9
+ return (React.createElement("div", { className: [
10
+ 'panel-nav-button-container',
11
+ 'T02',
12
+ active ? 'panel-nav-button-active' : '',
13
+ ].join(' '), "data-focused": focused, style: {
14
+ width,
15
+ } },
16
+ React.createElement(BaseButton, null,
17
+ React.createElement(Icon, { iconName: iconName, height: 36, width: 36 })),
18
+ React.createElement("div", { className: "FONT_BOLD" }, children)));
19
+ }
20
+ }
21
+ Object.defineProperty(PanelNavButton, "displayName", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: 'PanelNavButton'
26
+ });
27
+ export default withFocusable()(PanelNavButton);
@@ -0,0 +1,2 @@
1
+ import PanelNavButton from './PanelNavButton';
2
+ export default PanelNavButton;
@@ -0,0 +1,10 @@
1
+ import BaseButton from '@/components/atoms/BaseButton/BaseButton';
2
+ import './SegmentButton.styles.css';
3
+ import React from 'react';
4
+ import { withFocusable, } from '@/external/spatial-navigation';
5
+ class SegmentButton extends React.Component {
6
+ render() {
7
+ return (React.createElement(BaseButton, { className: "segment-button T05_ALT", "data-focused": this.props.focused, "data-active": this.props.active }, this.props.children));
8
+ }
9
+ }
10
+ export default withFocusable()(SegmentButton);
@@ -0,0 +1,2 @@
1
+ import SegmentButton from './SegmentButton';
2
+ export default SegmentButton;
@@ -0,0 +1,14 @@
1
+ import { withFocusable, } from '@/external/spatial-navigation';
2
+ import React from 'react';
3
+ import ActionButton from '../ActionButton';
4
+ import './TabLoadError.styles.css';
5
+ class TabLoadErrorView extends React.Component {
6
+ render() {
7
+ const { focused } = this.props;
8
+ return (React.createElement("div", { "data-focused": focused, className: "tab-load-error focus-ring" },
9
+ React.createElement("h3", { className: "T70" }, "We dropped the ball."),
10
+ React.createElement("p", { className: "T20" }, "We're having trouble loading that for you. Please try again."),
11
+ React.createElement(ActionButton, { "data-focused": focused, onEnterPress: this.props.onEnterPress }, "Try Again")));
12
+ }
13
+ }
14
+ export default withFocusable()(TabLoadErrorView);
@@ -0,0 +1,2 @@
1
+ import TabLoadErrorView from './TabLoadError';
2
+ export default TabLoadErrorView;
@@ -0,0 +1,15 @@
1
+ import BaseButton from '@/components/atoms/BaseButton/BaseButton';
2
+ import Icon from '@/components/atoms/SvgIcon';
3
+ import './WatchButton.styles.css';
4
+ import React from 'react';
5
+ class WatchButton extends React.Component {
6
+ constructor(props) {
7
+ super(props);
8
+ }
9
+ render() {
10
+ return (React.createElement(BaseButton, { className: "watch-button T05_ALT", ...this.props },
11
+ React.createElement(Icon, { iconName: "play", height: 20, width: 19 }),
12
+ this.props.children));
13
+ }
14
+ }
15
+ export default WatchButton;
@@ -0,0 +1,2 @@
1
+ import WatchButton from './WatchButton';
2
+ export default WatchButton;
@@ -0,0 +1,60 @@
1
+ import PanelNavButton from '@/components/molecules/PanelNavButton';
2
+ import './PanelNavigation.styles.css';
3
+ import React from 'react';
4
+ import SDK from '@/index';
5
+ import { withFocusable, } from '@/external/spatial-navigation';
6
+ const BUTTON_MARGIN = 12;
7
+ class PanelNavigationButton extends React.Component {
8
+ constructor() {
9
+ super(...arguments);
10
+ Object.defineProperty(this, "handleArrowPress", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: (d, _props) => {
15
+ if (d === 'left' && this.props.index === 0) {
16
+ SDK.getMaestroEventViewModel().deliverFocus();
17
+ return;
18
+ }
19
+ if (this.props.onArrowPress) {
20
+ this.props.onArrowPress(d);
21
+ }
22
+ }
23
+ });
24
+ }
25
+ render() {
26
+ const { item, index, width } = this.props;
27
+ return (React.createElement(PanelNavButton, { iconName: item.iconName, key: item.title, index: index, onBecameFocused: this.props.onBecameFocused(index), active: item.active, focusKey: `PANEL_NAV_BUTTON_${index}`, onArrowPress: this.handleArrowPress, parentFocusKey: "PANEL_NAVIGATION", width: width }, item.title));
28
+ }
29
+ }
30
+ class PanelNavigation extends React.Component {
31
+ constructor() {
32
+ super(...arguments);
33
+ Object.defineProperty(this, "handleBecameFocused", {
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true,
37
+ value: (index) => () => {
38
+ if (this.props.items[index]) {
39
+ this.props.items[index].onEnter();
40
+ }
41
+ }
42
+ });
43
+ }
44
+ render() {
45
+ const itemsCount = this.props.items.length;
46
+ if (itemsCount === 0) {
47
+ return null;
48
+ }
49
+ const marginTotal = (itemsCount - 1) * BUTTON_MARGIN;
50
+ const buttonWidth = `calc((100% - ${marginTotal}px) / ${itemsCount})`;
51
+ return (React.createElement(FocusableWrapper, { focusKey: "PANEL_NAVIGATION" }, this.props.items.map((item, index) => (React.createElement(PanelNavigationButton, { onBecameFocused: this.handleBecameFocused, key: item.title, item: item, index: index, width: buttonWidth })))));
52
+ }
53
+ }
54
+ class Wrapper extends React.Component {
55
+ render() {
56
+ return React.createElement("div", { className: "panel-navigation" }, this.props.children);
57
+ }
58
+ }
59
+ const FocusableWrapper = withFocusable({ trackChildren: true })(Wrapper);
60
+ export default PanelNavigation;
@@ -0,0 +1,2 @@
1
+ import PanelNavigation from './PanelNavigation';
2
+ export default PanelNavigation;