{"version":3,"file":"js/react/mls-previous-matches-app.js?_t=e63e79ec92d257af450f","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAGA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAWA;AAEA;AAMA;AAUA;AAEA;;;;;;;;;;;;;;;;AChEA;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAoBA;AAEA;;;;;;;;;;;;;;;;AC9CA;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AAAA;AAGA;AAKA;AAEA;;;;;;;;;;;;;;;;AC1CA;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AAEA;AACA;AACA;AAOA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AA4BA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAcA;AAcA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAGA;AAAA;AAAA;AACA;AAAA;AAUA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAGA;AAAA;AAAA;AACA;AAAA;AAQA;AAQA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAGA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AA2CA;AAAA;AAAA;AACA;AAAA;AAAA;AAQA;AAAA;AAAA;AACA;AAAA;AAAA;AAwCA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAWA;AAGA;AAEA;;;;;;;;;;;;;;;;AC/LA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAGA;AAGA;AAEA;;;;;;;;;;;;;;;;AC3BA","sources":["webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/Broadcasters/Broadcasters.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/Broadcasters/index.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/Match/Match.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/Match/index.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/MatchShootout/MatchShootout.js","webpack://@mlssoccer/netcore/./scripts/react/mls-previous-matches/app.js","webpack://@mlssoccer/netcore/./scripts/react/mls-previous-matches/loader.js","webpack://@mlssoccer/netcore/./scripts/react/mls-previous-matches/main.js","webpack://@mlssoccer/netcore/./scripts/react/shared/svg/BroadcastIcon/BroadcastIcon.js","webpack://@mlssoccer/netcore/./scripts/react/shared/svg/BroadcastIcon/index.js"],"sourcesContent":["import React from 'react';\nimport BroadcastIcon from \"../../../shared/svg/BroadcastIcon\";\nimport { listTypes, statusTypes, useMatchData } from \"../../utils\";\nimport { composeGeoLocatedProviders } from \"../../../shared/utils\";\nimport { useReactAppState } from \"../../../shared/containers/utils\";\n\nconst Broadcasters = () => {\n const { location } = useReactAppState();\n const { mediaProviders, listType, status } = useMatchData();\n if (listType !== listTypes.matches) {\n return null;\n }\n\n const { country } = location || {};\n\n const { homeLinear, awayLinear, homeStreaming, awayStreaming, clubLinear, clubStreaming, clubRadio } = mediaProviders || {};\n\n const { national, streaming, radio } = composeGeoLocatedProviders(mediaProviders, country);\n const mergedProviders = [\n ...national,\n ...streaming,\n ...radio,\n ...(homeLinear != null ? homeLinear : []),\n ...(awayLinear != null ? awayLinear : []),\n ...(homeStreaming != null ? homeStreaming : []),\n ...(awayStreaming != null ? awayStreaming : []),\n ...(clubLinear != null ? clubLinear : []),\n ...(clubStreaming != null ? clubStreaming : []),\n ...(clubRadio != null ? clubRadio : []),\n ];\n\n const showBroadcasters = status?.abbreviation !== statusTypes.post && mergedProviders && mergedProviders.length > 0;\n\n return (\n
\n {\n showBroadcasters\n ? (\n <>\n \n \n \n {\n mergedProviders.map((provider, index) => {\n const { broadcasterName } = provider || {};\n\n return (\n broadcasterName != null\n ? (\n \n {`${broadcasterName}${index < mergedProviders.length - 1 ? \",\" : \"\"}`}\n \n ) : null\n );\n })\n }\n \n )\n : null\n }\n
\n );\n};\n\nexport default Broadcasters;\n","export { default } from './Broadcasters';\n","import React from 'react';\nimport ClubSeparator from \"../ClubSeparator\";\nimport Club from '../Club';\nimport Broadcasters from \"../Broadcasters\";\nimport MatchTime from \"../MatchTime\";\nimport MatchWatch from \"../MatchWatch\";\nimport { useMatchData, formatScores, listTypes } from \"../../utils\";\nimport { trackMatchInteraction } from '../../../../libraries/_modules/tracking/helpers';\nimport MatchShootout from \"../MatchShootout/MatchShootout\";\n\nconst Match = ({ includeMatchWatch = false, includeBroadcasters = false, isFullDate = false, includeTitle = false, position }) => {\n const { homeClubData, awayClubData, listType, references, status, leagueMatchTitle, competition, winnerStatus, period, resultType } = useMatchData();\n\n const { name: competitionName } = competition || {};\n const title = leagueMatchTitle ? leagueMatchTitle : competitionName;\n\n const { homeScore, awayScore } = formatScores({\n homeClubData,\n awayClubData,\n period,\n resultType\n });\n const { isHomeWinner, isAwayWinner } = winnerStatus || {};\n\n return (\n <>\n
\n
\n {\n title && includeTitle\n ?

{title}

\n : null\n }\n \n \n \n \n {includeMatchWatch ? : null}\n {listType === listTypes.tv ? null : }\n
\n
\n {includeBroadcasters ? : null}\n \n );\n};\n\nexport default Match;\n","export { default } from './Match';\n","import { formatScores, useMatchData, composeAggregate } from \"../../utils\";\nimport React from \"react\";\nimport { d3AggregateAPI } from \"../../../shared/api/variables\";\nimport { useQuery } from \"react-query\";\nimport { fetchClient } from \"../../../shared/api/fetching\";\nimport { useReactAppState } from \"../../../shared/containers/utils\";\n\nfunction MatchShootout() {\n const { apiList } = useReactAppState();\n const { d3SportsAPI } = apiList || {};\n const { homeClubData, awayClubData, period, resultType, queryConfig, matchOptaId, competition } = useMatchData();\n\n const d3AggregateEndpoint = d3AggregateAPI({ matchOptaId });\n const { data: aggregateData, isLoading } = useQuery({\n queryKey: [`d3-aggregate`, { matchOptaId }],\n queryFn: () => fetchClient({ endpoint: d3AggregateEndpoint, apiURL: d3SportsAPI }),\n ...queryConfig,\n enabled: !!(matchOptaId) && (competition?.optaId == 549 || (competition?.optaId == 98 && competition?.matchType === \"Cup\"))\n });\n\n const { aggregate, date } = aggregateData || {};\n\n const composedAggregate = composeAggregate(aggregate, date);\n\n const { shootoutResult } = formatScores({\n homeClubData,\n awayClubData,\n period,\n resultType\n });\n\n if (isLoading) {\n return null;\n }\n\n return (\n composedAggregate || shootoutResult\n ?
{composedAggregate || shootoutResult}
\n : null\n );\n}\n\nexport default MatchShootout;\n","export { default } from './main';\n","import React from 'react';\nimport Picture from \"../shared/components/Picture\";\nimport { useReactAppState } from \"../shared/containers/utils\";\n\nconst PreviousMatchesLoader = () => {\n const { t } = useReactAppState();\n return (\n
\n
{t('match_details')}
\n
\n
\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n \n
\n \n
\n
\n\n
\n
\n
\n
\n {\n [...Array(3)].map((m, index) => {\n return (\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n );\n })\n }\n
\n
\n
\n );\n};\n\nexport default PreviousMatchesLoader;\n","import React, { useState } from 'react';\nimport { useQuery } from \"react-query\";\nimport { apiURL, d3PreviousMatchesAPI } from \"../shared/api/variables\";\nimport { fetchClient } from \"../shared/api/fetching\";\nimport ErrorDisplay from \"../shared/components/ErrorDisplay\";\nimport { listTypes, statusTypes } from \"../mls-match-list/utils\";\nimport Picture from \"../shared/components/Picture\";\nimport MatchStrip from \"../mls-match-list/components/MatchStrip\";\nimport Match from \"../mls-match-list/components/Match\";\nimport { formatImageUrl } from \"../shared/utils\";\nimport { useMatchStatus } from \"../shared/hooks/useMatchStatus\";\nimport { useReactAppState } from \"../shared/containers/utils\";\nimport PreviousMatchesLoader from \"./loader\";\n\nfunction PreviousMatches({ options }) {\n const { match: appMatch, mediaQueries, t, matchStatusOverride, urlList, isLeague } = useReactAppState();\n const { isMediumLargeMin } = mediaQueries || {};\n const { baseUrl } = urlList || {};\n const [matchOptaId] = [options.matchOptaId || appMatch?.optaId];\n const [previousMatchesCount] = useState(options.previousMatchesCount || 3);\n const [home] = useState(options.home);\n const [away] = useState(options.away);\n const [matchDate] = useState(options.matchDate);\n\n const { mlsMatch, error, isLoading, isError, status: matchStatus } = useMatchStatus({\n initialState: {\n matchOptaId\n }\n });\n\n const status = matchStatusOverride?.abbreviation ? matchStatusOverride : matchStatus;\n\n const { logoColorUrl: homeLogoColorUrl, slug: homeSlug } = home || {};\n const { logoColorUrl: awayLogoColorUrl, slug: awaySlug } = away || {};\n\n const { highQuality: homeClubLogoSrc } = homeLogoColorUrl ? formatImageUrl(homeLogoColorUrl, { format: \"w_128,h_128,c_pad\", extension: \"f_png\" }) : {};\n const { highQuality: awayClubLogoSrc } = awayLogoColorUrl ? formatImageUrl(awayLogoColorUrl, { format: \"w_128,h_128,c_pad\", extension: \"f_png\" }) : {};\n\n const { abbreviation: homeAbbrev, fullName: homeFullName, shortName: homeShortName, optaId: homeOptaId } = home || {};\n const { abbreviation: awayAbbrev, fullName: awayFullName, shortName: awayShortName, optaId: awayOptaId } = away || {};\n\n const availableHomeShortName = homeShortName ? homeShortName : homeFullName;\n const availableAwayShortName = awayShortName ? awayShortName : awayFullName;\n const previousMatchesEndPoint = d3PreviousMatchesAPI({ homeOptaId, awayOptaId, previousMatchesCount, matchDate });\n\n const {\n isLoading: isLoadingPrevious,\n isError: isErrorPrevious,\n data: matchesData,\n error: matchesError,\n } = useQuery({\n queryKey: [`d3-previous-matches`, { matchOptaId, previousMatchesCount }],\n queryFn: () => fetchClient({ endpoint: previousMatchesEndPoint, apiURL: apiURL.d3SportsAPI }),\n enabled: !!(matchDate && mlsMatch)\n });\n\n const {\n draws,\n firstClubWins,\n previousMatches,\n secondClubWins,\n firstClubFormGuide,\n secondClubFormGuide\n } = matchesData || {};\n\n if (status?.abbreviation !== statusTypes.pre) {\n return null;\n }\n\n if (!matchOptaId) {\n return null;\n }\n\n return (\n isLoading || isLoadingPrevious\n ? \n : isError || isErrorPrevious\n ? \n : previousMatches && previousMatches.length > 0\n ? (\n
\n
{t('match_details')}
\n
\n
\n
\n
\n {isLeague ?\n \n \n \n :\n \n }\n
\n
\n {\n isMediumLargeMin\n ? (\n
\n {availableHomeShortName}\n
\n )\n :\n (\n
\n {homeAbbrev}\n
\n )\n }\n
\n {firstClubFormGuide}\n
\n
\n
\n
\n
\n {`${isMediumLargeMin ? `${homeAbbrev} Wins` : homeAbbrev}`}
\n
{firstClubWins}
\n
\n
\n
{t(\"match_draws\")}
\n
{draws}
\n
\n
\n {`${isMediumLargeMin ? `${awayAbbrev} Wins` : awayAbbrev}`}
\n
{secondClubWins}
\n
\n
\n
\n
\n {isLeague ?\n \n \n \n :\n \n }\n
\n
\n {\n isMediumLargeMin\n ? (\n
\n {availableAwayShortName}\n
\n )\n :\n (\n
\n {awayAbbrev}\n
\n )\n }\n
\n {secondClubFormGuide}\n
\n
\n
\n
\n
\n
{t(`last_${previousMatchesCount}_matches`)}
\n
\n {\n previousMatches.map((p, index) => {\n const { optaId } = p || {};\n return (\n \n \n \n );\n })\n }\n
\n
\n
\n
\n )\n : null\n );\n}\n\n// eslint-disable-next-line no-func-assign\nPreviousMatches = React.memo(PreviousMatches);\n\nexport default PreviousMatches;\n","import React from 'react';\n\nconst BroadcastIcon = ({ extraClasses, size = \"small\" }) => {\n return (\n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default BroadcastIcon;\n","export { default } from './BroadcastIcon';\n"],"names":[],"sourceRoot":""}