@clickview/lite 0.103.1 → 0.103.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 (52) hide show
  1. package/dist/.vite/manifest.json +271 -271
  2. package/dist/bundles.json +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{igSDXA6g.chunk.js → 1WHinyQW.chunk.js} +2 -2
  5. package/dist/scripts/{igSDXA6g.chunk.js.map → 1WHinyQW.chunk.js.map} +1 -1
  6. package/dist/scripts/{kMWvzbRv2.chunk.js → B1ag1ah72.chunk.js} +2 -2
  7. package/dist/scripts/{kMWvzbRv2.chunk.js.map → B1ag1ah72.chunk.js.map} +1 -1
  8. package/dist/scripts/{D2_GYzlb.chunk.js → B6Pc3q-u.chunk.js} +2 -2
  9. package/dist/scripts/{D2_GYzlb.chunk.js.map → B6Pc3q-u.chunk.js.map} +1 -1
  10. package/dist/scripts/{sCuSDiER2.chunk.js → BPbjSFkC2.chunk.js} +2 -2
  11. package/dist/scripts/{sCuSDiER2.chunk.js.map → BPbjSFkC2.chunk.js.map} +1 -1
  12. package/dist/scripts/{CNm_4jj62.chunk.js → BZFomoIH2.chunk.js} +2 -2
  13. package/dist/scripts/BZFomoIH2.chunk.js.map +1 -0
  14. package/dist/scripts/{CW_rYB-i2.chunk.js → BazdM9Ah2.chunk.js} +2 -2
  15. package/dist/scripts/{CW_rYB-i2.chunk.js.map → BazdM9Ah2.chunk.js.map} +1 -1
  16. package/dist/scripts/{BcPrUEuC2.chunk.js → CNPnPJMp2.chunk.js} +2 -2
  17. package/dist/scripts/{BcPrUEuC2.chunk.js.map → CNPnPJMp2.chunk.js.map} +1 -1
  18. package/dist/scripts/{Dd23z1_x2.chunk.js → CUp7_5gE2.chunk.js} +2 -2
  19. package/dist/scripts/{Dd23z1_x2.chunk.js.map → CUp7_5gE2.chunk.js.map} +1 -1
  20. package/dist/scripts/{C-zUHAyD.chunk.js → CajcIz6S.chunk.js} +2 -2
  21. package/dist/scripts/{C-zUHAyD.chunk.js.map → CajcIz6S.chunk.js.map} +1 -1
  22. package/dist/scripts/{Drx3PvJj.chunk.js → Cc9f2ux0.chunk.js} +2 -2
  23. package/dist/scripts/{Drx3PvJj.chunk.js.map → Cc9f2ux0.chunk.js.map} +1 -1
  24. package/dist/scripts/Cj_F4Lv92.chunk.js +2 -0
  25. package/dist/scripts/{C8l37H7t2.chunk.js.map → Cj_F4Lv92.chunk.js.map} +1 -1
  26. package/dist/scripts/{DFrz_upP2.chunk.js → CtBGtgb32.chunk.js} +2 -2
  27. package/dist/scripts/{DFrz_upP2.chunk.js.map → CtBGtgb32.chunk.js.map} +1 -1
  28. package/dist/scripts/{BpiZZWnJ2.chunk.js → CtWAorP42.chunk.js} +2 -2
  29. package/dist/scripts/{BpiZZWnJ2.chunk.js.map → CtWAorP42.chunk.js.map} +1 -1
  30. package/dist/scripts/{C3Qd_bbV2.chunk.js → D8mi6CVp2.chunk.js} +2 -2
  31. package/dist/scripts/{C3Qd_bbV2.chunk.js.map → D8mi6CVp2.chunk.js.map} +1 -1
  32. package/dist/scripts/{3K2h5K5-.chunk.js → DJfIirut.chunk.js} +2 -2
  33. package/dist/scripts/{3K2h5K5-.chunk.js.map → DJfIirut.chunk.js.map} +1 -1
  34. package/dist/scripts/{Cc63s6rS2.chunk.js → DaaQ5htA2.chunk.js} +2 -2
  35. package/dist/scripts/{Cc63s6rS2.chunk.js.map → DaaQ5htA2.chunk.js.map} +1 -1
  36. package/dist/scripts/{CHwPLUZK.chunk.js → DkFP4cXM.chunk.js} +2 -2
  37. package/dist/scripts/{CHwPLUZK.chunk.js.map → DkFP4cXM.chunk.js.map} +1 -1
  38. package/dist/scripts/{izXlxhJf.chunk.js → Dzy1nQk7.chunk.js} +2 -2
  39. package/dist/scripts/{izXlxhJf.chunk.js.map → Dzy1nQk7.chunk.js.map} +1 -1
  40. package/dist/scripts/{DGy8Ldlr.chunk.js → FIUOppmy.chunk.js} +2 -2
  41. package/dist/scripts/{DGy8Ldlr.chunk.js.map → FIUOppmy.chunk.js.map} +1 -1
  42. package/dist/scripts/{CPBvCqVK.chunk.js → H511PXuG.chunk.js} +2 -2
  43. package/dist/scripts/{CPBvCqVK.chunk.js.map → H511PXuG.chunk.js.map} +1 -1
  44. package/dist/scripts/{D8Op6EUa2.chunk.js → IYIY9hIU2.chunk.js} +2 -2
  45. package/dist/scripts/{D8Op6EUa2.chunk.js.map → IYIY9hIU2.chunk.js.map} +1 -1
  46. package/dist/scripts/{app-BHlllGhO.js → app-DvYKGw_S.js} +3 -3
  47. package/dist/scripts/{app-BHlllGhO.js.map → app-DvYKGw_S.js.map} +1 -1
  48. package/dist/scripts/{2HZlmQRs2.chunk.js → lJ6ZVpyv2.chunk.js} +2 -2
  49. package/dist/scripts/{2HZlmQRs2.chunk.js.map → lJ6ZVpyv2.chunk.js.map} +1 -1
  50. package/package.json +1 -1
  51. package/dist/scripts/C8l37H7t2.chunk.js +0 -2
  52. package/dist/scripts/CNm_4jj62.chunk.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CHwPLUZK.chunk.js","names":[],"sources":["../../src/shared/interfaces/query-params/LiveCalendarViewQueryParams.ts","../../../../libs/shared/src/apps/calendar/components/calendar-cell/calendar-cell.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-cell/CalendarCell.tsx","../../../../libs/shared/src/apps/calendar/components/empty-state/SpecialEventEmptyState.tsx","../../../../libs/shared/src/apps/calendar/components/special-event-list/special-event-list.module.scss","../../../../libs/shared/src/apps/calendar/components/special-event-list/SpecialEventList.tsx","../../../../libs/shared/src/apps/calendar/components/calendar-body/calendar-body.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-body/CalendarBody.tsx","../../../../libs/shared/src/apps/calendar/components/calendar-nav/calendar-nav.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-nav/CalendarNav.tsx","../../../../libs/shared/src/apps/calendar/components/error-state/SpecialEventErrorState.tsx","../../../../libs/shared/src/apps/calendar/hooks/useCalendarEventsData.ts","../../../../libs/shared/src/apps/calendar/hooks/useCalendarWeeksTable.ts","../../src/apps/calendar/views/calendar-view/calendar/CalendarView.tsx","../../src/apps/calendar/hooks/useLiveCalendarEventsData.ts","../../src/apps/calendar/views/calendar-view/live-calendar/LiveCalendarView.tsx","../../src/apps/calendar/views/calendar-view/BaseCalendarView.tsx"],"sourcesContent":["import { HashObject } from 'libs/common/react/interfaces';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { CalendarQueryParams } from 'libs/shared/apps/calendar/interfaces/CalendarQueryParams';\n\n/**\n * NOTE: Ensure any keys added here are also added\n * to sanitizeLiveCalendarViewParams below.\n */\nexport interface LiveCalendarViewQueryParams extends CalendarQueryParams {\n classification?: string;\n yearGroup?: string;\n}\n\nexport function sanitizeLiveCalendarViewParams(\n queryParams: HashObject\n): LiveCalendarViewQueryParams {\n if (!queryParams)\n return {};\n\n return ObjectHelper.pick(queryParams, [\n 'year',\n 'classification',\n 'yearGroup'\n ]);\n}\n",":local {\n .wrapper {\n border-width: 0.125rem !important;\n }\n\n .weekend {\n background-color: $gray-100;\n }\n}","import React from 'react';\n\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarDay } from 'libs/shared/apps/calendar/components/calendar-day/CalendarDay';\nimport { CalendarCellProps } from 'libs/shared/apps/calendar/interfaces/CalendarCellProps';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { HoverToPortalContainer } from 'libs/shared/components/hover-to-portal-container/HoverToPortalContainer';\n\nimport styles from './calendar-cell.module.scss';\n\nfunction getIsWeekend(date: Date): boolean {\n return DateHelper.getWeekday(date) === 0 || DateHelper.getWeekday(date) === 6;\n}\n\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const { date, notCurrentMonth } = props;\n const [ sliderStep, setSliderStep ] = React.useState<number>(0);\n\n let wrapperClassname = `position-relative border ${props.theme.border} ${styles.wrapper}`;\n if (getIsWeekend(date)) wrapperClassname += ` ${styles.weekend}`;\n if (notCurrentMonth) wrapperClassname += `opacity-50`;\n\n const eventsOnDay = SpecialEventHelper.getEventsForDay(\n date,\n props.events || [],\n props.crossMonthEvents || [],\n props.viewingMonth\n );\n\n const updatedProps = { ...props, eventsOnDay, sliderStep, setSliderStep };\n return (\n <td className={wrapperClassname}>\n {eventsOnDay?.length > 0 ? (\n <HoverToPortalContainer<CalendarCellProps>\n hoverableComponent={CalendarDay}\n componentProps={updatedProps}\n hoverScale={1.35}\n />\n ) : <CalendarDay {...updatedProps} isHovering={false} />}\n </td>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'specialEvent.eventsEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface SpecialEventEmptyStateProps {\n appLink: Core.AppLink;\n imageUrl: string;\n heading?: string;\n}\n\nexport function SpecialEventEmptyState(props: SpecialEventEmptyStateProps): JSX.Element {\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} altText={getPhrase('info')} />\n <EmptyState.Heading>{props.heading || <Text phrase='heading' />}</EmptyState.Heading>\n {props.appLink &&\n <EmptyState.Info>\n <>\n <Text namespace={namespace} phrase='info' />\n <AppLink appLink={props.appLink}>\n <span className='text-info'>{getPhrase('link')}</span>\n </AppLink>\n </>\n </EmptyState.Info>\n }\n </EmptyState>\n </LanguageNamespaceContext.Provider>\n );\n}\n",":local {\n .date {\n margin-bottom: 1rem;\n }\n .first {\n margin-top: map-get($spacers, 1) !important;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { SpecialEventListItem } from 'libs/shared/apps/calendar/components/special-event-list-item/SpecialEventListItem';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { CalendarEvent, CalendarEventContent } from 'libs/shared/interfaces';\n\nimport styles from './special-event-list.module.scss';\n\ninterface SpecialEventListProps {\n events: CalendarEvent[];\n presentationId: string;\n appLink: (content: CalendarEventContent, slug?: string) => Core.AppLink;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getActionLabel?: (content?: CalendarEventContent) => string;\n getStartTime?: (content: CalendarEventContent) => string;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function SpecialEventList(props: SpecialEventListProps): JSX.Element {\n const eventsInMonth: Record<string, CalendarEvent<CalendarEventContent>[]> = {};\n\n props.events.forEach(e => {\n const startDate = e.startDate;\n if (eventsInMonth[startDate]) {\n eventsInMonth[startDate].push(e);\n } else {\n eventsInMonth[startDate] = [e];\n }\n });\n\n const keys = Object.keys(eventsInMonth);\n keys.sort((a, b) => DateHelper.isBefore(a, b) ? -1 : 0);\n\n return (\n <div className='py-1'>\n {keys.map((k, idx) => {\n let prevTime = '';\n let currentTime = '';\n return (\n <div key={k}>\n <div className={`h4 mt-4 ${styles.date} ${idx === 0 ? styles.first : ''}`}>{SpecialEventHelper.getOrdinalDate(k)}</div>\n {eventsInMonth[k].map(e => {\n prevTime = currentTime;\n currentTime = props.getStartTime?.(e.content);\n\n return (\n <SpecialEventListItem\n key={e.content.id}\n getAppLink={(id, name) => {\n return props.appLink(id, TextHelper.slugify(name));\n }}\n event={e}\n presentationId={props.presentationId}\n getIconUrl={props.getIconUrl}\n getBannerUrl={props.getBannerUrl}\n getBackgroundColor={props.getBackgroundColor}\n getActionLabel={() => props.getActionLabel(e.content)}\n getStartTime={props.getStartTime && prevTime !== currentTime ?\n props.getStartTime :\n null\n }\n isPastEvent={props.isPastEvent}\n />\n );\n })}\n </div>\n );\n })}\n </div>\n );\n}\n",":local {\n .header {\n height: map-get($spacers, 5);\n }\n .thead {\n border-width: 0.125rem !important;\n }\n td {\n width: 14.285%; // 100% / 7\n }\n}","import React from 'react';\nimport { Spinner } from 'react-bootstrap';\n\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarCell } from 'libs/shared/apps/calendar/components/calendar-cell/CalendarCell';\nimport { getCalendarAnimationDurationMs } from 'libs/shared/apps/calendar/constants/CalendarAnimation';\nimport { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarImageUrls } from 'libs/shared/apps/calendar/interfaces/CalendarImageUrls';\nimport { CalendarTheme } from 'libs/shared/apps/calendar/interfaces/CalendarTheme';\nimport { MonthQuery } from 'libs/shared/apps/calendar/interfaces/MonthQuery';\nimport { WeeksTable } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { Timezone } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { CalendarEvent, CalendarEventContent } from 'libs/shared/interfaces';\n\nimport { SpecialEventEmptyState } from '../empty-state/SpecialEventEmptyState';\nimport { SpecialEventList } from '../special-event-list/SpecialEventList';\n\nimport styles from './calendar-body.module.scss';\n\nCalendarBody.defaultProps = {\n theme: {\n border: 'border-light-blue',\n background: 'bg-light-blue'\n }\n};\n\ninterface CalendarBodyProps {\n weekDays: WeeksTable;\n weekDaysHeader: string[];\n events?: CalendarEvent[];\n monthQuery: MonthQuery;\n viewingMonth: Date;\n eventsLoaded: boolean;\n presentationId: string;\n appLinks: CalendarAppLinks;\n imageUrls: CalendarImageUrls;\n viewMode?: string;\n theme?: CalendarTheme;\n emptyStateHeading?: string;\n fadePastEvents?: boolean;\n timezone?: Timezone;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getCoverUrl?: (content: CalendarEventContent) => string;\n getActionLabel?: (content?: CalendarEventContent) => string;\n getStartTime?: (content: CalendarEventContent) => string;\n getHardCodedEvent?: (content: CalendarEventContent) => HashObject;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function CalendarBody(props: CalendarBodyProps): JSX.Element {\n const { appLinks, imageUrls } = props;\n\n const breakpoints = useBreakpoints();\n\n const eventsInMonth = SpecialEventHelper.getEventsInMonth(props.events || [], props.viewingMonth);\n\n // cross-month events that should be shown on the first cell of the month\n const crossMonthEventsForFirstDay = React.useMemo(() => {\n const allDatesInView = new Set(\n props.weekDays.reduce((acc, week) => acc.concat(week), [])\n .map(d => DateHelper.format(d, 'YYYY-MM-DD'))\n );\n\n const crossMonthEvents = (props.events || []).filter(e => {\n if (!e.startDate) return false;\n const isFromPreviousMonth = SpecialEventHelper.isEventFromPreviousMonth(e, props.viewingMonth);\n // Only include if the event's start date is NOT already visible in the current view\n const startDateVisible = allDatesInView.has(DateHelper.format(e.startDate, 'YYYY-MM-DD'));\n return isFromPreviousMonth && !startDateVisible;\n });\n\n return crossMonthEvents;\n }, [ props.weekDays, props.events ]);\n\n const isGridView = props.viewMode !== 'list' && !breakpoints.xs && !breakpoints.sm && !breakpoints.md;\n\n const [ hasInitialized, setHasInitialized ] = React.useState(false);\n const [ hoveredEvent, setHoveredEvent ] = React.useState<CalendarEvent<CalendarEventContent>>(null);\n\n React.useEffect(() => {\n if (props.eventsLoaded && !hasInitialized) {\n const maxRowIndex = props.weekDays.length - 1;\n const timeoutId = window.setTimeout(\n () => setHasInitialized(true),\n getCalendarAnimationDurationMs(maxRowIndex)\n );\n return () => window.clearTimeout(timeoutId);\n }\n }, [props.eventsLoaded]);\n\n if (props.eventsLoaded && !eventsInMonth?.length) {\n return (\n <SpecialEventEmptyState\n imageUrl={imageUrls.emptyState}\n appLink={appLinks.emptyStateRedirect?.()}\n heading={props.emptyStateHeading}\n />\n );\n }\n\n if (!isGridView) {\n if (!props.eventsLoaded) {\n return (\n <div className='d-flex justify-content-center align-items-center mb-4'>\n <Spinner as='div' animation='border' role='status' />\n </div>\n );\n }\n\n return (\n <SpecialEventList\n events={eventsInMonth}\n presentationId={props.presentationId}\n appLink={props.appLinks.event}\n getIconUrl={props.getIconUrl}\n getBannerUrl={props.getBannerUrl}\n getBackgroundColor={props.getBackgroundColor}\n getActionLabel={props.getActionLabel}\n getStartTime={props.getStartTime}\n isPastEvent={props.isPastEvent}\n />\n );\n }\n\n return (\n <table className='user-select-none w-100 mt-3 overflow-hidden rounded-top-lg'>\n <thead className={`border ${props.theme.border} ${styles.thead}`}>\n <tr className={`fw-semibold ${props.theme.background} ${styles.header}`}>\n {props.weekDaysHeader.map(w => <th key={w} className='px-2 h4' scope='col'>{w}</th>)}\n </tr>\n </thead>\n\n <tbody>\n {props.weekDays.map((w, weekIndex) => (\n <tr key={w[0].toString()}>\n {w.map(d => {\n return (\n <CalendarCell\n key={d.toString()}\n rowIndex={weekIndex}\n date={d}\n notCurrentMonth={!!d.notCurrentMonth}\n events={props.events}\n crossMonthEvents={crossMonthEventsForFirstDay}\n viewingMonth={props.viewingMonth}\n monthQuery={props.monthQuery}\n hasInitialized={hasInitialized}\n presentationId={props.presentationId}\n hoveredEvent={hoveredEvent}\n theme={props.theme}\n setHoveredEvent={setHoveredEvent}\n getEventsListAppLink={() => props.appLinks.eventList(props.monthQuery, d, props.presentationId)}\n getTopicAppLink={(calendarEventContent, slug) =>\n props.appLinks.event(calendarEventContent, slug)}\n getIconUrl={props.getIconUrl}\n getBackgroundColor={props.getBackgroundColor}\n getCoverUrl={props.getCoverUrl}\n getHardCodedEvent={props.getHardCodedEvent}\n fadePastEvents={props.fadePastEvents}\n timezone={props.timezone}\n />\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n",":local {\n $svg-shift: 0.1rem; // Even though the element is centered, the chevron SVGs appear slightly off-center. This corrects that.\n\n .chevron {\n min-width: $cv-svg-size-xlg;\n }\n\n .left {\n left: -1rem;\n\n svg {\n transform: translateX(-$svg-shift);\n }\n }\n\n .right {\n right: -1rem;\n\n svg {\n transform: translateX($svg-shift);\n }\n }\n\n .viewModeContainer {\n height: 2.5rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { AnalyticsOptions, CalendarDisplayModeDescriptor, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarViewMode } from 'libs/shared/apps/calendar/interfaces/CalendarViewMode';\nimport { canNavToOtherMonths } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { IconButton } from 'libs/shared/components/icon-button/IconButton';\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { ChevronLeftSvg } from 'libs/shared/images/svg/arrows/ChevronLeftSvg';\nimport { ChevronRightSvg } from 'libs/shared/images/svg/arrows/ChevronRightSvg';\nimport { CalendarSvg } from 'libs/shared/images/svg/objects/CalendarSvg';\nimport { TableOfContentsSvg } from 'libs/shared/images/svg/objects/TableOfContentsSvg';\n\nimport styles from './calendar-nav.module.scss';\n\nconst namespace = 'specialEventCalendar.calendarNav';\n\ninterface CalendarNavProps extends React.PropsWithChildren {\n monthDate: Date;\n appLinks: CalendarAppLinks;\n viewMode?: CalendarViewMode;\n queryParams?: HashObject;\n setViewingMonthDate: (date?: Date) => void;\n setViewMode?: (viewMode: CalendarViewMode) => void;\n}\n\ninterface ViewModeSwitcherProps {\n viewMode: CalendarViewMode;\n setViewMode?: (viewMode: CalendarViewMode) => void;\n}\n\nfunction ViewModeSwitcher(props: ViewModeSwitcherProps): JSX.Element {\n return (\n <div className={`${styles.viewModeContainer} d-none d-lg-block`}>\n <IconButton\n svg={CalendarSvg}\n className={`${props.viewMode === 'calendar' ? 'bg-dark text-white' : ''} btn btn-outline-dark rounded-start rounded-end-0 border-end-0 px-3 h-100`}\n onClick={() => props.setViewMode('calendar')}\n analyticsData={{}}\n analyticsOptions={{\n entity: EntityType.AppLink,\n actionType: UserAction.Click,\n descriptor: CalendarDisplayModeDescriptor.Calendar,\n location: LocationContext.CalendarNav\n }}\n />\n <IconButton\n svg={TableOfContentsSvg}\n className={`${props.viewMode === 'list' ? 'bg-dark text-white' : ''} btn btn-outline-dark rounded-end rounded-start-0 border-start-0 px-3 h-100`}\n onClick={() => props.setViewMode('list')}\n analyticsData={{}}\n analyticsOptions={{\n entity: EntityType.AppLink,\n actionType: UserAction.Click,\n descriptor: CalendarDisplayModeDescriptor.List,\n location: LocationContext.CalendarNav\n }}\n />\n </div>\n );\n}\n\ninterface NavigateButtonProps {\n action: 'next' | 'previous';\n appLink?: Core.AppLink;\n analyticsOptions?: AnalyticsOptions;\n analyticsData?: HashObject;\n onClick: () => void;\n}\n\nfunction NavigateButton(props: NavigateButtonProps): JSX.Element {\n const arrowSvg = props.action === 'previous' ? ChevronLeftSvg : ChevronRightSvg;\n const className = props.action === 'previous' ? styles.left : styles.right;\n\n function onClick() {\n Core.AppLinkHelper.trigger(props.appLink);\n\n props.onClick();\n }\n\n return (\n <AppLink\n appLink={props.appLink}\n analyticsData={props.analyticsData}\n analyticsOptions={props.analyticsOptions}\n className={`${styles.chevron} ${className} border border-dark rounded-circle bg-white d-flex align-items-center justify-content-center`}\n onClick={onClick}\n >\n <SvgContainer\n svg={arrowSvg}\n size={SvgContainerSize.Medium}\n className={`svg-container d-inline-block ${styles.svg}`}\n />\n </AppLink>\n );\n}\n\nconst CUR_DATE = new Date();\n\nexport function CalendarNav(props: CalendarNavProps): JSX.Element {\n const { appLinks } = props;\n\n const breakpoints = useBreakpoints();\n \n function getAppLink(monthDate?: Date): Core.AppLink {\n const month = DateHelper.format(monthDate, 'MMMM').toLocaleLowerCase();\n\n const appLink: Core.AppLink = appLinks.month(month);\n\n const params: HashObject = {};\n\n if (monthDate) {\n const currentYear = new Date().getFullYear();\n const year = monthDate.getFullYear();\n \n if (currentYear !== year)\n params.year = year;\n }\n\n if (props.queryParams?.classification)\n params.classification = props.queryParams.classification;\n\n if (props.queryParams?.yearGroup)\n params.yearGroup = props.queryParams.yearGroup;\n\n appLink.params = params;\n\n return appLink;\n }\n\n function onClickNext () {\n const nextMonth = DateHelper.add(props.monthDate, 1, 'month');\n props.setViewingMonthDate(nextMonth);\n }\n\n function onClickPrevious() {\n const prevMonth = DateHelper.subtract(props.monthDate, 1, 'month');\n props.setViewingMonthDate(prevMonth);\n }\n\n function onClickToday() {\n if (DateHelper.format(CUR_DATE, 'M YY') === DateHelper.format(props.monthDate, 'M YY')) return;\n \n props.setViewingMonthDate();\n }\n \n const { showPrev, showNext } = canNavToOtherMonths(props.monthDate);\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: LocationContext.CalendarNav\n };\n\n function formatAnalyticDataDate(date: Date) {\n return DateHelper.format(date, 'YYYY-MM-DD');\n }\n return (\n <div className='d-flex flex-wrap gap-3 justify-content-end align-items-center'>\n <h1 className='mb-0 h2 me-auto'>{DateHelper.format(props.monthDate, breakpoints.xs ? 'MMM YYYY' : 'MMMM YYYY')}</h1>\n\n {props.children}\n\n {props.setViewMode && (\n <ViewModeSwitcher viewMode={props.viewMode} setViewMode={props.setViewMode} />\n )}\n <div className='d-flex gap-3'>\n {showPrev && (\n <NavigateButton\n appLink={getAppLink(DateHelper.startOf(DateHelper.subtract(props.monthDate, 1, 'month'), 'month'))}\n action='previous'\n onClick={onClickPrevious}\n analyticsOptions={analyticsOptions}\n analyticsData={{ action: 'previous', date: formatAnalyticDataDate(DateHelper.startOf(DateHelper.add(props.monthDate, 1, 'month'), 'month')) }}\n />\n )}\n <AppLink\n appLink={getAppLink()}className={`${styles.todayWrapper} btn btn-outline-dark fw-semibold`}\n onClick={onClickToday}\n analyticsOptions={analyticsOptions}\n analyticsData={{ action: 'today', date: formatAnalyticDataDate(DateHelper.startOf(CUR_DATE, 'month')) }}\n >\n {LanguageService.getPhrase(namespace, 'today')}\n </AppLink>\n {showNext && (\n <NavigateButton\n appLink={getAppLink(DateHelper.startOf(DateHelper.add(props.monthDate, 1, 'month'), 'month'))}\n analyticsOptions={analyticsOptions}\n analyticsData={{ action: 'next', date: formatAnalyticDataDate(DateHelper.startOf(DateHelper.add(props.monthDate, 1, 'month'), 'month')) }}\n action='next'\n onClick={onClickNext}\n />\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'specialEvent.eventsErrorState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface SpecialEventErrorStateProps {\n imageUrl: string;\n appLink: Core.AppLink;\n}\n\nexport function SpecialEventErrorState(props: SpecialEventErrorStateProps): JSX.Element {\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} />\n <EmptyState.Heading><Text phrase='heading' /></EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='info' />\n <br/>\n <AppLink appLink={props.appLink}>\n <span className='text-info'>{getPhrase('link')}</span>\n </AppLink>\n </EmptyState.Info>\n </EmptyState>\n </LanguageNamespaceContext.Provider>\n );\n}\n","import { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarEvent } from 'libs/shared/interfaces';\n\nimport { CalendarRequests } from '../flight-request/CalendarRequests';\nimport { getCalendarRange } from '../utils/CalendarHelper';\n\nexport function useCalendarEventsData(viewMonth: Date, presentationId: string) {\n const pid = presentationId;\n const [ startDate, endDate ] = getCalendarRange(viewMonth);\n\n const nextMonth = DateHelper.add(viewMonth, 1, 'month');\n const [ nextStartDate, nextEndDate ] = getCalendarRange(nextMonth);\n\n const prevMonth = DateHelper.subtract(viewMonth, 1, 'month');\n const [ prevStartDate, prevEndDate ] = getCalendarRange(prevMonth);\n\n const events = Flight.useBasicFetch<CalendarEvent[]>((startDate && endDate && pid)\n && CalendarRequests.calendarEvents(DateHelper.format(startDate, 'YYYY-MM-DD'), DateHelper.format(endDate, 'YYYY-MM-DD'), pid));\n const nextEvents = Flight.useBasicFetch<CalendarEvent[]>((nextStartDate && nextEndDate && pid)\n && CalendarRequests.calendarEvents(DateHelper.format(nextStartDate, 'YYYY-MM-DD'), DateHelper.format(nextEndDate, 'YYYY-MM-DD'), pid));\n const prevEvents = Flight.useBasicFetch<CalendarEvent[]>((prevStartDate && prevEndDate && pid)\n && CalendarRequests.calendarEvents(DateHelper.format(prevStartDate, 'YYYY-MM-DD'), DateHelper.format(prevEndDate, 'YYYY-MM-DD'), pid));\n\n const uniqueEventList = ArrayHelper.uniq(\n [ ...prevEvents.data || [], ...events.data || [], ...nextEvents.data || [] ],\n e => e.specialEventPolicyId\n );\n\n return { events: uniqueEventList, loaded: events.hasCompleted };\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\n\nimport { buildWeeksTable, DatePositionMap, initWeekDays, WeeksTable } from '../utils/CalendarHelper';\n\ntype Cache = Record<string, {\n datePositionMap: DatePositionMap,\n weeksTable: WeeksTable\n}>;\n\nconst TODAY_DATE = new Date();\n\nexport function useCalendarWeeksTable(date: Date = TODAY_DATE, appLinks: CalendarAppLinks, startAtMon: boolean = true) {\n const weekDaysHeader = initWeekDays(startAtMon);\n const cacheRef = React.useRef<Cache>({});\n\n const monthDateString = DateHelper.format(date, 'YYYY-MM');\n const weekDays = React.useMemo(() => {\n const cached = cacheRef.current[monthDateString];\n if (!cached) {\n const { weeksTable, datePositionMap } = buildWeeksTable(date, startAtMon);\n\n cacheRef.current[monthDateString] = { weeksTable, datePositionMap };\n return weeksTable;\n }\n\n return cached.weeksTable;\n }, [ monthDateString, startAtMon ]);\n\n function setViewingMonthDate(nextMonthDate?: Date) {\n if (!nextMonthDate) {\n Core.AppLinkHelper.trigger(appLinks.calendar());\n\n return;\n }\n\n if (monthDateString !== DateHelper.format(nextMonthDate, 'YYYY-MM')) {\n const month = DateHelper.format(nextMonthDate, 'MMMM').toLocaleLowerCase();\n\n const currentYear = new Date().getFullYear();\n const year = date.getFullYear();\n\n const appLink: Core.AppLink = appLinks.month(month);\n\n if (currentYear !== year)\n appLink.params = { year };\n\n Core.AppLinkHelper.trigger(appLink);\n }\n }\n\n const startDate = ArrayHelper.first(ArrayHelper.first(weekDays));\n const endDate = ArrayHelper.last(ArrayHelper.last(weekDays));\n\n return { weekDaysHeader, weekDays, monthDate: date, setMonthDate: setViewingMonthDate, startDate, endDate };\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/react/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarBody } from 'libs/shared/apps/calendar/components/calendar-body/CalendarBody';\nimport { CalendarNav } from 'libs/shared/apps/calendar/components/calendar-nav/CalendarNav';\nimport { SpecialEventErrorState } from 'libs/shared/apps/calendar/components/error-state/SpecialEventErrorState';\nimport { useCalendarEventsData } from 'libs/shared/apps/calendar/hooks/useCalendarEventsData';\nimport { useCalendarWeeksTable } from 'libs/shared/apps/calendar/hooks/useCalendarWeeksTable';\nimport { CalendarQueryParams } from 'libs/shared/apps/calendar/interfaces/CalendarQueryParams';\nimport { getIsValidMonth, parseMonthString } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { HardCoded } from 'libs/shared/constants/HardCoded';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Classification, CurrentUser } from 'libs/shared/interfaces';\nimport { ImageHelper } from 'libs/shared/utils/ImageHelper';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useAvailablePresentations } from 'shared/hooks/presentations/useAvailablePresentations';\nimport { useRequestAccess } from 'shared/hooks/useRequestAccess';\nimport { useShowCalendar } from 'shared/hooks/useShowCalendar';\nimport { REGIONAL_CALENDAR_INDEXABILITY } from 'shared/utils/LiteRegionHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { getCalendarAppLinks, getCalendarImageUrls } from 'apps/calendar/views/calendar-view/CalendarViewUtils';\nimport { getDiscoverHeaderAppLinks } from 'apps/dashboard/views/dashboard/DiscoverViewUtils';\n\nconst namespace = 'specialEventCalendar.calendarView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport interface CalendarViewProps {\n month?: string;\n presentationSlug: string;\n}\n\nexport function CalendarView(props: CalendarViewProps): JSX.Element {\n const breakpoints = useBreakpoints();\n const { showCalendar, isLoading } = useShowCalendar();\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const { availablePresentations } = useAvailablePresentations();\n const { activePresentation } = useActivePresentation();\n \n const { applinks: calendarAppLinks } = useRequestAccess({\n applinks: getCalendarAppLinks(props.presentationSlug ?? null, availablePresentations),\n exceptions: ['month']\n });\n\n const isValidMonth = getIsValidMonth(props.month);\n\n React.useEffect(() => {\n if (!isLoading && !showCalendar)\n Core.AppLinkHelper.trigger(\n getDiscoverHeaderAppLinks(activePresentation?.vanitySlug ?? props.presentationSlug).forYou,\n { replace: true }\n );\n }, [ showCalendar, isLoading ]);\n\n const viewingMonth = parseMonthString(props.month);\n\n const {\n monthDate,\n setMonthDate,\n weekDays,\n weekDaysHeader,\n startDate, endDate\n } = useCalendarWeeksTable(viewingMonth, calendarAppLinks);\n\n const { events, loaded } = useCalendarEventsData(viewingMonth, activePresentation.id);\n\n const currentMonthYear = DateHelper.format(monthDate, 'MMMM YYYY');\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: currentMonthYear,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink<keyof CalendarQueryParams>({ allowedParams: ['year']}),\n allowIndexing: SeoHelper.allowIndexing(),\n hrefLang: SeoHelper.getStaticRouteHrefLang(\n activePresentation?.learningLevel,\n calendarAppLinks.calendar,\n REGIONAL_CALENDAR_INDEXABILITY\n )\n }));\n\n if (props.month !== null && !isValidMonth) {\n return (\n <SpecialEventErrorState\n imageUrl={getCalendarImageUrls().errorState}\n appLink={calendarAppLinks.calendar()}\n />\n );\n }\n\n function getIconUrl(classification: Classification, hardCodedEvent?: HashObject): string {\n return hardCodedEvent ?\n // in calendar we use hardcoded icon for hardcoded event\n ImageHelper.createUrl((hardCodedEvent.iconUrl), { size: ImageSize.Medium }) :\n ImageHelper.createUrl(classification.icon?.url, { size: ImageSize.Small });\n }\n\n function getCoverUrl(classification: Classification): string {\n return ImageHelper.createUrl(classification.cover?.url, { size: ImageSize.Small });\n }\n\n function getActionLabel(): string {\n return !breakpoints.xs ? getPhrase('buttonLabel') : getPhrase('mobileButtonLabel');\n }\n\n function getHardCodedEvent(classification: Classification): HashObject {\n return HardCoded.SpecialEvents[classification.id as keyof typeof HardCoded.SpecialEvents];\n }\n\n if (isLoading || !showCalendar || !activePresentation?.id || !currentUser.data.countryCode)\n return <></>;\n\n return (\n <div className='bg-white px-3'>\n <CalendarNav monthDate={monthDate} setViewingMonthDate={setMonthDate} appLinks={calendarAppLinks} />\n <CalendarBody\n weekDays={weekDays}\n weekDaysHeader={weekDaysHeader}\n events={events}\n monthQuery={{ from: startDate?.toString(), to: endDate?.toString() }}\n viewingMonth={viewingMonth}\n eventsLoaded={loaded}\n presentationId={activePresentation.id}\n appLinks={calendarAppLinks}\n imageUrls={getCalendarImageUrls(currentUser.data.countryCode)}\n getIconUrl={(classification: Classification) => getIconUrl(classification, getHardCodedEvent(classification))}\n getCoverUrl={getCoverUrl}\n getBackgroundColor={(classification: Classification) => classification.metadata?.backgroundColor}\n getBannerUrl={(classification: Classification) => classification.banner?.url}\n getActionLabel={getActionLabel}\n getHardCodedEvent={getHardCodedEvent}\n />\n </div>\n );\n}\n","import { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { HashObject } from 'libs/analytics/interfaces';\n\nimport { getCalendarRange } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { CalendarEvent } from 'libs/shared/interfaces';\n\nimport { LivestreamRequests } from 'shared/flight-requests/LivestreamRequests';\n\nexport function useLiveCalendarEventsData(viewMonth: Date, queryParams?: HashObject) {\n const [ startDate, endDate ] = getCalendarRange(viewMonth);\n\n const nextMonth = DateHelper.add(viewMonth, 1, 'month');\n const [ nextStartDate, nextEndDate ] = getCalendarRange(nextMonth);\n\n const prevMonth = DateHelper.subtract(viewMonth, 1, 'month');\n const [ prevStartDate, prevEndDate ] = getCalendarRange(prevMonth);\n\n const filters: HashObject = {};\n\n if (queryParams.yearGroup)\n filters.audienceId = queryParams.yearGroup;\n\n if (queryParams.classification) {\n filters.topicId = queryParams.classification;\n filters.includeChildrenTopics = true;\n }\n\n const events = Flight.useBasicFetch<CalendarEvent[]>((startDate && endDate)\n && LivestreamRequests.calendarLivestreams({\n from: DateHelper.format(startDate, 'YYYY-MM-DD'),\n to: DateHelper.format(endDate, 'YYYY-MM-DD'),\n ...filters\n }));\n\n const nextEvents = Flight.useBasicFetch<CalendarEvent[]>((nextStartDate && nextEndDate)\n && LivestreamRequests.calendarLivestreams({\n from: DateHelper.format(nextStartDate, 'YYYY-MM-DD'),\n to: DateHelper.format(nextEndDate, 'YYYY-MM-DD'),\n ...filters\n }));\n\n const prevEvents = Flight.useBasicFetch<CalendarEvent[]>((prevStartDate && prevEndDate)\n && LivestreamRequests.calendarLivestreams({\n from: DateHelper.format(prevStartDate, 'YYYY-MM-DD'),\n to: DateHelper.format(prevEndDate, 'YYYY-MM-DD'),\n ...filters\n }));\n\n const uniqueEventList = ArrayHelper.uniq(\n [ ...prevEvents.data || [], ...events.data || [], ...nextEvents.data || [] ],\n e => e.id\n );\n\n return { events: uniqueEventList, loaded: events.hasCompleted };\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { StorageType } from 'libs/common/backbone/utils/LocalStorageHelper';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\nimport { Flight } from 'libs/common/react/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { CalendarBody } from 'libs/shared/apps/calendar/components/calendar-body/CalendarBody';\nimport { CalendarNav } from 'libs/shared/apps/calendar/components/calendar-nav/CalendarNav';\nimport { SpecialEventErrorState } from 'libs/shared/apps/calendar/components/error-state/SpecialEventErrorState';\nimport { useCalendarWeeksTable } from 'libs/shared/apps/calendar/hooks/useCalendarWeeksTable';\nimport { CalendarQueryParams } from 'libs/shared/apps/calendar/interfaces/CalendarQueryParams';\nimport { CalendarViewMode } from 'libs/shared/apps/calendar/interfaces/CalendarViewMode';\nimport { getIsValidMonth, parseMonthString } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { SearchFilters } from 'libs/shared/apps/search/components/search-filters/SearchFilters';\nimport { SearchFilter, TopicResults } from 'libs/shared/apps/search/interfaces';\nimport { TimezoneIndicator } from 'libs/shared/apps/streamable-learning/components/timezone-indicator/TimezoneIndicator';\nimport { Timezone } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { ClassificationRequests } from 'libs/shared/flight-requests/ClassificationRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Livestream, PresentationAudience } from 'libs/shared/interfaces';\nimport { ImageHelper } from 'libs/shared/utils/ImageHelper';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useRequestAccess } from 'shared/hooks/useRequestAccess';\nimport { LiveCalendarViewQueryParams } from 'shared/interfaces/query-params/LiveCalendarViewQueryParams';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { useLiveCalendarEventsData } from 'apps/calendar/hooks/useLiveCalendarEventsData';\nimport { LiveCalendarUtils } from 'apps/calendar/utils/LiveCalendarUtils';\nimport {\n getLiveCalendarAppLinks, getLiveCalendarImageUrls } from 'apps/calendar/views/calendar-view/CalendarViewUtils';\n\nconst namespace = 'liveCalendar.calendarView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface ViewModelViewModel {\n viewMode: CalendarViewMode;\n}\n\nLiveCalendarView.defaultProps = {\n queryParams: {}\n};\n\nexport interface LiveCalendarViewProps {\n month?: string;\n presentationSlug: string | null;\n queryParams?: LiveCalendarViewQueryParams;\n}\n\nexport function LiveCalendarView(props: LiveCalendarViewProps): JSX.Element {\n const [{ viewMode }, setMode ] = useViewModel<ViewModelViewModel>('calendar:mode', { viewMode: 'calendar' }, {\n storage: StorageType.LocalStorage\n });\n\n const { hasPermissions } = usePermissions();\n const isStudent = hasPermissions(PermissionName.StudentExperience);\n\n const { activePresentation } = useActivePresentation();\n \n const { applinks: calendarAppLinks } = useRequestAccess({\n applinks: getLiveCalendarAppLinks(props.presentationSlug),\n exceptions: ['month']\n });\n\n const audiences = Flight.useBasicFetch<PresentationAudience[]>(activePresentation &&\n AudienceRequests.presentationAudiences(PresentationType.StreamableLearning, activePresentation.id));\n\n const availableTopics = Flight.useBasicFetch<TopicResults>(activePresentation &&\n ClassificationRequests.topicsFromAllAvailablePresentations([activePresentation.id]));\n\n const isValidMonth = getIsValidMonth(props.month);\n\n const viewingMonth = parseMonthString(props.month);\n\n const {\n monthDate,\n setMonthDate,\n weekDays,\n weekDaysHeader,\n startDate,\n endDate\n } = useCalendarWeeksTable(viewingMonth, calendarAppLinks);\n\n const { events, loaded } = useLiveCalendarEventsData(viewingMonth, props.queryParams);\n const currentMonthYear = DateHelper.format(monthDate, 'MMMM YYYY');\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: currentMonthYear,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink<keyof CalendarQueryParams>({ allowedParams: ['year']}),\n allowIndexing: true\n }));\n\n if (props.month !== null && !isValidMonth) {\n return (\n <SpecialEventErrorState\n imageUrl={getLiveCalendarImageUrls().errorState}\n appLink={calendarAppLinks.calendar()}\n />\n );\n }\n\n const mainFilters: SearchFilter<string>[] = [\n {\n id: 'classification',\n name: getPhrase('subjectFilter'),\n options: availableTopics.data?.topics.map(t => ({ name: t.name, id: t.topicIds.join(':') })),\n type: 'checkbox',\n compatibleIndices: []\n },\n {\n id: 'yearGroup',\n name: getPhrase('gradeFilter'),\n type: 'checkbox',\n options: audiences.data?.map(a => ({ name: a.name, id: a.masterId })),\n compatibleIndices: []\n }\n ];\n\n function getAppLink(): Core.AppLink {\n const month = DateHelper.format(monthDate, 'MMMM').toLocaleLowerCase();\n\n const currentYear = new Date().getFullYear();\n const year = monthDate.getFullYear();\n\n const appLink: Core.AppLink = calendarAppLinks.month(month);\n\n const params: HashObject = {};\n\n if (currentYear !== year)\n params.year = year;\n\n if (props.queryParams.classification)\n params.classification = props.queryParams.classification;\n\n if (props.queryParams.yearGroup)\n params.yearGroup = props.queryParams.yearGroup;\n\n return appLink;\n }\n\n function getActionLabel(livestream: Livestream): string {\n return isStudent || DateHelper.isBefore(livestream.endDateTime, new Date()) ? 'pastActionLabel' : 'actionLabel';\n }\n\n function getEmptyStateHeading(): string {\n const eventsInMonth = SpecialEventHelper.getEventsInMonth(events || [], viewingMonth);\n\n if (!eventsInMonth.length && (props.queryParams.yearGroup || props.queryParams.classification))\n return getPhrase('emptyStateText');\n }\n\n function getIconUrl(content: Livestream) {\n return ImageHelper.createUrl(content.company.logo?.url, { size: ImageSize.Small });\n }\n\n function getBannerUrl(content: Livestream) {\n return ImageHelper.createUrl(content.company.banner?.url, { size: ImageSize.Large });\n }\n\n if (!activePresentation)\n return <></>;\n\n return (\n <div className='bg-white px-4'>\n <CalendarNav\n monthDate={monthDate}\n setViewingMonthDate={setMonthDate}\n appLinks={calendarAppLinks}\n queryParams={props.queryParams}\n viewMode={viewMode}\n setViewMode={(newViewMode: CalendarViewMode) => setMode({ viewMode: newViewMode })}\n >\n <div className='mx-n1 order-1 order-sm-0'>\n <SearchFilters\n queryParams={ObjectHelper.omit(props.queryParams, ['year'])}\n mainFilters={mainFilters}\n appLink={getAppLink()}\n isFetchingOptions={!availableTopics.data || !activePresentation || !audiences.data}\n alignResetButtonLeft\n hideDivider\n hideHeading\n hideCaret={false}\n noContainerPaddingBottom\n />\n </div>\n </CalendarNav>\n <div className={`position-relative mt-3 ${viewMode === 'list' ? '' : 'mt-lg-0'}`}>\n <div className={`d-block ${viewMode === 'list' ? '' : 'd-lg-none'} position-absolute top-0 end-0 mt-2`}>\n <TimezoneIndicator />\n </div>\n <CalendarBody\n weekDays={weekDays}\n weekDaysHeader={weekDaysHeader}\n events={events}\n monthQuery={{ from: startDate?.toString(), to: endDate?.toString() }}\n viewingMonth={viewingMonth}\n eventsLoaded={loaded}\n presentationId={activePresentation.id}\n appLinks={calendarAppLinks}\n imageUrls={getLiveCalendarImageUrls()}\n viewMode={viewMode}\n getActionLabel={livestream => getPhrase(getActionLabel(livestream as Livestream))}\n getBackgroundColor={(content: Livestream) => content.company.metadata?.colour}\n getBannerUrl={getBannerUrl}\n getIconUrl={getIconUrl}\n getStartTime={LiveCalendarUtils.getStartTime}\n theme={{\n background: 'bg-light-green',\n border: 'border-light-green'\n }}\n emptyStateHeading={getEmptyStateHeading()}\n fadePastEvents\n timezone={Timezone.ET}\n isPastEvent={LiveCalendarUtils.isPastEvent}\n />\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\n\nimport {\n sanitizeLiveCalendarViewParams\n} from 'shared/interfaces/query-params/LiveCalendarViewQueryParams';\nimport { createPresentationDispatcherView } from 'shared/utils/createPresentationDispatcherView';\n\nimport { CalendarView } from 'apps/calendar/views/calendar-view/calendar/CalendarView';\nimport { LiveCalendarView } from 'apps/calendar/views/calendar-view/live-calendar/LiveCalendarView';\n\ninterface CalendarRouteProps {\n month?: string;\n presentationSlug: string;\n queryParams?: HashObject;\n}\n\nexport const BaseCalendarView = createPresentationDispatcherView<CalendarRouteProps>({\n [PresentationType.Subject]: ctx => (\n <CalendarView month={ctx.month} presentationSlug={ctx.presentationSlug} />\n ),\n [PresentationType.StreamableLearning]: ctx => (\n <LiveCalendarView\n month={ctx.month}\n presentationSlug={ctx.presentationSlug}\n queryParams={sanitizeLiveCalendarViewParams(ctx.queryParams)}\n />\n )\n});\n\nBaseCalendarView.displayName = 'BaseCalendarView';\n"],"mappings":"soEAcA,SAAgB,GACd,EAC6B,CAI7B,OAHK,EAGE,EAAa,KAAK,EAAa,CACpC,OACA,iBACA,WACF,CAAC,EANQ,CAAC,CAOZ,sEEdA,SAAS,GAAa,EAAqB,CACzC,OAAO,EAAW,WAAW,CAAI,IAAM,GAAK,EAAW,WAAW,CAAI,IAAM,CAC9E,CAEA,SAAgB,GAAa,EAAuC,CAClE,GAAM,CAAE,OAAM,mBAAoB,EAC5B,CAAE,EAAY,GAAA,EAAwB,SAAiB,CAAC,EAE1D,EAAmB,4BAA4B,EAAM,MAAM,OAAO,GAAG,GAAO,UAC5E,GAAa,CAAI,IAAG,GAAoB,IAAI,GAAO,WACnD,IAAiB,GAAoB,cAEzC,IAAM,EAAc,EAAmB,gBACrC,EACA,EAAM,QAAU,CAAC,EACjB,EAAM,kBAAoB,CAAC,EAC3B,EAAM,YACR,EAEM,EAAe,CAAE,GAAG,EAAO,cAAa,aAAY,eAAc,EACxE,OACE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAW,WACZ,GAAa,OAAS,GACrB,EAAA,EAAA,IAAA,CAAC,GAAD,CACE,mBAAoB,EACpB,eAAgB,EAChB,WAAY,IACb,CAAA,GACC,EAAA,EAAA,IAAA,CAAC,EAAD,CAAa,GAAI,EAAc,WAAY,EAAQ,CAAA,CACrD,CAAA,CAER,CCjCA,IAAM,EAAY,gCACZ,GAAY,EAAgB,iBAAiB,CAAS,EAQ5D,SAAgB,GAAuB,EAAiD,CACtF,OACE,EAAA,EAAA,IAAA,CAAC,EAAyB,SAA1B,CAAmC,MAAO,YACxC,EAAA,EAAA,KA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,EAAI,MACX,iBAAkB,EAAI,iBACtB,YAAa,GAA+B,EAAI,WAAW,CAC5D,CAAA,CAEL,CAAC,EAED,GAAiB,YAAc"}
1
+ {"version":3,"file":"DkFP4cXM.chunk.js","names":[],"sources":["../../src/shared/interfaces/query-params/LiveCalendarViewQueryParams.ts","../../../../libs/shared/src/apps/calendar/components/calendar-cell/calendar-cell.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-cell/CalendarCell.tsx","../../../../libs/shared/src/apps/calendar/components/empty-state/SpecialEventEmptyState.tsx","../../../../libs/shared/src/apps/calendar/components/special-event-list/special-event-list.module.scss","../../../../libs/shared/src/apps/calendar/components/special-event-list/SpecialEventList.tsx","../../../../libs/shared/src/apps/calendar/components/calendar-body/calendar-body.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-body/CalendarBody.tsx","../../../../libs/shared/src/apps/calendar/components/calendar-nav/calendar-nav.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-nav/CalendarNav.tsx","../../../../libs/shared/src/apps/calendar/components/error-state/SpecialEventErrorState.tsx","../../../../libs/shared/src/apps/calendar/hooks/useCalendarEventsData.ts","../../../../libs/shared/src/apps/calendar/hooks/useCalendarWeeksTable.ts","../../src/apps/calendar/views/calendar-view/calendar/CalendarView.tsx","../../src/apps/calendar/hooks/useLiveCalendarEventsData.ts","../../src/apps/calendar/views/calendar-view/live-calendar/LiveCalendarView.tsx","../../src/apps/calendar/views/calendar-view/BaseCalendarView.tsx"],"sourcesContent":["import { HashObject } from 'libs/common/react/interfaces';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { CalendarQueryParams } from 'libs/shared/apps/calendar/interfaces/CalendarQueryParams';\n\n/**\n * NOTE: Ensure any keys added here are also added\n * to sanitizeLiveCalendarViewParams below.\n */\nexport interface LiveCalendarViewQueryParams extends CalendarQueryParams {\n classification?: string;\n yearGroup?: string;\n}\n\nexport function sanitizeLiveCalendarViewParams(\n queryParams: HashObject\n): LiveCalendarViewQueryParams {\n if (!queryParams)\n return {};\n\n return ObjectHelper.pick(queryParams, [\n 'year',\n 'classification',\n 'yearGroup'\n ]);\n}\n",":local {\n .wrapper {\n border-width: 0.125rem !important;\n }\n\n .weekend {\n background-color: $gray-100;\n }\n}","import React from 'react';\n\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarDay } from 'libs/shared/apps/calendar/components/calendar-day/CalendarDay';\nimport { CalendarCellProps } from 'libs/shared/apps/calendar/interfaces/CalendarCellProps';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { HoverToPortalContainer } from 'libs/shared/components/hover-to-portal-container/HoverToPortalContainer';\n\nimport styles from './calendar-cell.module.scss';\n\nfunction getIsWeekend(date: Date): boolean {\n return DateHelper.getWeekday(date) === 0 || DateHelper.getWeekday(date) === 6;\n}\n\nexport function CalendarCell(props: CalendarCellProps): JSX.Element {\n const { date, notCurrentMonth } = props;\n const [ sliderStep, setSliderStep ] = React.useState<number>(0);\n\n let wrapperClassname = `position-relative border ${props.theme.border} ${styles.wrapper}`;\n if (getIsWeekend(date)) wrapperClassname += ` ${styles.weekend}`;\n if (notCurrentMonth) wrapperClassname += `opacity-50`;\n\n const eventsOnDay = SpecialEventHelper.getEventsForDay(\n date,\n props.events || [],\n props.crossMonthEvents || [],\n props.viewingMonth\n );\n\n const updatedProps = { ...props, eventsOnDay, sliderStep, setSliderStep };\n return (\n <td className={wrapperClassname}>\n {eventsOnDay?.length > 0 ? (\n <HoverToPortalContainer<CalendarCellProps>\n hoverableComponent={CalendarDay}\n componentProps={updatedProps}\n hoverScale={1.35}\n />\n ) : <CalendarDay {...updatedProps} isHovering={false} />}\n </td>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'specialEvent.eventsEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface SpecialEventEmptyStateProps {\n appLink: Core.AppLink;\n imageUrl: string;\n heading?: string;\n}\n\nexport function SpecialEventEmptyState(props: SpecialEventEmptyStateProps): JSX.Element {\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} altText={getPhrase('info')} />\n <EmptyState.Heading>{props.heading || <Text phrase='heading' />}</EmptyState.Heading>\n {props.appLink &&\n <EmptyState.Info>\n <>\n <Text namespace={namespace} phrase='info' />\n <AppLink appLink={props.appLink}>\n <span className='text-info'>{getPhrase('link')}</span>\n </AppLink>\n </>\n </EmptyState.Info>\n }\n </EmptyState>\n </LanguageNamespaceContext.Provider>\n );\n}\n",":local {\n .date {\n margin-bottom: 1rem;\n }\n .first {\n margin-top: map-get($spacers, 1) !important;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { SpecialEventListItem } from 'libs/shared/apps/calendar/components/special-event-list-item/SpecialEventListItem';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { CalendarEvent, CalendarEventContent } from 'libs/shared/interfaces';\n\nimport styles from './special-event-list.module.scss';\n\ninterface SpecialEventListProps {\n events: CalendarEvent[];\n presentationId: string;\n appLink: (content: CalendarEventContent, slug?: string) => Core.AppLink;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getActionLabel?: (content?: CalendarEventContent) => string;\n getStartTime?: (content: CalendarEventContent) => string;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function SpecialEventList(props: SpecialEventListProps): JSX.Element {\n const eventsInMonth: Record<string, CalendarEvent<CalendarEventContent>[]> = {};\n\n props.events.forEach(e => {\n const startDate = e.startDate;\n if (eventsInMonth[startDate]) {\n eventsInMonth[startDate].push(e);\n } else {\n eventsInMonth[startDate] = [e];\n }\n });\n\n const keys = Object.keys(eventsInMonth);\n keys.sort((a, b) => DateHelper.isBefore(a, b) ? -1 : 0);\n\n return (\n <div className='py-1'>\n {keys.map((k, idx) => {\n let prevTime = '';\n let currentTime = '';\n return (\n <div key={k}>\n <div className={`h4 mt-4 ${styles.date} ${idx === 0 ? styles.first : ''}`}>{SpecialEventHelper.getOrdinalDate(k)}</div>\n {eventsInMonth[k].map(e => {\n prevTime = currentTime;\n currentTime = props.getStartTime?.(e.content);\n\n return (\n <SpecialEventListItem\n key={e.content.id}\n getAppLink={(id, name) => {\n return props.appLink(id, TextHelper.slugify(name));\n }}\n event={e}\n presentationId={props.presentationId}\n getIconUrl={props.getIconUrl}\n getBannerUrl={props.getBannerUrl}\n getBackgroundColor={props.getBackgroundColor}\n getActionLabel={() => props.getActionLabel(e.content)}\n getStartTime={props.getStartTime && prevTime !== currentTime ?\n props.getStartTime :\n null\n }\n isPastEvent={props.isPastEvent}\n />\n );\n })}\n </div>\n );\n })}\n </div>\n );\n}\n",":local {\n .header {\n height: map-get($spacers, 5);\n }\n .thead {\n border-width: 0.125rem !important;\n }\n td {\n width: 14.285%; // 100% / 7\n }\n}","import React from 'react';\nimport { Spinner } from 'react-bootstrap';\n\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarCell } from 'libs/shared/apps/calendar/components/calendar-cell/CalendarCell';\nimport { getCalendarAnimationDurationMs } from 'libs/shared/apps/calendar/constants/CalendarAnimation';\nimport { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarImageUrls } from 'libs/shared/apps/calendar/interfaces/CalendarImageUrls';\nimport { CalendarTheme } from 'libs/shared/apps/calendar/interfaces/CalendarTheme';\nimport { MonthQuery } from 'libs/shared/apps/calendar/interfaces/MonthQuery';\nimport { WeeksTable } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { Timezone } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { CalendarEvent, CalendarEventContent } from 'libs/shared/interfaces';\n\nimport { SpecialEventEmptyState } from '../empty-state/SpecialEventEmptyState';\nimport { SpecialEventList } from '../special-event-list/SpecialEventList';\n\nimport styles from './calendar-body.module.scss';\n\nCalendarBody.defaultProps = {\n theme: {\n border: 'border-light-blue',\n background: 'bg-light-blue'\n }\n};\n\ninterface CalendarBodyProps {\n weekDays: WeeksTable;\n weekDaysHeader: string[];\n events?: CalendarEvent[];\n monthQuery: MonthQuery;\n viewingMonth: Date;\n eventsLoaded: boolean;\n presentationId: string;\n appLinks: CalendarAppLinks;\n imageUrls: CalendarImageUrls;\n viewMode?: string;\n theme?: CalendarTheme;\n emptyStateHeading?: string;\n fadePastEvents?: boolean;\n timezone?: Timezone;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getCoverUrl?: (content: CalendarEventContent) => string;\n getActionLabel?: (content?: CalendarEventContent) => string;\n getStartTime?: (content: CalendarEventContent) => string;\n getHardCodedEvent?: (content: CalendarEventContent) => HashObject;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function CalendarBody(props: CalendarBodyProps): JSX.Element {\n const { appLinks, imageUrls } = props;\n\n const breakpoints = useBreakpoints();\n\n const eventsInMonth = SpecialEventHelper.getEventsInMonth(props.events || [], props.viewingMonth);\n\n // cross-month events that should be shown on the first cell of the month\n const crossMonthEventsForFirstDay = React.useMemo(() => {\n const allDatesInView = new Set(\n props.weekDays.reduce((acc, week) => acc.concat(week), [])\n .map(d => DateHelper.format(d, 'YYYY-MM-DD'))\n );\n\n const crossMonthEvents = (props.events || []).filter(e => {\n if (!e.startDate) return false;\n const isFromPreviousMonth = SpecialEventHelper.isEventFromPreviousMonth(e, props.viewingMonth);\n // Only include if the event's start date is NOT already visible in the current view\n const startDateVisible = allDatesInView.has(DateHelper.format(e.startDate, 'YYYY-MM-DD'));\n return isFromPreviousMonth && !startDateVisible;\n });\n\n return crossMonthEvents;\n }, [ props.weekDays, props.events ]);\n\n const isGridView = props.viewMode !== 'list' && !breakpoints.xs && !breakpoints.sm && !breakpoints.md;\n\n const [ hasInitialized, setHasInitialized ] = React.useState(false);\n const [ hoveredEvent, setHoveredEvent ] = React.useState<CalendarEvent<CalendarEventContent>>(null);\n\n React.useEffect(() => {\n if (props.eventsLoaded && !hasInitialized) {\n const maxRowIndex = props.weekDays.length - 1;\n const timeoutId = window.setTimeout(\n () => setHasInitialized(true),\n getCalendarAnimationDurationMs(maxRowIndex)\n );\n return () => window.clearTimeout(timeoutId);\n }\n }, [props.eventsLoaded]);\n\n if (props.eventsLoaded && !eventsInMonth?.length) {\n return (\n <SpecialEventEmptyState\n imageUrl={imageUrls.emptyState}\n appLink={appLinks.emptyStateRedirect?.()}\n heading={props.emptyStateHeading}\n />\n );\n }\n\n if (!isGridView) {\n if (!props.eventsLoaded) {\n return (\n <div className='d-flex justify-content-center align-items-center mb-4'>\n <Spinner as='div' animation='border' role='status' />\n </div>\n );\n }\n\n return (\n <SpecialEventList\n events={eventsInMonth}\n presentationId={props.presentationId}\n appLink={props.appLinks.event}\n getIconUrl={props.getIconUrl}\n getBannerUrl={props.getBannerUrl}\n getBackgroundColor={props.getBackgroundColor}\n getActionLabel={props.getActionLabel}\n getStartTime={props.getStartTime}\n isPastEvent={props.isPastEvent}\n />\n );\n }\n\n return (\n <table className='user-select-none w-100 mt-3 overflow-hidden rounded-top-lg'>\n <thead className={`border ${props.theme.border} ${styles.thead}`}>\n <tr className={`fw-semibold ${props.theme.background} ${styles.header}`}>\n {props.weekDaysHeader.map(w => <th key={w} className='px-2 h4' scope='col'>{w}</th>)}\n </tr>\n </thead>\n\n <tbody>\n {props.weekDays.map((w, weekIndex) => (\n <tr key={w[0].toString()}>\n {w.map(d => {\n return (\n <CalendarCell\n key={d.toString()}\n rowIndex={weekIndex}\n date={d}\n notCurrentMonth={!!d.notCurrentMonth}\n events={props.events}\n crossMonthEvents={crossMonthEventsForFirstDay}\n viewingMonth={props.viewingMonth}\n monthQuery={props.monthQuery}\n hasInitialized={hasInitialized}\n presentationId={props.presentationId}\n hoveredEvent={hoveredEvent}\n theme={props.theme}\n setHoveredEvent={setHoveredEvent}\n getEventsListAppLink={() => props.appLinks.eventList(props.monthQuery, d, props.presentationId)}\n getTopicAppLink={(calendarEventContent, slug) =>\n props.appLinks.event(calendarEventContent, slug)}\n getIconUrl={props.getIconUrl}\n getBackgroundColor={props.getBackgroundColor}\n getCoverUrl={props.getCoverUrl}\n getHardCodedEvent={props.getHardCodedEvent}\n fadePastEvents={props.fadePastEvents}\n timezone={props.timezone}\n />\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n",":local {\n $svg-shift: 0.1rem; // Even though the element is centered, the chevron SVGs appear slightly off-center. This corrects that.\n\n .chevron {\n min-width: $cv-svg-size-xlg;\n }\n\n .left {\n left: -1rem;\n\n svg {\n transform: translateX(-$svg-shift);\n }\n }\n\n .right {\n right: -1rem;\n\n svg {\n transform: translateX($svg-shift);\n }\n }\n\n .viewModeContainer {\n height: 2.5rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { AnalyticsOptions, CalendarDisplayModeDescriptor, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarViewMode } from 'libs/shared/apps/calendar/interfaces/CalendarViewMode';\nimport { canNavToOtherMonths } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { IconButton } from 'libs/shared/components/icon-button/IconButton';\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { ChevronLeftSvg } from 'libs/shared/images/svg/arrows/ChevronLeftSvg';\nimport { ChevronRightSvg } from 'libs/shared/images/svg/arrows/ChevronRightSvg';\nimport { CalendarSvg } from 'libs/shared/images/svg/objects/CalendarSvg';\nimport { TableOfContentsSvg } from 'libs/shared/images/svg/objects/TableOfContentsSvg';\n\nimport styles from './calendar-nav.module.scss';\n\nconst namespace = 'specialEventCalendar.calendarNav';\n\ninterface CalendarNavProps extends React.PropsWithChildren {\n monthDate: Date;\n appLinks: CalendarAppLinks;\n viewMode?: CalendarViewMode;\n queryParams?: HashObject;\n setViewingMonthDate: (date?: Date) => void;\n setViewMode?: (viewMode: CalendarViewMode) => void;\n}\n\ninterface ViewModeSwitcherProps {\n viewMode: CalendarViewMode;\n setViewMode?: (viewMode: CalendarViewMode) => void;\n}\n\nfunction ViewModeSwitcher(props: ViewModeSwitcherProps): JSX.Element {\n return (\n <div className={`${styles.viewModeContainer} d-none d-lg-block`}>\n <IconButton\n svg={CalendarSvg}\n className={`${props.viewMode === 'calendar' ? 'bg-dark text-white' : ''} btn btn-outline-dark rounded-start rounded-end-0 border-end-0 px-3 h-100`}\n onClick={() => props.setViewMode('calendar')}\n analyticsData={{}}\n analyticsOptions={{\n entity: EntityType.AppLink,\n actionType: UserAction.Click,\n descriptor: CalendarDisplayModeDescriptor.Calendar,\n location: LocationContext.CalendarNav\n }}\n />\n <IconButton\n svg={TableOfContentsSvg}\n className={`${props.viewMode === 'list' ? 'bg-dark text-white' : ''} btn btn-outline-dark rounded-end rounded-start-0 border-start-0 px-3 h-100`}\n onClick={() => props.setViewMode('list')}\n analyticsData={{}}\n analyticsOptions={{\n entity: EntityType.AppLink,\n actionType: UserAction.Click,\n descriptor: CalendarDisplayModeDescriptor.List,\n location: LocationContext.CalendarNav\n }}\n />\n </div>\n );\n}\n\ninterface NavigateButtonProps {\n action: 'next' | 'previous';\n appLink?: Core.AppLink;\n analyticsOptions?: AnalyticsOptions;\n analyticsData?: HashObject;\n onClick: () => void;\n}\n\nfunction NavigateButton(props: NavigateButtonProps): JSX.Element {\n const arrowSvg = props.action === 'previous' ? ChevronLeftSvg : ChevronRightSvg;\n const className = props.action === 'previous' ? styles.left : styles.right;\n\n function onClick() {\n Core.AppLinkHelper.trigger(props.appLink);\n\n props.onClick();\n }\n\n return (\n <AppLink\n appLink={props.appLink}\n analyticsData={props.analyticsData}\n analyticsOptions={props.analyticsOptions}\n className={`${styles.chevron} ${className} border border-dark rounded-circle bg-white d-flex align-items-center justify-content-center`}\n onClick={onClick}\n >\n <SvgContainer\n svg={arrowSvg}\n size={SvgContainerSize.Medium}\n className={`svg-container d-inline-block ${styles.svg}`}\n />\n </AppLink>\n );\n}\n\nconst CUR_DATE = new Date();\n\nexport function CalendarNav(props: CalendarNavProps): JSX.Element {\n const { appLinks } = props;\n\n const breakpoints = useBreakpoints();\n \n function getAppLink(monthDate?: Date): Core.AppLink {\n const month = DateHelper.format(monthDate, 'MMMM').toLocaleLowerCase();\n\n const appLink: Core.AppLink = appLinks.month(month);\n\n const params: HashObject = {};\n\n if (monthDate) {\n const currentYear = new Date().getFullYear();\n const year = monthDate.getFullYear();\n \n if (currentYear !== year)\n params.year = year;\n }\n\n if (props.queryParams?.classification)\n params.classification = props.queryParams.classification;\n\n if (props.queryParams?.yearGroup)\n params.yearGroup = props.queryParams.yearGroup;\n\n appLink.params = params;\n\n return appLink;\n }\n\n function onClickNext () {\n const nextMonth = DateHelper.add(props.monthDate, 1, 'month');\n props.setViewingMonthDate(nextMonth);\n }\n\n function onClickPrevious() {\n const prevMonth = DateHelper.subtract(props.monthDate, 1, 'month');\n props.setViewingMonthDate(prevMonth);\n }\n\n function onClickToday() {\n if (DateHelper.format(CUR_DATE, 'M YY') === DateHelper.format(props.monthDate, 'M YY')) return;\n \n props.setViewingMonthDate();\n }\n \n const { showPrev, showNext } = canNavToOtherMonths(props.monthDate);\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: LocationContext.CalendarNav\n };\n\n function formatAnalyticDataDate(date: Date) {\n return DateHelper.format(date, 'YYYY-MM-DD');\n }\n return (\n <div className='d-flex flex-wrap gap-3 justify-content-end align-items-center'>\n <h1 className='mb-0 h2 me-auto'>{DateHelper.format(props.monthDate, breakpoints.xs ? 'MMM YYYY' : 'MMMM YYYY')}</h1>\n\n {props.children}\n\n {props.setViewMode && (\n <ViewModeSwitcher viewMode={props.viewMode} setViewMode={props.setViewMode} />\n )}\n <div className='d-flex gap-3'>\n {showPrev && (\n <NavigateButton\n appLink={getAppLink(DateHelper.startOf(DateHelper.subtract(props.monthDate, 1, 'month'), 'month'))}\n action='previous'\n onClick={onClickPrevious}\n analyticsOptions={analyticsOptions}\n analyticsData={{ action: 'previous', date: formatAnalyticDataDate(DateHelper.startOf(DateHelper.add(props.monthDate, 1, 'month'), 'month')) }}\n />\n )}\n <AppLink\n appLink={getAppLink()}className={`${styles.todayWrapper} btn btn-outline-dark fw-semibold`}\n onClick={onClickToday}\n analyticsOptions={analyticsOptions}\n analyticsData={{ action: 'today', date: formatAnalyticDataDate(DateHelper.startOf(CUR_DATE, 'month')) }}\n >\n {LanguageService.getPhrase(namespace, 'today')}\n </AppLink>\n {showNext && (\n <NavigateButton\n appLink={getAppLink(DateHelper.startOf(DateHelper.add(props.monthDate, 1, 'month'), 'month'))}\n analyticsOptions={analyticsOptions}\n analyticsData={{ action: 'next', date: formatAnalyticDataDate(DateHelper.startOf(DateHelper.add(props.monthDate, 1, 'month'), 'month')) }}\n action='next'\n onClick={onClickNext}\n />\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'specialEvent.eventsErrorState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface SpecialEventErrorStateProps {\n imageUrl: string;\n appLink: Core.AppLink;\n}\n\nexport function SpecialEventErrorState(props: SpecialEventErrorStateProps): JSX.Element {\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} />\n <EmptyState.Heading><Text phrase='heading' /></EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='info' />\n <br/>\n <AppLink appLink={props.appLink}>\n <span className='text-info'>{getPhrase('link')}</span>\n </AppLink>\n </EmptyState.Info>\n </EmptyState>\n </LanguageNamespaceContext.Provider>\n );\n}\n","import { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarEvent } from 'libs/shared/interfaces';\n\nimport { CalendarRequests } from '../flight-request/CalendarRequests';\nimport { getCalendarRange } from '../utils/CalendarHelper';\n\nexport function useCalendarEventsData(viewMonth: Date, presentationId: string) {\n const pid = presentationId;\n const [ startDate, endDate ] = getCalendarRange(viewMonth);\n\n const nextMonth = DateHelper.add(viewMonth, 1, 'month');\n const [ nextStartDate, nextEndDate ] = getCalendarRange(nextMonth);\n\n const prevMonth = DateHelper.subtract(viewMonth, 1, 'month');\n const [ prevStartDate, prevEndDate ] = getCalendarRange(prevMonth);\n\n const events = Flight.useBasicFetch<CalendarEvent[]>((startDate && endDate && pid)\n && CalendarRequests.calendarEvents(DateHelper.format(startDate, 'YYYY-MM-DD'), DateHelper.format(endDate, 'YYYY-MM-DD'), pid));\n const nextEvents = Flight.useBasicFetch<CalendarEvent[]>((nextStartDate && nextEndDate && pid)\n && CalendarRequests.calendarEvents(DateHelper.format(nextStartDate, 'YYYY-MM-DD'), DateHelper.format(nextEndDate, 'YYYY-MM-DD'), pid));\n const prevEvents = Flight.useBasicFetch<CalendarEvent[]>((prevStartDate && prevEndDate && pid)\n && CalendarRequests.calendarEvents(DateHelper.format(prevStartDate, 'YYYY-MM-DD'), DateHelper.format(prevEndDate, 'YYYY-MM-DD'), pid));\n\n const uniqueEventList = ArrayHelper.uniq(\n [ ...prevEvents.data || [], ...events.data || [], ...nextEvents.data || [] ],\n e => e.specialEventPolicyId\n );\n\n return { events: uniqueEventList, loaded: events.hasCompleted };\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\n\nimport { buildWeeksTable, DatePositionMap, initWeekDays, WeeksTable } from '../utils/CalendarHelper';\n\ntype Cache = Record<string, {\n datePositionMap: DatePositionMap,\n weeksTable: WeeksTable\n}>;\n\nconst TODAY_DATE = new Date();\n\nexport function useCalendarWeeksTable(date: Date = TODAY_DATE, appLinks: CalendarAppLinks, startAtMon: boolean = true) {\n const weekDaysHeader = initWeekDays(startAtMon);\n const cacheRef = React.useRef<Cache>({});\n\n const monthDateString = DateHelper.format(date, 'YYYY-MM');\n const weekDays = React.useMemo(() => {\n const cached = cacheRef.current[monthDateString];\n if (!cached) {\n const { weeksTable, datePositionMap } = buildWeeksTable(date, startAtMon);\n\n cacheRef.current[monthDateString] = { weeksTable, datePositionMap };\n return weeksTable;\n }\n\n return cached.weeksTable;\n }, [ monthDateString, startAtMon ]);\n\n function setViewingMonthDate(nextMonthDate?: Date) {\n if (!nextMonthDate) {\n Core.AppLinkHelper.trigger(appLinks.calendar());\n\n return;\n }\n\n if (monthDateString !== DateHelper.format(nextMonthDate, 'YYYY-MM')) {\n const month = DateHelper.format(nextMonthDate, 'MMMM').toLocaleLowerCase();\n\n const currentYear = new Date().getFullYear();\n const year = date.getFullYear();\n\n const appLink: Core.AppLink = appLinks.month(month);\n\n if (currentYear !== year)\n appLink.params = { year };\n\n Core.AppLinkHelper.trigger(appLink);\n }\n }\n\n const startDate = ArrayHelper.first(ArrayHelper.first(weekDays));\n const endDate = ArrayHelper.last(ArrayHelper.last(weekDays));\n\n return { weekDaysHeader, weekDays, monthDate: date, setMonthDate: setViewingMonthDate, startDate, endDate };\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/react/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarBody } from 'libs/shared/apps/calendar/components/calendar-body/CalendarBody';\nimport { CalendarNav } from 'libs/shared/apps/calendar/components/calendar-nav/CalendarNav';\nimport { SpecialEventErrorState } from 'libs/shared/apps/calendar/components/error-state/SpecialEventErrorState';\nimport { useCalendarEventsData } from 'libs/shared/apps/calendar/hooks/useCalendarEventsData';\nimport { useCalendarWeeksTable } from 'libs/shared/apps/calendar/hooks/useCalendarWeeksTable';\nimport { CalendarQueryParams } from 'libs/shared/apps/calendar/interfaces/CalendarQueryParams';\nimport { getIsValidMonth, parseMonthString } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { HardCoded } from 'libs/shared/constants/HardCoded';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Classification, CurrentUser } from 'libs/shared/interfaces';\nimport { ImageHelper } from 'libs/shared/utils/ImageHelper';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useAvailablePresentations } from 'shared/hooks/presentations/useAvailablePresentations';\nimport { useRequestAccess } from 'shared/hooks/useRequestAccess';\nimport { useShowCalendar } from 'shared/hooks/useShowCalendar';\nimport { REGIONAL_CALENDAR_INDEXABILITY } from 'shared/utils/LiteRegionHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { getCalendarAppLinks, getCalendarImageUrls } from 'apps/calendar/views/calendar-view/CalendarViewUtils';\nimport { getDiscoverHeaderAppLinks } from 'apps/dashboard/views/dashboard/DiscoverViewUtils';\n\nconst namespace = 'specialEventCalendar.calendarView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport interface CalendarViewProps {\n month?: string;\n presentationSlug: string;\n}\n\nexport function CalendarView(props: CalendarViewProps): JSX.Element {\n const breakpoints = useBreakpoints();\n const { showCalendar, isLoading } = useShowCalendar();\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const { availablePresentations } = useAvailablePresentations();\n const { activePresentation } = useActivePresentation();\n \n const { applinks: calendarAppLinks } = useRequestAccess({\n applinks: getCalendarAppLinks(props.presentationSlug ?? null, availablePresentations),\n exceptions: ['month']\n });\n\n const isValidMonth = getIsValidMonth(props.month);\n\n React.useEffect(() => {\n if (!isLoading && !showCalendar)\n Core.AppLinkHelper.trigger(\n getDiscoverHeaderAppLinks(activePresentation?.vanitySlug ?? props.presentationSlug).forYou,\n { replace: true }\n );\n }, [ showCalendar, isLoading ]);\n\n const viewingMonth = parseMonthString(props.month);\n\n const {\n monthDate,\n setMonthDate,\n weekDays,\n weekDaysHeader,\n startDate, endDate\n } = useCalendarWeeksTable(viewingMonth, calendarAppLinks);\n\n const { events, loaded } = useCalendarEventsData(viewingMonth, activePresentation.id);\n\n const currentMonthYear = DateHelper.format(monthDate, 'MMMM YYYY');\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: currentMonthYear,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink<keyof CalendarQueryParams>({ allowedParams: ['year']}),\n allowIndexing: SeoHelper.allowIndexing(),\n hrefLang: SeoHelper.getStaticRouteHrefLang(\n activePresentation?.learningLevel,\n calendarAppLinks.calendar,\n REGIONAL_CALENDAR_INDEXABILITY\n )\n }));\n\n if (props.month !== null && !isValidMonth) {\n return (\n <SpecialEventErrorState\n imageUrl={getCalendarImageUrls().errorState}\n appLink={calendarAppLinks.calendar()}\n />\n );\n }\n\n function getIconUrl(classification: Classification, hardCodedEvent?: HashObject): string {\n return hardCodedEvent ?\n // in calendar we use hardcoded icon for hardcoded event\n ImageHelper.createUrl((hardCodedEvent.iconUrl), { size: ImageSize.Medium }) :\n ImageHelper.createUrl(classification.icon?.url, { size: ImageSize.Small });\n }\n\n function getCoverUrl(classification: Classification): string {\n return ImageHelper.createUrl(classification.cover?.url, { size: ImageSize.Small });\n }\n\n function getActionLabel(): string {\n return !breakpoints.xs ? getPhrase('buttonLabel') : getPhrase('mobileButtonLabel');\n }\n\n function getHardCodedEvent(classification: Classification): HashObject {\n return HardCoded.SpecialEvents[classification.id as keyof typeof HardCoded.SpecialEvents];\n }\n\n if (isLoading || !showCalendar || !activePresentation?.id || !currentUser.data.countryCode)\n return <></>;\n\n return (\n <div className='bg-white px-3'>\n <CalendarNav monthDate={monthDate} setViewingMonthDate={setMonthDate} appLinks={calendarAppLinks} />\n <CalendarBody\n weekDays={weekDays}\n weekDaysHeader={weekDaysHeader}\n events={events}\n monthQuery={{ from: startDate?.toString(), to: endDate?.toString() }}\n viewingMonth={viewingMonth}\n eventsLoaded={loaded}\n presentationId={activePresentation.id}\n appLinks={calendarAppLinks}\n imageUrls={getCalendarImageUrls(currentUser.data.countryCode)}\n getIconUrl={(classification: Classification) => getIconUrl(classification, getHardCodedEvent(classification))}\n getCoverUrl={getCoverUrl}\n getBackgroundColor={(classification: Classification) => classification.metadata?.backgroundColor}\n getBannerUrl={(classification: Classification) => classification.banner?.url}\n getActionLabel={getActionLabel}\n getHardCodedEvent={getHardCodedEvent}\n />\n </div>\n );\n}\n","import { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { HashObject } from 'libs/analytics/interfaces';\n\nimport { getCalendarRange } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { CalendarEvent } from 'libs/shared/interfaces';\n\nimport { LivestreamRequests } from 'shared/flight-requests/LivestreamRequests';\n\nexport function useLiveCalendarEventsData(viewMonth: Date, queryParams?: HashObject) {\n const [ startDate, endDate ] = getCalendarRange(viewMonth);\n\n const nextMonth = DateHelper.add(viewMonth, 1, 'month');\n const [ nextStartDate, nextEndDate ] = getCalendarRange(nextMonth);\n\n const prevMonth = DateHelper.subtract(viewMonth, 1, 'month');\n const [ prevStartDate, prevEndDate ] = getCalendarRange(prevMonth);\n\n const filters: HashObject = {};\n\n if (queryParams.yearGroup)\n filters.audienceId = queryParams.yearGroup;\n\n if (queryParams.classification) {\n filters.topicId = queryParams.classification;\n filters.includeChildrenTopics = true;\n }\n\n const events = Flight.useBasicFetch<CalendarEvent[]>((startDate && endDate)\n && LivestreamRequests.calendarLivestreams({\n from: DateHelper.format(startDate, 'YYYY-MM-DD'),\n to: DateHelper.format(endDate, 'YYYY-MM-DD'),\n ...filters\n }));\n\n const nextEvents = Flight.useBasicFetch<CalendarEvent[]>((nextStartDate && nextEndDate)\n && LivestreamRequests.calendarLivestreams({\n from: DateHelper.format(nextStartDate, 'YYYY-MM-DD'),\n to: DateHelper.format(nextEndDate, 'YYYY-MM-DD'),\n ...filters\n }));\n\n const prevEvents = Flight.useBasicFetch<CalendarEvent[]>((prevStartDate && prevEndDate)\n && LivestreamRequests.calendarLivestreams({\n from: DateHelper.format(prevStartDate, 'YYYY-MM-DD'),\n to: DateHelper.format(prevEndDate, 'YYYY-MM-DD'),\n ...filters\n }));\n\n const uniqueEventList = ArrayHelper.uniq(\n [ ...prevEvents.data || [], ...events.data || [], ...nextEvents.data || [] ],\n e => e.id\n );\n\n return { events: uniqueEventList, loaded: events.hasCompleted };\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { StorageType } from 'libs/common/backbone/utils/LocalStorageHelper';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\nimport { Flight } from 'libs/common/react/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { CalendarBody } from 'libs/shared/apps/calendar/components/calendar-body/CalendarBody';\nimport { CalendarNav } from 'libs/shared/apps/calendar/components/calendar-nav/CalendarNav';\nimport { SpecialEventErrorState } from 'libs/shared/apps/calendar/components/error-state/SpecialEventErrorState';\nimport { useCalendarWeeksTable } from 'libs/shared/apps/calendar/hooks/useCalendarWeeksTable';\nimport { CalendarQueryParams } from 'libs/shared/apps/calendar/interfaces/CalendarQueryParams';\nimport { CalendarViewMode } from 'libs/shared/apps/calendar/interfaces/CalendarViewMode';\nimport { getIsValidMonth, parseMonthString } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { SearchFilters } from 'libs/shared/apps/search/components/search-filters/SearchFilters';\nimport { SearchFilter, TopicResults } from 'libs/shared/apps/search/interfaces';\nimport { TimezoneIndicator } from 'libs/shared/apps/streamable-learning/components/timezone-indicator/TimezoneIndicator';\nimport { Timezone } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { ClassificationRequests } from 'libs/shared/flight-requests/ClassificationRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Livestream, PresentationAudience } from 'libs/shared/interfaces';\nimport { ImageHelper } from 'libs/shared/utils/ImageHelper';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useRequestAccess } from 'shared/hooks/useRequestAccess';\nimport { LiveCalendarViewQueryParams } from 'shared/interfaces/query-params/LiveCalendarViewQueryParams';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { useLiveCalendarEventsData } from 'apps/calendar/hooks/useLiveCalendarEventsData';\nimport { LiveCalendarUtils } from 'apps/calendar/utils/LiveCalendarUtils';\nimport {\n getLiveCalendarAppLinks, getLiveCalendarImageUrls } from 'apps/calendar/views/calendar-view/CalendarViewUtils';\n\nconst namespace = 'liveCalendar.calendarView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface ViewModelViewModel {\n viewMode: CalendarViewMode;\n}\n\nLiveCalendarView.defaultProps = {\n queryParams: {}\n};\n\nexport interface LiveCalendarViewProps {\n month?: string;\n presentationSlug: string | null;\n queryParams?: LiveCalendarViewQueryParams;\n}\n\nexport function LiveCalendarView(props: LiveCalendarViewProps): JSX.Element {\n const [{ viewMode }, setMode ] = useViewModel<ViewModelViewModel>('calendar:mode', { viewMode: 'calendar' }, {\n storage: StorageType.LocalStorage\n });\n\n const { hasPermissions } = usePermissions();\n const isStudent = hasPermissions(PermissionName.StudentExperience);\n\n const { activePresentation } = useActivePresentation();\n \n const { applinks: calendarAppLinks } = useRequestAccess({\n applinks: getLiveCalendarAppLinks(props.presentationSlug),\n exceptions: ['month']\n });\n\n const audiences = Flight.useBasicFetch<PresentationAudience[]>(activePresentation &&\n AudienceRequests.presentationAudiences(PresentationType.StreamableLearning, activePresentation.id));\n\n const availableTopics = Flight.useBasicFetch<TopicResults>(activePresentation &&\n ClassificationRequests.topicsFromAllAvailablePresentations([activePresentation.id]));\n\n const isValidMonth = getIsValidMonth(props.month);\n\n const viewingMonth = parseMonthString(props.month);\n\n const {\n monthDate,\n setMonthDate,\n weekDays,\n weekDaysHeader,\n startDate,\n endDate\n } = useCalendarWeeksTable(viewingMonth, calendarAppLinks);\n\n const { events, loaded } = useLiveCalendarEventsData(viewingMonth, props.queryParams);\n const currentMonthYear = DateHelper.format(monthDate, 'MMMM YYYY');\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: currentMonthYear,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink<keyof CalendarQueryParams>({ allowedParams: ['year']}),\n allowIndexing: true\n }));\n\n if (props.month !== null && !isValidMonth) {\n return (\n <SpecialEventErrorState\n imageUrl={getLiveCalendarImageUrls().errorState}\n appLink={calendarAppLinks.calendar()}\n />\n );\n }\n\n const mainFilters: SearchFilter<string>[] = [\n {\n id: 'classification',\n name: getPhrase('subjectFilter'),\n options: availableTopics.data?.topics.map(t => ({ name: t.name, id: t.topicIds.join(':') })),\n type: 'checkbox',\n compatibleIndices: []\n },\n {\n id: 'yearGroup',\n name: getPhrase('gradeFilter'),\n type: 'checkbox',\n options: audiences.data?.map(a => ({ name: a.name, id: a.masterId })),\n compatibleIndices: []\n }\n ];\n\n function getAppLink(): Core.AppLink {\n const month = DateHelper.format(monthDate, 'MMMM').toLocaleLowerCase();\n\n const currentYear = new Date().getFullYear();\n const year = monthDate.getFullYear();\n\n const appLink: Core.AppLink = calendarAppLinks.month(month);\n\n const params: HashObject = {};\n\n if (currentYear !== year)\n params.year = year;\n\n if (props.queryParams.classification)\n params.classification = props.queryParams.classification;\n\n if (props.queryParams.yearGroup)\n params.yearGroup = props.queryParams.yearGroup;\n\n return appLink;\n }\n\n function getActionLabel(livestream: Livestream): string {\n return isStudent || DateHelper.isBefore(livestream.endDateTime, new Date()) ? 'pastActionLabel' : 'actionLabel';\n }\n\n function getEmptyStateHeading(): string {\n const eventsInMonth = SpecialEventHelper.getEventsInMonth(events || [], viewingMonth);\n\n if (!eventsInMonth.length && (props.queryParams.yearGroup || props.queryParams.classification))\n return getPhrase('emptyStateText');\n }\n\n function getIconUrl(content: Livestream) {\n return ImageHelper.createUrl(content.company.logo?.url, { size: ImageSize.Small });\n }\n\n function getBannerUrl(content: Livestream) {\n return ImageHelper.createUrl(content.company.banner?.url, { size: ImageSize.Large });\n }\n\n if (!activePresentation)\n return <></>;\n\n return (\n <div className='bg-white px-4'>\n <CalendarNav\n monthDate={monthDate}\n setViewingMonthDate={setMonthDate}\n appLinks={calendarAppLinks}\n queryParams={props.queryParams}\n viewMode={viewMode}\n setViewMode={(newViewMode: CalendarViewMode) => setMode({ viewMode: newViewMode })}\n >\n <div className='mx-n1 order-1 order-sm-0'>\n <SearchFilters\n queryParams={ObjectHelper.omit(props.queryParams, ['year'])}\n mainFilters={mainFilters}\n appLink={getAppLink()}\n isFetchingOptions={!availableTopics.data || !activePresentation || !audiences.data}\n alignResetButtonLeft\n hideDivider\n hideHeading\n hideCaret={false}\n noContainerPaddingBottom\n />\n </div>\n </CalendarNav>\n <div className={`position-relative mt-3 ${viewMode === 'list' ? '' : 'mt-lg-0'}`}>\n <div className={`d-block ${viewMode === 'list' ? '' : 'd-lg-none'} position-absolute top-0 end-0 mt-2`}>\n <TimezoneIndicator />\n </div>\n <CalendarBody\n weekDays={weekDays}\n weekDaysHeader={weekDaysHeader}\n events={events}\n monthQuery={{ from: startDate?.toString(), to: endDate?.toString() }}\n viewingMonth={viewingMonth}\n eventsLoaded={loaded}\n presentationId={activePresentation.id}\n appLinks={calendarAppLinks}\n imageUrls={getLiveCalendarImageUrls()}\n viewMode={viewMode}\n getActionLabel={livestream => getPhrase(getActionLabel(livestream as Livestream))}\n getBackgroundColor={(content: Livestream) => content.company.metadata?.colour}\n getBannerUrl={getBannerUrl}\n getIconUrl={getIconUrl}\n getStartTime={LiveCalendarUtils.getStartTime}\n theme={{\n background: 'bg-light-green',\n border: 'border-light-green'\n }}\n emptyStateHeading={getEmptyStateHeading()}\n fadePastEvents\n timezone={Timezone.ET}\n isPastEvent={LiveCalendarUtils.isPastEvent}\n />\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\n\nimport {\n sanitizeLiveCalendarViewParams\n} from 'shared/interfaces/query-params/LiveCalendarViewQueryParams';\nimport { createPresentationDispatcherView } from 'shared/utils/createPresentationDispatcherView';\n\nimport { CalendarView } from 'apps/calendar/views/calendar-view/calendar/CalendarView';\nimport { LiveCalendarView } from 'apps/calendar/views/calendar-view/live-calendar/LiveCalendarView';\n\ninterface CalendarRouteProps {\n month?: string;\n presentationSlug: string;\n queryParams?: HashObject;\n}\n\nexport const BaseCalendarView = createPresentationDispatcherView<CalendarRouteProps>({\n [PresentationType.Subject]: ctx => (\n <CalendarView month={ctx.month} presentationSlug={ctx.presentationSlug} />\n ),\n [PresentationType.StreamableLearning]: ctx => (\n <LiveCalendarView\n month={ctx.month}\n presentationSlug={ctx.presentationSlug}\n queryParams={sanitizeLiveCalendarViewParams(ctx.queryParams)}\n />\n )\n});\n\nBaseCalendarView.displayName = 'BaseCalendarView';\n"],"mappings":"soEAcA,SAAgB,GACd,EAC6B,CAI7B,OAHK,EAGE,EAAa,KAAK,EAAa,CACpC,OACA,iBACA,WACF,CAAC,EANQ,CAAC,CAOZ,sEEdA,SAAS,GAAa,EAAqB,CACzC,OAAO,EAAW,WAAW,CAAI,IAAM,GAAK,EAAW,WAAW,CAAI,IAAM,CAC9E,CAEA,SAAgB,GAAa,EAAuC,CAClE,GAAM,CAAE,OAAM,mBAAoB,EAC5B,CAAE,EAAY,GAAA,EAAwB,SAAiB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A,CAAC,EAAD,CACY,YACM,iBACR,SACR,WAAY,CAAE,KAAM,GAAW,SAAS,EAAG,GAAI,GAAS,SAAS,CAAE,EACrD,eACd,aAAc,EACd,eAAgB,EAAmB,GACnC,SAAU,EACV,UAAW,EAAyB,EAC1B,WACV,eAAgB,GAAc,EAAU,EAAe,CAAwB,CAAC,EAChF,mBAAqB,GAAwB,EAAQ,QAAQ,UAAU,OACzD,gBACF,cACZ,aAAc,EAAkB,aAChC,MAAO,CACL,WAAY,iBACZ,OAAQ,oBACV,EACA,kBAAmB,GAAqB,EACxC,eAAA,GACA,SAAU,GAAS,GACnB,YAAa,EAAkB,WAChC,CAAA,CACE,GACF,KAxDE,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CA0Df,CCvNA,IAAa,GAAmB,GAAqD,EAClF,EAAiB,SAAU,IAC1B,EAAA,EAAA,IAAA,CAAC,GAAD,CAAc,MAAO,EAAI,MAAO,iBAAkB,EAAI,gBAAmB,CAAA,GAE1E,EAAiB,oBAAqB,IACrC,EAAA,EAAA,IAAA,CAAC,GAAD,CACE,MAAO,EAAI,MACX,iBAAkB,EAAI,iBACtB,YAAa,GAA+B,EAAI,WAAW,CAC5D,CAAA,CAEL,CAAC,EAED,GAAiB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{r as t}from"./D8uRDrkd.chunk.js";import{_ as n,x as r,y as i}from"./BftnFbcr.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{u}from"./BX0wDJmp.chunk.js";import{t as d}from"./C1SLt-ar.chunk.js";import{y as f}from"./NlCAcBdo.chunk.js";import{r as p}from"./Cr6TXzQQ2.chunk.js";import{t as m}from"./oPIkfKWW2.chunk.js";import{n as h,t as g}from"./CmcCVXi32.chunk.js";import{t as _}from"./CcDvlSWl2.chunk.js";import{n as v}from"./DsXWD-Sn.chunk.js";import{t as y}from"./DdsRCMkN.chunk.js";import{t as b}from"./BWaKdG0l.chunk.js";import{t as x}from"./Vp01-r6R.chunk.js";import{n as S,t as C}from"./A8xLZrSw.chunk.js";import{t as w}from"./BQKcAczf.chunk.js";import{t as T}from"./DR9DEoQL.chunk.js";import{t as E}from"./CpP_XziV2.chunk.js";import{t as D}from"./DuIIaGgk2.chunk.js";import{n as O}from"./CpFtf-tI2.chunk.js";import{t as k}from"./DW51cSV_2.chunk.js";import{t as A}from"./9PCtVxot.chunk.js";import{t as j}from"./DDJBf9pK.chunk.js";import{n as M}from"./B-eFTZdx2.chunk.js";import{r as N,t as P}from"./C5uTRLOC2.chunk.js";import{t as F}from"./DewCxv4i.chunk.js";import{t as I}from"./NVkf8UeY.chunk.js";import{t as L}from"./M21xrW6i2.chunk.js";import{t as R}from"./C2pEjcxD.chunk.js";import{t as z}from"./BmR4qY-v2.chunk.js";import{n as B,t as V}from"./y3q_PHh_.chunk.js";import{t as H}from"./C-zUHAyD.chunk.js";import{t as U}from"./cX5MHowe.chunk.js";import{r as W}from"./CHQUozwb.chunk.js";import{t as G}from"./BpiZZWnJ2.chunk.js";var K=e(s()),q=c(),J=`moviesAndTv.companyDashboardEmptyState`,Y=a.encloseNamespace(J);function X(e){let n=e.dashboard?.status===g.Archived;return(0,q.jsxs)(x,{children:[(0,q.jsx)(x.Image,{src:e.imageUrl,altText:Y(`info`)}),(0,q.jsx)(x.Heading,{children:(0,q.jsx)(O,{namespace:J,phrase:`heading`})}),(0,q.jsx)(x.Info,{children:(0,q.jsx)(O,{namespace:J,phrase:`info`})}),(0,q.jsx)(t,{title:n?a.getPhrase(J,`archivedCtaTooltip`):``,spanHack:!0,children:(0,q.jsx)(x.Cta,{text:a.getPhrase(J,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:j,disabled:n})})]})}function Z(e){let t=d.sortBy(e.dashboard?.widgets,`index`);function n(t,n,r){let i=p.getWidgetParams(n,r,p.getDashboardTargetType(e.dashboard));return e.getWidgetContentRequest(t,i,r)}let r=e.isReadonly&&!t?.length;return(0,q.jsxs)(q.Fragment,{children:[!!t.length&&(0,q.jsxs)(q.Fragment,{children:[e.company?(0,q.jsx)(V,{heading:e.company.name,banner:e.company.banner,imageCdnUrl:e.commonVideoProps.imageCdnUrl,blockColourClass:P(e.company.name,N),actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`}):(0,q.jsx)(B,{}),(0,q.jsx)(`div`,{className:`py-3 mb-3 border-bottom`,children:(0,q.jsx)(R,{breadcrumbs:e.getBreadcrumbs?.()})}),(0,q.jsx)(`div`,{className:`mt-3`,children:t.map(t=>(0,q.jsx)(H,{widgetCollection:h.Company,dashboardTarget:h.Company,id:t.id,getContentRequest:n,audiences:e.audiences,name:t.name,description:t.description,templateId:t.templateId,metadata:t.metadata,appLinks:e.widgetAppLinks,isScrollToTargetWidget:e?.scrollToWidgetId===t.id,widgetTypeId:t.widgetId,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,settings:e.settings,imageCdnUrl:e.commonVideoProps.imageCdnUrl,commonVideoProps:e.commonVideoProps,classification:null,contentType:null,hasTableOfContents:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},t.id))})]}),r&&(0,q.jsx)(X,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.widgetAppLinks.widgetWizard})]})}function Q({enabled:e=!0,to:t,applinkOptions:n},a=[]){(0,K.useEffect)(()=>{if(!(!e||!t)){if(typeof t==`string`){r.Redirect(t);return}i.trigger(t,n)}},[e,t,n,...a])}var $=a.encloseNamespace(`moviesAndTv.companyDashboard`);function ee(e,t){return{partner:E.getPartnerDashboardAppLink,partnerHome:E.getPartnerHomeAppLink,videoType:(n,r)=>k.getAppLink(n,{...r,moviesAndTv:!0,context:v.Widget,includeContext:e?.isAuthenticated},t),series:e=>D.getSeriesAppLink(e,{},t),playlist:e=>({application:l.PLAYLISTS,action:y.Playlists.PLAYLIST,args:[t,e.id,o.slugify(e.name)]}),getPreviewQuestionsAppLink:e=>A.getPreviewQuestionsAppLink(e),classification:()=>null,allTopics:()=>null,calendar:()=>null,calendarMonth:()=>null,classificationDirectory:()=>null,classificationLatestReleases:()=>null,company:()=>null,discover:()=>null,livestream:()=>null,watchHistory:()=>null,widgetVideoList:()=>null,widgetWizard:()=>null,searchSettings:()=>null,searchHome:()=>null}}function te(e){return!e?.partnerProfiles||e.partnerProfiles?.count===0?E.getPartnerHomeAppLink():e?.partnerProfiles?.count>1?E.getPartnerDashboardHubAppLink(e):E.getPartnerDashboardAppLink(e?.partnerProfiles?.data?.[0])}function ne(e,t){return e.isLoadingSettings?null:e.hasPartnerProfiles?L.company(t,!0):L.company(t)}function re(e){let t=_(null),r=u(ne(t,e.companyId)),i=u(m.currentUser()),{openInCurationStudioLabel:a,isUserCurator:s,getOpenInCurationStudioLink:c}=W();Q({enabled:!t.isLoadingSettings&&t.hasPartnerProfiles,to:r.hasCompleted?te(r.data):null},[r.hasCompleted,r.data]);let{commonVideoProps:d}=z({locationContext:f.VideoThumbnail,mtv:!0}),{hasPermissions:p,hasLocalPermissions:g}=w(),{dashboard:v,isPreviewing:x}=I({targetType:h.Company,queryParams:e.queryParams,companyId:e.companyId,enabled:!t.isLoadingSettings&&!t.hasPartnerProfiles});C(S.getDefaultMetadata({title:r.data?.name,phraseContext:{phraseHandler:$,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:T.getCanonicalLink({stripPresentationSlug:!0,customAppLink:{application:l.MOVIES_AND_TV,action:y.MoviesAndTv.COMPANY_DASHBOARD,args:[e.presentationSlug,r.data?.id,o.slugify(r.data?.name)]}}),allowIndexing:!1})),M({id:e.companyId,app:`studios`});let E=U({name:r.data?.name});function D(){return r.hasCompleted?E:[]}function O(){return s?[{label:a,href:c(r.data?.typeId,r.data?.id),openInNewTab:!0}]:[]}return K.useEffect(()=>{!v.hasCompleted||v.data||n.throw(new b)},[v.data,v.hasCompleted]),(0,q.jsxs)(`div`,{className:`position-relative px-4`,children:[!!(x&&v.data)&&(0,q.jsx)(G,{status:v.data.status,type:`company`}),(0,q.jsx)(Z,{company:r.data,dashboard:v.data,getWidgetContentRequest:F.dashboardWidgetContent,getBannerActions:O,widgetAppLinks:ee(i.data,e.presentationSlug),getBreadcrumbs:D,hasPermissions:p,hasLocalPermissions:g,settings:t,commonVideoProps:d})]})}export{re as CompanyDashboardView};
2
- //# sourceMappingURL=izXlxhJf.chunk.js.map
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{r as t}from"./D8uRDrkd.chunk.js";import{_ as n,x as r,y as i}from"./BftnFbcr.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{u}from"./BX0wDJmp.chunk.js";import{t as d}from"./C1SLt-ar.chunk.js";import{y as f}from"./NlCAcBdo.chunk.js";import{r as p}from"./Cr6TXzQQ2.chunk.js";import{t as m}from"./oPIkfKWW2.chunk.js";import{n as h,t as g}from"./CmcCVXi32.chunk.js";import{t as _}from"./CcDvlSWl2.chunk.js";import{n as v}from"./DsXWD-Sn.chunk.js";import{t as y}from"./DdsRCMkN.chunk.js";import{t as b}from"./BWaKdG0l.chunk.js";import{t as x}from"./Vp01-r6R.chunk.js";import{n as S,t as C}from"./A8xLZrSw.chunk.js";import{t as w}from"./BQKcAczf.chunk.js";import{t as T}from"./DR9DEoQL.chunk.js";import{t as E}from"./CpP_XziV2.chunk.js";import{t as D}from"./DuIIaGgk2.chunk.js";import{n as O}from"./CpFtf-tI2.chunk.js";import{t as k}from"./DW51cSV_2.chunk.js";import{t as A}from"./9PCtVxot.chunk.js";import{t as j}from"./DDJBf9pK.chunk.js";import{n as M}from"./B-eFTZdx2.chunk.js";import{r as N,t as P}from"./C5uTRLOC2.chunk.js";import{t as F}from"./DewCxv4i.chunk.js";import{t as I}from"./NVkf8UeY.chunk.js";import{t as L}from"./M21xrW6i2.chunk.js";import{t as R}from"./C2pEjcxD.chunk.js";import{t as z}from"./BmR4qY-v2.chunk.js";import{n as B,t as V}from"./y3q_PHh_.chunk.js";import{t as H}from"./CajcIz6S.chunk.js";import{t as U}from"./cX5MHowe.chunk.js";import{r as W}from"./CHQUozwb.chunk.js";import{t as G}from"./CtWAorP42.chunk.js";var K=e(s()),q=c(),J=`moviesAndTv.companyDashboardEmptyState`,Y=a.encloseNamespace(J);function X(e){let n=e.dashboard?.status===g.Archived;return(0,q.jsxs)(x,{children:[(0,q.jsx)(x.Image,{src:e.imageUrl,altText:Y(`info`)}),(0,q.jsx)(x.Heading,{children:(0,q.jsx)(O,{namespace:J,phrase:`heading`})}),(0,q.jsx)(x.Info,{children:(0,q.jsx)(O,{namespace:J,phrase:`info`})}),(0,q.jsx)(t,{title:n?a.getPhrase(J,`archivedCtaTooltip`):``,spanHack:!0,children:(0,q.jsx)(x.Cta,{text:a.getPhrase(J,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:j,disabled:n})})]})}function Z(e){let t=d.sortBy(e.dashboard?.widgets,`index`);function n(t,n,r){let i=p.getWidgetParams(n,r,p.getDashboardTargetType(e.dashboard));return e.getWidgetContentRequest(t,i,r)}let r=e.isReadonly&&!t?.length;return(0,q.jsxs)(q.Fragment,{children:[!!t.length&&(0,q.jsxs)(q.Fragment,{children:[e.company?(0,q.jsx)(V,{heading:e.company.name,banner:e.company.banner,imageCdnUrl:e.commonVideoProps.imageCdnUrl,blockColourClass:P(e.company.name,N),actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`}):(0,q.jsx)(B,{}),(0,q.jsx)(`div`,{className:`py-3 mb-3 border-bottom`,children:(0,q.jsx)(R,{breadcrumbs:e.getBreadcrumbs?.()})}),(0,q.jsx)(`div`,{className:`mt-3`,children:t.map(t=>(0,q.jsx)(H,{widgetCollection:h.Company,dashboardTarget:h.Company,id:t.id,getContentRequest:n,audiences:e.audiences,name:t.name,description:t.description,templateId:t.templateId,metadata:t.metadata,appLinks:e.widgetAppLinks,isScrollToTargetWidget:e?.scrollToWidgetId===t.id,widgetTypeId:t.widgetId,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,settings:e.settings,imageCdnUrl:e.commonVideoProps.imageCdnUrl,commonVideoProps:e.commonVideoProps,classification:null,contentType:null,hasTableOfContents:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},t.id))})]}),r&&(0,q.jsx)(X,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.widgetAppLinks.widgetWizard})]})}function Q({enabled:e=!0,to:t,applinkOptions:n},a=[]){(0,K.useEffect)(()=>{if(!(!e||!t)){if(typeof t==`string`){r.Redirect(t);return}i.trigger(t,n)}},[e,t,n,...a])}var $=a.encloseNamespace(`moviesAndTv.companyDashboard`);function ee(e,t){return{partner:E.getPartnerDashboardAppLink,partnerHome:E.getPartnerHomeAppLink,videoType:(n,r)=>k.getAppLink(n,{...r,moviesAndTv:!0,context:v.Widget,includeContext:e?.isAuthenticated},t),series:e=>D.getSeriesAppLink(e,{},t),playlist:e=>({application:l.PLAYLISTS,action:y.Playlists.PLAYLIST,args:[t,e.id,o.slugify(e.name)]}),getPreviewQuestionsAppLink:e=>A.getPreviewQuestionsAppLink(e),classification:()=>null,allTopics:()=>null,calendar:()=>null,calendarMonth:()=>null,classificationDirectory:()=>null,classificationLatestReleases:()=>null,company:()=>null,discover:()=>null,livestream:()=>null,watchHistory:()=>null,widgetVideoList:()=>null,widgetWizard:()=>null,searchSettings:()=>null,searchHome:()=>null}}function te(e){return!e?.partnerProfiles||e.partnerProfiles?.count===0?E.getPartnerHomeAppLink():e?.partnerProfiles?.count>1?E.getPartnerDashboardHubAppLink(e):E.getPartnerDashboardAppLink(e?.partnerProfiles?.data?.[0])}function ne(e,t){return e.isLoadingSettings?null:e.hasPartnerProfiles?L.company(t,!0):L.company(t)}function re(e){let t=_(null),r=u(ne(t,e.companyId)),i=u(m.currentUser()),{openInCurationStudioLabel:a,isUserCurator:s,getOpenInCurationStudioLink:c}=W();Q({enabled:!t.isLoadingSettings&&t.hasPartnerProfiles,to:r.hasCompleted?te(r.data):null},[r.hasCompleted,r.data]);let{commonVideoProps:d}=z({locationContext:f.VideoThumbnail,mtv:!0}),{hasPermissions:p,hasLocalPermissions:g}=w(),{dashboard:v,isPreviewing:x}=I({targetType:h.Company,queryParams:e.queryParams,companyId:e.companyId,enabled:!t.isLoadingSettings&&!t.hasPartnerProfiles});C(S.getDefaultMetadata({title:r.data?.name,phraseContext:{phraseHandler:$,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:T.getCanonicalLink({stripPresentationSlug:!0,customAppLink:{application:l.MOVIES_AND_TV,action:y.MoviesAndTv.COMPANY_DASHBOARD,args:[e.presentationSlug,r.data?.id,o.slugify(r.data?.name)]}}),allowIndexing:!1})),M({id:e.companyId,app:`studios`});let E=U({name:r.data?.name});function D(){return r.hasCompleted?E:[]}function O(){return s?[{label:a,href:c(r.data?.typeId,r.data?.id),openInNewTab:!0}]:[]}return K.useEffect(()=>{!v.hasCompleted||v.data||n.throw(new b)},[v.data,v.hasCompleted]),(0,q.jsxs)(`div`,{className:`position-relative px-4`,children:[!!(x&&v.data)&&(0,q.jsx)(G,{status:v.data.status,type:`company`}),(0,q.jsx)(Z,{company:r.data,dashboard:v.data,getWidgetContentRequest:F.dashboardWidgetContent,getBannerActions:O,widgetAppLinks:ee(i.data,e.presentationSlug),getBreadcrumbs:D,hasPermissions:p,hasLocalPermissions:g,settings:t,commonVideoProps:d})]})}export{re as CompanyDashboardView};
2
+ //# sourceMappingURL=Dzy1nQk7.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"izXlxhJf.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState.tsx","../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/CompanyDashboard.tsx","../../src/shared/hooks/useRedirect.ts","../../src/apps/movies-and-tv/views/company-dashboard/CompanyDashboardView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { PlusSvg } from 'libs/shared/images/svg/actions/PlusSvg';\nimport { CuratedDashboard, DashboardStatus } from 'libs/shared/interfaces';\n\nconst namespace = 'moviesAndTv.companyDashboardEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CompanyDashboardEmptyStateProps {\n dashboard: CuratedDashboard;\n imageUrl: string;\n isReadonly: boolean;\n addWidgetApplink?: () => Core.AppLink;\n}\n\nexport function CompanyDashboardEmptyState(props: CompanyDashboardEmptyStateProps): JSX.Element {\n const isArchived = props.dashboard?.status === DashboardStatus.Archived;\n\n return (\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} altText={getPhrase('info')} />\n <EmptyState.Heading>\n <Text namespace={namespace} phrase='heading' />\n </EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='info' />\n </EmptyState.Info>\n <Tooltip title={isArchived ? LanguageService.getPhrase(namespace, 'archivedCtaTooltip') : ''} spanHack>\n <EmptyState.Cta\n text={LanguageService.getPhrase(namespace, 'add')}\n appLink={props.addWidgetApplink?.()}\n className='btn btn-dark'\n icon={PlusSvg}\n disabled={isArchived}\n />\n </Tooltip>\n </EmptyState>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { CompanyDashboardEmptyState } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { BannerHeader, PartialBannerHeader } from 'libs/shared/components/banner-header/BannerHeader';\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { WidgetContainerView } from 'libs/shared/components/widgets/curated-widgets/WidgetContainerView';\nimport { AllCompanyWidgetTemplates } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { BG_COLOUR_CLASS_NAMES } from 'libs/shared/constants/ColourClassNames';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { HasLocalPermissionsFunc, HasPermissionsFunc } from 'libs/shared/hooks/usePermissions';\nimport { Company, CuratedDashboard, CuratedWidgetQueryParams, DashboardTargetType, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { CuratedDashboardHelper } from 'libs/shared/utils/DashboardHelper';\nimport { getBgColorClass } from 'libs/shared/utils/getBgColorClass';\n\nexport interface CompanyDashboardProps {\n dashboard: CuratedDashboard;\n company: Company;\n getWidgetContentRequest: (\n id: string,\n params: CuratedWidgetQueryParams,\n widgetTemplate: WidgetTemplate\n ) => Flight.Request;\n hasPermissions: HasPermissionsFunc;\n hasLocalPermissions: HasLocalPermissionsFunc;\n audiences?: PresentationAudience[];\n emptyImageUrl?: string;\n widgetAppLinks?: AllCompanyWidgetTemplates['appLinks'] & {\n widgetWizard: () => Core.AppLink\n };\n scrollToWidgetId?: string;\n isReadonly?: boolean;\n getBreadcrumbs?: () => Breadcrumb[];\n getBannerActions?: () => ActionOptions[];\n commonVideoProps: CommonVideoProps;\n\n settings?: AllCompanyWidgetTemplates['settings'];\n}\n\nexport function CompanyDashboard(props: CompanyDashboardProps): JSX.Element {\n const widgets = ArrayHelper.sortBy(props.dashboard?.widgets, 'index');\n\n function getWidgetContentRequest(id: string, widgetTypeId: WidgetTypeId, template: WidgetTemplate): Flight.Request {\n const params = CuratedDashboardHelper.getWidgetParams(\n widgetTypeId,\n template,\n CuratedDashboardHelper.getDashboardTargetType(props.dashboard)\n );\n\n return props.getWidgetContentRequest(id, params, template);\n }\n\n const showEmptyState = props.isReadonly && !widgets?.length;\n\n return (\n <>\n {!!widgets.length &&\n <>\n {props.company ?\n (\n <BannerHeader\n heading={props.company.name}\n banner={props.company.banner}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n blockColourClass={getBgColorClass(props.company.name, BG_COLOUR_CLASS_NAMES)}\n actions={props.getBannerActions?.()}\n actionsDropdownClassName='btn btn-outline-dark'\n />\n ) : <PartialBannerHeader />\n }\n\n <div className='py-3 mb-3 border-bottom'>\n <Breadcrumbs breadcrumbs={props.getBreadcrumbs?.()} />\n </div>\n\n <div className='mt-3'>\n {widgets.map(widget => {\n return (\n <WidgetContainerView\n widgetCollection={DashboardTargetType.Company}\n dashboardTarget={DashboardTargetType.Company}\n key={widget.id}\n id={widget.id}\n getContentRequest={getWidgetContentRequest}\n audiences={props.audiences}\n name={widget.name}\n description={widget.description}\n templateId={widget.templateId}\n metadata={widget.metadata}\n appLinks={props.widgetAppLinks}\n isScrollToTargetWidget={props?.scrollToWidgetId === widget.id}\n widgetTypeId={widget.widgetId}\n hasPermissions={props.hasPermissions}\n hasLocalPermissions={props.hasLocalPermissions}\n isPreviewing={props.isReadonly}\n settings={props.settings}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n commonVideoProps={props.commonVideoProps}\n\n // TODO: Ideally we don't have to do this\n classification={null}\n contentType={null}\n hasTableOfContents={false}\n seeMoreLink={null}\n onClickRemoveItem={null}\n badgeComponent={null}\n />\n );\n })}\n </div>\n </>\n }\n\n {showEmptyState && (\n <CompanyDashboardEmptyState\n dashboard={props.dashboard}\n isReadonly={props.isReadonly}\n imageUrl={props.emptyImageUrl}\n addWidgetApplink={props.widgetAppLinks.widgetWizard}\n />\n )}\n </>\n );\n}\n","import { useEffect } from 'react';\n\nimport { AppLink, AppLinkHelper, AppLinkOptions, LocationUtils } from 'libs/common/backbone/core';\n\ntype BaseRedirectOptions = {\n /**\n * Whether the redirect should occur. \n * `true` by default.\n */\n enabled?: boolean\n};\n\ntype AppLinkRedirectOptions = {\n to: AppLink | null,\n applinkOptions?: AppLinkOptions\n};\n\ntype ExternalRedirectOptions = {\n to: string | null,\n applinkOptions?: never\n};\n\ntype UseRedirectOptions = BaseRedirectOptions & (AppLinkRedirectOptions | ExternalRedirectOptions);\n\nexport function useRedirect(\n { enabled = true, to, applinkOptions }: UseRedirectOptions,\n deps: React.DependencyList = []\n) {\n useEffect(() => {\n if (!enabled || !to)\n return;\n\n // External redirect\n if (typeof to === 'string') {\n LocationUtils.Redirect(to);\n return;\n }\n\n // Internal redirect\n AppLinkHelper.trigger(to, applinkOptions);\n }, [ enabled, to, applinkOptions, ...deps ]);\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { CompanyDashboard, CompanyDashboardProps } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/CompanyDashboard';\nimport { PreviewBanner } from 'libs/shared/apps/subjects/components/preview-banner/PreviewBanner';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { Breadcrumb } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { RelatedVideosContext } from 'libs/shared/enums/RelatedVideosContext';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { DashboardRequests } from 'libs/shared/flight-requests/DashboardRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCurationStudio } from 'libs/shared/hooks/useCurationStudio';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { SettingsHash, useSettings } from 'libs/shared/hooks/useSettings';\nimport { Company, CurrentUser, DashboardTargetType, Playlist, Series, VideoTypes } from 'libs/shared/interfaces';\nimport { GetVideoAppLinkOptions } from 'libs/shared/interfaces/VideoAppLinkOptions';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CompanyRequests } from 'shared/flight-requests/CompanyRequests';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useRedirect } from 'shared/hooks/useRedirect';\nimport { DashboardViewQueryParams } from 'shared/interfaces/query-params/DashboardViewQueryParams';\nimport { ContentPartnerAppLinkHelper } from 'shared/utils/ContentPartnerAppLinkHelper';\nimport { useFetchCuratedDashboard } from 'shared/utils/DashboardHelper';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { SeriesAppLinkHelper } from 'apps/series/SeriesAppLinkHelper';\n\nconst namespace = 'moviesAndTv.companyDashboard';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction getCompanyAppLinks(\n currentUser: CurrentUser,\n presentationSlug: string | null\n): CompanyDashboardProps['widgetAppLinks'] {\n return {\n partner: ContentPartnerAppLinkHelper.getPartnerDashboardAppLink,\n partnerHome: ContentPartnerAppLinkHelper.getPartnerHomeAppLink,\n videoType: (video: VideoTypes, opts: GetVideoAppLinkOptions) => (\n VideoAppLinkHelper.getAppLink(video, {\n ...opts,\n moviesAndTv: true,\n context: RelatedVideosContext.Widget,\n includeContext: currentUser?.isAuthenticated\n }, presentationSlug)\n ),\n\n series: (series: Series) => SeriesAppLinkHelper.getSeriesAppLink(series, {}, presentationSlug),\n\n playlist: (playlist: Playlist) => ({\n application: AppChannels.PLAYLISTS,\n action: Actions.Playlists.PLAYLIST,\n args: [ presentationSlug, playlist.id, TextHelper.slugify(playlist.name) ]\n }),\n\n getPreviewQuestionsAppLink: interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive),\n \n // TODO: Find a nice way around having to pass these in\n classification: () => null,\n allTopics: () => null,\n calendar: () => null,\n calendarMonth: () => null,\n classificationDirectory: () => null,\n classificationLatestReleases: () => null,\n company: () => null,\n discover: () => null,\n livestream: () => null,\n watchHistory: () => null,\n widgetVideoList: () => null,\n widgetWizard: () => null,\n searchSettings: () => null,\n searchHome: () => null\n };\n}\n\n/**\n * If there are no partner profiles, we redirect to the partner index page.\n * If there is only one partner profile, we redirect to the partner dashboard page.\n * If there are multiple partner profiles, we redirect to the partner dashboard hub page.\n */\nfunction getRedirectAppLink(company: Company): Core.AppLink | null {\n if (!company?.partnerProfiles || company.partnerProfiles?.count === 0)\n return ContentPartnerAppLinkHelper.getPartnerHomeAppLink();\n \n if (company?.partnerProfiles?.count > 1)\n return ContentPartnerAppLinkHelper.getPartnerDashboardHubAppLink(company);\n\n return ContentPartnerAppLinkHelper.getPartnerDashboardAppLink(company?.partnerProfiles?.data?.[0]);\n}\n\nfunction getCompanyRequest(settings: SettingsHash, companyId: string): Flight.PublicRequest | null {\n if (settings.isLoadingSettings)\n return null;\n\n if (settings.hasPartnerProfiles)\n return CompanyRequests.company(companyId, true);\n\n return CompanyRequests.company(companyId);\n}\n\ninterface CompanyDashboardViewProps {\n presentationSlug: string | null;\n companyId: string;\n queryParams?: DashboardViewQueryParams;\n}\n\nexport function CompanyDashboardView(props: CompanyDashboardViewProps): JSX.Element {\n const settings = useSettings(null);\n const company = Flight.useBasicFetch<Company>(getCompanyRequest(settings, props.companyId));\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const { openInCurationStudioLabel, isUserCurator, getOpenInCurationStudioLink } = useCurationStudio();\n\n /**\n * Redirect to respective feature channel dashboard if it exists.\n * Only redirect if the user has partner profiles feature flag enabled.\n */\n useRedirect({\n enabled: !settings.isLoadingSettings && settings.hasPartnerProfiles,\n to: company.hasCompleted ? getRedirectAppLink(company.data) : null\n }, [ company.hasCompleted, company.data ]);\n\n const { commonVideoProps } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail,\n mtv: true\n });\n \n const { hasPermissions, hasLocalPermissions } = usePermissions();\n\n const {\n dashboard,\n isPreviewing\n } = useFetchCuratedDashboard({\n targetType: DashboardTargetType.Company,\n queryParams: props.queryParams,\n companyId: props.companyId,\n enabled: !settings.isLoadingSettings && !settings.hasPartnerProfiles\n });\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: company.data?.name,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n stripPresentationSlug: true,\n customAppLink: {\n application: AppChannels.MOVIES_AND_TV,\n action: Actions.MoviesAndTv.COMPANY_DASHBOARD,\n args: [ props.presentationSlug, company.data?.id, TextHelper.slugify(company.data?.name) ]\n }\n }),\n allowIndexing: false\n }));\n\n useDeepLinks({ id: props.companyId, app: 'studios' });\n\n const breadcrumbs = useBreadcrumbs({ name: company.data?.name });\n function getBreadcrumbs(): Breadcrumb[] {\n if (!company.hasCompleted)\n return [];\n\n return breadcrumbs;\n }\n\n function getBannerActions(): ActionOptions[] {\n if (!isUserCurator)\n return [];\n\n return [{\n label: openInCurationStudioLabel,\n href: getOpenInCurationStudioLink(company.data?.typeId, company.data?.id),\n openInNewTab: true\n }];\n }\n\n React.useEffect(() => {\n if (!dashboard.hasCompleted || dashboard.data)\n return;\n\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ dashboard.data, dashboard.hasCompleted ]);\n\n return (\n <div className='position-relative px-4'>\n {!!(isPreviewing && dashboard.data) && <PreviewBanner status={dashboard.data.status} type='company' />}\n <CompanyDashboard\n company={company.data}\n dashboard={dashboard.data}\n getWidgetContentRequest={DashboardRequests.dashboardWidgetContent}\n getBannerActions={getBannerActions}\n widgetAppLinks={getCompanyAppLinks(currentUser.data, props.presentationSlug)}\n getBreadcrumbs={getBreadcrumbs}\n hasPermissions={hasPermissions}\n hasLocalPermissions={hasLocalPermissions}\n settings={settings}\n commonVideoProps={commonVideoProps}\n />\n </div>\n );\n}\n"],"mappings":"qoDAWM,EAAY,yCACZ,EAAY,EAAgB,iBAAiB,CAAS,EAS5D,SAAgB,EAA2B,EAAqD,CAC9F,IAAM,EAAa,EAAM,WAAW,SAAW,EAAgB,SAE/D,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAW,MAAZ,CAAkB,IAAK,EAAM,SAAU,QAAS,EAAU,MAAM,CAAI,CAAA,GACpE,EAAA,EAAA,IAAA,CAAC,EAAW,QAAZ,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,SAAW,CAAA,CAC5B,CAAA,GACpB,EAAA,EAAA,IAAA,CAAC,EAAW,KAAZ,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,MAAQ,CAAA,CAC5B,CAAA,GACjB,EAAA,EAAA,IAAA,CAAC,EAAD,CAAS,MAAO,EAAa,EAAgB,UAAU,EAAW,oBAAoB,EAAI,GAAI,SAAA,aAC5F,EAAA,EAAA,IAAA,CAAC,EAAW,IAAZ,CACE,KAAM,EAAgB,UAAU,EAAW,KAAK,EAChD,QAAS,EAAM,mBAAmB,EAClC,UAAU,eACV,KAAM,EACN,SAAU,CACX,CAAA,CACM,CAAA,CACC,CAAA,CAAA,CAEhB,CCCA,SAAgB,EAAiB,EA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Ae,CACb,YAAa,EAAY,cACzB,OAAQ,EAAQ,YAAY,kBAC5B,KAAM,CAAE,EAAM,iBAAkB,EAAQ,MAAM,GAAI,EAAW,QAAQ,EAAQ,MAAM,IAAI,CAAE,CAC3F,CACF,CAAC,EACD,cAAe,EACjB,CAAC,CAAC,EAEF,EAAa,CAAE,GAAI,EAAM,UAAW,IAAK,SAAU,CAAC,EAEpD,IAAM,EAAc,EAAe,CAAE,KAAM,EAAQ,MAAM,IAAK,CAAC,EAC/D,SAAS,GAA+B,CAItC,OAHK,EAAQ,aAGN,EAFE,CAAC,CAGZ,CAEA,SAAS,GAAoC,CAI3C,OAHK,EAGE,CAAC,CACN,MAAO,EACP,KAAM,EAA4B,EAAQ,MAAM,OAAQ,EAAQ,MAAM,EAAE,EACxE,aAAc,EAChB,CAAC,EANQ,CAAC,CAOZ,CASA,OAPA,EAAM,cAAgB,CAChB,CAAC,EAAU,cAAgB,EAAU,MAGzC,EAAiB,MAAM,IAAI,CAAe,CAC5C,EAAG,CAAE,EAAU,KAAM,EAAU,YAAa,CAAC,GAG3C,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,kCAAf,CACG,CAAC,EAAE,GAAgB,EAAU,QAAS,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,OAAQ,EAAU,KAAK,OAAQ,KAAK,SAAW,CAAA,GACrG,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,QAAS,EAAQ,KACjB,UAAW,EAAU,KACrB,wBAAyB,EAAkB,uBACzB,mBAClB,eAAgB,GAAmB,EAAY,KAAM,EAAM,gBAAgB,EAC3D,iBACA,iBACK,sBACX,WACQ,kBACnB,CAAA,CACE,GAET"}
1
+ {"version":3,"file":"Dzy1nQk7.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState.tsx","../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/CompanyDashboard.tsx","../../src/shared/hooks/useRedirect.ts","../../src/apps/movies-and-tv/views/company-dashboard/CompanyDashboardView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { PlusSvg } from 'libs/shared/images/svg/actions/PlusSvg';\nimport { CuratedDashboard, DashboardStatus } from 'libs/shared/interfaces';\n\nconst namespace = 'moviesAndTv.companyDashboardEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CompanyDashboardEmptyStateProps {\n dashboard: CuratedDashboard;\n imageUrl: string;\n isReadonly: boolean;\n addWidgetApplink?: () => Core.AppLink;\n}\n\nexport function CompanyDashboardEmptyState(props: CompanyDashboardEmptyStateProps): JSX.Element {\n const isArchived = props.dashboard?.status === DashboardStatus.Archived;\n\n return (\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} altText={getPhrase('info')} />\n <EmptyState.Heading>\n <Text namespace={namespace} phrase='heading' />\n </EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='info' />\n </EmptyState.Info>\n <Tooltip title={isArchived ? LanguageService.getPhrase(namespace, 'archivedCtaTooltip') : ''} spanHack>\n <EmptyState.Cta\n text={LanguageService.getPhrase(namespace, 'add')}\n appLink={props.addWidgetApplink?.()}\n className='btn btn-dark'\n icon={PlusSvg}\n disabled={isArchived}\n />\n </Tooltip>\n </EmptyState>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { CompanyDashboardEmptyState } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { BannerHeader, PartialBannerHeader } from 'libs/shared/components/banner-header/BannerHeader';\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { WidgetContainerView } from 'libs/shared/components/widgets/curated-widgets/WidgetContainerView';\nimport { AllCompanyWidgetTemplates } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { BG_COLOUR_CLASS_NAMES } from 'libs/shared/constants/ColourClassNames';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { HasLocalPermissionsFunc, HasPermissionsFunc } from 'libs/shared/hooks/usePermissions';\nimport { Company, CuratedDashboard, CuratedWidgetQueryParams, DashboardTargetType, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { CuratedDashboardHelper } from 'libs/shared/utils/DashboardHelper';\nimport { getBgColorClass } from 'libs/shared/utils/getBgColorClass';\n\nexport interface CompanyDashboardProps {\n dashboard: CuratedDashboard;\n company: Company;\n getWidgetContentRequest: (\n id: string,\n params: CuratedWidgetQueryParams,\n widgetTemplate: WidgetTemplate\n ) => Flight.Request;\n hasPermissions: HasPermissionsFunc;\n hasLocalPermissions: HasLocalPermissionsFunc;\n audiences?: PresentationAudience[];\n emptyImageUrl?: string;\n widgetAppLinks?: AllCompanyWidgetTemplates['appLinks'] & {\n widgetWizard: () => Core.AppLink\n };\n scrollToWidgetId?: string;\n isReadonly?: boolean;\n getBreadcrumbs?: () => Breadcrumb[];\n getBannerActions?: () => ActionOptions[];\n commonVideoProps: CommonVideoProps;\n\n settings?: AllCompanyWidgetTemplates['settings'];\n}\n\nexport function CompanyDashboard(props: CompanyDashboardProps): JSX.Element {\n const widgets = ArrayHelper.sortBy(props.dashboard?.widgets, 'index');\n\n function getWidgetContentRequest(id: string, widgetTypeId: WidgetTypeId, template: WidgetTemplate): Flight.Request {\n const params = CuratedDashboardHelper.getWidgetParams(\n widgetTypeId,\n template,\n CuratedDashboardHelper.getDashboardTargetType(props.dashboard)\n );\n\n return props.getWidgetContentRequest(id, params, template);\n }\n\n const showEmptyState = props.isReadonly && !widgets?.length;\n\n return (\n <>\n {!!widgets.length &&\n <>\n {props.company ?\n (\n <BannerHeader\n heading={props.company.name}\n banner={props.company.banner}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n blockColourClass={getBgColorClass(props.company.name, BG_COLOUR_CLASS_NAMES)}\n actions={props.getBannerActions?.()}\n actionsDropdownClassName='btn btn-outline-dark'\n />\n ) : <PartialBannerHeader />\n }\n\n <div className='py-3 mb-3 border-bottom'>\n <Breadcrumbs breadcrumbs={props.getBreadcrumbs?.()} />\n </div>\n\n <div className='mt-3'>\n {widgets.map(widget => {\n return (\n <WidgetContainerView\n widgetCollection={DashboardTargetType.Company}\n dashboardTarget={DashboardTargetType.Company}\n key={widget.id}\n id={widget.id}\n getContentRequest={getWidgetContentRequest}\n audiences={props.audiences}\n name={widget.name}\n description={widget.description}\n templateId={widget.templateId}\n metadata={widget.metadata}\n appLinks={props.widgetAppLinks}\n isScrollToTargetWidget={props?.scrollToWidgetId === widget.id}\n widgetTypeId={widget.widgetId}\n hasPermissions={props.hasPermissions}\n hasLocalPermissions={props.hasLocalPermissions}\n isPreviewing={props.isReadonly}\n settings={props.settings}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n commonVideoProps={props.commonVideoProps}\n\n // TODO: Ideally we don't have to do this\n classification={null}\n contentType={null}\n hasTableOfContents={false}\n seeMoreLink={null}\n onClickRemoveItem={null}\n badgeComponent={null}\n />\n );\n })}\n </div>\n </>\n }\n\n {showEmptyState && (\n <CompanyDashboardEmptyState\n dashboard={props.dashboard}\n isReadonly={props.isReadonly}\n imageUrl={props.emptyImageUrl}\n addWidgetApplink={props.widgetAppLinks.widgetWizard}\n />\n )}\n </>\n );\n}\n","import { useEffect } from 'react';\n\nimport { AppLink, AppLinkHelper, AppLinkOptions, LocationUtils } from 'libs/common/backbone/core';\n\ntype BaseRedirectOptions = {\n /**\n * Whether the redirect should occur. \n * `true` by default.\n */\n enabled?: boolean\n};\n\ntype AppLinkRedirectOptions = {\n to: AppLink | null,\n applinkOptions?: AppLinkOptions\n};\n\ntype ExternalRedirectOptions = {\n to: string | null,\n applinkOptions?: never\n};\n\ntype UseRedirectOptions = BaseRedirectOptions & (AppLinkRedirectOptions | ExternalRedirectOptions);\n\nexport function useRedirect(\n { enabled = true, to, applinkOptions }: UseRedirectOptions,\n deps: React.DependencyList = []\n) {\n useEffect(() => {\n if (!enabled || !to)\n return;\n\n // External redirect\n if (typeof to === 'string') {\n LocationUtils.Redirect(to);\n return;\n }\n\n // Internal redirect\n AppLinkHelper.trigger(to, applinkOptions);\n }, [ enabled, to, applinkOptions, ...deps ]);\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { CompanyDashboard, CompanyDashboardProps } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/CompanyDashboard';\nimport { PreviewBanner } from 'libs/shared/apps/subjects/components/preview-banner/PreviewBanner';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { Breadcrumb } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { RelatedVideosContext } from 'libs/shared/enums/RelatedVideosContext';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { DashboardRequests } from 'libs/shared/flight-requests/DashboardRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCurationStudio } from 'libs/shared/hooks/useCurationStudio';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { SettingsHash, useSettings } from 'libs/shared/hooks/useSettings';\nimport { Company, CurrentUser, DashboardTargetType, Playlist, Series, VideoTypes } from 'libs/shared/interfaces';\nimport { GetVideoAppLinkOptions } from 'libs/shared/interfaces/VideoAppLinkOptions';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CompanyRequests } from 'shared/flight-requests/CompanyRequests';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useRedirect } from 'shared/hooks/useRedirect';\nimport { DashboardViewQueryParams } from 'shared/interfaces/query-params/DashboardViewQueryParams';\nimport { ContentPartnerAppLinkHelper } from 'shared/utils/ContentPartnerAppLinkHelper';\nimport { useFetchCuratedDashboard } from 'shared/utils/DashboardHelper';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { SeriesAppLinkHelper } from 'apps/series/SeriesAppLinkHelper';\n\nconst namespace = 'moviesAndTv.companyDashboard';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction getCompanyAppLinks(\n currentUser: CurrentUser,\n presentationSlug: string | null\n): CompanyDashboardProps['widgetAppLinks'] {\n return {\n partner: ContentPartnerAppLinkHelper.getPartnerDashboardAppLink,\n partnerHome: ContentPartnerAppLinkHelper.getPartnerHomeAppLink,\n videoType: (video: VideoTypes, opts: GetVideoAppLinkOptions) => (\n VideoAppLinkHelper.getAppLink(video, {\n ...opts,\n moviesAndTv: true,\n context: RelatedVideosContext.Widget,\n includeContext: currentUser?.isAuthenticated\n }, presentationSlug)\n ),\n\n series: (series: Series) => SeriesAppLinkHelper.getSeriesAppLink(series, {}, presentationSlug),\n\n playlist: (playlist: Playlist) => ({\n application: AppChannels.PLAYLISTS,\n action: Actions.Playlists.PLAYLIST,\n args: [ presentationSlug, playlist.id, TextHelper.slugify(playlist.name) ]\n }),\n\n getPreviewQuestionsAppLink: interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive),\n \n // TODO: Find a nice way around having to pass these in\n classification: () => null,\n allTopics: () => null,\n calendar: () => null,\n calendarMonth: () => null,\n classificationDirectory: () => null,\n classificationLatestReleases: () => null,\n company: () => null,\n discover: () => null,\n livestream: () => null,\n watchHistory: () => null,\n widgetVideoList: () => null,\n widgetWizard: () => null,\n searchSettings: () => null,\n searchHome: () => null\n };\n}\n\n/**\n * If there are no partner profiles, we redirect to the partner index page.\n * If there is only one partner profile, we redirect to the partner dashboard page.\n * If there are multiple partner profiles, we redirect to the partner dashboard hub page.\n */\nfunction getRedirectAppLink(company: Company): Core.AppLink | null {\n if (!company?.partnerProfiles || company.partnerProfiles?.count === 0)\n return ContentPartnerAppLinkHelper.getPartnerHomeAppLink();\n \n if (company?.partnerProfiles?.count > 1)\n return ContentPartnerAppLinkHelper.getPartnerDashboardHubAppLink(company);\n\n return ContentPartnerAppLinkHelper.getPartnerDashboardAppLink(company?.partnerProfiles?.data?.[0]);\n}\n\nfunction getCompanyRequest(settings: SettingsHash, companyId: string): Flight.PublicRequest | null {\n if (settings.isLoadingSettings)\n return null;\n\n if (settings.hasPartnerProfiles)\n return CompanyRequests.company(companyId, true);\n\n return CompanyRequests.company(companyId);\n}\n\ninterface CompanyDashboardViewProps {\n presentationSlug: string | null;\n companyId: string;\n queryParams?: DashboardViewQueryParams;\n}\n\nexport function CompanyDashboardView(props: CompanyDashboardViewProps): JSX.Element {\n const settings = useSettings(null);\n const company = Flight.useBasicFetch<Company>(getCompanyRequest(settings, props.companyId));\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const { openInCurationStudioLabel, isUserCurator, getOpenInCurationStudioLink } = useCurationStudio();\n\n /**\n * Redirect to respective feature channel dashboard if it exists.\n * Only redirect if the user has partner profiles feature flag enabled.\n */\n useRedirect({\n enabled: !settings.isLoadingSettings && settings.hasPartnerProfiles,\n to: company.hasCompleted ? getRedirectAppLink(company.data) : null\n }, [ company.hasCompleted, company.data ]);\n\n const { commonVideoProps } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail,\n mtv: true\n });\n \n const { hasPermissions, hasLocalPermissions } = usePermissions();\n\n const {\n dashboard,\n isPreviewing\n } = useFetchCuratedDashboard({\n targetType: DashboardTargetType.Company,\n queryParams: props.queryParams,\n companyId: props.companyId,\n enabled: !settings.isLoadingSettings && !settings.hasPartnerProfiles\n });\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: company.data?.name,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n stripPresentationSlug: true,\n customAppLink: {\n application: AppChannels.MOVIES_AND_TV,\n action: Actions.MoviesAndTv.COMPANY_DASHBOARD,\n args: [ props.presentationSlug, company.data?.id, TextHelper.slugify(company.data?.name) ]\n }\n }),\n allowIndexing: false\n }));\n\n useDeepLinks({ id: props.companyId, app: 'studios' });\n\n const breadcrumbs = useBreadcrumbs({ name: company.data?.name });\n function getBreadcrumbs(): Breadcrumb[] {\n if (!company.hasCompleted)\n return [];\n\n return breadcrumbs;\n }\n\n function getBannerActions(): ActionOptions[] {\n if (!isUserCurator)\n return [];\n\n return [{\n label: openInCurationStudioLabel,\n href: getOpenInCurationStudioLink(company.data?.typeId, company.data?.id),\n openInNewTab: true\n }];\n }\n\n React.useEffect(() => {\n if (!dashboard.hasCompleted || dashboard.data)\n return;\n\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ dashboard.data, dashboard.hasCompleted ]);\n\n return (\n <div className='position-relative px-4'>\n {!!(isPreviewing && dashboard.data) && <PreviewBanner status={dashboard.data.status} type='company' />}\n <CompanyDashboard\n company={company.data}\n dashboard={dashboard.data}\n getWidgetContentRequest={DashboardRequests.dashboardWidgetContent}\n getBannerActions={getBannerActions}\n widgetAppLinks={getCompanyAppLinks(currentUser.data, props.presentationSlug)}\n getBreadcrumbs={getBreadcrumbs}\n hasPermissions={hasPermissions}\n hasLocalPermissions={hasLocalPermissions}\n settings={settings}\n commonVideoProps={commonVideoProps}\n />\n </div>\n );\n}\n"],"mappings":"qoDAWM,EAAY,yCACZ,EAAY,EAAgB,iBAAiB,CAAS,EAS5D,SAAgB,EAA2B,EAAqD,CAC9F,IAAM,EAAa,EAAM,WAAW,SAAW,EAAgB,SAE/D,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAW,MAAZ,CAAkB,IAAK,EAAM,SAAU,QAAS,EAAU,MAAM,CAAI,CAAA,GACpE,EAAA,EAAA,IAAA,CAAC,EAAW,QAAZ,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,SAAW,CAAA,CAC5B,CAAA,GACpB,EAAA,EAAA,IAAA,CAAC,EAAW,KAAZ,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,MAAQ,CAAA,CAC5B,CAAA,GACjB,EAAA,EAAA,IAAA,CAAC,EAAD,CAAS,MAAO,EAAa,EAAgB,UAAU,EAAW,oBAAoB,EAAI,GAAI,SAAA,aAC5F,EAAA,EAAA,IAAA,CAAC,EAAW,IAAZ,CACE,KAAM,EAAgB,UAAU,EAAW,KAAK,EAChD,QAAS,EAAM,mBAAmB,EAClC,UAAU,eACV,KAAM,EACN,SAAU,CACX,CAAA,CACM,CAAA,CACC,CAAA,CAAA,CAEhB,CCCA,SAAgB,EAAiB,EAA2C,CAC1E,IAAM,EAAU,EAAY,OAAO,EAAM,WAAW,QAAS,OAAO,EAEpE,SAAS,EAAwB,EAAY,EAA4B,EAA0C,CACjH,IAAM,EAAS,EAAuB,gBACpC,EACA,EACA,EAAuB,uBAAuB,EAAM,SAAS,CAC/D,EAEA,OAAO,EA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EAAa,CAAE,GAAI,EAAM,UAAW,IAAK,SAAU,CAAC,EAEpD,IAAM,EAAc,EAAe,CAAE,KAAM,EAAQ,MAAM,IAAK,CAAC,EAC/D,SAAS,GAA+B,CAItC,OAHK,EAAQ,aAGN,EAFE,CAAC,CAGZ,CAEA,SAAS,GAAoC,CAI3C,OAHK,EAGE,CAAC,CACN,MAAO,EACP,KAAM,EAA4B,EAAQ,MAAM,OAAQ,EAAQ,MAAM,EAAE,EACxE,aAAc,EAChB,CAAC,EANQ,CAAC,CAOZ,CASA,OAPA,EAAM,cAAgB,CAChB,CAAC,EAAU,cAAgB,EAAU,MAGzC,EAAiB,MAAM,IAAI,CAAe,CAC5C,EAAG,CAAE,EAAU,KAAM,EAAU,YAAa,CAAC,GAG3C,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,kCAAf,CACG,CAAC,EAAE,GAAgB,EAAU,QAAS,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,OAAQ,EAAU,KAAK,OAAQ,KAAK,SAAW,CAAA,GACrG,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,QAAS,EAAQ,KACjB,UAAW,EAAU,KACrB,wBAAyB,EAAkB,uBACzB,mBAClB,eAAgB,GAAmB,EAAY,KAAM,EAAM,gBAAgB,EAC3D,iBACA,iBACK,sBACX,WACQ,kBACnB,CAAA,CACE,GAET"}
@@ -1,2 +1,2 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import{t as n}from"./CQyJ7YGa.chunk.js";import{t as r}from"./C2w0pmFW.chunk.js";import{t as i}from"./wrLrTezN.chunk.js";import{t as a}from"./BXTI9cmX.chunk.js";import{u as o}from"./BX0wDJmp.chunk.js";import{t as s}from"./C1SLt-ar.chunk.js";import{y as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./DIqO2TFN.chunk.js";import{r as u}from"./Cr6TXzQQ2.chunk.js";import{t as d}from"./oPIkfKWW2.chunk.js";import{n as f,r as p,t as m}from"./CmcCVXi32.chunk.js";import{t as h}from"./CcDvlSWl2.chunk.js";import{t as g}from"./DdsRCMkN.chunk.js";import{t as _}from"./D_gWf2lC.chunk.js";import{t as v}from"./ZwDDc8Zd.chunk.js";import{t as y}from"./M97_Ztsu.chunk.js";import{t as b}from"./PgzMrOyM.chunk.js";import{t as x}from"./B0aLOQEJ2.chunk.js";import{t as S}from"./A8xLZrSw.chunk.js";import{t as C}from"./BQKcAczf.chunk.js";import{t as w}from"./D4jQxS0H.chunk.js";import{t as T}from"./dEqScqMh2.chunk.js";import{t as E}from"./D1EthTiX.chunk.js";import{t as D}from"./DOnmTMfX.chunk.js";import{t as O}from"./DMZ_X3HL.chunk.js";import{t as k}from"./DewCxv4i.chunk.js";import{t as A}from"./DMaQV7L2.chunk.js";import{t as j}from"./CETzluXN.chunk.js";import{t as M}from"./BmR4qY-v2.chunk.js";import{t as N}from"./C-zUHAyD.chunk.js";import{t as P}from"./CaJxXKnx.chunk.js";var F=e(r()),I=i(),L=n.encloseNamespace(`subjects.twigEntry`),{Twig:R,Tigtag:z}=l.Classifications,B={[y.UK]:{twigHubId:R.EnglandSecondary.HUB,tigtagHubId:z.EnglandPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.EnglandPrimary.TIGTAG_JUNIOR_HUB},[y.SCOT]:{twigHubId:R.ScotlandSecondary.HUB,tigtagHubId:z.ScotlandPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.ScotlandPrimary.TIGTAG_JUNIOR_HUB},[y.NZ]:{twigHubId:R.NewZealandSecondary.HUB,tigtagHubId:z.NewZealandPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.NewZealandPrimary.TIGTAG_JUNIOR_HUB},[y.CA]:{twigHubId:R.CanadaMiddle.HUB,tigtagHubId:z.CanadaElementary.TIGTAG_HUB,tigtagJuniorHubId:z.CanadaElementary.TIGTAG_JUNIOR_HUB},[y.GLOBAL]:{twigHubId:R.InternationalSecondary.HUB,tigtagHubId:z.InternationalPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.InternationalPrimary.TIGTAG_JUNIOR_HUB},[y.AU]:null,[y.US]:null};function V(e){let{classificationId:t,currentUser:n,config:r}=e,{hasPermissions:i,hasLocalPermissions:a}=C(),{hasTopicDirectories:l}=h(null),{activePresentation:d}=v(),{availablePresentations:g}=D(),_=j(),{commonVideoProps:y}=M({locationContext:c.VideoThumbnail}),S=o(x.classification(t,n?.id)),T=o(S.data&&x.presentationById(S.data.presentationId)),E=o(S.data&&A.audiencesByPresentationId(S.data.presentationId)),O=o(S.data&&k.getDashboard(p.Staff,[m.Published],`classification:${t}`)),L=F.useMemo(()=>s.sortBy(O.data?.widgets,`index`)??[],[O.data?.widgets]);function R(e,t,n){let r=u.getWidgetParams(t,n,f.Classification);return k.dashboardWidgetContent(e,r,n,T.data)}let z=w(S.data,f.Classification,{},n,d?.vanitySlug,g),B={presentationId:T.data?.id,presentationName:T.data?.name,currentClassificationId:S.data?.id,currentClassificationName:S.data?.name,followingCurrentClassification:!!S.data?.followers?.data?.length};return!O.hasCompleted||!S.data||!T.data||!E.hasCompleted||!L.length?(0,I.jsx)(I.Fragment,{}):(0,I.jsx)(`div`,{className:`mb-3`,children:(0,I.jsx)(`div`,{className:`dashboard-spacing-lg`,children:L.map((e,t)=>(0,I.jsx)(N,{id:e.id,name:e.name,description:e.description,templateId:e.templateId,widgetTypeId:e.widgetId,widgetCollection:f.Classification,dashboardTarget:f.Classification,getContentRequest:R,hasPermissions:i,hasLocalPermissions:a,classification:S.data,presentation:T.data,audiences:E.data,metadata:e.metadata,widgetIndex:t,lazyLoad:!0,commonVideoProps:y,settings:{hasTopicDirectories:l},imageCdnUrl:r?.imageCdnUrl,imageUrls:P,resourceThumbnailFallbackImageUrl:b.Fallbacks.RESOURCE_THUMBNAIL,isTertiaryCustomerWithoutExchange:!1,curriculums:_,analyticsData:B,appLinks:z,onToggleFollowClassification:void 0,onSubmitFeedback:void 0,isPreviewing:!1,isBot:!1,contentType:void 0,hasTableOfContents:!1,limitTotalItems:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},e.id))})})}function H(e){let[n,r]=F.useState(e.showError);S({title:L(`heading`)});let i=o(d.currentUser()),s=o(_.config()),c=o(i.data?.isAuthenticated&&O.libraries()),l=F.useMemo(()=>i.data?.contentRegion?B[i.data.contentRegion]||B[y.UK]:null,[i.data?.contentRegion]),u=i.hasCompleted&&(!i.data?.isAuthenticated||c.hasCompleted)&&s.hasCompleted;return F.useEffect(()=>{!u||l||t.trigger({application:a.DASHBOARD,action:g.Dashboard.HOME,args:[null]})},[u,l]),!u||!l?(0,I.jsx)(I.Fragment,{}):(0,I.jsxs)(`div`,{className:`bg-white p-4`,children:[(0,I.jsx)(`h1`,{className:`mb-4 h2`,children:L(`heading`)}),e.showError&&(0,I.jsx)(`div`,{className:`alert text-dark bg-light-blue px-3 rounded-3`,children:L(`errorPopupDescription`)}),(0,I.jsx)(`hr`,{className:`mt-2`}),(0,I.jsx)(V,{classificationId:l.twigHubId,currentUser:i.data,config:s.data}),(0,I.jsx)(V,{classificationId:l.tigtagHubId,currentUser:i.data,config:s.data}),(0,I.jsx)(V,{classificationId:l.tigtagJuniorHubId,currentUser:i.data,config:s.data}),n&&(0,I.jsxs)(T,{title:L(`errorPopupHeading`),closePopup:()=>r(!1),children:[(0,I.jsxs)(`div`,{className:`d-flex flex-column align-items-center text-center`,children:[(0,I.jsx)(`img`,{src:b.EmptyStates.TWIG,alt:L(`errorPopupHeading`),className:`mb-3 mx-auto w-75`}),(0,I.jsx)(`p`,{className:`mb-4`,children:L(`errorPopupDescription`)})]}),(0,I.jsx)(E,{children:(0,I.jsx)(E.Cancel,{text:L(`errorPopupCloseButton`),onClick:()=>r(!1)})})]})]})}export{H as TwigEntryView};
2
- //# sourceMappingURL=DGy8Ldlr.chunk.js.map
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import{t as n}from"./CQyJ7YGa.chunk.js";import{t as r}from"./C2w0pmFW.chunk.js";import{t as i}from"./wrLrTezN.chunk.js";import{t as a}from"./BXTI9cmX.chunk.js";import{u as o}from"./BX0wDJmp.chunk.js";import{t as s}from"./C1SLt-ar.chunk.js";import{y as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./DIqO2TFN.chunk.js";import{r as u}from"./Cr6TXzQQ2.chunk.js";import{t as d}from"./oPIkfKWW2.chunk.js";import{n as f,r as p,t as m}from"./CmcCVXi32.chunk.js";import{t as h}from"./CcDvlSWl2.chunk.js";import{t as g}from"./DdsRCMkN.chunk.js";import{t as _}from"./D_gWf2lC.chunk.js";import{t as v}from"./ZwDDc8Zd.chunk.js";import{t as y}from"./M97_Ztsu.chunk.js";import{t as b}from"./PgzMrOyM.chunk.js";import{t as x}from"./B0aLOQEJ2.chunk.js";import{t as S}from"./A8xLZrSw.chunk.js";import{t as C}from"./BQKcAczf.chunk.js";import{t as w}from"./D4jQxS0H.chunk.js";import{t as T}from"./dEqScqMh2.chunk.js";import{t as E}from"./D1EthTiX.chunk.js";import{t as D}from"./DOnmTMfX.chunk.js";import{t as O}from"./DMZ_X3HL.chunk.js";import{t as k}from"./DewCxv4i.chunk.js";import{t as A}from"./DMaQV7L2.chunk.js";import{t as j}from"./CETzluXN.chunk.js";import{t as M}from"./BmR4qY-v2.chunk.js";import{t as N}from"./CajcIz6S.chunk.js";import{t as P}from"./CaJxXKnx.chunk.js";var F=e(r()),I=i(),L=n.encloseNamespace(`subjects.twigEntry`),{Twig:R,Tigtag:z}=l.Classifications,B={[y.UK]:{twigHubId:R.EnglandSecondary.HUB,tigtagHubId:z.EnglandPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.EnglandPrimary.TIGTAG_JUNIOR_HUB},[y.SCOT]:{twigHubId:R.ScotlandSecondary.HUB,tigtagHubId:z.ScotlandPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.ScotlandPrimary.TIGTAG_JUNIOR_HUB},[y.NZ]:{twigHubId:R.NewZealandSecondary.HUB,tigtagHubId:z.NewZealandPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.NewZealandPrimary.TIGTAG_JUNIOR_HUB},[y.CA]:{twigHubId:R.CanadaMiddle.HUB,tigtagHubId:z.CanadaElementary.TIGTAG_HUB,tigtagJuniorHubId:z.CanadaElementary.TIGTAG_JUNIOR_HUB},[y.GLOBAL]:{twigHubId:R.InternationalSecondary.HUB,tigtagHubId:z.InternationalPrimary.TIGTAG_HUB,tigtagJuniorHubId:z.InternationalPrimary.TIGTAG_JUNIOR_HUB},[y.AU]:null,[y.US]:null};function V(e){let{classificationId:t,currentUser:n,config:r}=e,{hasPermissions:i,hasLocalPermissions:a}=C(),{hasTopicDirectories:l}=h(null),{activePresentation:d}=v(),{availablePresentations:g}=D(),_=j(),{commonVideoProps:y}=M({locationContext:c.VideoThumbnail}),S=o(x.classification(t,n?.id)),T=o(S.data&&x.presentationById(S.data.presentationId)),E=o(S.data&&A.audiencesByPresentationId(S.data.presentationId)),O=o(S.data&&k.getDashboard(p.Staff,[m.Published],`classification:${t}`)),L=F.useMemo(()=>s.sortBy(O.data?.widgets,`index`)??[],[O.data?.widgets]);function R(e,t,n){let r=u.getWidgetParams(t,n,f.Classification);return k.dashboardWidgetContent(e,r,n,T.data)}let z=w(S.data,f.Classification,{},n,d?.vanitySlug,g),B={presentationId:T.data?.id,presentationName:T.data?.name,currentClassificationId:S.data?.id,currentClassificationName:S.data?.name,followingCurrentClassification:!!S.data?.followers?.data?.length};return!O.hasCompleted||!S.data||!T.data||!E.hasCompleted||!L.length?(0,I.jsx)(I.Fragment,{}):(0,I.jsx)(`div`,{className:`mb-3`,children:(0,I.jsx)(`div`,{className:`dashboard-spacing-lg`,children:L.map((e,t)=>(0,I.jsx)(N,{id:e.id,name:e.name,description:e.description,templateId:e.templateId,widgetTypeId:e.widgetId,widgetCollection:f.Classification,dashboardTarget:f.Classification,getContentRequest:R,hasPermissions:i,hasLocalPermissions:a,classification:S.data,presentation:T.data,audiences:E.data,metadata:e.metadata,widgetIndex:t,lazyLoad:!0,commonVideoProps:y,settings:{hasTopicDirectories:l},imageCdnUrl:r?.imageCdnUrl,imageUrls:P,resourceThumbnailFallbackImageUrl:b.Fallbacks.RESOURCE_THUMBNAIL,isTertiaryCustomerWithoutExchange:!1,curriculums:_,analyticsData:B,appLinks:z,onToggleFollowClassification:void 0,onSubmitFeedback:void 0,isPreviewing:!1,isBot:!1,contentType:void 0,hasTableOfContents:!1,limitTotalItems:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},e.id))})})}function H(e){let[n,r]=F.useState(e.showError);S({title:L(`heading`)});let i=o(d.currentUser()),s=o(_.config()),c=o(i.data?.isAuthenticated&&O.libraries()),l=F.useMemo(()=>i.data?.contentRegion?B[i.data.contentRegion]||B[y.UK]:null,[i.data?.contentRegion]),u=i.hasCompleted&&(!i.data?.isAuthenticated||c.hasCompleted)&&s.hasCompleted;return F.useEffect(()=>{!u||l||t.trigger({application:a.DASHBOARD,action:g.Dashboard.HOME,args:[null]})},[u,l]),!u||!l?(0,I.jsx)(I.Fragment,{}):(0,I.jsxs)(`div`,{className:`bg-white p-4`,children:[(0,I.jsx)(`h1`,{className:`mb-4 h2`,children:L(`heading`)}),e.showError&&(0,I.jsx)(`div`,{className:`alert text-dark bg-light-blue px-3 rounded-3`,children:L(`errorPopupDescription`)}),(0,I.jsx)(`hr`,{className:`mt-2`}),(0,I.jsx)(V,{classificationId:l.twigHubId,currentUser:i.data,config:s.data}),(0,I.jsx)(V,{classificationId:l.tigtagHubId,currentUser:i.data,config:s.data}),(0,I.jsx)(V,{classificationId:l.tigtagJuniorHubId,currentUser:i.data,config:s.data}),n&&(0,I.jsxs)(T,{title:L(`errorPopupHeading`),closePopup:()=>r(!1),children:[(0,I.jsxs)(`div`,{className:`d-flex flex-column align-items-center text-center`,children:[(0,I.jsx)(`img`,{src:b.EmptyStates.TWIG,alt:L(`errorPopupHeading`),className:`mb-3 mx-auto w-75`}),(0,I.jsx)(`p`,{className:`mb-4`,children:L(`errorPopupDescription`)})]}),(0,I.jsx)(E,{children:(0,I.jsx)(E.Cancel,{text:L(`errorPopupCloseButton`),onClick:()=>r(!1)})})]})]})}export{H as TwigEntryView};
2
+ //# sourceMappingURL=FIUOppmy.chunk.js.map