@clickview/lite 0.104.0-rc.2 → 0.104.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +779 -779
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{CXN0_XjU.chunk.js → -KvTbeQV.chunk.js} +2 -2
- package/dist/scripts/{CXN0_XjU.chunk.js.map → -KvTbeQV.chunk.js.map} +1 -1
- package/dist/scripts/{Bu7Sr1dy.chunk.js → 0Fek4oFk.chunk.js} +2 -2
- package/dist/scripts/{Bu7Sr1dy.chunk.js.map → 0Fek4oFk.chunk.js.map} +1 -1
- package/dist/scripts/{CfRQYWGG.chunk.js → 5PKjjI4Y.chunk.js} +2 -2
- package/dist/scripts/{CfRQYWGG.chunk.js.map → 5PKjjI4Y.chunk.js.map} +1 -1
- package/dist/scripts/{z8IWZ1V1.chunk.js → AEOAlemi.chunk.js} +2 -2
- package/dist/scripts/{z8IWZ1V1.chunk.js.map → AEOAlemi.chunk.js.map} +1 -1
- package/dist/scripts/{DBcWjmUy.chunk.js → B1TqilLB.chunk.js} +2 -2
- package/dist/scripts/{DBcWjmUy.chunk.js.map → B1TqilLB.chunk.js.map} +1 -1
- package/dist/scripts/B1hsuVfV2.chunk.js +2 -0
- package/dist/scripts/{BwBWuxjr2.chunk.js.map → B1hsuVfV2.chunk.js.map} +1 -1
- package/dist/scripts/{BiUOH1CR.chunk.js → B2wDqI1S.chunk.js} +2 -2
- package/dist/scripts/{BiUOH1CR.chunk.js.map → B2wDqI1S.chunk.js.map} +1 -1
- package/dist/scripts/{DWJiezgB2.chunk.js → BBWnpWNB2.chunk.js} +2 -2
- package/dist/scripts/{DWJiezgB2.chunk.js.map → BBWnpWNB2.chunk.js.map} +1 -1
- package/dist/scripts/BILyzh0I.chunk.js +1 -0
- package/dist/scripts/{B-k4BlVQ2.chunk.js → BUVko1EF2.chunk.js} +3 -3
- package/dist/scripts/{B-k4BlVQ2.chunk.js.map → BUVko1EF2.chunk.js.map} +1 -1
- package/dist/scripts/{GolowYbA.chunk.js → BYbQI3CA.chunk.js} +2 -2
- package/dist/scripts/{GolowYbA.chunk.js.map → BYbQI3CA.chunk.js.map} +1 -1
- package/dist/scripts/{DFlO2qoz2.chunk.js → Bf9r1ZoF2.chunk.js} +2 -2
- package/dist/scripts/{DFlO2qoz2.chunk.js.map → Bf9r1ZoF2.chunk.js.map} +1 -1
- package/dist/scripts/{BpHA-MkZ.chunk.js → BiWUSyJr.chunk.js} +2 -2
- package/dist/scripts/{BpHA-MkZ.chunk.js.map → BiWUSyJr.chunk.js.map} +1 -1
- package/dist/scripts/{C8tDgg1l2.chunk.js → BlsbWOzw2.chunk.js} +2 -2
- package/dist/scripts/{C8tDgg1l2.chunk.js.map → BlsbWOzw2.chunk.js.map} +1 -1
- package/dist/scripts/{C_tdgSWS2.chunk.js → Bzk4AwVx2.chunk.js} +2 -2
- package/dist/scripts/{C_tdgSWS2.chunk.js.map → Bzk4AwVx2.chunk.js.map} +1 -1
- package/dist/scripts/{uSXjtjlJ.chunk.js → C3PXfYEd.chunk.js} +2 -2
- package/dist/scripts/{uSXjtjlJ.chunk.js.map → C3PXfYEd.chunk.js.map} +1 -1
- package/dist/scripts/{BgPye7Nd2.chunk.js → C46OeU6w2.chunk.js} +2 -2
- package/dist/scripts/{BgPye7Nd2.chunk.js.map → C46OeU6w2.chunk.js.map} +1 -1
- package/dist/scripts/{9oMRc0cb2.chunk.js → CAs2Sere2.chunk.js} +2 -2
- package/dist/scripts/{9oMRc0cb2.chunk.js.map → CAs2Sere2.chunk.js.map} +1 -1
- package/dist/scripts/{Bm5qACA52.chunk.js → CNfmLVE82.chunk.js} +2 -2
- package/dist/scripts/{Bm5qACA52.chunk.js.map → CNfmLVE82.chunk.js.map} +1 -1
- package/dist/scripts/{-7qiRMLt.chunk.js → CW1i-QHv.chunk.js} +2 -2
- package/dist/scripts/{-7qiRMLt.chunk.js.map → CW1i-QHv.chunk.js.map} +1 -1
- package/dist/scripts/{EKwCaE3J2.chunk.js → CX6c7KRp2.chunk.js} +2 -2
- package/dist/scripts/{EKwCaE3J2.chunk.js.map → CX6c7KRp2.chunk.js.map} +1 -1
- package/dist/scripts/{D_uAdX7E2.chunk.js → CaCm4N_d2.chunk.js} +2 -2
- package/dist/scripts/{D_uAdX7E2.chunk.js.map → CaCm4N_d2.chunk.js.map} +1 -1
- package/dist/scripts/{DW_sm5se2.chunk.js → CfNYFxJl2.chunk.js} +2 -2
- package/dist/scripts/{DW_sm5se2.chunk.js.map → CfNYFxJl2.chunk.js.map} +1 -1
- package/dist/scripts/{CVL6bQWp.chunk.js → CpzveYo2.chunk.js} +2 -2
- package/dist/scripts/{CVL6bQWp.chunk.js.map → CpzveYo2.chunk.js.map} +1 -1
- package/dist/scripts/{CFduwlo0.chunk.js → Cqq1N9xw.chunk.js} +2 -2
- package/dist/scripts/{CFduwlo0.chunk.js.map → Cqq1N9xw.chunk.js.map} +1 -1
- package/dist/scripts/{UCiRB6cQ.chunk.js → CwFYdvvA.chunk.js} +2 -2
- package/dist/scripts/{UCiRB6cQ.chunk.js.map → CwFYdvvA.chunk.js.map} +1 -1
- package/dist/scripts/{By9Vb8Wn.chunk.js → CwYg3Mqk.chunk.js} +2 -2
- package/dist/scripts/{By9Vb8Wn.chunk.js.map → CwYg3Mqk.chunk.js.map} +1 -1
- package/dist/scripts/{DLcyKjA7.chunk.js → Cyit3dMk.chunk.js} +2 -2
- package/dist/scripts/{DLcyKjA7.chunk.js.map → Cyit3dMk.chunk.js.map} +1 -1
- package/dist/scripts/{BxjzTnvL2.chunk.js → D-iyHqNw2.chunk.js} +3 -3
- package/dist/scripts/{BxjzTnvL2.chunk.js.map → D-iyHqNw2.chunk.js.map} +1 -1
- package/dist/scripts/{DICsRDM42.chunk.js → DH_0KtTK2.chunk.js} +2 -2
- package/dist/scripts/{DICsRDM42.chunk.js.map → DH_0KtTK2.chunk.js.map} +1 -1
- package/dist/scripts/{BTcLMVw4.chunk.js → DKDWcWxk.chunk.js} +2 -2
- package/dist/scripts/{BTcLMVw4.chunk.js.map → DKDWcWxk.chunk.js.map} +1 -1
- package/dist/scripts/{Df6x5Ekm2.chunk.js → DN82USWW2.chunk.js} +2 -2
- package/dist/scripts/{Df6x5Ekm2.chunk.js.map → DN82USWW2.chunk.js.map} +1 -1
- package/dist/scripts/{C62uevy9.chunk.js → DWo8DfD9.chunk.js} +2 -2
- package/dist/scripts/{C62uevy9.chunk.js.map → DWo8DfD9.chunk.js.map} +1 -1
- package/dist/scripts/{Bh-26cqn.chunk.js → Dnz8CbEu.chunk.js} +3 -3
- package/dist/scripts/{Bh-26cqn.chunk.js.map → Dnz8CbEu.chunk.js.map} +1 -1
- package/dist/scripts/{CukXgE1z.chunk.js → Dt5731Ay.chunk.js} +2 -2
- package/dist/scripts/{CukXgE1z.chunk.js.map → Dt5731Ay.chunk.js.map} +1 -1
- package/dist/scripts/{DCPsmD1m.chunk.js → Dtag-27K.chunk.js} +2 -2
- package/dist/scripts/{DCPsmD1m.chunk.js.map → Dtag-27K.chunk.js.map} +1 -1
- package/dist/scripts/{DOCHl5Sy.chunk.js → DyE6EUDb.chunk.js} +2 -2
- package/dist/scripts/{DOCHl5Sy.chunk.js.map → DyE6EUDb.chunk.js.map} +1 -1
- package/dist/scripts/{app-CuKrDFuc.js → app-CfAhMxn1.js} +4 -4
- package/dist/scripts/{app-CuKrDFuc.js.map → app-CfAhMxn1.js.map} +1 -1
- package/dist/scripts/{DerPQKk6.chunk.js → cDv6zuhh.chunk.js} +2 -2
- package/dist/scripts/{DerPQKk6.chunk.js.map → cDv6zuhh.chunk.js.map} +1 -1
- package/dist/scripts/jAtAipGN.chunk.js +2 -0
- package/dist/scripts/{CpsbRDII.chunk.js.map → jAtAipGN.chunk.js.map} +1 -1
- package/dist/scripts/{CXKdMqPJ.chunk.js → pKtXmGbN.chunk.js} +2 -2
- package/dist/scripts/{CXKdMqPJ.chunk.js.map → pKtXmGbN.chunk.js.map} +1 -1
- package/dist/scripts/{DhdM2yGm.chunk.js → qRLSbnEr.chunk.js} +2 -2
- package/dist/scripts/{DhdM2yGm.chunk.js.map → qRLSbnEr.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/BwBWuxjr2.chunk.js +0 -2
- package/dist/scripts/CCBk_ENs.chunk.js +0 -1
- package/dist/scripts/CpsbRDII.chunk.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DFlO2qoz2.chunk.js","names":[],"sources":["../../src/shared/components/play-page/ArchivedBanner.tsx","../../src/shared/components/related-videos/RelatedVideos.tsx","../../../../libs/shared/src/components/play-page/interactives-widget/InteractiveWidgetItem.tsx","../../src/shared/components/citations/citation-generator.module.scss","../../src/shared/components/citations/EditableCitationField.tsx","../../src/shared/components/citations/CitationStyles.tsx","../../src/shared/components/citations/CitationHelpers.tsx","../../src/shared/components/citations/CitationWidget.tsx","../../src/shared/components/play-page/RestrictionBanner.tsx"],"sourcesContent":["import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EntityType } from 'libs/analytics/interfaces';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { ArchiveSvg } from 'libs/shared/images/svg/objects/ArchiveSvg';\n\nconst namespace = 'shared.playPage';\n\ninterface ArchivedBannerProps {\n typeId: MasterType;\n hasStudentExperience: boolean;\n}\n\nfunction mapTypeId(typeId: MasterType): string {\n switch (typeId) {\n case MasterType.Video:\n return 'video';\n case MasterType.Clip:\n return 'clip';\n case MasterType.Interactive:\n return 'interactive';\n default:\n return '';\n }\n}\n\nexport function ArchivedBanner(props: ArchivedBannerProps): JSX.Element {\n const getPhrase = LanguageService.encloseNamespace(namespace);\n const type = mapTypeId(props.typeId);\n\n return (\n <div className='alert bg-light-blue p-3 rounded-3 d-flex justify-content-between align-items-center'>\n <SvgContainer\n svg={ArchiveSvg}\n size={SvgContainerSize.Standard}\n className='me-2 svg-container'\n />\n \n <div className='w-100'>\n <p className='fw-semibold mb-0'>{getPhrase('archivedInfoTitle', { type })}</p>\n {(!props.hasStudentExperience || type === EntityType.Video) && (\n <p className='mb-1'>{getPhrase('archivedInfo', { type: `${type}s` })}</p>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { InfiniteScrollFooter } from 'libs/shared/components/infinite-scroll-footer/InfiniteScrollFooter';\nimport { PartialVideoList } from 'libs/shared/components/video-list/partial-loading/PartialVideoList';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { WidgetHeader } from 'libs/shared/components/widgets/curated-widgets/components/header/WidgetHeader';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { CurrentUser, PresentationAudience, VideoTypes } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { GetVideoAppLinkOptions } from 'libs/shared/interfaces/VideoAppLinkOptions';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\n\nconst namespace = 'shared.relatedVideos';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface RelatedVideosProps {\n presentationSlug: string | null;\n currentVideo: VideoTypes;\n relatedVideos: RelatedVideosHash;\n currentUser: CurrentUser;\n audiences: PresentationAudience[];\n getVideoAppLink: (video: VideoTypes, opts: GetVideoAppLinkOptions) => Core.AppLink;\n moviesAndTv: boolean;\n headingRef?: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function RelatedVideos(props: RelatedVideosProps): JSX.Element {\n const videoActions = useVideoActions({\n location: VideoActionsLocation.VideoItem,\n presentationSlug: props.presentationSlug\n });\n const { hasPermissions } = usePermissions();\n\n if (!props.currentUser?.isAuthenticated) // Don't render if user is unauthenticated\n return <></>;\n\n if (props.relatedVideos.hasError) // Don't render if request has errored\n return <></>;\n\n if (props.relatedVideos.hasCompleted && !props.relatedVideos.videos?.length) // Don't render if response is empty\n return <></>;\n\n if (!props.relatedVideos.isFetching && !props.relatedVideos.hasCompleted) // Don't render if request is never made\n return <></>;\n\n // We don't support autoplaying from interactives. This means the related videos heading won't say \"Up next\"\n const canAutoplay = !VideoHelper.isInteractive(props.currentVideo);\n\n return (\n <section\n id={PlayPageAnchor.RelatedVideos}\n className='play-page-section'\n ref={el => {\n (el && props.headingRef?.current\n && !!props.relatedVideos.videos?.length)\n && props.headingRef.current.set(PlayPageAnchor.RelatedVideos, el);\n }}\n >\n <VideoActionsContext.Provider value={videoActions}>\n <WidgetHeader name={canAutoplay ? getPhrase('upNext') : getPhrase('relatedVideos')} />\n \n {props.relatedVideos.hasCompleted ? (\n <VideoList\n videos={props.relatedVideos.videos}\n getVideoAppLink={props.getVideoAppLink}\n hasPermissions={hasPermissions}\n presentationAudiences={props.audiences}\n getPreviewQuestionsAppLink={interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={props.commonVideoProps}\n />\n ) : <PartialVideoList />\n }\n {props.relatedVideos.hasMore && (\n <InfiniteScrollFooter\n isFetching={props.relatedVideos.isFetching}\n fetchNext={props.relatedVideos.fetchNext}\n />\n )}\n </VideoActionsContext.Provider>\n </section>\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 { Text } from 'libs/shared/components/text/Text';\nimport { ThumbnailText } from 'libs/shared/components/thumbnails/thumbnail-text/ThumbnailText';\nimport { VideoThumbnail } from 'libs/shared/components/thumbnails/video/VideoThumbnail';\nimport { FixedWidgetItemProps } from 'libs/shared/components/widgets/items/FixedWidgetItemProps';\nimport { ThumbnailTextPosition } from 'libs/shared/enums/ThumbnailTextPosition';\nimport { InteractiveMetadata } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { getTotalInteractions } from 'libs/shared/utils/InteractiveHelper';\n\nconst namespace = 'shared.interactiveWidgetItem';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport interface InteractiveWidgetItemProps extends FixedWidgetItemProps<InteractiveMetadata> {\n questionsAppLink: Core.AppLink;\n showOwner?: boolean;\n commonVideoProps: CommonVideoProps;\n}\n\nexport const InteractiveWidgetItem = React.memo(function(props: InteractiveWidgetItemProps): JSX.Element {\n const { data: interactive, thumbnailSize, preloadImage } = props;\n\n const questionsAppLink: Core.AppLink = {\n ...props.questionsAppLink,\n args: [props.data.id]\n };\n\n const questionsNumber = getTotalInteractions(interactive);\n\n return (\n <div className='flex-shrink-0 px-1 col-6 col-sm-4'>\n <VideoThumbnail\n type='static'\n textPosition={ThumbnailTextPosition.Independent}\n video={interactive}\n appLink={props.getAppLink(interactive)}\n imageOptions={{ size: thumbnailSize }}\n preload={preloadImage}\n analyticsData={props.analyticsData}\n analyticsOptions={props.analyticsOptions}\n hideDuration={false}\n commonVideoProps={props.commonVideoProps}\n />\n\n <div className='mt-2'>\n <ThumbnailText\n {...props}\n video={interactive}\n appLink={props.getAppLink(interactive)}\n />\n </div>\n\n <AppLink\n appLink={questionsAppLink}\n className='cursor-pointer hover-text-underline'\n ariaLabel={`${getPhrase('previewQuestions', { count: questionsNumber, smartCount: questionsNumber })} ${getPhrase('ariaPreview', { name: interactive.name })}`}\n >\n {questionsNumber ?\n (\n <Text namespace={namespace} phrase='previewQuestions' options={{ count: questionsNumber, smartCount: questionsNumber }}/>\n ) : (\n // handling a rare case: add a fallback phrase if we don't get the question number\n <Text namespace={namespace} phrase='previewQuestionsFallback' />\n )}\n </AppLink>\n </div>\n );\n});\n",":local {\n .citationButton {\n border-radius: $border-radius-sm 0 $border-radius-sm 0;\n }\n\n .citationText {\n word-break: break-word;\n }\n\n .editableFieldContainer {\n border-bottom: 1px dashed;\n cursor: pointer;\n }\n\n .editableField {\n border-radius: $border-radius-sm;\n outline: none;\n }\n\n .editableFieldEmpty {\n color: $text-muted;\n font-style: italic;\n }\n\n .editableFieldIconEmpty {\n color: $text-muted;\n }\n\n .editableFieldInput {\n border: 1px solid $blue;\n border-radius: $border-radius-sm;\n background-color: $input-focus-bg;\n box-shadow: $input-focus-box-shadow;\n outline: none;\n\n &::placeholder {\n color: $text-muted;\n font-style: italic;\n }\n }\n}","import React from 'react';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { EditSvg } from 'libs/shared/images/svg/actions/EditSvg';\n\nimport styles from './citation-generator.module.scss';\n\nexport interface EditableCitationFieldRef {\n focus: () => void;\n}\n\nexport interface EditableCitationFieldProps {\n value: string;\n placeholder: string;\n tooltipText: string;\n inputSize?: number;\n onChange: (value: string) => void;\n}\n\nexport const EditableCitationField = React.forwardRef<EditableCitationFieldRef, EditableCitationFieldProps>((\n props,\n ref\n) => {\n const { value, placeholder, tooltipText, onChange } = props;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [ isEditing, setIsEditing ] = React.useState(false);\n\n React.useImperativeHandle(ref, () => ({\n focus: () => setIsEditing(true)\n }));\n\n if (isEditing) {\n return (\n <input\n ref={inputRef}\n type='text'\n size={props.inputSize}\n className={styles.editableFieldInput}\n value={value}\n placeholder={placeholder}\n autoFocus\n spellCheck={false}\n onChange={e => onChange(e.target.value)}\n onBlur={() => setIsEditing(false)}\n onKeyDown={e => e.key === 'Enter' && inputRef.current?.blur()}\n />\n );\n }\n\n return (\n <Tooltip title={tooltipText} placement='top' spanHack spanHackClassName='d-inline'>\n <div className='d-inline-block'>\n <div className={`d-flex flex-row ${styles.editableFieldContainer}`} onClick={() => setIsEditing(true)}>\n <span\n className={`${styles.editableField} ${!value ? styles.editableFieldEmpty : ''}`}\n onKeyDown={e => e.key === 'Enter' && setIsEditing(true)}\n role='button'\n tabIndex={0}\n >\n {value || placeholder}\n </span>\n <SvgContainer\n svg={EditSvg}\n size={SvgContainerSize.Small}\n className={`svg-container ${!value ? styles.editableFieldIconEmpty : ''}`}\n />\n </div>\n </div>\n </Tooltip>\n );\n});\n","import React from 'react';\n\nimport { EditableCitationField, EditableCitationFieldProps, EditableCitationFieldRef } from './EditableCitationField';\n\nexport interface EditablePlaceholder extends EditableCitationFieldProps {\n fieldRef: React.RefObject<EditableCitationFieldRef>;\n}\n\ninterface AuthorProps {\n author: string;\n placeholder?: EditablePlaceholder;\n suffix: string;\n}\n\nfunction Author({ author, placeholder, suffix }: AuthorProps): JSX.Element {\n if (placeholder) {\n return (\n <>\n <EditableCitationField\n ref={placeholder.fieldRef}\n value={placeholder.value}\n placeholder={placeholder.placeholder}\n inputSize={placeholder.inputSize}\n tooltipText={placeholder.tooltipText}\n onChange={placeholder.onChange}\n />\n {suffix}\n </>\n );\n }\n return <>{author ? `${author}${suffix}` : ''}</>;\n}\n\ninterface YearProps {\n year: number;\n placeholder?: EditablePlaceholder;\n}\n\nfunction Year({ year, placeholder }: YearProps): JSX.Element {\n if (placeholder) {\n return (\n <EditableCitationField\n ref={placeholder.fieldRef}\n value={placeholder.value}\n placeholder={placeholder.placeholder}\n inputSize={placeholder.inputSize}\n tooltipText={placeholder.tooltipText}\n onChange={placeholder.onChange}\n />\n );\n }\n return <>{year}</>;\n}\n\nexport interface SeriesInfo {\n seriesName: string;\n seasonNumber: number;\n episodeNumber: number;\n}\n\ninterface CitationComponentProps {\n name: string;\n url: string;\n viewedOn: string;\n author: string;\n publisher: string;\n productionYear: number;\n authorPlaceholder?: EditablePlaceholder;\n yearPlaceholder?: EditablePlaceholder;\n seriesInfo?: SeriesInfo;\n}\n\nexport function APA6Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, author, publisher, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). {name}\n {' '}(Season {seriesInfo.seasonNumber}, Episode {seriesInfo.episodeNumber}) [TV series episode].\n {' '}In <em>{seriesInfo.seriesName}</em>. {publisher}. Retrieved from {url}\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). <em>{name}</em> [Motion picture].\n {' '}{publisher}. Retrieved from {url}\n </span>\n );\n}\n\nexport function APA7Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, author, publisher, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). {name}\n {' '}(Season {seriesInfo.seasonNumber}, Episode {seriesInfo.episodeNumber}) [TV series episode].\n {' '}In <em>{seriesInfo.seriesName}</em>. {publisher}. {url}\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). <em>{name}</em> [Film]. {publisher}. {url}\n </span>\n );\n}\n\nexport function HarvardCitation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). '{name}',\n {' '}<em>{seriesInfo.seriesName}</em>, Season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber} [video].\n {' '}ClickView. Available at: {url} (Accessed: {viewedOn}).\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). <em>{name}</em> [video].\n {' '}ClickView. Available at: {url} (Accessed: {viewedOn}).\n </span>\n );\n}\n\nexport function HarvardAUCitation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n <Year year={productionYear} placeholder={yearPlaceholder} />, '{name}',\n {' '}<em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}, video, ClickView, viewed {viewedOn}, {url}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n <Year year={productionYear} placeholder={yearPlaceholder} />, <em>{name}</em>, video, ClickView,\n {' '}viewed {viewedOn}, {url}.\n </span>\n );\n}\n\nexport function MLA8Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n \"{name}.\" <em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}, ClickView,\n {' '}<Year year={productionYear} placeholder={yearPlaceholder} />, {url}. Accessed {viewedOn}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n <em>{name}</em>. ClickView, <Year year={productionYear} placeholder={yearPlaceholder} />, {url}.\n {' '}Accessed {viewedOn}.\n </span>\n );\n}\n\nexport function MLA9Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n \"{name}.\" <em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}, ClickView,\n {' '}<Year year={productionYear} placeholder={yearPlaceholder} />, {url}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n <em>{name}</em>. ClickView, <Year year={productionYear} placeholder={yearPlaceholder} />, {url}.\n </span>\n );\n}\n\nexport function ChicagoCitation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n \"{name}.\" <em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}. ClickView,\n {' '}<Year year={productionYear} placeholder={yearPlaceholder} />. {url}. Accessed {viewedOn}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n <em>{name}</em>. ClickView, <Year year={productionYear} placeholder={yearPlaceholder} />. {url}.\n {' '}Accessed {viewedOn}.\n </span>\n );\n}\n","import React from 'react';\n\nimport { Video } from 'libs/shared/interfaces';\n\nimport { CitationStyleId } from 'shared/enums/CitationStyleId';\n\nimport { SUPPORTED_CITATION_STYLES } from './CitationStyleDropdown';\nimport {\n APA6Citation,\n APA7Citation,\n ChicagoCitation,\n EditablePlaceholder,\n HarvardAUCitation,\n HarvardCitation,\n MLA8Citation,\n MLA9Citation,\n SeriesInfo\n} from './CitationStyles';\n\ntype PeopleRolesMap = Map<string, string[]>;\n\ninterface GetCitationStylesOptions {\n name: string;\n creatorPeople: PeopleRolesMap;\n creatorCompanies: string[];\n productionYear: number;\n url: string;\n authorPlaceholder?: EditablePlaceholder;\n yearPlaceholder?: EditablePlaceholder;\n seriesInfo?: SeriesInfo;\n}\n\nexport interface CitationStyle {\n id: CitationStyleId;\n name: string;\n component: JSX.Element;\n}\n\nexport const CitationHelpers = {\n hasAuthorData(peopleRoles: PeopleRolesMap, companies: string[]): boolean {\n return peopleRoles.size > 0 || companies.length > 0;\n },\n\n processCompanies(video: Video): string[] {\n let companies: string[] = [];\n\n if (video?.productionCompanies?.data?.length) {\n companies = video.productionCompanies.data.map(pc => pc.name ?? '');\n } else if (video?.distributors?.data?.length) {\n companies = video.distributors.data.map(d => d.name ?? '');\n } else if (video?.channel?.name) {\n companies = [video.channel.name];\n }\n\n return companies.filter(c => c.trim());\n },\n\n joinWithAmpersand(items: string[]): string {\n if (items.length === 0) return '';\n if (items.length === 1) return items[0];\n if (items.length === 2) return `${items[0]}, & ${items[1]}`;\n\n // 3 or more: comma-separated with \", &\" before the last one\n const allButLast = items.slice(0, -1).join(', ');\n const last = items[items.length - 1];\n return `${allButLast}, & ${last}`;\n },\n\n processSeriesInfo(video: Video): SeriesInfo | undefined {\n if (!video.series?.name) return undefined;\n if (!video.season?.number) return undefined;\n if (!video.episodeNumber) return undefined;\n\n return {\n seriesName: video.series.name,\n seasonNumber: video.season.number,\n episodeNumber: video.episodeNumber\n };\n },\n\n processAuthors(video: Video): PeopleRolesMap {\n const peopleRoles = new Map<string, string[]>();\n\n (video?.directors?.data ?? []).forEach(d => {\n if (d?.name) {\n const roles = peopleRoles.get(d.name) || [];\n roles.push('Director');\n peopleRoles.set(d.name, roles);\n }\n });\n\n (video?.producers?.data ?? []).forEach(p => {\n if (p?.name) {\n const roles = peopleRoles.get(p.name) || [];\n roles.push('Producer');\n peopleRoles.set(p.name, roles);\n }\n });\n\n return peopleRoles;\n },\n\n formatAuthorsDefault(peopleRoles: PeopleRolesMap, creatorCompanies: string[]): string {\n const people = Array.from(peopleRoles.entries()).map(([ name, roles ]) =>\n `${name} (${roles.join(' & ')})`);\n\n return people.length > 0 ? people.join(', ') :\n creatorCompanies.length > 0 ? creatorCompanies[0] : '';\n },\n\n formatPublisher(peopleRoles: PeopleRolesMap, creatorCompanies: string[]): string {\n // Production company when we have human authors and a distinct non-ClickView company,\n // otherwise fall back to \"ClickView\" (avoids listing the same company as both author and publisher).\n const hasPeople = peopleRoles.size > 0;\n const nonClickView = creatorCompanies.filter(c => c !== 'ClickView');\n\n if (hasPeople && nonClickView.length > 0)\n return nonClickView.join(', ');\n\n return 'ClickView';\n },\n\n formatAuthorsAPA7(peopleRoles: PeopleRolesMap, creatorCompanies: string[]): string {\n // APA 7 use `Last name, Initials` format for people\n function formatName(name: string, roles: string[]) {\n const nameParts = name.trim().split(/\\s+/);\n const roleString = roles.join(' & ');\n\n if (nameParts.length === 0) return '';\n if (nameParts.length === 1) return `${nameParts[0]} (${roleString})`;\n\n const lastName = nameParts[nameParts.length - 1];\n const firstNames = nameParts.slice(0, -1);\n const initials = firstNames.map(n => `${n.charAt(0)}.`).join(' ');\n\n return `${lastName}, ${initials} (${roleString})`;\n }\n\n const formattedAuthors = Array.from(peopleRoles.entries()).map(([ name, roles ]) => formatName(name, roles));\n\n if (formattedAuthors.length > 0) {\n return `${CitationHelpers.joinWithAmpersand(formattedAuthors)}.`;\n }\n\n // Fallback to companies if no people authors\n if (creatorCompanies.length === 0) return '';\n\n const formattedCompanies = CitationHelpers.joinWithAmpersand(creatorCompanies);\n return formattedCompanies ? `${formattedCompanies}.` : '';\n },\n\n getCitationStyles(options: GetCitationStylesOptions): CitationStyle[] {\n const {\n name,\n creatorPeople,\n creatorCompanies,\n productionYear,\n url,\n authorPlaceholder,\n yearPlaceholder,\n seriesInfo\n } = options;\n\n const defaultAuthor = CitationHelpers.formatAuthorsDefault(creatorPeople, creatorCompanies);\n const apa7Author = CitationHelpers.formatAuthorsAPA7(creatorPeople, creatorCompanies);\n const publisher = CitationHelpers.formatPublisher(creatorPeople, creatorCompanies);\n\n const today = new Date();\n const viewedOn = `${today.getDate()} ${today.toLocaleString('default', { month: 'long' })} ${today.getFullYear()}`;\n\n const commonProps = {\n name,\n url,\n viewedOn,\n publisher,\n productionYear,\n authorPlaceholder,\n yearPlaceholder,\n seriesInfo\n };\n\n const components: Record<CitationStyleId, JSX.Element> = {\n [CitationStyleId.APA6]: <APA6Citation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.APA7]: <APA7Citation {...commonProps} author={apa7Author} />,\n [CitationStyleId.Harvard]: <HarvardCitation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.HarvardAU]: <HarvardAUCitation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.MLA8]: <MLA8Citation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.MLA9]: <MLA9Citation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.Chicago]: <ChicagoCitation {...commonProps} author={defaultAuthor} />\n };\n\n return SUPPORTED_CITATION_STYLES.map(style => ({\n ...style,\n component: components[style.id]\n }));\n }\n};\n","import React from 'react';\n\nimport { LocationUtils } from 'libs/common/backbone/core/LocationUtils';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { ContentRegion } from 'libs/shared/enums/ContentRegion';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { useCopyToClipboard } from 'libs/shared/hooks/useCopyToClipboard';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Video, VideoTypes } from 'libs/shared/interfaces';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CitationStyleId } from 'shared/enums/CitationStyleId';\nimport { usePreferredCitationStyle } from 'shared/hooks/usePreferredCitationStyle';\nimport { generatePublicUrl } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { CitationHelpers, CitationStyle } from './CitationHelpers';\nimport { CitationStyleDropdown } from './CitationStyleDropdown';\nimport { EditableCitationFieldRef } from './EditableCitationField';\n\nimport styles from './citation-generator.module.scss';\n\nconst namespace = 'shared.citations';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ntype CitationWidgetProps = {\n parentVideo?: Video,\n media: VideoTypes,\n headingRef?: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>,\n contentRegion: ContentRegion,\n shareId: string,\n presentationSlug: string | null\n};\n\nexport function CitationWidget(props: CitationWidgetProps): JSX.Element {\n const { headingRef, contentRegion } = props;\n\n const { copyToClipboard } = useCopyToClipboard();\n const { preferredStyleId, setPreferredStyleId } = usePreferredCitationStyle();\n const { hasPermissions } = usePermissions();\n const ref = React.useRef<HTMLDivElement>(null);\n const authorFieldRef = React.useRef<EditableCitationFieldRef>(null);\n const yearFieldRef = React.useRef<EditableCitationFieldRef>(null);\n\n const canManageSettings = hasPermissions(PermissionName.ManageCustomerSettings);\n\n // if the video is a clip or interactive, use the parent video\n // so we have a reliable source of video data\n const video = VideoHelper.isVideo(props.media) ? props.media : props.parentVideo;\n\n const url = props.shareId ?\n LocationUtils.GetCurrentUrl() :\n generatePublicUrl(contentRegion, VideoAppLinkHelper.getAppLink(video, {}, props.presentationSlug));\n\n // State for user-entered values when metadata is missing\n const [ customAuthor, setCustomAuthor ] = React.useState<string>('');\n const [ customYear, setCustomYear ] = React.useState<string>('');\n\n // Check if author data is missing and placeholder is needed\n const processedAuthors = CitationHelpers.processAuthors(video);\n const processedCompanies = CitationHelpers.processCompanies(video);\n const processedSeriesInfo = CitationHelpers.processSeriesInfo(video);\n const needsAuthorPlaceholder = !CitationHelpers.hasAuthorData(processedAuthors, processedCompanies);\n const needsYearPlaceholder = !video.productionYear;\n\n const citationStyles = React.useMemo(() => {\n return CitationHelpers.getCitationStyles({\n // make sure we use the clip, interactive or video title here\n name: props.media.name,\n creatorPeople: processedAuthors,\n creatorCompanies: processedCompanies,\n seriesInfo: processedSeriesInfo,\n productionYear: video.productionYear,\n url: url,\n authorPlaceholder: needsAuthorPlaceholder ? {\n value: customAuthor,\n placeholder: getPhrase('authorPlaceholder'),\n tooltipText: getPhrase('authorTooltip'),\n inputSize: 12,\n onChange: setCustomAuthor,\n fieldRef: authorFieldRef\n } : undefined,\n yearPlaceholder: needsYearPlaceholder ? {\n value: customYear,\n placeholder: getPhrase('yearPlaceholder'),\n tooltipText: getPhrase('yearTooltip'),\n inputSize: 6,\n onChange: setCustomYear,\n fieldRef: yearFieldRef\n } : undefined\n });\n }, [\n props.media,\n props.parentVideo,\n video.id,\n customAuthor,\n customYear,\n needsAuthorPlaceholder,\n needsYearPlaceholder,\n processedSeriesInfo?.seriesName,\n processedSeriesInfo?.seasonNumber,\n processedSeriesInfo?.episodeNumber\n ]);\n\n const initialStyle = citationStyles.find(s => s.id === preferredStyleId) ?? citationStyles[0];\n const [ selectedStyle, setSelectedStyle ] = React.useState<CitationStyle>(initialStyle);\n const [ copied, setCopied ] = React.useState(false);\n\n const onClickCopy = () => {\n copyToClipboard(ref.current?.innerText);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n };\n\n const onChangeStyle = (styleId: CitationStyleId) => {\n const style = citationStyles.find(s => s.id === styleId);\n if (style) {\n setSelectedStyle(style);\n setPreferredStyleId(styleId);\n }\n };\n\n // Keep selectedStyle in sync when citationStyles regenerate (e.g., when `customAuthor` changes)\n React.useEffect(() => {\n const updatedStyle = citationStyles.find(s => s.id === selectedStyle.id);\n if (updatedStyle)\n setSelectedStyle(updatedStyle);\n }, [citationStyles]);\n\n return (\n <section\n id={PlayPageAnchor.ReferenceVideo}\n className='play-page-section'\n ref={el => {\n (el && headingRef?.current) && headingRef.current.set(PlayPageAnchor.ReferenceVideo, el);\n }}\n >\n <h2 className='h4 mb-2'>{getPhrase('title')}</h2>\n <p>{getPhrase('description')} \"<strong>{video.name}</strong>\".</p>\n <div className='form-group'>\n <CitationStyleDropdown value={selectedStyle.id} onChange={onChangeStyle} />\n {canManageSettings && (\n <AppLink\n className='text-info d-block mt-2 text-end'\n appLink={{ application: AppChannels.SETTINGS, action: Actions.Settings.CITATION_STYLE }}\n >\n {getPhrase('configureCitationSettings')}\n </AppLink>\n )}\n </div>\n <div className='bg-light-orange rounded-1 border px-3 pb-0 position-relative'>\n <div ref={ref} className='pt-3 text-wrap pb-4'>{selectedStyle.component}</div>\n <button\n className={`${styles.citationButton} border-top border-start bg-white position-absolute bottom-0 end-0 d-inline-block py-1 px-2`}\n onClick={onClickCopy}\n >\n {copied ? getPhrase('copyToClipboardSuccess') : getPhrase('copyToClipboard')}\n </button>\n </div>\n </section>\n );\n}\n","import React from 'react';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { RestrictionType } from 'libs/shared/enums/RestrictionType';\nimport { Restrictions, YearGroup } from 'libs/shared/interfaces';\nimport { RestrictionHelper } from 'libs/shared/utils/RestrictionHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\n\nconst namespace = 'shared.playPage';\n\ninterface RestrictionBannerProps {\n restrictions: Restrictions;\n yearGroups: YearGroup[];\n objectId: string;\n objectTypeId: MasterType;\n canManageVideoAccess: boolean;\n}\n\nexport function RestrictionBanner(props: RestrictionBannerProps): JSX.Element {\n if (!props.restrictions?.value?.length || !props.yearGroups || !props.canManageVideoAccess)\n return <></>;\n\n const restriction = RestrictionHelper.getWeightedRestriction(props.restrictions.value);\n\n if (restriction.type !== RestrictionType.Custom)\n return <></>;\n\n const baseClassName = RestrictionHelper.mapRestrictionToClass(props.restrictions);\n const className = `${baseClassName} fw-semibold p-2 rounded mb-3 d-flex justify-content-between align-items-center`;\n\n return (\n <div className={className}>\n <div className='d-flex align-items-center'>\n <SvgContainer\n svg={RestrictionHelper.mapRestrictionToSvg(props.restrictions)}\n size={SvgContainerSize.Large}\n />\n <span className='ps-1'>\n {RestrictionHelper.mapRestrictionToText(props.restrictions, props.yearGroups)}\n </span>\n </div>\n \n <AppLink\n appLink={{\n application: AppChannels.DEFAULT,\n action: Actions.Default.APPROVE_VIDEO,\n params: {\n objectId: props.objectId,\n objectTypeId: props.objectTypeId\n }\n }}\n className='btn btn-outline-dark'\n >\n <Text namespace={namespace} phrase='approve' />\n </AppLink>\n </div>\n );\n}\n"],"mappings":"6xCAUM,EAAY,kBAOlB,SAAS,EAAU,EAA4B,CAC7C,OAAQ,EAAR,CACE,KAAK,EAAW,MACd,MAAO,QACT,KAAK,EAAW,KACd,MAAO,OACT,KAAK,EAAW,YACd,MAAO,cACT,QACE,MAAO,EACX,CACF,CAEA,SAAgB,EAAe,EAAyC,CACtE,IAAM,EAAY,EAAgB,iBAAiB,CAAS,EACtD,EAAO,EAAU,EAAM,MAAM,EAEnC,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,+FAAf,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,IAAK,EACL,KAAM,EAAiB,SACvB,UAAU,oBACX,CAAA,GAED,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,iBAAf,EACE,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,4BAAoB,EAAU,oBAAqB,CAAE,MAAK,CAAC,CAAK,CAAA,GAC3E,CAAC,EAAM,sBAAwB,IAAS,EAAW,SACnD,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,gBAAQ,EAAU,eAAgB,CAAE,KAAM,GAAG,EAAK,EAAG,CAAC,CAAK,CAAA,CAEvE,GACF,GAET,CC5BA,IAAM,EAAY,EAAgB,iBAAiB,sBAAS,EAc5D,SAAgB,EAAc,EAAwC,CACpE,IAAM,EAAe,EAAgB,CACnC,SAAU,EAAqB,UAC/B,iBAAkB,EAAM,gBAC1B,CAAC,EACK,CAAE,kBAA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IAAI,CACzC,WA4CkB,EAAT,EAAmB,yBAAsC,iBAAiB,CACrE,CAAA,CACL,GACE,GAEb,CCzJA,IAAM,GAAY,kBAUlB,SAAgB,GAAkB,EAA4C,CAY5E,MAXI,CAAC,EAAM,cAAc,OAAO,QAAU,CAAC,EAAM,YAAc,CAAC,EAAM,sBAGlD,EAAkB,uBAAuB,EAAM,aAAa,KAE5E,CAAA,CAAY,OAAS,EAAgB,QAChC,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,GAMX,EAAA,EAAA,KAAA,CAAC,MAAD,CAAgB,UAAA,GAJI,EAAkB,sBAAsB,EAAM,YAC/C,EAAc,0FAGjC,EACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,qCAAf,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,IAAK,EAAkB,oBAAoB,EAAM,YAAY,EAC7D,KAAM,EAAiB,KACxB,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gBACb,EAAkB,qBAAqB,EAAM,aAAc,EAAM,UAAU,CACxE,CAAA,CACH,KAEL,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,cACxB,OAAQ,CACN,SAAU,EAAM,SAChB,aAAc,EAAM,YACtB,CACF,EACA,UAAU,iCAEV,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,aAAW,OAAO,SAAW,CAAA,CACvC,CAAA,CACN,GAET"}
|
|
1
|
+
{"version":3,"file":"Bf9r1ZoF2.chunk.js","names":[],"sources":["../../src/shared/components/play-page/ArchivedBanner.tsx","../../src/shared/components/related-videos/RelatedVideos.tsx","../../../../libs/shared/src/components/play-page/interactives-widget/InteractiveWidgetItem.tsx","../../src/shared/components/citations/citation-generator.module.scss","../../src/shared/components/citations/EditableCitationField.tsx","../../src/shared/components/citations/CitationStyles.tsx","../../src/shared/components/citations/CitationHelpers.tsx","../../src/shared/components/citations/CitationWidget.tsx","../../src/shared/components/play-page/RestrictionBanner.tsx"],"sourcesContent":["import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EntityType } from 'libs/analytics/interfaces';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { ArchiveSvg } from 'libs/shared/images/svg/objects/ArchiveSvg';\n\nconst namespace = 'shared.playPage';\n\ninterface ArchivedBannerProps {\n typeId: MasterType;\n hasStudentExperience: boolean;\n}\n\nfunction mapTypeId(typeId: MasterType): string {\n switch (typeId) {\n case MasterType.Video:\n return 'video';\n case MasterType.Clip:\n return 'clip';\n case MasterType.Interactive:\n return 'interactive';\n default:\n return '';\n }\n}\n\nexport function ArchivedBanner(props: ArchivedBannerProps): JSX.Element {\n const getPhrase = LanguageService.encloseNamespace(namespace);\n const type = mapTypeId(props.typeId);\n\n return (\n <div className='alert bg-light-blue p-3 rounded-3 d-flex justify-content-between align-items-center'>\n <SvgContainer\n svg={ArchiveSvg}\n size={SvgContainerSize.Standard}\n className='me-2 svg-container'\n />\n \n <div className='w-100'>\n <p className='fw-semibold mb-0'>{getPhrase('archivedInfoTitle', { type })}</p>\n {(!props.hasStudentExperience || type === EntityType.Video) && (\n <p className='mb-1'>{getPhrase('archivedInfo', { type: `${type}s` })}</p>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { InfiniteScrollFooter } from 'libs/shared/components/infinite-scroll-footer/InfiniteScrollFooter';\nimport { PartialVideoList } from 'libs/shared/components/video-list/partial-loading/PartialVideoList';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { WidgetHeader } from 'libs/shared/components/widgets/curated-widgets/components/header/WidgetHeader';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { CurrentUser, PresentationAudience, VideoTypes } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { GetVideoAppLinkOptions } from 'libs/shared/interfaces/VideoAppLinkOptions';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\n\nconst namespace = 'shared.relatedVideos';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface RelatedVideosProps {\n presentationSlug: string | null;\n currentVideo: VideoTypes;\n relatedVideos: RelatedVideosHash;\n currentUser: CurrentUser;\n audiences: PresentationAudience[];\n getVideoAppLink: (video: VideoTypes, opts: GetVideoAppLinkOptions) => Core.AppLink;\n moviesAndTv: boolean;\n headingRef?: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function RelatedVideos(props: RelatedVideosProps): JSX.Element {\n const videoActions = useVideoActions({\n location: VideoActionsLocation.VideoItem,\n presentationSlug: props.presentationSlug\n });\n const { hasPermissions } = usePermissions();\n\n if (!props.currentUser?.isAuthenticated) // Don't render if user is unauthenticated\n return <></>;\n\n if (props.relatedVideos.hasError) // Don't render if request has errored\n return <></>;\n\n if (props.relatedVideos.hasCompleted && !props.relatedVideos.videos?.length) // Don't render if response is empty\n return <></>;\n\n if (!props.relatedVideos.isFetching && !props.relatedVideos.hasCompleted) // Don't render if request is never made\n return <></>;\n\n // We don't support autoplaying from interactives. This means the related videos heading won't say \"Up next\"\n const canAutoplay = !VideoHelper.isInteractive(props.currentVideo);\n\n return (\n <section\n id={PlayPageAnchor.RelatedVideos}\n className='play-page-section'\n ref={el => {\n (el && props.headingRef?.current\n && !!props.relatedVideos.videos?.length)\n && props.headingRef.current.set(PlayPageAnchor.RelatedVideos, el);\n }}\n >\n <VideoActionsContext.Provider value={videoActions}>\n <WidgetHeader name={canAutoplay ? getPhrase('upNext') : getPhrase('relatedVideos')} />\n \n {props.relatedVideos.hasCompleted ? (\n <VideoList\n videos={props.relatedVideos.videos}\n getVideoAppLink={props.getVideoAppLink}\n hasPermissions={hasPermissions}\n presentationAudiences={props.audiences}\n getPreviewQuestionsAppLink={interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={props.commonVideoProps}\n />\n ) : <PartialVideoList />\n }\n {props.relatedVideos.hasMore && (\n <InfiniteScrollFooter\n isFetching={props.relatedVideos.isFetching}\n fetchNext={props.relatedVideos.fetchNext}\n />\n )}\n </VideoActionsContext.Provider>\n </section>\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 { Text } from 'libs/shared/components/text/Text';\nimport { ThumbnailText } from 'libs/shared/components/thumbnails/thumbnail-text/ThumbnailText';\nimport { VideoThumbnail } from 'libs/shared/components/thumbnails/video/VideoThumbnail';\nimport { FixedWidgetItemProps } from 'libs/shared/components/widgets/items/FixedWidgetItemProps';\nimport { ThumbnailTextPosition } from 'libs/shared/enums/ThumbnailTextPosition';\nimport { InteractiveMetadata } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { getTotalInteractions } from 'libs/shared/utils/InteractiveHelper';\n\nconst namespace = 'shared.interactiveWidgetItem';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport interface InteractiveWidgetItemProps extends FixedWidgetItemProps<InteractiveMetadata> {\n questionsAppLink: Core.AppLink;\n showOwner?: boolean;\n commonVideoProps: CommonVideoProps;\n}\n\nexport const InteractiveWidgetItem = React.memo(function(props: InteractiveWidgetItemProps): JSX.Element {\n const { data: interactive, thumbnailSize, preloadImage } = props;\n\n const questionsAppLink: Core.AppLink = {\n ...props.questionsAppLink,\n args: [props.data.id]\n };\n\n const questionsNumber = getTotalInteractions(interactive);\n\n return (\n <div className='flex-shrink-0 px-1 col-6 col-sm-4'>\n <VideoThumbnail\n type='static'\n textPosition={ThumbnailTextPosition.Independent}\n video={interactive}\n appLink={props.getAppLink(interactive)}\n imageOptions={{ size: thumbnailSize }}\n preload={preloadImage}\n analyticsData={props.analyticsData}\n analyticsOptions={props.analyticsOptions}\n hideDuration={false}\n commonVideoProps={props.commonVideoProps}\n />\n\n <div className='mt-2'>\n <ThumbnailText\n {...props}\n video={interactive}\n appLink={props.getAppLink(interactive)}\n />\n </div>\n\n <AppLink\n appLink={questionsAppLink}\n className='cursor-pointer hover-text-underline'\n ariaLabel={`${getPhrase('previewQuestions', { count: questionsNumber, smartCount: questionsNumber })} ${getPhrase('ariaPreview', { name: interactive.name })}`}\n >\n {questionsNumber ?\n (\n <Text namespace={namespace} phrase='previewQuestions' options={{ count: questionsNumber, smartCount: questionsNumber }}/>\n ) : (\n // handling a rare case: add a fallback phrase if we don't get the question number\n <Text namespace={namespace} phrase='previewQuestionsFallback' />\n )}\n </AppLink>\n </div>\n );\n});\n",":local {\n .citationButton {\n border-radius: $border-radius-sm 0 $border-radius-sm 0;\n }\n\n .citationText {\n word-break: break-word;\n }\n\n .editableFieldContainer {\n border-bottom: 1px dashed;\n cursor: pointer;\n }\n\n .editableField {\n border-radius: $border-radius-sm;\n outline: none;\n }\n\n .editableFieldEmpty {\n color: $text-muted;\n font-style: italic;\n }\n\n .editableFieldIconEmpty {\n color: $text-muted;\n }\n\n .editableFieldInput {\n border: 1px solid $blue;\n border-radius: $border-radius-sm;\n background-color: $input-focus-bg;\n box-shadow: $input-focus-box-shadow;\n outline: none;\n\n &::placeholder {\n color: $text-muted;\n font-style: italic;\n }\n }\n}","import React from 'react';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { EditSvg } from 'libs/shared/images/svg/actions/EditSvg';\n\nimport styles from './citation-generator.module.scss';\n\nexport interface EditableCitationFieldRef {\n focus: () => void;\n}\n\nexport interface EditableCitationFieldProps {\n value: string;\n placeholder: string;\n tooltipText: string;\n inputSize?: number;\n onChange: (value: string) => void;\n}\n\nexport const EditableCitationField = React.forwardRef<EditableCitationFieldRef, EditableCitationFieldProps>((\n props,\n ref\n) => {\n const { value, placeholder, tooltipText, onChange } = props;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [ isEditing, setIsEditing ] = React.useState(false);\n\n React.useImperativeHandle(ref, () => ({\n focus: () => setIsEditing(true)\n }));\n\n if (isEditing) {\n return (\n <input\n ref={inputRef}\n type='text'\n size={props.inputSize}\n className={styles.editableFieldInput}\n value={value}\n placeholder={placeholder}\n autoFocus\n spellCheck={false}\n onChange={e => onChange(e.target.value)}\n onBlur={() => setIsEditing(false)}\n onKeyDown={e => e.key === 'Enter' && inputRef.current?.blur()}\n />\n );\n }\n\n return (\n <Tooltip title={tooltipText} placement='top' spanHack spanHackClassName='d-inline'>\n <div className='d-inline-block'>\n <div className={`d-flex flex-row ${styles.editableFieldContainer}`} onClick={() => setIsEditing(true)}>\n <span\n className={`${styles.editableField} ${!value ? styles.editableFieldEmpty : ''}`}\n onKeyDown={e => e.key === 'Enter' && setIsEditing(true)}\n role='button'\n tabIndex={0}\n >\n {value || placeholder}\n </span>\n <SvgContainer\n svg={EditSvg}\n size={SvgContainerSize.Small}\n className={`svg-container ${!value ? styles.editableFieldIconEmpty : ''}`}\n />\n </div>\n </div>\n </Tooltip>\n );\n});\n","import React from 'react';\n\nimport { EditableCitationField, EditableCitationFieldProps, EditableCitationFieldRef } from './EditableCitationField';\n\nexport interface EditablePlaceholder extends EditableCitationFieldProps {\n fieldRef: React.RefObject<EditableCitationFieldRef>;\n}\n\ninterface AuthorProps {\n author: string;\n placeholder?: EditablePlaceholder;\n suffix: string;\n}\n\nfunction Author({ author, placeholder, suffix }: AuthorProps): JSX.Element {\n if (placeholder) {\n return (\n <>\n <EditableCitationField\n ref={placeholder.fieldRef}\n value={placeholder.value}\n placeholder={placeholder.placeholder}\n inputSize={placeholder.inputSize}\n tooltipText={placeholder.tooltipText}\n onChange={placeholder.onChange}\n />\n {suffix}\n </>\n );\n }\n return <>{author ? `${author}${suffix}` : ''}</>;\n}\n\ninterface YearProps {\n year: number;\n placeholder?: EditablePlaceholder;\n}\n\nfunction Year({ year, placeholder }: YearProps): JSX.Element {\n if (placeholder) {\n return (\n <EditableCitationField\n ref={placeholder.fieldRef}\n value={placeholder.value}\n placeholder={placeholder.placeholder}\n inputSize={placeholder.inputSize}\n tooltipText={placeholder.tooltipText}\n onChange={placeholder.onChange}\n />\n );\n }\n return <>{year}</>;\n}\n\nexport interface SeriesInfo {\n seriesName: string;\n seasonNumber: number;\n episodeNumber: number;\n}\n\ninterface CitationComponentProps {\n name: string;\n url: string;\n viewedOn: string;\n author: string;\n publisher: string;\n productionYear: number;\n authorPlaceholder?: EditablePlaceholder;\n yearPlaceholder?: EditablePlaceholder;\n seriesInfo?: SeriesInfo;\n}\n\nexport function APA6Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, author, publisher, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). {name}\n {' '}(Season {seriesInfo.seasonNumber}, Episode {seriesInfo.episodeNumber}) [TV series episode].\n {' '}In <em>{seriesInfo.seriesName}</em>. {publisher}. Retrieved from {url}\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). <em>{name}</em> [Motion picture].\n {' '}{publisher}. Retrieved from {url}\n </span>\n );\n}\n\nexport function APA7Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, author, publisher, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). {name}\n {' '}(Season {seriesInfo.seasonNumber}, Episode {seriesInfo.episodeNumber}) [TV series episode].\n {' '}In <em>{seriesInfo.seriesName}</em>. {publisher}. {url}\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). <em>{name}</em> [Film]. {publisher}. {url}\n </span>\n );\n}\n\nexport function HarvardCitation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). '{name}',\n {' '}<em>{seriesInfo.seriesName}</em>, Season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber} [video].\n {' '}ClickView. Available at: {url} (Accessed: {viewedOn}).\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n (<Year year={productionYear} placeholder={yearPlaceholder} />). <em>{name}</em> [video].\n {' '}ClickView. Available at: {url} (Accessed: {viewedOn}).\n </span>\n );\n}\n\nexport function HarvardAUCitation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n <Year year={productionYear} placeholder={yearPlaceholder} />, '{name}',\n {' '}<em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}, video, ClickView, viewed {viewedOn}, {url}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix=' ' />\n <Year year={productionYear} placeholder={yearPlaceholder} />, <em>{name}</em>, video, ClickView,\n {' '}viewed {viewedOn}, {url}.\n </span>\n );\n}\n\nexport function MLA8Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n \"{name}.\" <em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}, ClickView,\n {' '}<Year year={productionYear} placeholder={yearPlaceholder} />, {url}. Accessed {viewedOn}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n <em>{name}</em>. ClickView, <Year year={productionYear} placeholder={yearPlaceholder} />, {url}.\n {' '}Accessed {viewedOn}.\n </span>\n );\n}\n\nexport function MLA9Citation(props: CitationComponentProps): JSX.Element {\n const { name, url, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n \"{name}.\" <em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}, ClickView,\n {' '}<Year year={productionYear} placeholder={yearPlaceholder} />, {url}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n <em>{name}</em>. ClickView, <Year year={productionYear} placeholder={yearPlaceholder} />, {url}.\n </span>\n );\n}\n\nexport function ChicagoCitation(props: CitationComponentProps): JSX.Element {\n const { name, url, viewedOn, author, productionYear, authorPlaceholder, yearPlaceholder, seriesInfo } = props;\n\n if (seriesInfo) {\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n \"{name}.\" <em>{seriesInfo.seriesName}</em>, season {seriesInfo.seasonNumber},\n {' '}episode {seriesInfo.episodeNumber}. ClickView,\n {' '}<Year year={productionYear} placeholder={yearPlaceholder} />. {url}. Accessed {viewedOn}.\n </span>\n );\n }\n\n return (\n <span>\n <Author author={author} placeholder={authorPlaceholder} suffix='. ' />\n <em>{name}</em>. ClickView, <Year year={productionYear} placeholder={yearPlaceholder} />. {url}.\n {' '}Accessed {viewedOn}.\n </span>\n );\n}\n","import React from 'react';\n\nimport { Video } from 'libs/shared/interfaces';\n\nimport { CitationStyleId } from 'shared/enums/CitationStyleId';\n\nimport { SUPPORTED_CITATION_STYLES } from './CitationStyleDropdown';\nimport {\n APA6Citation,\n APA7Citation,\n ChicagoCitation,\n EditablePlaceholder,\n HarvardAUCitation,\n HarvardCitation,\n MLA8Citation,\n MLA9Citation,\n SeriesInfo\n} from './CitationStyles';\n\ntype PeopleRolesMap = Map<string, string[]>;\n\ninterface GetCitationStylesOptions {\n name: string;\n creatorPeople: PeopleRolesMap;\n creatorCompanies: string[];\n productionYear: number;\n url: string;\n authorPlaceholder?: EditablePlaceholder;\n yearPlaceholder?: EditablePlaceholder;\n seriesInfo?: SeriesInfo;\n}\n\nexport interface CitationStyle {\n id: CitationStyleId;\n name: string;\n component: JSX.Element;\n}\n\nexport const CitationHelpers = {\n hasAuthorData(peopleRoles: PeopleRolesMap, companies: string[]): boolean {\n return peopleRoles.size > 0 || companies.length > 0;\n },\n\n processCompanies(video: Video): string[] {\n let companies: string[] = [];\n\n if (video?.productionCompanies?.data?.length) {\n companies = video.productionCompanies.data.map(pc => pc.name ?? '');\n } else if (video?.distributors?.data?.length) {\n companies = video.distributors.data.map(d => d.name ?? '');\n } else if (video?.channel?.name) {\n companies = [video.channel.name];\n }\n\n return companies.filter(c => c.trim());\n },\n\n joinWithAmpersand(items: string[]): string {\n if (items.length === 0) return '';\n if (items.length === 1) return items[0];\n if (items.length === 2) return `${items[0]}, & ${items[1]}`;\n\n // 3 or more: comma-separated with \", &\" before the last one\n const allButLast = items.slice(0, -1).join(', ');\n const last = items[items.length - 1];\n return `${allButLast}, & ${last}`;\n },\n\n processSeriesInfo(video: Video): SeriesInfo | undefined {\n if (!video.series?.name) return undefined;\n if (!video.season?.number) return undefined;\n if (!video.episodeNumber) return undefined;\n\n return {\n seriesName: video.series.name,\n seasonNumber: video.season.number,\n episodeNumber: video.episodeNumber\n };\n },\n\n processAuthors(video: Video): PeopleRolesMap {\n const peopleRoles = new Map<string, string[]>();\n\n (video?.directors?.data ?? []).forEach(d => {\n if (d?.name) {\n const roles = peopleRoles.get(d.name) || [];\n roles.push('Director');\n peopleRoles.set(d.name, roles);\n }\n });\n\n (video?.producers?.data ?? []).forEach(p => {\n if (p?.name) {\n const roles = peopleRoles.get(p.name) || [];\n roles.push('Producer');\n peopleRoles.set(p.name, roles);\n }\n });\n\n return peopleRoles;\n },\n\n formatAuthorsDefault(peopleRoles: PeopleRolesMap, creatorCompanies: string[]): string {\n const people = Array.from(peopleRoles.entries()).map(([ name, roles ]) =>\n `${name} (${roles.join(' & ')})`);\n\n return people.length > 0 ? people.join(', ') :\n creatorCompanies.length > 0 ? creatorCompanies[0] : '';\n },\n\n formatPublisher(peopleRoles: PeopleRolesMap, creatorCompanies: string[]): string {\n // Production company when we have human authors and a distinct non-ClickView company,\n // otherwise fall back to \"ClickView\" (avoids listing the same company as both author and publisher).\n const hasPeople = peopleRoles.size > 0;\n const nonClickView = creatorCompanies.filter(c => c !== 'ClickView');\n\n if (hasPeople && nonClickView.length > 0)\n return nonClickView.join(', ');\n\n return 'ClickView';\n },\n\n formatAuthorsAPA7(peopleRoles: PeopleRolesMap, creatorCompanies: string[]): string {\n // APA 7 use `Last name, Initials` format for people\n function formatName(name: string, roles: string[]) {\n const nameParts = name.trim().split(/\\s+/);\n const roleString = roles.join(' & ');\n\n if (nameParts.length === 0) return '';\n if (nameParts.length === 1) return `${nameParts[0]} (${roleString})`;\n\n const lastName = nameParts[nameParts.length - 1];\n const firstNames = nameParts.slice(0, -1);\n const initials = firstNames.map(n => `${n.charAt(0)}.`).join(' ');\n\n return `${lastName}, ${initials} (${roleString})`;\n }\n\n const formattedAuthors = Array.from(peopleRoles.entries()).map(([ name, roles ]) => formatName(name, roles));\n\n if (formattedAuthors.length > 0) {\n return `${CitationHelpers.joinWithAmpersand(formattedAuthors)}.`;\n }\n\n // Fallback to companies if no people authors\n if (creatorCompanies.length === 0) return '';\n\n const formattedCompanies = CitationHelpers.joinWithAmpersand(creatorCompanies);\n return formattedCompanies ? `${formattedCompanies}.` : '';\n },\n\n getCitationStyles(options: GetCitationStylesOptions): CitationStyle[] {\n const {\n name,\n creatorPeople,\n creatorCompanies,\n productionYear,\n url,\n authorPlaceholder,\n yearPlaceholder,\n seriesInfo\n } = options;\n\n const defaultAuthor = CitationHelpers.formatAuthorsDefault(creatorPeople, creatorCompanies);\n const apa7Author = CitationHelpers.formatAuthorsAPA7(creatorPeople, creatorCompanies);\n const publisher = CitationHelpers.formatPublisher(creatorPeople, creatorCompanies);\n\n const today = new Date();\n const viewedOn = `${today.getDate()} ${today.toLocaleString('default', { month: 'long' })} ${today.getFullYear()}`;\n\n const commonProps = {\n name,\n url,\n viewedOn,\n publisher,\n productionYear,\n authorPlaceholder,\n yearPlaceholder,\n seriesInfo\n };\n\n const components: Record<CitationStyleId, JSX.Element> = {\n [CitationStyleId.APA6]: <APA6Citation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.APA7]: <APA7Citation {...commonProps} author={apa7Author} />,\n [CitationStyleId.Harvard]: <HarvardCitation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.HarvardAU]: <HarvardAUCitation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.MLA8]: <MLA8Citation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.MLA9]: <MLA9Citation {...commonProps} author={defaultAuthor} />,\n [CitationStyleId.Chicago]: <ChicagoCitation {...commonProps} author={defaultAuthor} />\n };\n\n return SUPPORTED_CITATION_STYLES.map(style => ({\n ...style,\n component: components[style.id]\n }));\n }\n};\n","import React from 'react';\n\nimport { LocationUtils } from 'libs/common/backbone/core/LocationUtils';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { ContentRegion } from 'libs/shared/enums/ContentRegion';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { useCopyToClipboard } from 'libs/shared/hooks/useCopyToClipboard';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Video, VideoTypes } from 'libs/shared/interfaces';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CitationStyleId } from 'shared/enums/CitationStyleId';\nimport { usePreferredCitationStyle } from 'shared/hooks/usePreferredCitationStyle';\nimport { generatePublicUrl } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { CitationHelpers, CitationStyle } from './CitationHelpers';\nimport { CitationStyleDropdown } from './CitationStyleDropdown';\nimport { EditableCitationFieldRef } from './EditableCitationField';\n\nimport styles from './citation-generator.module.scss';\n\nconst namespace = 'shared.citations';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ntype CitationWidgetProps = {\n parentVideo?: Video,\n media: VideoTypes,\n headingRef?: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>,\n contentRegion: ContentRegion,\n shareId: string,\n presentationSlug: string | null\n};\n\nexport function CitationWidget(props: CitationWidgetProps): JSX.Element {\n const { headingRef, contentRegion } = props;\n\n const { copyToClipboard } = useCopyToClipboard();\n const { preferredStyleId, setPreferredStyleId } = usePreferredCitationStyle();\n const { hasPermissions } = usePermissions();\n const ref = React.useRef<HTMLDivElement>(null);\n const authorFieldRef = React.useRef<EditableCitationFieldRef>(null);\n const yearFieldRef = React.useRef<EditableCitationFieldRef>(null);\n\n const canManageSettings = hasPermissions(PermissionName.ManageCustomerSettings);\n\n // if the video is a clip or interactive, use the parent video\n // so we have a reliable source of video data\n const video = VideoHelper.isVideo(props.media) ? props.media : props.parentVideo;\n\n const url = props.shareId ?\n LocationUtils.GetCurrentUrl() :\n generatePublicUrl(contentRegion, VideoAppLinkHelper.getAppLink(video, {}, props.presentationSlug));\n\n // State for user-entered values when metadata is missing\n const [ customAuthor, setCustomAuthor ] = React.useState<string>('');\n const [ customYear, setCustomYear ] = React.useState<string>('');\n\n // Check if author data is missing and placeholder is needed\n const processedAuthors = CitationHelpers.processAuthors(video);\n const processedCompanies = CitationHelpers.processCompanies(video);\n const processedSeriesInfo = CitationHelpers.processSeriesInfo(video);\n const needsAuthorPlaceholder = !CitationHelpers.hasAuthorData(processedAuthors, processedCompanies);\n const needsYearPlaceholder = !video.productionYear;\n\n const citationStyles = React.useMemo(() => {\n return CitationHelpers.getCitationStyles({\n // make sure we use the clip, interactive or video title here\n name: props.media.name,\n creatorPeople: processedAuthors,\n creatorCompanies: processedCompanies,\n seriesInfo: processedSeriesInfo,\n productionYear: video.productionYear,\n url: url,\n authorPlaceholder: needsAuthorPlaceholder ? {\n value: customAuthor,\n placeholder: getPhrase('authorPlaceholder'),\n tooltipText: getPhrase('authorTooltip'),\n inputSize: 12,\n onChange: setCustomAuthor,\n fieldRef: authorFieldRef\n } : undefined,\n yearPlaceholder: needsYearPlaceholder ? {\n value: customYear,\n placeholder: getPhrase('yearPlaceholder'),\n tooltipText: getPhrase('yearTooltip'),\n inputSize: 6,\n onChange: setCustomYear,\n fieldRef: yearFieldRef\n } : undefined\n });\n }, [\n props.media,\n props.parentVideo,\n video.id,\n customAuthor,\n customYear,\n needsAuthorPlaceholder,\n needsYearPlaceholder,\n processedSeriesInfo?.seriesName,\n processedSeriesInfo?.seasonNumber,\n processedSeriesInfo?.episodeNumber\n ]);\n\n const initialStyle = citationStyles.find(s => s.id === preferredStyleId) ?? citationStyles[0];\n const [ selectedStyle, setSelectedStyle ] = React.useState<CitationStyle>(initialStyle);\n const [ copied, setCopied ] = React.useState(false);\n\n const onClickCopy = () => {\n copyToClipboard(ref.current?.innerText);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n };\n\n const onChangeStyle = (styleId: CitationStyleId) => {\n const style = citationStyles.find(s => s.id === styleId);\n if (style) {\n setSelectedStyle(style);\n setPreferredStyleId(styleId);\n }\n };\n\n // Keep selectedStyle in sync when citationStyles regenerate (e.g., when `customAuthor` changes)\n React.useEffect(() => {\n const updatedStyle = citationStyles.find(s => s.id === selectedStyle.id);\n if (updatedStyle)\n setSelectedStyle(updatedStyle);\n }, [citationStyles]);\n\n return (\n <section\n id={PlayPageAnchor.ReferenceVideo}\n className='play-page-section'\n ref={el => {\n (el && headingRef?.current) && headingRef.current.set(PlayPageAnchor.ReferenceVideo, el);\n }}\n >\n <h2 className='h4 mb-2'>{getPhrase('title')}</h2>\n <p>{getPhrase('description')} \"<strong>{video.name}</strong>\".</p>\n <div className='form-group'>\n <CitationStyleDropdown value={selectedStyle.id} onChange={onChangeStyle} />\n {canManageSettings && (\n <AppLink\n className='text-info d-block mt-2 text-end'\n appLink={{ application: AppChannels.SETTINGS, action: Actions.Settings.CITATION_STYLE }}\n >\n {getPhrase('configureCitationSettings')}\n </AppLink>\n )}\n </div>\n <div className='bg-light-orange rounded-1 border px-3 pb-0 position-relative text-break'>\n <div ref={ref} className='pt-3 text-wrap pb-4'>{selectedStyle.component}</div>\n <button\n className={`${styles.citationButton} border-top border-start bg-white position-absolute bottom-0 end-0 d-inline-block py-1 px-2`}\n onClick={onClickCopy}\n >\n {copied ? getPhrase('copyToClipboardSuccess') : getPhrase('copyToClipboard')}\n </button>\n </div>\n </section>\n );\n}\n","import React from 'react';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { RestrictionType } from 'libs/shared/enums/RestrictionType';\nimport { Restrictions, YearGroup } from 'libs/shared/interfaces';\nimport { RestrictionHelper } from 'libs/shared/utils/RestrictionHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\n\nconst namespace = 'shared.playPage';\n\ninterface RestrictionBannerProps {\n restrictions: Restrictions;\n yearGroups: YearGroup[];\n objectId: string;\n objectTypeId: MasterType;\n canManageVideoAccess: boolean;\n}\n\nexport function RestrictionBanner(props: RestrictionBannerProps): JSX.Element {\n if (!props.restrictions?.value?.length || !props.yearGroups || !props.canManageVideoAccess)\n return <></>;\n\n const restriction = RestrictionHelper.getWeightedRestriction(props.restrictions.value);\n\n if (restriction.type !== RestrictionType.Custom)\n return <></>;\n\n const baseClassName = RestrictionHelper.mapRestrictionToClass(props.restrictions);\n const className = `${baseClassName} fw-semibold p-2 rounded mb-3 d-flex justify-content-between align-items-center`;\n\n return (\n <div className={className}>\n <div className='d-flex align-items-center'>\n <SvgContainer\n svg={RestrictionHelper.mapRestrictionToSvg(props.restrictions)}\n size={SvgContainerSize.Large}\n />\n <span className='ps-1'>\n {RestrictionHelper.mapRestrictionToText(props.restrictions, props.yearGroups)}\n </span>\n </div>\n \n <AppLink\n appLink={{\n application: AppChannels.DEFAULT,\n action: Actions.Default.APPROVE_VIDEO,\n params: {\n objectId: props.objectId,\n objectTypeId: props.objectTypeId\n }\n }}\n className='btn btn-outline-dark'\n >\n <Text namespace={namespace} phrase='approve' />\n </AppLink>\n </div>\n );\n}\n"],"mappings":"6xCAUM,EAAY,kBAOlB,SAAS,EAAU,EAA4B,CAC7C,OAAQ,EAAR,CACE,KAAK,EAAW,MACd,MAAO,QACT,KAAK,EAAW,KACd,MAAO,OACT,KAAK,EAAW,YACd,MAAO,cACT,QACE,MAAO,EACX,CACF,CAEA,SAAgB,EAAe,EAAyC,CACtE,IAAM,EAAY,EAAgB,iBAAiB,CAAS,EAC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M,EAAiB,KACxB,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gBACb,EAAkB,qBAAqB,EAAM,aAAc,EAAM,UAAU,CACxE,CAAA,CACH,KAEL,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,cACxB,OAAQ,CACN,SAAU,EAAM,SAChB,aAAc,EAAM,YACtB,CACF,EACA,UAAU,iCAEV,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,aAAW,OAAO,SAAW,CAAA,CACvC,CAAA,CACN,GAET"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{x as t}from"./BftnFbcr.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{C as i,U as a,d as o,l as s,z as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./Dyy-PWHO.chunk.js";import{a as u,c as d,d as f,f as p,m,n as h,o as g,p as _,s as v,t as ee,u as te}from"./
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{x as t}from"./BftnFbcr.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{C as i,U as a,d as o,l as s,z as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./Dyy-PWHO.chunk.js";import{a as u,c as d,d as f,f as p,m,n as h,o as g,p as _,s as v,t as ee,u as te}from"./DKDWcWxk.chunk.js";import{t as y}from"./CnnDkGmK.chunk.js";import{n as b}from"./B5XaBzZh.chunk.js";import"./cDv6zuhh.chunk.js";import"./Cqq1N9xw.chunk.js";import{t as x}from"./BiKac8UT2.chunk.js";import"./CNfmLVE82.chunk.js";import{a as S,i as C,n as w,o as T,r as E,s as D,t as O}from"./_jJAx6fU.chunk.js";import{t as ne}from"./CLjADRa42.chunk.js";var k=e(n()),re=m.getComponent(`Button`),A=class extends re{constructor(...e){super(...e),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildCSSClass(){return`cv-create-clip-button`}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return``}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}};A.prototype.controlText_=`Create clip`,m.registerComponent(`CreateClipButton`,A);var ie=m.getPlugin(`plugin`),ae=class extends ie{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){let e=this.player.getChild(`collapserator`);e&&e.addChild(`CreateClipButton`,{clickHandler:this.options.onClick})}};m.registerPlugin(`createClipButtonPlugin`,ae);var oe=m.getComponent(`PictureInPictureToggle`),se=class extends oe{handlePictureInPictureEnabledChange(){this.enable()}};m.registerComponent(`PictureInPictureToggle`,se);var ce=m.getComponent(`PlayToggle`),le=m.getPlugin(`plugin`),ue=800,de=class extends le{constructor(e,t){super(e,t),this.options=t,this.bindFunctions(),e.ready(()=>this.initialize())}bindFunctions(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}initialize(){let e=this.player.getChild(`collapserator`);this.toggle=e.addChild(`pictureInPictureToggle`,{}),this.toggle.enable(),this.player.on(`playerresize`,this.onPlayerResize),this.player.on(`dispose`,()=>{this.player?.off(`playerresize`,this.onPlayerResize)})}togglePictureInPicture(e){if(e===this.player.isInPictureInPicture())return;let t=e?`enterpictureinpicture`:`leavepictureinpicture`;this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}onPlayerResize(){if(this.player.isInPictureInPicture())return;let e=this.player.el().getBoundingClientRect();e.width!==0&&(e.width<ue?this.toggle?.hide():this.toggle?.show())}addPipStyles(){this.player.addClass(`cv-picture-in-picture`),this.playToggle=new ce(this.player),this.playToggle.addClass(`cv-pip-play-toggle`),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}removePipStyles(){this.player.removeClass(`cv-picture-in-picture`),this.player.removeChild(this.playToggle),delete this.playToggle}requestPictureInPicture(){this.togglePictureInPicture(!0),typeof this.options?.onRequestPictureInPicture==`function`&&this.options.onRequestPictureInPicture(!0)}async exitPictureInPicture(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}dispose(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,super.dispose()}};m.registerPlugin(`pictureInPicture`,de);var fe=m.getComponent(`Component`),pe=class extends fe{constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=ne,this.pointOfInterest=t.pointOfInterest,this.onMouseOver=this.onMouseOver.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onGlancePointOfInterestMouseEnter=this.onGlancePointOfInterestMouseEnter.bind(this),this.onGlancePointOfInterestMouseLeave=this.onGlancePointOfInterestMouseLeave.bind(this),this.initialize()}initialize(){this.setPosition(),this.bindListeners()}buildCSSClass(){return`cv-point-of-interest-indicator ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,className:this.buildCSSClass()},n)}bindListeners(){this.on(`mouseover`,this.onMouseOver),this.on(`mouseleave`,this.onMouseLeave),this.eventsService.subscribe(`glance:poi:mouseover`,this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe(`glance:poi:mouseleave`,this.onGlancePointOfInterestMouseLeave)}dispose(){this.eventsService.unsubscribe(`glance:poi:mouseover`,this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe(`glance:poi:mouseleave`,this.onGlancePointOfInterestMouseLeave)}getPointOfInterestTime(){return this.pointOfInterest.startTime}setPosition(){let e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+`%`}updateBuffered(e){let t=this.getPointOfInterestTime()<=e;if(t===this.hasBuffered)return;this.hasBuffered=t;let n=`cv-point-of-interest-indicator-buffered`;this.hasBuffered?this.addClass(n):this.removeClass(n)}updatePlaybackProgress(e){let t=this.getPointOfInterestTime()<=e;if(t===this.hasPlayed)return;this.hasPlayed=t;let n=`cv-point-of-interest-indicator-played`;t?this.addClass(n):this.removeClass(n)}toggleVisibility(e){let t=`cv-point-of-interest-indicator-hidden`;e?this.removeClass(t):this.addClass(t)}onMouseOver(){this.setTimeTooltipText(),this.eventsService.trigger(`player:poi:mouseover`,this.pointOfInterest)}onMouseLeave(){this.clearTimeTooltipText(),this.eventsService.trigger(`player:poi:mouseleave`)}onGlancePointOfInterestMouseEnter(e){e.id===this.pointOfInterest.id&&(this.addClass(`cv-point-of-interest-indicator-highlight`),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}onGlancePointOfInterestMouseLeave(){this.removeClass(`cv-point-of-interest-indicator-highlight`),this.hideMouseTimeDisplay()}setTimeTooltipText(){this.getTimeTooltip()?.setCustomChapterText(this.pointOfInterest.description)}clearTimeTooltipText(){this.getTimeTooltip()?.setCustomChapterText()}setTimeTooltipTime(){this.getTimeTooltip()?.updateTime(this.getPointOfInterestTime())}positionMouseTimeDisplay(){let e=this.getSeekBar()?.el();if(!e)return;let t=m.dom.findPosition(e),n=this.getPointOfInterestTime()/this.player().duration();this.getMouseTimeDisplay()?.update(t,n)}showMouseTimeDisplay(){this.getMouseTimeDisplay()?.forceShow()}hideMouseTimeDisplay(){this.getMouseTimeDisplay()?.removeForceShow()}getSeekBar(){return this.player().controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`)}getMouseTimeDisplay(){return this.getSeekBar()?.getChild(`MouseTimeDisplay`)}getTimeTooltip(){return this.getMouseTimeDisplay()?.getChild(`TimeTooltip`)}},me=m.getComponent(`MenuItem`),j=class extends me{constructor(e,t){super(e,t),this.pointsOfInterestVisible=t.pointsOfInterestVisible,this.toggle(this.pointsOfInterestVisible)}handleToggle(){this.toggle(!this.pointsOfInterestVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){m.dom.addClass(this.toggleEl,`on`),m.dom.setAttribute(this.toggleEl,`aria-checked`,`true`),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){m.dom.removeClass(this.toggleEl,`on`),m.dom.setAttribute(this.toggleEl,`aria-checked`,`false`),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,n){this.handlerBound||=(this.handleToggle=this.handleToggle.bind(this),!0),this.toggleEl&&this.toggleEl.removeEventListener(`click`,this.handleToggle),this.toggleEl=m.dom.createEl(`div`,{className:`custom-toggle custom-toggle-info toggle-option float-end`,innerHTML:`<span class="handle"></span></div>`}),m.dom.setAttribute(this.toggleEl,`id`,`poi-toggle`),m.dom.setAttribute(this.toggleEl,`role`,`switch`),this.toggleEl.addEventListener(`click`,this.handleToggle);let r=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item cv-poi-toggle`,innerHTML:`
|
|
2
2
|
<span for="poi-toggle" class="vjs-menu-item-text">Points of Interest</span>
|
|
3
3
|
<span class="cv-toggle-container"></span>`},n);return r.children[1].appendChild(this.toggleEl),r}};m.registerComponent(`PointsOfInterestMenuItem`,j);var M=m.getPlugin(`plugin`),N=`cvplayer-points-of-interest`,P=class extends M{constructor(e,t){super(e),this.pointOfInterestIndicators=[],this.enabled=!0,this.pointsOfInterest=t?.pointsOfInterest,this.initialize=this.initialize.bind(this),this.updateBuffered=this.updateBuffered.bind(this),this.updatePlaybackProgress=this.updatePlaybackProgress.bind(this),this.player.one(`loadedmetadata`,()=>this.player.ready(this.initialize))}initialize(){this.pointsOfInterest&&(b.hasLocalStorage()&&b.get(N)===`false`&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}bindListeners(){this.player.on(`progress`,this.updateBuffered),this.player.on(`timeupdate`,this.updatePlaybackProgress),this.player.on(`dispose`,()=>{this.player?.off(`progress`,this.updateBuffered),this.player?.off(`timeupdate`,this.updatePlaybackProgress)})}togglePointsOfInterest(e){b.set(N,e.toString()),this.pointOfInterestIndicators.forEach(t=>t.toggleVisibility(e))}setupTrack(){let e=this.player.addTextTrack(`metadata`,`pointsofinterest`);this.pointsOfInterest.forEach(t=>{e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})}),e.trigger({type:`loadeddata`,target:e})}createPointOfInterestIndicators(){let e=this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`);this.pointsOfInterest.forEach(t=>{let n=new pe(this.player,{pointOfInterest:t});this.pointOfInterestIndicators.push(n),e.addChild(n)})}addMenuItem(){(this.player.getChild(`collapserator`)?.getChild(`cogButton`)).addItem({ctor:j,name:`PointsOfInterestMenuItem`,options:{pointsOfInterestVisible:this.enabled}})}updateBuffered(){this.pointOfInterestIndicators.forEach(e=>e.updateBuffered(u(this.player)))}updatePlaybackProgress(){this.pointOfInterestIndicators.forEach(e=>e.updatePlaybackProgress(this.player.currentTime()))}};m.registerPlugin(`pointsOfInterestPlugin`,P);var F=m.getComponent(`Component`),I=class extends F{constructor(e,t){super(e,t),this.initialize()}initialize(){this.setPosition()}buildCSSClass(){return`cv-range-indicator ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,className:this.buildCSSClass()},n)}setPosition(){let e=this.player().duration();this.el_.style.left=this.options_.time/e*100+`%`}},L=m.getComponent(`ClickableComponent`),R=class extends L{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view-button ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,innerHTML:`<span class="${this.options_.iconClassName}"></span><span>${this.options_.label}</span>`,className:this.buildCSSClass()},n)}handleClick(){this.options_.onPress()}},z=m.getComponent(`Component`),he=class extends z{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view ${super.buildCSSClass()}`}createEl(e,t,n){let r=super.createEl(e,{...t,className:this.buildCSSClass()},n),i=m.dom.createEl(`h5`,{innerHTML:this.localize(`This clip has finished`),className:`cv-replay-heading`}),a=m.dom.createEl(`div`,{className:`cv-button-container`}),o=new R(this.player_,{label:this.localize(`Replay clip`),iconClassName:`cv-replay-icon`,onPress:this.options_.onReplayPress}),s=new R(this.player_,{label:this.localize(`Continue watching`),iconClassName:`cv-continue-icon`,onPress:this.options_.onContinuePress});return r.appendChild(i),r.appendChild(a),a.appendChild(o.el()),a.appendChild(s.el()),r}},ge=m.getPlugin(`plugin`),_e=class extends ge{constructor(e,t){if(super(e,t),this.startTime=parseFloat(t.startTime.toPrecision(4)),this.endTime=parseFloat(t.endTime.toPrecision(4)),this.dismissed=!1,this.startTime>this.endTime)throw Error(`Range start cannot be greater than range end`);this.bindFunctions(),this.initialize()}bindFunctions(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}initialize(){this.player.one(`loadedmetadata`,()=>this.player.ready(this.onReady)),this.player.on(`timeupdate`,this.onTimeUpdateOrSeeked),this.player.on(`seeked`,this.onTimeUpdateOrSeeked)}onReady(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}onTimeUpdateOrSeeked(){if(this.dismissed)return;let e=this.player.currentTime();if(e<this.startTime){this.player.currentTime(this.startTime);return}if(e>this.endTime){this.showReplayView(),this.disablePlayToggle(),this.player.pause(),this.player.currentTime(this.endTime);return}}onReplayPress(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}onContinuePress(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}showRangeIndicators(){let e=this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`);this.startTimeIndicator||(this.startTimeIndicator=new I(this.player,{time:this.startTime}),e?.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new I(this.player,{time:this.endTime}),e?.addChild(this.endTimeIndicator))}hideRangeIndicators(){this.startTimeIndicator?.hide(),this.endTimeIndicator?.hide()}addMaskToProgressBar(){let e=(this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`))?.el().getElementsByClassName(`cv-chapter-bar-items`);if(e&&e.length){let t=e[0],n=this.player.duration(),r=this.startTime/n*100,i=100-this.endTime/n*100;t.style.clipPath=`inset(-5em ${i}% -5em ${r}%)`}}removeMaskFromProgressBar(){let e=(this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`))?.el().getElementsByClassName(`cv-chapter-bar-items`);if(e&&e.length){let t=e[0];t.style.clipPath=``}}showReplayView(){this.replayView||(this.replayView=new he(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}hideReplayView(){this.replayView?.hide()}getPlayToggle(){return this.player.getChild(`collapserator`)?.getChild(`PlayToggle`)}enablePlayToggle(){let e=this.getPlayToggle();e&&e.enable()}disablePlayToggle(){let e=this.getPlayToggle();e&&e.disable()}addCssClasses(){this.player.addClass(`cv-range-indicator-plugin`)}removeCssClasses(){this.player.removeClass(`cv-range-indicator-plugin`)}dispose(){this.removeCssClasses(),this.player.off(`timeupdate`,this.onTimeUpdateOrSeeked),this.player.off(`seeked`,this.onTimeUpdateOrSeeked),this.startTimeIndicator?.dispose(),this.endTimeIndicator?.dispose(),this.replayView?.dispose(),super.dispose()}};m.registerPlugin(`rangeIndicatorPlugin`,_e);var B={generateRandomId:()=>window.crypto?.randomUUID?.()??Math.random().toString()},ve=class extends ee{constructor(e,t){super(e,t)}getPlayerOptions(){let e=super.getPlayerOptions();return this.options.allowTranscript&&(e.allowTranscript=!0),e.devicesConfig?.canUserCastToDevices?{...e,techOrder:[`devices`,...e.techOrder],devices:{instanceId:B.generateRandomId()}}:e}configurePlugins(){try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),this.options.pointsOfInterest?.length&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest}),this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}catch(e){console.log(`failed to register plugins`,e)}}setNextVideo(e,t,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(e,t,n)}togglePictureInPicture(e){let t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}toggleTheatreMode(e){let t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}toggleTranscript(e){if(!this.player.viewTranscriptPlugin)return;let t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}hasStarted(){return this.player.hasStarted()}async additionalSetup(e){if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),super.additionalSetup(e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),e.mediaType===`MasterClip`){let t=e.additionalData;if(t===null)throw Error(`Invalid clip data`);this.player.clipPlugin({startTime:t.startTime,endTime:t.endTime})}e.mediaType===`MasterVideo`&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime})}setupAnalyticsDependentPlugins(e){super.setupAnalyticsDependentPlugins(e),this.options.allowTranscript&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),this.options.devicesConfig?.canUserCastToDevices&&this.player.devicesPlugin&&this.player.devicesPlugin({...this.options.devicesConfig,userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService})}setActivityStatus(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}useCurrentTranscript(e,t){p.useMetadataTracks(this.player,`transcript`,e,t)}useChapters(e){p.useChapters(this.player,e)}},V={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:``},ye=class{constructor(e,t=V){this.bindFunctions(),this.url=e,this.options={...V,...t},this.webSocket=this.connect(),this.heartbeat=new E().schedule(()=>this.send(this.options.heartbeatMessage)).every(this.options.heartbeatIntervalInMillseconds)}bindFunctions(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}cleanup(){this.heartbeat.stop(),this.webSocket.removeEventListener(`error`,this.handleError),this.webSocket.removeEventListener(`message`,this.handleMessage),this.webSocket.removeEventListener(`open`,this.handleOpen),this.webSocket.removeEventListener(`close`,this.handleClose)}handleOpen(e){this.onOpen?.(e),this.options.heartbeatEnabled&&this.heartbeat.start()}handleMessage(e){this.onMessage?.(e)}handleClose(e){this.onClose?.(e),this.cleanup(),setTimeout(()=>{this.webSocket=this.connect()},this.options.reconnectIntervalInMilliseconds)}handleError(e){this.onError?.(e),this.handleClose()}connect(){let e=new WebSocket(this.url);return e.addEventListener(`open`,this.handleOpen),e.addEventListener(`message`,this.handleMessage),e.addEventListener(`close`,this.handleClose),e.addEventListener(`error`,this.handleError),e}send(e){this.webSocket.send(e)}dipose(){this.cleanup(),this.webSocket.close()}},be=2e3,xe=class{constructor(e,t){return this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource=``,this.subtitleSource=``,this.subtitles=!1,this.volume=0,this.title=e,this.device=t,this.ready=!1,this.playbackFinished=!1,this.debounced=w.withDebouncedSetters(this,be),w.withTimestampedSetters(this)}get position(){return this._position+this.getTimerDurationInSeconds()}set position(e){this._position=e,this.restartTimer()}get playing(){return this._playing}set playing(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}restartTimer(){this._timerStartedAt=Date.now()}stopTimer(){this._timerStartedAt=0}getTimerDurationInSeconds(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}},H=function(e){return e.Update=`update`,e.Volume=`volume`,e.Playing=`playing`,e.Paused=`paused`,e.NewChapter=`new_chapter`,e.Stopped=`stopped`,e.Ready=`ready`,e.Mute=`mute`,e.Finished=`finished`,e.Subtitles=`subtitles`,e}({}),Se=class extends S{constructor(e,t){super(),this.client=e,this.localState=new xe(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on(`dispose`,this.dispose),this.client.on(`connected`,this.handleClientConnected),this.client.on(`message`,this.handleDisconnectMessage).filter(e=>e.source===this.getDevice().id&&e.message.type===`disconnect`),this.client.on(`message`,this.handleAllVideoMessages).filter(e=>e.source===this.getDevice().id&&e.message.type===`video_event`)}dispose(){this.client.off(`dispose`,this.dispose),this.client.off(`connected`,this.handleClientConnected),this.client.off(`message`,this.handleDisconnectMessage),this.client.off(`message`,this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}async handleClientConnected(){try{await this.client.joinRoom(this.getDevice().id)}catch(e){this.trigger(`error`,e)}}handleDisconnectMessage(){this.dispose()}handleAllVideoMessages(e){let t=this.localState.debounced,n=e.message.payload.params||{};switch(e.message.payload.event){case H.Update:this.handleUpdateMessage(t,n);break;case H.NewChapter:this.handleNewChapterMessage(t,n);break;case H.Volume:this.handleVolumeMessage(t,n);break;case H.Playing:this.handlePlayingMessage(t);break;case H.Paused:this.handlePausedMessage(t);break;case H.Finished:this.handleFinishedMessage(t);break;case H.Stopped:this.handleStoppedMessage();break}}handleUpdateMessage(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger(`durationchange`,C.void)),e.position!==t.position&&(e.position=t.position,this.trigger(`positionchange`,C.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger(`subtitleschange`,C.void))}handleVolumeMessage(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=t.level===0,this.trigger(`volumechange`,C.void))}handlePlayingMessage(e){e.playing!==!0&&(e.playing=!0,e.playbackFinished=!1,this.trigger(`playingchange`,C.void))}handlePausedMessage(e){e.playing!==!1&&(e.playing=!1,this.trigger(`playingchange`,C.void))}handleFinishedMessage(e){e.playbackFinished!==!0&&(e.playing=!1,e.playbackFinished=!0,this.trigger(`playingchange`,C.void))}handleNewChapterMessage(e,t){let n=(t.queue??[]).find(t=>t.url===e.videoSource);if(!n){console.info(`The device is no longer playing the source we loaded - disposing the session`),this.dispose();return}e.subtitleSource!==n.suburl&&(e.subtitleSource=n.suburl,this.trigger(`subtitleschange`,C.void))}handleStoppedMessage(){this.dispose()}async loadSource(e,t){if(!(this.localState.videoSource===e&&this.localState.subtitleSource===t))try{let n=this.getDevice().id,r=this.getPosition();this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,await this.client.joinRoom(n),await this.client.loadQueue({title:this.getTitle(),roomId:n,videoSource:e,subtitleSource:t}),this.localState.ready=!0,this.trigger(`sourceloaded`,C.void),r>0&&this.seek(r),t&&this.setSubtitles(t)}catch(e){console.error(e),this.trigger(`error`,Error(`Could not load video on Vivi device`))}}play(){this.localState.ready&&this.localState.playing!==!0&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger(`playingchange`,C.void))}pause(){this.localState.ready&&this.localState.playing!==!1&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger(`playingchange`,C.void))}seek(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger(`positionchange`,C.void))}setVolume(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger(`volumechange`,C.void))}setMuted(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger(`volumechange`,C.void))}async setSubtitles(e){if(!this.localState.ready)return;e&&await this.loadSource(this.localState.videoSource,e);let t=!!e;this.localState.subtitles!==t&&(this.localState.subtitles=t,this.client.setSubtitles(this.getDevice().id,t),this.trigger(`subtitleschange`,C.void))}isPlaying(){return this.localState.playing}isPlaybackFinished(){return this.localState.playbackFinished}getPosition(){return this.localState.position}getDuration(){return this.localState.duration}getVolume(){return this.localState.volume}getMuted(){return this.localState.mute}getSubtitles(){if(this.localState.subtitles)return this.localState.subtitleSource}getDevice(){return this.localState.device}getTitle(){return this.localState.title}},U=1e4,Ce=500,we=1e4,W=class e extends S{constructor(e){super(),this.options=e,this.accessToken=``,this.devices=[],this.devicesFingerprint=``,this.deviceDiscovery=new E,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=y(this.sendMessage,Ce,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}initialize(){this.webSocket=new ye(this.options.url),this.webSocket.onMessage=e=>this.trigger(`message`,JSON.parse(e.data)),this.webSocket.onOpen=async()=>{try{this.accessToken=await this.options.fetchAccessToken(),await this.authenticateWithVivi(),this.beginDeviceDiscovery(),this.trigger(`connected`,C.void)}catch(e){console.error(e),this.trigger(`error`,Error(`Could not connect to Vivi`))}}}sendMessage(e){this.webSocket?.send(JSON.stringify(e))}beginDeviceDiscovery(){this.deviceDiscovery.every(we).schedule(async()=>{try{let t=await this.getRoomList(),n=e.calculateFingerprint(t);if(n===this.devicesFingerprint)return;let r=new Set(t.map(e=>e.organisation??``)).size,i=new Set(t.map(e=>e.location??``)).size;this.devices=t.map(e=>({id:e.id,name:e.name,schoolName:r>1?e.organisation:``,description:i>1?e.location:``,type:D.Vivi,status:T.Available})),this.devicesFingerprint=n,this.trigger(`deviceschange`,C.void)}catch(e){console.warn(e)}}).trigger().start()}dispose(){this.deviceDiscovery.stop(),this.webSocket?.dipose(),super.dispose()}canCastToDevice(e){return e===D.Vivi}getDevices(){return this.devices}startCastSession(e){return new Se(this,e)}async authenticateWithVivi(){this.sendMessage({destination:`relay`,message:{token:this.accessToken,type:`identify_video_api`}}),await this.one(`message`,e=>e.message.type===`video_api_identified`).timeout(U).catch(()=>{throw Error(`Failed to authenticate with Vivi`)})}async getRoomList(){return this.sendMessage({destination:`relay`,message:{type:`video_api_rooms`}}),(await this.one(`message`,e=>e.message.type===`video_api_rooms`).timeout(U).catch(()=>{throw Error(`Failed to fetch rooms`)})).message.rooms||[]}async joinRoom(e){this.sendMessage({destination:`relay`,message:{destination_type:`box`,new_destination:e,token:this.accessToken,type:`connect`}}),await this.one(`message`,t=>{if(t.source===e&&t.message.type===`connect`||t.message.type===`error`&&t.message.error_type===`already_connected`)return!0}).timeout(U).catch(()=>{throw Error(`Failed to join room`)})}async query(t){let n=e.createAckId();return this.sendMessage({destination:t,message:{type:`message_with_ack`,ack_id:n,name:`query`}}),await this.one(`message`,e=>e.message.ack_id===n).timeout(U).catch(()=>{throw Error(`Failed to fetch query`)})}async loadQueue({roomId:t,title:n,videoSource:r,subtitleSource:i}){this.sendMessage({destination:t,message:{type:`message_with_ack`,ack_id:e.createAckId(),name:`queue_load`,payload:{urls:[{title:n,url:r,suburl:i}]}}}),await this.one(`message`,e=>e.source===t&&e.message.payload?.event===`ready`).timeout(U).catch(()=>{throw Error(`Failed to load media`)})}async play(e){this.sendMessage({destination:e,message:{type:`message`,name:`video_play`,payload:{}}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`playing`).timeout(U).catch(()=>{throw Error(`Failed to play video`)})}async pause(e){this.sendMessage({destination:e,message:{type:`message`,name:`video_pause`}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`paused`).timeout(U).catch(()=>{throw Error(`Failed to pause video`)})}async stop(e){this.sendMessage({destination:e,message:{type:`message`,name:`video_stop`}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`stopped`).timeout(U).catch(()=>{throw Error(`Failed to stop video`)})}async seek(e,t){this.sendMessageDebounced({destination:e,message:{type:`message`,name:`video_seek`,payload:{position:t}}})&&await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`playing`).timeout(U).catch(()=>{throw Error(`Failed to seek video`)})}async setVolume(e,t){this.sendMessageDebounced({destination:e,message:{type:`message`,name:`set_volume`,payload:{volume:t}}})&&await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`volume`).timeout(U).catch(()=>{throw Error(`Failed to set volume`)})}async setMuted(e,t){this.sendMessage({destination:e,message:{type:`message`,name:`set_mute`,payload:{mute:t}}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`mute`).timeout(U).catch(()=>{throw Error(`Failed to set mute`)})}async setSubtitles(t,n){let r=e.createAckId();this.sendMessage({destination:t,message:{type:`message_with_ack`,ack_id:r,name:`set_subtitles`,payload:{subtitles:n}}}),await this.one(`message`,e=>e.source===t&&e.message.payload?.event===`subtitles`).timeout(U).catch(()=>{throw Error(`Failed to set subtitles`)})}static createAckId(){return B.generateRandomId()}static calculateFingerprint(e){return e.map(e=>e.id).sort().join(`,`)}},G=class e extends S{constructor(e){super(),this.instanceId=e,this.clients=[],this.bindFunctions()}bindFunctions(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}addClient(e){e.on(`deviceschange`,this.gatherAndPublishDevices),e.on(`error`,e=>this.trigger(`error`,e)),this.clients.push(e)}hasInstanceOfClient(e){return this.clients.some(t=>t instanceof e)}startCastSession(e){if(this.castSession)if(this.castSession.getDevice().id!==e.device.id)this.castSession.dispose();else{console.info(`A session with device ${e.device.id} already exists - this is a no-op`);return}let t=this.clients.find(t=>t.canCastToDevice(e.device.type));t&&(this.castSession=t.startCastSession(e),this.castSession.on(`error`,e=>{this.castSession.dispose(),this.trigger(`error`,e)}),this.castSession.on(`dispose`,()=>{this.castSession=void 0,this.trigger(`castsessionchange`,void 0)}),this.trigger(`castsessionchange`,this.castSession))}getCastSession(){return this.castSession}gatherAndPublishDevices(){let e=this.clients.map(e=>e.getDevices()).reduce((e,t)=>[...e,...t],[]);this.trigger(`deviceschange`,e)}dispose(){this.castSession?.dispose(),this.clients.forEach(e=>e.dispose()),this.castSession=void 0,this.clients=[],super.dispose()}static{this.instances={}}static getOrCreateInstance(t){if(!t)throw Error(`instanceId is required`);return this.instances[t]||(this.instances[t]=new e(t)),this.instances[t]}static disposeAndRemoveInstance(e){e.dispose(),delete this.instances[e.instanceId]}static isActive(){return Object.keys(this.instances).length>0}},Te=m.getComponent(`MenuItem`),K=class extends Te{constructor(e,t){super(e,t),this.isVisible=this.isVisible.bind(this)}createEl(){let e={vivi:`cv-vivi-icon`,"apple-tv":`cv-apple-icon`},t=super.createEl(`li`,{className:`vjs-menu-item cv-device-menu-item`}),n=m.dom.createEl(`div`,{className:`cv-device-menu-item-body`,innerHTML:`
|
|
4
4
|
<span class="cv-device-icon ${e[this.options_.type]}"></span>
|
|
@@ -14,4 +14,4 @@ import{o as e}from"./DAXXjFlN.chunk.js";import{x as t}from"./BftnFbcr.chunk.js";
|
|
|
14
14
|
</div>
|
|
15
15
|
<div class="cv-devices-background" style="background-image: url(${this.poster})"></div>
|
|
16
16
|
`;let t=document.createElement(`button`),n=e=>{e.stopPropagation(),this.options_.onStopCasting()};t.onclick=n,t.ontouchstart=n,t.className=`stop-casting-button`,t.innerHTML=this.localize(`Stop casting`),this.el_.querySelector(`.cv-devices-content`).appendChild(t)}play(){}},Fe=m.getComponent(`Tech`),Ie=class extends Fe{constructor(e,t){super(e,t),this.featuresVolumeControl=!0,this.featuresPlaybackRate=!1,this.movingMediaElementInDOM=!1,this.featuresFullscreenResize=!0,this.featuresTimeupdateEvents=!0,this.featuresProgressEvents=!1,this.featuresNativeTextTracks=!1,this.featuresNativeAudioTracks=!1,this.featuresNativeVideoTracks=!1,this.featuresMuteControl=!0,this.featuresSourceset=!1,this.videojsPlayer=m(this.options_.playerId),this.bindFunctions(),this.bindEventListeners(),this.ready(()=>{this.setSource(this.options_.source)}),this.triggerReady()}bindFunctions(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}bindEventListeners(){let e=this.getCastSession();e&&(this.textTracks().on(`change`,this.onTextTrackChanged),this.videojsPlayer.one(`ended`,()=>{e.dispose()}),e.on(`durationchange`,()=>{this.trigger(`durationchange`)}),e.on(`dispose`,()=>{this.trigger(`ended`),this.hideUI()}),e.on(`playingchange`,()=>{e.isPlaying()?(this.trigger(`play`),this.trigger(`playing`)):this.trigger(`pause`)}),e.on(`volumechange`,()=>{this.trigger(`volumechange`)}),e.on(`sourceloaded`,()=>{this.trigger(`loadeddata`)}),e.on(`subtitleschange`,()=>{this.setSelectedTextTrack(e.getSubtitles())}))}onTextTrackChanged(){let e=this.getSelectedTextTrack();this.getCastSession()?.setSubtitles(e?.src)}getSelectedTextTrack(){return p.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode===`showing`&&!!e.src)}setSelectedTextTrack(e){p.forEachTrack(this.videojsPlayer.player_,t=>{t.kind===`subtitles`&&(t.src===e?t.mode=`showing`:t.mode=`disabled`)})}showUI(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}hideUI(){this.ui?.hide()}dispose(){this.textTracks().off(`change`,this.onTextTrackChanged);let e=this.getCastSession();e&&e.dispose(),super.cleanupAutoTextTracks(),super.dispose()}createEl(){return this.ui=this.ui||new Pe({onStopCasting:()=>{this.getCastSession()?.dispose()}}),this.ui.el()}setSource(e){let t=this.getCastSession();if(!t)return;this.showUI(t.getDevice()),this.trigger(`loadstart`);let n=this.getSelectedTextTrack();t.loadSource(d.getOriginalUrl(e.src),n?.src)}addRemoteTextTrack(e){return super.addRemoteTextTrack(e,!0)}getCastSession(){return G.getOrCreateInstance(this.options_.instanceId??``).getCastSession()}play(){this.getCastSession()?.play()}pause(){this.getCastSession()?.pause()}paused(){return this.getCastSession()?.isPlaying()===!1}ended(){return this.getCastSession()?.isPlaybackFinished()??!1}setCurrentTime(e){this.getCastSession()?.seek(e??0)}currentTime(){return this.getCastSession()?.getPosition()??0}duration(){return this.getCastSession()?.getDuration()??this.videojsPlayer.duration()}volume(){return this.getCastSession()?.getVolume()??1}setVolume(e){this.getCastSession()?.setVolume(e)}muted(){return this.getCastSession()?.getMuted()??!1}setMuted(e){this.getCastSession()?.setMuted(e)}buffered(){}seekable(){return m.createTimeRanges(0,this.duration())}playbackRate(){return 1}readyState(){return 4}controls(){return!1}playsinline(){return!0}supportsFullScreen(){return!0}setAutoplay(){}preload(){}load(){}setPlaybackRate(){}static canPlayType(){return``}static canPlaySource(e,t){return e.type!==`application/dash+xml`&&!!G.getOrCreateInstance(t?.instanceId??``).getCastSession()}static isSupported(){return G.isActive()}};m.registerTech(`devices`,Ie);var Z=m.getPlugin(`plugin`),Le=class extends Z{constructor(e,t){super(e,t),this.options=t,this.instanceId=this.player.options_.devices?.instanceId??``,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}initialize(){this.player.ready(this.onReady)}onReady(){let e=this.player.getChild(`collapserator`),t=this.getSessionManager();if(!e||!t)return;t.on(`deviceschange`,this.onDevicesChanged),t.on(`castsessionchange`,this.onCastSessionChanged),t.on(`error`,this.onDevicesError);let n=()=>{this.addViviClient(t),this.addAppleTvClient(t)},r=(e,n)=>{t.startCastSession({device:n,title:this.options.title}),this.options.analyticsService?.logUserAction(n,{actionType:c.Select,workflowPhase:a.Complete,descriptor:i.ChangeDevice,entity:s.Device,eventVersion:o.V3})},l=this.options.ctaOptions,u=this.options.vivi,d=this.options.appleTv,f=[];d.enabled||f.push(D.AppleTv),(!u.enabled||!u.accountConnected)&&f.push(D.Vivi);let p={onClick:n,onDeviceMenuItemClick:r,ctaOptions:{...l,inactiveIntegrations:f}};this.devicesButton=e.addChild(`DevicesButton`,p)}onDevicesChanged(e){this.devicesButton?.setDevices(e)}onCastSessionChanged(e){this.devicesButton?.setCastSession(e),this.reloadTech(),e?(this.player.addClass(`cv-device-casting`),this.player.addClass(`cv-device-${e.getDevice().type}`),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass(`cv-device-casting`),this.player.removeClass(`cv-device-${D.AppleTv}`),this.player.removeClass(`cv-device-${D.Vivi}`))}onDevicesError(e){this.player.error(e.message),this.player.pause()}addViviClient(e){if(!this.options.vivi.enabled||!this.options.vivi.accountConnected||!this.options.vivi.apiUrl||e.hasInstanceOfClient(W))return;let t=new W({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}addAppleTvClient(e){if(!this.options.appleTv.enabled||!this.options.trackingCode||!this.options.userId||e.hasInstanceOfClient(O))return;let t=new O({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}reloadTech(){let e=this.player,t=e.currentSources(),n=e.volume(),r=e.muted(),i=e.currentTime(),a=e.paused();e.src(t),e.one(`playing`,()=>{e.volume(n),e.muted(r),e.currentTime(i),a?e.pause():e.play()})}getSessionManager(){if(this.instanceId)return G.getOrCreateInstance(this.instanceId)}dispose(){let e=this.getSessionManager();e&&(e.off(`deviceschange`,this.onDevicesChanged),e.off(`castsessionchange`,this.onCastSessionChanged),e.off(`error`,this.onDevicesError),G.disposeAndRemoveInstance(e),super.dispose())}};m.registerPlugin(`devicesPlugin`,Le);function Re(e){return(0,J.jsx)(`div`,{className:`cv-resource-item`,children:(0,J.jsx)(l,{data:e.resource,imageCdnUrl:e.imageCdnUrl,titlePosition:`above`,hideTypeBadge:!0})})}var ze=h((e,t)=>(0,J.jsx)(Re,{...t})),Be=m.getComponent(`MenuItem`),Ve=class extends Be{constructor(e,t){super(e,t);let n=new ze(e,{resource:t.resource,imageCdnUrl:t.imageCdnUrl});this.addChild(n)}createEl(e,t={},n){return super.createEl(e,{...t,className:`${t.className} cv-resource-menu-item`},n)}handleClick(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}},He=m.getComponent(`MenuButton`),Q=class extends He{constructor(...e){super(...e),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildWrapperCSSClass(){return`cv-menu-small cv-resources-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-resources-button ${super.buildCSSClass()}`}update(){super.update()}createItems(){let e=[];return e.push(new _(this.player_,{label:`Resources`})),this.options_.resources.forEach(t=>{let n=new Ve(this.player(),{resource:t,imageCdnUrl:this.options_.imageCdnUrl,downloadResource:e=>this.downloadResource(e),label:t.name});e.push(n)}),e}downloadResource(e){if(e.type===`link`){t.PageLoad(e.url,!0);return}this.getDownloadIframe().src=e.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=m.dom.createEl(`iframe`),this.downloadIframe.style.display=`none`,m.dom.appendContent(m.dom.$(`body`),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return``}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}};Q.prototype.controlText_=`Resources`,m.registerComponent(`ResourcesButton`,Q);var Ue=m.getPlugin(`plugin`),We=class extends Ue{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){this.options.resources.length&&this.player.getChild(`collapserator`).addChild(`ResourcesButton`,{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl})}};m.registerPlugin(`resourcesPlugin`,We);function $(e){let{className:t=``,playerApi:n,onReady:r,onDispose:i,...a}=e,o=k.useRef(null);return k.useEffect(()=>{if(!o)return;let e=new ve(o.current,{...a,playerApi:n});return r&&e.ready(()=>{r(x(e))}),i&&e.one(`dispose`,i),()=>{e?.dispose()}},[e.viewKey]),(0,J.jsx)(`div`,{ref:o,className:t})}export{$ as ClickViewPlayer,$ as default};
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=BiWUSyJr.chunk.js.map
|