@maestro_io/maestro-web-sdk 4.0.0 → 4.0.1
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.
- package/dist/maestro-web-sdk.esm.js +2 -2
- package/dist/maestro-web-sdk.esm.js.map +1 -1
- package/dist/maestro-web-sdk.umd.js +2 -2
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/package.json +92 -0
- package/dist/src/components/atoms/BaseButton/BaseButton.d.ts +7 -0
- package/dist/src/components/atoms/BaseButton/BaseButton.js +11 -0
- package/dist/src/components/atoms/BaseButton/index.d.ts +2 -0
- package/dist/src/components/atoms/BaseButton/index.js +2 -0
- package/dist/src/components/atoms/Image/index.d.ts +13 -0
- package/dist/src/components/atoms/Image/index.js +34 -0
- package/dist/src/components/atoms/Rive/index.d.ts +219 -0
- package/dist/src/components/atoms/Rive/index.js +53 -0
- package/dist/src/components/atoms/SvgIcon/BetGeneralIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/BetGeneralIcon.js +9 -0
- package/dist/src/components/atoms/SvgIcon/BetsIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/BetsIcon.js +8 -0
- package/dist/src/components/atoms/SvgIcon/BetsWarningIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/BetsWarningIcon.js +11 -0
- package/dist/src/components/atoms/SvgIcon/ChatIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/ChatIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/CheckmarkIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/CheckmarkIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/CollapseIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/CollapseIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/ExpandIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/ExpandIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/FantasyIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/FantasyIcon.js +15 -0
- package/dist/src/components/atoms/SvgIcon/FlameIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/FlameIcon.js +11 -0
- package/dist/src/components/atoms/SvgIcon/HelloWorldIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/HelloWorldIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/Icon.d.ts +39 -0
- package/dist/src/components/atoms/SvgIcon/Icon.js +44 -0
- package/dist/src/components/atoms/SvgIcon/KeyPlaysIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/KeyPlaysIcon.js +10 -0
- package/dist/src/components/atoms/SvgIcon/MobilePhoneIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/MobilePhoneIcon.js +11 -0
- package/dist/src/components/atoms/SvgIcon/PlayIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/PlayIcon.js +8 -0
- package/dist/src/components/atoms/SvgIcon/ShopIcon.d.ts +5 -0
- package/dist/src/components/atoms/SvgIcon/ShopIcon.js +7 -0
- package/dist/src/components/atoms/SvgIcon/ShopifyIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/ShopifyIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/StatsIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/StatsIcon.js +12 -0
- package/dist/src/components/atoms/SvgIcon/TimesIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/TimesIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/WarningIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/WarningIcon.js +8 -0
- package/dist/src/components/atoms/SvgIcon/index.d.ts +2 -0
- package/dist/src/components/atoms/SvgIcon/index.js +2 -0
- package/dist/src/components/core/App/App.d.ts +11 -0
- package/dist/src/components/core/App/App.js +35 -0
- package/dist/src/components/core/App/index.d.ts +2 -0
- package/dist/src/components/core/App/index.js +2 -0
- package/dist/src/components/core/PanelManager/PanelManager.d.ts +21 -0
- package/dist/src/components/core/PanelManager/PanelManager.js +86 -0
- package/dist/src/components/core/PanelManager/index.d.ts +2 -0
- package/dist/src/components/core/PanelManager/index.js +2 -0
- package/dist/src/components/core/ScrollableContainer/FocusableItem.d.ts +6 -0
- package/dist/src/components/core/ScrollableContainer/FocusableItem.js +38 -0
- package/dist/src/components/core/ScrollableContainer/ScrollableContainer.d.ts +78 -0
- package/dist/src/components/core/ScrollableContainer/ScrollableContainer.js +169 -0
- package/dist/src/components/core/ScrollableContainer/index.d.ts +2 -0
- package/dist/src/components/core/ScrollableContainer/index.js +2 -0
- package/dist/src/components/molecules/ActionButton/ActionButton.d.ts +94 -0
- package/dist/src/components/molecules/ActionButton/ActionButton.js +10 -0
- package/dist/src/components/molecules/ActionButton/index.d.ts +2 -0
- package/dist/src/components/molecules/ActionButton/index.js +2 -0
- package/dist/src/components/molecules/HeadshotImage/HeadshotImage.d.ts +16 -0
- package/dist/src/components/molecules/HeadshotImage/HeadshotImage.js +50 -0
- package/dist/src/components/molecules/HeadshotImage/index.d.ts +2 -0
- package/dist/src/components/molecules/HeadshotImage/index.js +2 -0
- package/dist/src/components/molecules/Overlay/Overlay.d.ts +34 -0
- package/dist/src/components/molecules/Overlay/Overlay.js +139 -0
- package/dist/src/components/molecules/Overlay/index.d.ts +2 -0
- package/dist/src/components/molecules/Overlay/index.js +2 -0
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.d.ts +104 -0
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.js +27 -0
- package/dist/src/components/molecules/PanelNavButton/index.d.ts +2 -0
- package/dist/src/components/molecules/PanelNavButton/index.js +2 -0
- package/dist/src/components/molecules/SegmentButton/SegmentButton.d.ts +9 -0
- package/dist/src/components/molecules/SegmentButton/SegmentButton.js +10 -0
- package/dist/src/components/molecules/SegmentButton/index.d.ts +2 -0
- package/dist/src/components/molecules/SegmentButton/index.js +2 -0
- package/dist/src/components/molecules/TabLoadError/TabLoadError.d.ts +94 -0
- package/dist/src/components/molecules/TabLoadError/TabLoadError.js +14 -0
- package/dist/src/components/molecules/TabLoadError/index.d.ts +2 -0
- package/dist/src/components/molecules/TabLoadError/index.js +2 -0
- package/dist/src/components/molecules/WatchButton/WatchButton.d.ts +10 -0
- package/dist/src/components/molecules/WatchButton/WatchButton.js +15 -0
- package/dist/src/components/molecules/WatchButton/index.d.ts +2 -0
- package/dist/src/components/molecules/WatchButton/index.js +2 -0
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.d.ts +16 -0
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.js +60 -0
- package/dist/src/components/organisms/PanelNavigation/index.d.ts +2 -0
- package/dist/src/components/organisms/PanelNavigation/index.js +2 -0
- package/dist/src/components/organisms/SegmentController/SegmentController.d.ts +30 -0
- package/dist/src/components/organisms/SegmentController/SegmentController.js +76 -0
- package/dist/src/components/organisms/SegmentController/index.d.ts +3 -0
- package/dist/src/components/organisms/SegmentController/index.js +2 -0
- package/dist/src/development/MaestroEventDelegate.d.ts +27 -0
- package/dist/src/development/MaestroEventDelegate.js +109 -0
- package/dist/src/development/TimeSeek.d.ts +22 -0
- package/dist/src/development/TimeSeek.js +218 -0
- package/dist/src/development/development.d.ts +1 -0
- package/dist/src/development/development.js +36 -0
- package/dist/src/external/AxiosNetworkClient.d.ts +28 -0
- package/dist/src/external/AxiosNetworkClient.js +110 -0
- package/dist/src/external/LocalStorageCacheManager.d.ts +65 -0
- package/dist/src/external/LocalStorageCacheManager.js +213 -0
- package/dist/src/external/ReactRenderer.d.ts +17 -0
- package/dist/src/external/ReactRenderer.js +65 -0
- package/dist/src/external/mocks/MockExternalNetworkClient.d.ts +104 -0
- package/dist/src/external/mocks/MockExternalNetworkClient.js +187 -0
- package/dist/src/external/ports/cacheManager.d.ts +17 -0
- package/dist/src/external/ports/cacheManager.js +1 -0
- package/dist/src/external/ports/networkClient.d.ts +19 -0
- package/dist/src/external/ports/networkClient.js +1 -0
- package/dist/src/external/ports/renderer.d.ts +4 -0
- package/dist/src/external/ports/renderer.js +1 -0
- package/dist/src/external/spatial-navigation/__mocks__/withFocusable.d.ts +8 -0
- package/dist/src/external/spatial-navigation/__mocks__/withFocusable.js +7 -0
- package/dist/src/external/spatial-navigation/index.d.ts +4 -0
- package/dist/src/external/spatial-navigation/index.js +3 -0
- package/dist/src/external/spatial-navigation/measureLayout.d.ts +2 -0
- package/dist/src/external/spatial-navigation/measureLayout.js +30 -0
- package/dist/src/external/spatial-navigation/spatialNavigation.d.ts +155 -0
- package/dist/src/external/spatial-navigation/spatialNavigation.js +876 -0
- package/dist/src/external/spatial-navigation/utils.d.ts +20 -0
- package/dist/src/external/spatial-navigation/utils.js +6 -0
- package/dist/src/external/spatial-navigation/visualDebugger.d.ts +17 -0
- package/dist/src/external/spatial-navigation/visualDebugger.js +76 -0
- package/dist/src/external/spatial-navigation/withFocusable.d.ts +123 -0
- package/dist/src/external/spatial-navigation/withFocusable.js +245 -0
- package/dist/src/helpers/Observable.d.ts +12 -0
- package/dist/src/helpers/Observable.js +37 -0
- package/dist/src/helpers/strings.d.ts +2 -0
- package/dist/src/helpers/strings.js +14 -0
- package/dist/src/helpers/url.d.ts +1 -0
- package/dist/src/helpers/url.js +12 -0
- package/dist/src/index.d.ts +54 -0
- package/dist/src/index.js +165 -0
- package/dist/src/interfaces/IMaestroEvent.d.ts +126 -0
- package/dist/src/interfaces/IMaestroEvent.js +18 -0
- package/dist/src/interfaces/IMaestroEventDelegate.d.ts +74 -0
- package/dist/src/interfaces/IMaestroEventDelegate.js +1 -0
- package/dist/src/interfaces/IMaestroManager.d.ts +45 -0
- package/dist/src/interfaces/IMaestroManager.js +1 -0
- package/dist/src/interfaces/IUserSettings.d.ts +44 -0
- package/dist/src/interfaces/IUserSettings.js +20 -0
- package/dist/src/models/IModel.d.ts +7 -0
- package/dist/src/models/IModel.js +1 -0
- package/dist/src/models/IPanel.d.ts +15 -0
- package/dist/src/models/IPanel.js +40 -0
- package/dist/src/models/ITheme.d.ts +77 -0
- package/dist/src/models/ITheme.js +20 -0
- package/dist/src/models/IWinningBet.d.ts +7 -0
- package/dist/src/models/IWinningBet.js +1 -0
- package/dist/src/modules/bets/interfaces/IBets.d.ts +192 -0
- package/dist/src/modules/bets/interfaces/IBets.js +1 -0
- package/dist/src/modules/bets/mocks.d.ts +2 -0
- package/dist/src/modules/bets/mocks.js +573 -0
- package/dist/src/modules/bets/types/BetsAnalyticsTypes.d.ts +8 -0
- package/dist/src/modules/bets/types/BetsAnalyticsTypes.js +1 -0
- package/dist/src/modules/bets/view/BetsView.d.ts +28 -0
- package/dist/src/modules/bets/view/BetsView.js +143 -0
- package/dist/src/modules/bets/view/HotProps/HotPropsView.d.ts +100 -0
- package/dist/src/modules/bets/view/HotProps/HotPropsView.js +150 -0
- package/dist/src/modules/bets/view/SixPack/SixPackView.d.ts +23 -0
- package/dist/src/modules/bets/view/SixPack/SixPackView.js +110 -0
- package/dist/src/modules/bets/view/UserBets/BetResult/BetResult.d.ts +6 -0
- package/dist/src/modules/bets/view/UserBets/BetResult/BetResult.js +6 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +101 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCard.js +149 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardEvent.d.ts +26 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardEvent.js +34 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardFooter.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardFooter.js +18 -0
- package/dist/src/modules/bets/view/UserBets/Boost/Boost.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/Boost/Boost.js +6 -0
- package/dist/src/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.d.ts +6 -0
- package/dist/src/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.js +9 -0
- package/dist/src/modules/bets/view/UserBets/Parlay/Parlay.d.ts +8 -0
- package/dist/src/modules/bets/view/UserBets/Parlay/Parlay.js +13 -0
- package/dist/src/modules/bets/view/UserBets/Straight/Straight.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/Straight/Straight.js +6 -0
- package/dist/src/modules/bets/view/UserBets/Teaser/Teaser.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/Teaser/Teaser.js +13 -0
- package/dist/src/modules/bets/view/UserBets/UserBetsView.d.ts +25 -0
- package/dist/src/modules/bets/view/UserBets/UserBetsView.js +107 -0
- package/dist/src/modules/bets/view/components/Bet/Bet.d.ts +158 -0
- package/dist/src/modules/bets/view/components/Bet/Bet.js +32 -0
- package/dist/src/modules/bets/view/components/BetPill/BetPill.d.ts +6 -0
- package/dist/src/modules/bets/view/components/BetPill/BetPill.js +6 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCard.d.ts +10 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCard.js +15 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCardHeader.d.ts +16 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCardHeader.js +20 -0
- package/dist/src/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.d.ts +8 -0
- package/dist/src/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.js +14 -0
- package/dist/src/modules/bets/view/components/LocationWarning/LocationWarning.d.ts +10 -0
- package/dist/src/modules/bets/view/components/LocationWarning/LocationWarning.js +16 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +18 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.js +78 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/index.d.ts +1 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/index.js +1 -0
- package/dist/src/modules/bets/view-model/BetsViewModel.d.ts +219 -0
- package/dist/src/modules/bets/view-model/BetsViewModel.js +974 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/ExpandedAthletesList.d.ts +28 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/ExpandedAthletesList.js +107 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/index.d.ts +1 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/index.js +1 -0
- package/dist/src/modules/fantasy/components/LeagueCard/LeagueCard.d.ts +102 -0
- package/dist/src/modules/fantasy/components/LeagueCard/LeagueCard.js +20 -0
- package/dist/src/modules/fantasy/components/LeagueCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/components/LeagueCard/index.js +2 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/TopPlayerCard.d.ts +99 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/TopPlayerCard.js +29 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/index.js +2 -0
- package/dist/src/modules/fantasy/mocks.d.ts +7620 -0
- package/dist/src/modules/fantasy/mocks.js +3682 -0
- package/dist/src/modules/fantasy/types.d.ts +176 -0
- package/dist/src/modules/fantasy/types.js +6 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/ActiveAthletesMarquee.d.ts +21 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/ActiveAthletesMarquee.js +74 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/index.js +2 -0
- package/dist/src/modules/fantasy/view/FantasyItemView.d.ts +22 -0
- package/dist/src/modules/fantasy/view/FantasyItemView.js +74 -0
- package/dist/src/modules/fantasy/view/FantasyView.d.ts +27 -0
- package/dist/src/modules/fantasy/view/FantasyView.js +133 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/DraftDateCountdown.d.ts +23 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/DraftDateCountdown.js +95 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/InactiveLeague.d.ts +98 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/InactiveLeague.js +13 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/index.js +2 -0
- package/dist/src/modules/fantasy/view/LoginView/LoginView.d.ts +94 -0
- package/dist/src/modules/fantasy/view/LoginView/LoginView.js +27 -0
- package/dist/src/modules/fantasy/view/LoginView/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/LoginView/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/DoubleAthleteCard.d.ts +95 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/DoubleAthleteCard.js +25 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/ExpandedDoubleAthleteCards.d.ts +14 -0
- package/dist/src/modules/fantasy/view/MatchupPair/ExpandedDoubleAthleteCards.js +9 -0
- package/dist/src/modules/fantasy/view/MatchupPair/MatchupPair.d.ts +100 -0
- package/dist/src/modules/fantasy/view/MatchupPair/MatchupPair.js +118 -0
- package/dist/src/modules/fantasy/view/MatchupPair/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/ExpandedSingleAthleteCards.d.ts +14 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/ExpandedSingleAthleteCards.js +9 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/MatchupSingle.d.ts +100 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/MatchupSingle.js +108 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/SingleAthleteCard.d.ts +95 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/SingleAthleteCard.js +18 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/index.js +2 -0
- package/dist/src/modules/fantasy/view/PromoView/PromoView.d.ts +98 -0
- package/dist/src/modules/fantasy/view/PromoView/PromoView.js +12 -0
- package/dist/src/modules/fantasy/view/PromoView/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/PromoView/index.js +2 -0
- package/dist/src/modules/fantasy/view/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/index.js +2 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.FantasyPolling.d.ts +32 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.FantasyPolling.js +132 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.LeagueManagerPolling.d.ts +32 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.LeagueManagerPolling.js +141 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.d.ts +148 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.js +534 -0
- package/dist/src/modules/hello-world/HelloWorldImage.d.ts +2 -0
- package/dist/src/modules/hello-world/HelloWorldImage.js +32 -0
- package/dist/src/modules/hello-world/HelloWorldView.d.ts +11 -0
- package/dist/src/modules/hello-world/HelloWorldView.js +34 -0
- package/dist/src/modules/hello-world/index.d.ts +2 -0
- package/dist/src/modules/hello-world/index.js +2 -0
- package/dist/src/modules/key-plays/constants.d.ts +3 -0
- package/dist/src/modules/key-plays/constants.js +292 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlays.d.ts +32 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlays.js +14 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlaysResponse.d.ts +44 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlaysResponse.js +1 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardScoreTagView.d.ts +9 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardScoreTagView.js +16 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardView.d.ts +39 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardView.js +139 -0
- package/dist/src/modules/key-plays/view/KeyPlayErrorStateView.d.ts +13 -0
- package/dist/src/modules/key-plays/view/KeyPlayErrorStateView.js +65 -0
- package/dist/src/modules/key-plays/view/KeyPlaysView.d.ts +37 -0
- package/dist/src/modules/key-plays/view/KeyPlaysView.js +151 -0
- package/dist/src/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +37 -0
- package/dist/src/modules/key-plays/view-model/KeyPlaysViewModel.js +246 -0
- package/dist/src/modules/shop/mocks.d.ts +22 -0
- package/dist/src/modules/shop/mocks.js +391 -0
- package/dist/src/modules/shop/types.d.ts +161 -0
- package/dist/src/modules/shop/types.js +7 -0
- package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.d.ts +9 -0
- package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.js +60 -0
- package/dist/src/modules/shop/view/ProductDetailView/index.d.ts +2 -0
- package/dist/src/modules/shop/view/ProductDetailView/index.js +2 -0
- package/dist/src/modules/shop/view/ShopView.d.ts +35 -0
- package/dist/src/modules/shop/view/ShopView.js +182 -0
- package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.d.ts +101 -0
- package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.js +23 -0
- package/dist/src/modules/shop/view/components/BrowseCard/index.d.ts +2 -0
- package/dist/src/modules/shop/view/components/BrowseCard/index.js +2 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.d.ts +102 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.js +26 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/index.d.ts +2 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/index.js +1 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/ShopPromoView.d.ts +8 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/ShopPromoView.js +19 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/index.d.ts +1 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/index.js +1 -0
- package/dist/src/modules/shop/view/components/ShopSection/ShopSection.d.ts +23 -0
- package/dist/src/modules/shop/view/components/ShopSection/ShopSection.js +61 -0
- package/dist/src/modules/shop/view/components/ShopSection/index.d.ts +1 -0
- package/dist/src/modules/shop/view/components/ShopSection/index.js +1 -0
- package/dist/src/modules/shop/view/index.d.ts +2 -0
- package/dist/src/modules/shop/view/index.js +2 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.ShopPolling.d.ts +31 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.ShopPolling.js +111 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.d.ts +77 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.js +357 -0
- package/dist/src/modules/stats/interfaces/IStats.d.ts +226 -0
- package/dist/src/modules/stats/interfaces/IStats.js +1 -0
- package/dist/src/modules/stats/mocks.d.ts +2 -0
- package/dist/src/modules/stats/mocks.js +746 -0
- package/dist/src/modules/stats/utils/driveSummaryUtils.d.ts +18 -0
- package/dist/src/modules/stats/utils/driveSummaryUtils.js +48 -0
- package/dist/src/modules/stats/utils/renderTeamStatistic.d.ts +20 -0
- package/dist/src/modules/stats/utils/renderTeamStatistic.js +16 -0
- package/dist/src/modules/stats/utils.d.ts +39 -0
- package/dist/src/modules/stats/utils.js +62 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +22 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ActiveAthletes.js +98 -0
- package/dist/src/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +4 -0
- package/dist/src/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.js +27 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +22 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.js +89 -0
- package/dist/src/modules/stats/view/ActiveAthletes/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ActiveAthletes/index.js +2 -0
- package/dist/src/modules/stats/view/DriveSummary/DrivePlayCard.d.ts +106 -0
- package/dist/src/modules/stats/view/DriveSummary/DrivePlayCard.js +70 -0
- package/dist/src/modules/stats/view/DriveSummary/DriveSummary.d.ts +17 -0
- package/dist/src/modules/stats/view/DriveSummary/DriveSummary.js +87 -0
- package/dist/src/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.d.ts +27 -0
- package/dist/src/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.js +129 -0
- package/dist/src/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.d.ts +12 -0
- package/dist/src/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.js +26 -0
- package/dist/src/modules/stats/view/DriveSummary/MainStat/MainStat.d.ts +10 -0
- package/dist/src/modules/stats/view/DriveSummary/MainStat/MainStat.js +24 -0
- package/dist/src/modules/stats/view/DriveSummary/index.d.ts +2 -0
- package/dist/src/modules/stats/view/DriveSummary/index.js +2 -0
- package/dist/src/modules/stats/view/GameLeaders/GameLeaders.d.ts +21 -0
- package/dist/src/modules/stats/view/GameLeaders/GameLeaders.js +48 -0
- package/dist/src/modules/stats/view/GameLeaders/index.d.ts +2 -0
- package/dist/src/modules/stats/view/GameLeaders/index.js +2 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/DonutChart.d.ts +17 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/DonutChart.js +55 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/index.d.ts +2 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/index.js +1 -0
- package/dist/src/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +98 -0
- package/dist/src/modules/stats/view/MatchPredictor/MatchPredictorView.js +60 -0
- package/dist/src/modules/stats/view/MatchPredictor/index.d.ts +3 -0
- package/dist/src/modules/stats/view/MatchPredictor/index.js +2 -0
- package/dist/src/modules/stats/view/Penalties/Penalties.d.ts +9 -0
- package/dist/src/modules/stats/view/Penalties/Penalties.js +6 -0
- package/dist/src/modules/stats/view/Penalties/index.d.ts +2 -0
- package/dist/src/modules/stats/view/Penalties/index.js +2 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/ExpandedPlayerStats.d.ts +16 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/ExpandedPlayerStats.js +66 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsCard.d.ts +97 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsCard.js +23 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsMinified.d.ts +6 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsMinified.js +13 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsView.d.ts +8 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsView.js +148 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/index.d.ts +1 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/index.js +1 -0
- package/dist/src/modules/stats/view/RecentGames/RecentGames.d.ts +98 -0
- package/dist/src/modules/stats/view/RecentGames/RecentGames.js +23 -0
- package/dist/src/modules/stats/view/RecentGames/index.d.ts +2 -0
- package/dist/src/modules/stats/view/RecentGames/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.d.ts +30 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.js +123 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/ScoreItem.d.ts +98 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/ScoreItem.js +62 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/ScoresSection.d.ts +6 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/ScoresSection.js +23 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.d.ts +29 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.js +125 -0
- package/dist/src/modules/stats/view/ScoringSummary/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/index.js +2 -0
- package/dist/src/modules/stats/view/StatsItemView.d.ts +22 -0
- package/dist/src/modules/stats/view/StatsItemView.js +92 -0
- package/dist/src/modules/stats/view/StatsQRCode/StatsQRCodeView.d.ts +98 -0
- package/dist/src/modules/stats/view/StatsQRCode/StatsQRCodeView.js +36 -0
- package/dist/src/modules/stats/view/StatsQRCode/index.d.ts +2 -0
- package/dist/src/modules/stats/view/StatsQRCode/index.js +1 -0
- package/dist/src/modules/stats/view/StatsView.d.ts +27 -0
- package/dist/src/modules/stats/view/StatsView.js +137 -0
- package/dist/src/modules/stats/view/TeamStats/TeamStatsView.d.ts +98 -0
- package/dist/src/modules/stats/view/TeamStats/TeamStatsView.js +43 -0
- package/dist/src/modules/stats/view/TeamStats/index.d.ts +2 -0
- package/dist/src/modules/stats/view/TeamStats/index.js +1 -0
- package/dist/src/modules/stats/view/Teams/StatsCarousel.d.ts +25 -0
- package/dist/src/modules/stats/view/Teams/StatsCarousel.js +83 -0
- package/dist/src/modules/stats/view/Teams/StatsProgressBar.d.ts +6 -0
- package/dist/src/modules/stats/view/Teams/StatsProgressBar.js +19 -0
- package/dist/src/modules/stats/view/Teams/Teams.d.ts +98 -0
- package/dist/src/modules/stats/view/Teams/Teams.js +43 -0
- package/dist/src/modules/stats/view/Teams/index.d.ts +2 -0
- package/dist/src/modules/stats/view/Teams/index.js +2 -0
- package/dist/src/modules/stats/view/WinProbability/WinProbability.d.ts +98 -0
- package/dist/src/modules/stats/view/WinProbability/WinProbability.js +28 -0
- package/dist/src/modules/stats/view/WinProbability/index.d.ts +2 -0
- package/dist/src/modules/stats/view/WinProbability/index.js +2 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/AthletesStatistics.d.ts +113 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/AthletesStatistics.js +89 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/StatisticTable.d.ts +3 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/StatisticTable.js +12 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/index.d.ts +2 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/index.js +2 -0
- package/dist/src/modules/stats/view/index.d.ts +2 -0
- package/dist/src/modules/stats/view/index.js +2 -0
- package/dist/src/modules/stats/view-model/StatsViewModel.d.ts +241 -0
- package/dist/src/modules/stats/view-model/StatsViewModel.js +989 -0
- package/dist/src/sentry.d.ts +3 -0
- package/dist/src/sentry.js +31 -0
- package/dist/src/services/AnalyticsService/AnalyticsService.d.ts +84 -0
- package/dist/src/services/AnalyticsService/AnalyticsService.js +404 -0
- package/dist/src/services/AnalyticsService/types.d.ts +65 -0
- package/dist/src/services/AnalyticsService/types.js +1 -0
- package/dist/src/services/BetsService.d.ts +81 -0
- package/dist/src/services/BetsService.js +122 -0
- package/dist/src/services/FantasyService.d.ts +53 -0
- package/dist/src/services/FantasyService.js +92 -0
- package/dist/src/services/InsightsService/InsightsPayloadBuilder.d.ts +279 -0
- package/dist/src/services/InsightsService/InsightsPayloadBuilder.js +386 -0
- package/dist/src/services/InsightsService/InsightsService.d.ts +11 -0
- package/dist/src/services/InsightsService/InsightsService.js +74 -0
- package/dist/src/services/NetworkManager/NetworkManager.d.ts +147 -0
- package/dist/src/services/NetworkManager/NetworkManager.js +457 -0
- package/dist/src/services/NetworkManager/NetworkManagerFactory.d.ts +42 -0
- package/dist/src/services/NetworkManager/NetworkManagerFactory.js +101 -0
- package/dist/src/services/NetworkManager/errors.d.ts +17 -0
- package/dist/src/services/NetworkManager/errors.js +45 -0
- package/dist/src/services/NetworkManager/types.d.ts +103 -0
- package/dist/src/services/NetworkManager/types.js +10 -0
- package/dist/src/services/ShopService.d.ts +23 -0
- package/dist/src/services/ShopService.js +46 -0
- package/dist/src/services/StaticService/StaticService.d.ts +12 -0
- package/dist/src/services/StaticService/StaticService.js +59 -0
- package/dist/src/services/StaticService/index.d.ts +2 -0
- package/dist/src/services/StaticService/index.js +2 -0
- package/dist/src/services/StaticService/mocks.d.ts +2 -0
- package/dist/src/services/StaticService/mocks.js +104 -0
- package/dist/src/services/StaticService/types.d.ts +76 -0
- package/dist/src/services/StaticService/types.js +1 -0
- package/dist/src/services/StatsService.d.ts +46 -0
- package/dist/src/services/StatsService.js +147 -0
- package/dist/src/services/ThemeManager/constants.d.ts +2 -0
- package/dist/src/services/ThemeManager/constants.js +47 -0
- package/dist/src/services/UserSettingsManager.d.ts +63 -0
- package/dist/src/services/UserSettingsManager.js +155 -0
- package/dist/src/test-polyfills.d.ts +1 -0
- package/dist/src/test-polyfills.js +15 -0
- package/dist/src/types/OverlayTypes.d.ts +43 -0
- package/dist/src/types/OverlayTypes.js +4 -0
- package/dist/src/view-models/MaestroEventViewModel.d.ts +63 -0
- package/dist/src/view-models/MaestroEventViewModel.js +304 -0
- package/dist/src/view-models/OverlayViewModel.d.ts +33 -0
- package/dist/src/view-models/OverlayViewModel.js +222 -0
- package/dist/src/view-models/PanelManagerViewModel.d.ts +46 -0
- package/dist/src/view-models/PanelManagerViewModel.js +212 -0
- package/dist/src/view-models/ViewModel.d.ts +12 -0
- package/dist/src/view-models/ViewModel.js +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { captureException } from '@/sentry';
|
|
2
|
+
import { stringHashCode } from '@/helpers/strings';
|
|
3
|
+
const DEFAULT_SHOP_POLLING_INTERVAL = 30000; // 30 seconds
|
|
4
|
+
export default class ShopPolling {
|
|
5
|
+
constructor(service) {
|
|
6
|
+
Object.defineProperty(this, "polling", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: {
|
|
11
|
+
interval: DEFAULT_SHOP_POLLING_INTERVAL,
|
|
12
|
+
task: null,
|
|
13
|
+
lastResponseHash: null,
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "shopService", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: void 0
|
|
21
|
+
});
|
|
22
|
+
this.shopService = service;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Refresh polling for shop data
|
|
26
|
+
*/
|
|
27
|
+
refresh(callback) {
|
|
28
|
+
// First stop any existing polling
|
|
29
|
+
this.stop();
|
|
30
|
+
// Start the poll loop
|
|
31
|
+
this.start(callback);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Stop polling for shop data
|
|
35
|
+
*/
|
|
36
|
+
stop() {
|
|
37
|
+
if (this.polling.task) {
|
|
38
|
+
this.polling.task.stop();
|
|
39
|
+
this.polling.task = null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
removeLastResponseHash() {
|
|
43
|
+
this.polling.lastResponseHash = null;
|
|
44
|
+
}
|
|
45
|
+
start(callback) {
|
|
46
|
+
try {
|
|
47
|
+
this.polling.task = this.shopService.pollShopData(this.polling.interval, (response) => {
|
|
48
|
+
this.updateInterval(response.headers, callback);
|
|
49
|
+
this.processPolledData(response.data, callback);
|
|
50
|
+
}, (error) => this.handlePollingError(error));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
captureException(error, {
|
|
54
|
+
context: 'ShopViewModel.pollShop',
|
|
55
|
+
});
|
|
56
|
+
console.error('[SHOP] Error setting up shop polling:', error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @description Update polling interval checking either response header or panel config.
|
|
61
|
+
* Refresh polling if necessary.
|
|
62
|
+
*/
|
|
63
|
+
updateInterval(headers, callback) {
|
|
64
|
+
const headerInterval = this.getResponseHeaderPollingIntervalValue(headers);
|
|
65
|
+
// Only update if we have a valid new interval and it's different from current
|
|
66
|
+
if (headerInterval && headerInterval !== this.polling.interval) {
|
|
67
|
+
console.log(`[SHOP] Updating shop polling interval from ${this.polling.interval}ms to ${headerInterval}ms`);
|
|
68
|
+
this.polling.interval = headerInterval;
|
|
69
|
+
// Restart polling with the new interval
|
|
70
|
+
this.refresh(callback);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
getResponseHeaderPollingIntervalValue(headers) {
|
|
74
|
+
const newInterval = headers['polling-interval'];
|
|
75
|
+
if (!newInterval) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const parsedInterval = parseInt(newInterval, 10);
|
|
79
|
+
if (isNaN(parsedInterval) || parsedInterval <= 0) {
|
|
80
|
+
console.warn(`[SHOP] Invalid polling interval header received: ${newInterval}.`);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return parsedInterval * 1000; // Convert seconds to milliseconds
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Process data received from polling
|
|
87
|
+
*/
|
|
88
|
+
processPolledData(data, callback) {
|
|
89
|
+
// Calculate hash for the response to check if it's different from the last one
|
|
90
|
+
const responseHash = stringHashCode(JSON.stringify(data));
|
|
91
|
+
// Check if this is the same as the last successful response
|
|
92
|
+
if (this.polling.lastResponseHash === responseHash) {
|
|
93
|
+
console.log('[SHOP] Shop Response hash is the same as last successful response - skipping update');
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.polling.lastResponseHash = responseHash;
|
|
97
|
+
callback(data);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Handle errors that occur during shop polling
|
|
101
|
+
*/
|
|
102
|
+
handlePollingError(error) {
|
|
103
|
+
console.error('[SHOP] Shop polling error:', error);
|
|
104
|
+
captureException(error, {
|
|
105
|
+
context: 'ShopViewModel.pollShop',
|
|
106
|
+
extra: {
|
|
107
|
+
pollingInterval: this.polling.interval,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Observable } from '../../../helpers/Observable';
|
|
2
|
+
import { ViewModel } from '../../../view-models/ViewModel';
|
|
3
|
+
import { IShopSection, IShopProduct, IShopBrowseCard, IShopDefaultItem } from '../types';
|
|
4
|
+
import { TestUseCase } from '@/interfaces/IMaestroEvent';
|
|
5
|
+
declare const SHOP_ERROR_STATE: {
|
|
6
|
+
readonly NONE: "none";
|
|
7
|
+
readonly TAB_LOAD_FAILURE: "tabLoadFailure";
|
|
8
|
+
readonly EMPTY_SHOP: "emptyShop";
|
|
9
|
+
};
|
|
10
|
+
export type ShopErrorState = typeof SHOP_ERROR_STATE[keyof typeof SHOP_ERROR_STATE];
|
|
11
|
+
/**
|
|
12
|
+
* ViewModel for Shop panel
|
|
13
|
+
* Manages shop data fetching, polling, and state
|
|
14
|
+
*/
|
|
15
|
+
export declare class ShopViewModel extends ViewModel {
|
|
16
|
+
sections: Observable<IShopSection[]>;
|
|
17
|
+
isDataLoading: Observable<boolean>;
|
|
18
|
+
errorState: Observable<ShopErrorState>;
|
|
19
|
+
hasEverSuccessfullyLoaded: Observable<boolean>;
|
|
20
|
+
promoData: Observable<IShopDefaultItem | null>;
|
|
21
|
+
private shopService;
|
|
22
|
+
private analyticsService;
|
|
23
|
+
private shopPolling;
|
|
24
|
+
private useMockData;
|
|
25
|
+
private mockDataType;
|
|
26
|
+
initialized: boolean;
|
|
27
|
+
constructor(eventId: string, options?: {
|
|
28
|
+
useMockData?: boolean;
|
|
29
|
+
mockDataType?: 'nfl' | 'nba' | 'ncf' | 'empty' | 'single';
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Initialize the ViewModel and start data fetching
|
|
33
|
+
*/
|
|
34
|
+
init(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Clean up resources when the ViewModel is no longer needed
|
|
37
|
+
*/
|
|
38
|
+
cleanup(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Track panel view event
|
|
41
|
+
*/
|
|
42
|
+
private trackPanelView;
|
|
43
|
+
/**
|
|
44
|
+
* Parse price string to number, handling currency formats
|
|
45
|
+
*/
|
|
46
|
+
private parsePriceToNumber;
|
|
47
|
+
/**
|
|
48
|
+
* Track shop item card click event
|
|
49
|
+
*/
|
|
50
|
+
trackItemClick(card: 'product_summary' | 'want more' | 'product_detail' | 'fallback', item: IShopProduct | IShopBrowseCard | null, section: IShopSection | null): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Refresh polling for shop data
|
|
53
|
+
*/
|
|
54
|
+
refreshPolling(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Process the shop data and update the sections
|
|
57
|
+
*/
|
|
58
|
+
private processShopData;
|
|
59
|
+
setTabLoadFailure(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Fetch new shop data immediately (one-time)
|
|
62
|
+
*/
|
|
63
|
+
fetchNewData(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch mock data for testing
|
|
66
|
+
*/
|
|
67
|
+
private fetchMockData;
|
|
68
|
+
/**
|
|
69
|
+
* Simulate different use cases for testing
|
|
70
|
+
*/
|
|
71
|
+
simulateUseCase<T = any>(useCase: TestUseCase, data: T): void;
|
|
72
|
+
/**
|
|
73
|
+
* Clear tab load failure and retry
|
|
74
|
+
*/
|
|
75
|
+
clearTabLoadFailure(): void;
|
|
76
|
+
}
|
|
77
|
+
export default ShopViewModel;
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { Observable } from '../../../helpers/Observable';
|
|
2
|
+
import ShopService from '../../../services/ShopService';
|
|
3
|
+
import AnalyticsService from '../../../services/AnalyticsService/AnalyticsService';
|
|
4
|
+
import { ViewModel } from '../../../view-models/ViewModel';
|
|
5
|
+
import { isShopProduct, } from '../types';
|
|
6
|
+
import { MOCK_SHOP_NFL_RESPONSE, MOCK_SHOP_NBA_RESPONSE, MOCK_SHOP_NCF_RESPONSE, MOCK_SHOP_EMPTY_RESPONSE, MOCK_SHOP_SINGLE_SECTION_RESPONSE, } from '../mocks';
|
|
7
|
+
import { captureException } from '@/sentry';
|
|
8
|
+
import ShopPolling from './ShopViewModel.ShopPolling';
|
|
9
|
+
import SDK from '@/index';
|
|
10
|
+
const SHOP_ERROR_STATE = {
|
|
11
|
+
NONE: 'none',
|
|
12
|
+
TAB_LOAD_FAILURE: 'tabLoadFailure',
|
|
13
|
+
EMPTY_SHOP: 'emptyShop',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* ViewModel for Shop panel
|
|
17
|
+
* Manages shop data fetching, polling, and state
|
|
18
|
+
*/
|
|
19
|
+
export class ShopViewModel extends ViewModel {
|
|
20
|
+
constructor(eventId, options = {}) {
|
|
21
|
+
super();
|
|
22
|
+
// Observable properties
|
|
23
|
+
Object.defineProperty(this, "sections", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: new Observable([])
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "isDataLoading", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: new Observable(true)
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "errorState", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: new Observable('none')
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "hasEverSuccessfullyLoaded", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: new Observable(false)
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(this, "promoData", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: new Observable(null)
|
|
52
|
+
});
|
|
53
|
+
// Properties
|
|
54
|
+
Object.defineProperty(this, "shopService", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: void 0
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(this, "analyticsService", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: void 0
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(this, "shopPolling", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: void 0
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(this, "useMockData", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: false
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(this, "mockDataType", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
value: 'nfl'
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(this, "initialized", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: false
|
|
89
|
+
});
|
|
90
|
+
this.shopService = new ShopService(eventId);
|
|
91
|
+
this.analyticsService = new AnalyticsService();
|
|
92
|
+
this.shopPolling = new ShopPolling(this.shopService);
|
|
93
|
+
this.useMockData = options.useMockData || false;
|
|
94
|
+
this.mockDataType = options.mockDataType || 'nfl';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Initialize the ViewModel and start data fetching
|
|
98
|
+
*/
|
|
99
|
+
init() {
|
|
100
|
+
// Track panel view on initialization
|
|
101
|
+
this.trackPanelView();
|
|
102
|
+
this.fetchNewData();
|
|
103
|
+
this.initialized = true;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Clean up resources when the ViewModel is no longer needed
|
|
107
|
+
*/
|
|
108
|
+
cleanup() {
|
|
109
|
+
this.shopPolling.stop();
|
|
110
|
+
this.initialized = false;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Track panel view event
|
|
114
|
+
*/
|
|
115
|
+
async trackPanelView() {
|
|
116
|
+
try {
|
|
117
|
+
const gameState = SDK.getMaestroEventViewModel().statsViewModel?.currentGameState.value ||
|
|
118
|
+
'unknown';
|
|
119
|
+
await this.analyticsService.panelView('espnShop', {
|
|
120
|
+
game_state: [gameState],
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
captureException(error, {
|
|
125
|
+
context: 'ShopViewModel.trackPanelView',
|
|
126
|
+
});
|
|
127
|
+
console.error('[SHOP] Error tracking panel view:', error);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Parse price string to number, handling currency formats
|
|
132
|
+
*/
|
|
133
|
+
parsePriceToNumber(priceString) {
|
|
134
|
+
// Remove currency symbols and spaces
|
|
135
|
+
const cleaned = priceString.replace(/[^0-9.,]/g, '');
|
|
136
|
+
// Find the last occurrence of comma or dot (decimal separator)
|
|
137
|
+
const lastComma = cleaned.lastIndexOf(',');
|
|
138
|
+
const lastDot = cleaned.lastIndexOf('.');
|
|
139
|
+
let normalized;
|
|
140
|
+
if (lastComma > lastDot) {
|
|
141
|
+
// EU format: €1.234,56 -> comma is decimal separator
|
|
142
|
+
normalized = cleaned.replace(/\./g, '').replace(',', '.');
|
|
143
|
+
}
|
|
144
|
+
else if (lastDot > lastComma) {
|
|
145
|
+
// US format: $1,234.56 -> dot is decimal separator
|
|
146
|
+
normalized = cleaned.replace(/,/g, '');
|
|
147
|
+
}
|
|
148
|
+
else if (lastComma !== -1) {
|
|
149
|
+
// Only comma present, assume decimal: €25,00
|
|
150
|
+
normalized = cleaned.replace(',', '.');
|
|
151
|
+
}
|
|
152
|
+
else if (lastDot !== -1) {
|
|
153
|
+
// Only dot present, assume decimal: $25.00
|
|
154
|
+
normalized = cleaned;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
// No separators: 25
|
|
158
|
+
normalized = cleaned;
|
|
159
|
+
}
|
|
160
|
+
return Number(normalized) || 0;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Track shop item card click event
|
|
164
|
+
*/
|
|
165
|
+
async trackItemClick(card, item, section) {
|
|
166
|
+
try {
|
|
167
|
+
let sale = 0;
|
|
168
|
+
let price = null;
|
|
169
|
+
const gameState = SDK.getMaestroEventViewModel().statsViewModel?.currentGameState.value ||
|
|
170
|
+
'unknown';
|
|
171
|
+
if (item && isShopProduct(item)) {
|
|
172
|
+
const basePrice = item.price?.displayRetail;
|
|
173
|
+
const currentPrice = item.price?.displayClearance ||
|
|
174
|
+
item.price?.displaySale ||
|
|
175
|
+
item.price?.displayRetail;
|
|
176
|
+
if (currentPrice && basePrice) {
|
|
177
|
+
const basePriceNumber = this.parsePriceToNumber(basePrice);
|
|
178
|
+
const salePriceNumber = this.parsePriceToNumber(currentPrice);
|
|
179
|
+
if (basePriceNumber > 0) {
|
|
180
|
+
sale = Math.round((1 - salePriceNumber / basePriceNumber) * 100);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
sale = 0;
|
|
184
|
+
}
|
|
185
|
+
price = currentPrice;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
await this.analyticsService.panelClick({
|
|
189
|
+
type: 'espnShop',
|
|
190
|
+
name: 'shop_item_clicked',
|
|
191
|
+
metadata: {
|
|
192
|
+
card: [card],
|
|
193
|
+
game_state: [gameState],
|
|
194
|
+
product: section?.product?.id || null,
|
|
195
|
+
entity_type: [section?.product?.type || 'unknown'],
|
|
196
|
+
entity_name: [section?.product?.shortDisplayName || 'unknown'],
|
|
197
|
+
price,
|
|
198
|
+
sale: [`${sale}%`],
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
captureException(error, {
|
|
204
|
+
context: 'ShopViewModel.trackItemClick',
|
|
205
|
+
item,
|
|
206
|
+
section,
|
|
207
|
+
});
|
|
208
|
+
console.error('[SHOP] Error tracking shop item click:', error);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Refresh polling for shop data
|
|
213
|
+
*/
|
|
214
|
+
refreshPolling() {
|
|
215
|
+
try {
|
|
216
|
+
if (this.useMockData) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.shopPolling.refresh(this.processShopData.bind(this));
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
this.setTabLoadFailure();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Process the shop data and update the sections
|
|
227
|
+
*/
|
|
228
|
+
processShopData(data) {
|
|
229
|
+
try {
|
|
230
|
+
const shop = data.shop?.[0];
|
|
231
|
+
const sections = shop?.sections || [];
|
|
232
|
+
// Check if there are any sections
|
|
233
|
+
if (!sections?.length && shop?.defaultItem) {
|
|
234
|
+
this.errorState.value = 'emptyShop';
|
|
235
|
+
this.sections.value = [];
|
|
236
|
+
this.promoData.value = shop.defaultItem;
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
// Update sections and clear error state
|
|
240
|
+
this.sections.value = sections;
|
|
241
|
+
this.errorState.value = 'none';
|
|
242
|
+
this.hasEverSuccessfullyLoaded.value = true;
|
|
243
|
+
if (this.isDataLoading.value) {
|
|
244
|
+
this.isDataLoading.value = false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
catch (err) {
|
|
248
|
+
captureException(err, {
|
|
249
|
+
context: 'ShopViewModel.processShopData',
|
|
250
|
+
});
|
|
251
|
+
console.error('[SHOP] Error processing shop data:', err);
|
|
252
|
+
this.setTabLoadFailure();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
setTabLoadFailure() {
|
|
256
|
+
if (!this.hasEverSuccessfullyLoaded.value) {
|
|
257
|
+
this.errorState.value = 'tabLoadFailure';
|
|
258
|
+
this.sections.value = [];
|
|
259
|
+
}
|
|
260
|
+
if (this.isDataLoading.value) {
|
|
261
|
+
this.isDataLoading.value = false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Fetch new shop data immediately (one-time)
|
|
266
|
+
*/
|
|
267
|
+
fetchNewData() {
|
|
268
|
+
this.isDataLoading.value = true;
|
|
269
|
+
try {
|
|
270
|
+
// Handle mock data if enabled
|
|
271
|
+
if (this.useMockData) {
|
|
272
|
+
this.sections.value = [];
|
|
273
|
+
this.fetchMockData();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
this.refreshPolling();
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
captureException(error, {
|
|
280
|
+
context: 'ShopViewModel.fetchNewData',
|
|
281
|
+
});
|
|
282
|
+
console.error('[SHOP] Error fetching shop data:', error);
|
|
283
|
+
this.setTabLoadFailure();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Fetch mock data for testing
|
|
288
|
+
*/
|
|
289
|
+
fetchMockData() {
|
|
290
|
+
let mockData;
|
|
291
|
+
switch (this.mockDataType) {
|
|
292
|
+
case 'nba':
|
|
293
|
+
mockData = MOCK_SHOP_NBA_RESPONSE;
|
|
294
|
+
break;
|
|
295
|
+
case 'ncf':
|
|
296
|
+
mockData = MOCK_SHOP_NCF_RESPONSE;
|
|
297
|
+
break;
|
|
298
|
+
case 'empty':
|
|
299
|
+
mockData = MOCK_SHOP_EMPTY_RESPONSE;
|
|
300
|
+
break;
|
|
301
|
+
case 'single':
|
|
302
|
+
mockData = MOCK_SHOP_SINGLE_SECTION_RESPONSE;
|
|
303
|
+
break;
|
|
304
|
+
case 'nfl':
|
|
305
|
+
default:
|
|
306
|
+
mockData = MOCK_SHOP_NFL_RESPONSE;
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
this.processShopData(mockData);
|
|
310
|
+
this.hasEverSuccessfullyLoaded.value = true;
|
|
311
|
+
this.isDataLoading.value = false;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Simulate different use cases for testing
|
|
315
|
+
*/
|
|
316
|
+
simulateUseCase(useCase, data) {
|
|
317
|
+
switch (useCase) {
|
|
318
|
+
case 'shopTabLoadFailure':
|
|
319
|
+
this.errorState.value = 'tabLoadFailure';
|
|
320
|
+
this.sections.value = [];
|
|
321
|
+
break;
|
|
322
|
+
case 'shopEmptyState':
|
|
323
|
+
this.errorState.value = 'emptyShop';
|
|
324
|
+
this.sections.value = [];
|
|
325
|
+
break;
|
|
326
|
+
case 'shopMockData':
|
|
327
|
+
this.shopPolling.stop();
|
|
328
|
+
this.useMockData = true;
|
|
329
|
+
this.mockDataType = data?.mockDataType || 'nfl';
|
|
330
|
+
this.shopPolling.removeLastResponseHash();
|
|
331
|
+
this.errorState.value = 'none';
|
|
332
|
+
this.fetchNewData();
|
|
333
|
+
break;
|
|
334
|
+
case 'shopLiveData':
|
|
335
|
+
this.useMockData = false;
|
|
336
|
+
this.shopPolling.removeLastResponseHash();
|
|
337
|
+
this.hasEverSuccessfullyLoaded.value = false;
|
|
338
|
+
this.errorState.value = 'none';
|
|
339
|
+
this.fetchNewData();
|
|
340
|
+
this.refreshPolling();
|
|
341
|
+
break;
|
|
342
|
+
default:
|
|
343
|
+
throw new Error(`Unsupported use case: ${useCase}`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Clear tab load failure and retry
|
|
348
|
+
*/
|
|
349
|
+
clearTabLoadFailure() {
|
|
350
|
+
this.errorState.value = 'none';
|
|
351
|
+
this.shopPolling.removeLastResponseHash();
|
|
352
|
+
setTimeout(() => {
|
|
353
|
+
this.refreshPolling();
|
|
354
|
+
}, 100);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
export default ShopViewModel;
|