@clickview/lite 0.105.0-rc.0 → 0.105.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/.vite/manifest.json +676 -676
  2. package/dist/bundles.json +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{CsGcvd52.chunk.js → 7lrVefxF.chunk.js} +2 -2
  5. package/dist/scripts/{CsGcvd52.chunk.js.map → 7lrVefxF.chunk.js.map} +1 -1
  6. package/dist/scripts/{CHZLAcZ_2.chunk.js → B-V5u42C2.chunk.js} +3 -3
  7. package/dist/scripts/{CHZLAcZ_2.chunk.js.map → B-V5u42C2.chunk.js.map} +1 -1
  8. package/dist/scripts/{CKh-VEMl.chunk.js → B1rSJN7u.chunk.js} +2 -2
  9. package/dist/scripts/{CKh-VEMl.chunk.js.map → B1rSJN7u.chunk.js.map} +1 -1
  10. package/dist/scripts/{Dfo4EB26.chunk.js → BMSgkYr_.chunk.js} +2 -2
  11. package/dist/scripts/{Dfo4EB26.chunk.js.map → BMSgkYr_.chunk.js.map} +1 -1
  12. package/dist/scripts/{CUiXvqkf2.chunk.js → BNAB3zGE2.chunk.js} +2 -2
  13. package/dist/scripts/{CUiXvqkf2.chunk.js.map → BNAB3zGE2.chunk.js.map} +1 -1
  14. package/dist/scripts/{DMefg444.chunk.js → BObH8Qah.chunk.js} +2 -2
  15. package/dist/scripts/{DMefg444.chunk.js.map → BObH8Qah.chunk.js.map} +1 -1
  16. package/dist/scripts/{kjKFfyCC2.chunk.js → BS-WKys42.chunk.js} +2 -2
  17. package/dist/scripts/{kjKFfyCC2.chunk.js.map → BS-WKys42.chunk.js.map} +1 -1
  18. package/dist/scripts/{qhSE4Eld.chunk.js → BUdIzi2I.chunk.js} +2 -2
  19. package/dist/scripts/{qhSE4Eld.chunk.js.map → BUdIzi2I.chunk.js.map} +1 -1
  20. package/dist/scripts/{Bg-NmCOq.chunk.js → B_Au77Ey.chunk.js} +2 -2
  21. package/dist/scripts/{Bg-NmCOq.chunk.js.map → B_Au77Ey.chunk.js.map} +1 -1
  22. package/dist/scripts/{BNMFIMSB.chunk.js → B_v9mBnF.chunk.js} +2 -2
  23. package/dist/scripts/{BNMFIMSB.chunk.js.map → B_v9mBnF.chunk.js.map} +1 -1
  24. package/dist/scripts/{BT2nvPyG.chunk.js → BaN7PH04.chunk.js} +2 -2
  25. package/dist/scripts/{BT2nvPyG.chunk.js.map → BaN7PH04.chunk.js.map} +1 -1
  26. package/dist/scripts/{BfK63iLm2.chunk.js → BuzAbtqC2.chunk.js} +2 -2
  27. package/dist/scripts/{BfK63iLm2.chunk.js.map → BuzAbtqC2.chunk.js.map} +1 -1
  28. package/dist/scripts/{DyERxRJT2.chunk.js → Bz3CmGse2.chunk.js} +3 -3
  29. package/dist/scripts/{DyERxRJT2.chunk.js.map → Bz3CmGse2.chunk.js.map} +1 -1
  30. package/dist/scripts/{Bpgrfq1W2.chunk.js → C7sAao1u2.chunk.js} +2 -2
  31. package/dist/scripts/{Bpgrfq1W2.chunk.js.map → C7sAao1u2.chunk.js.map} +1 -1
  32. package/dist/scripts/{kitbrI3y.chunk.js → CH2FOD_Y.chunk.js} +2 -2
  33. package/dist/scripts/{kitbrI3y.chunk.js.map → CH2FOD_Y.chunk.js.map} +1 -1
  34. package/dist/scripts/{a9yj-pru.chunk.js → CIpKTjTa.chunk.js} +2 -2
  35. package/dist/scripts/{a9yj-pru.chunk.js.map → CIpKTjTa.chunk.js.map} +1 -1
  36. package/dist/scripts/{Bqi3bvPn.chunk.js → CMIWX3sc.chunk.js} +2 -2
  37. package/dist/scripts/{Bqi3bvPn.chunk.js.map → CMIWX3sc.chunk.js.map} +1 -1
  38. package/dist/scripts/{CLYwJpCJ.chunk.js → CyKAODDv.chunk.js} +2 -2
  39. package/dist/scripts/{CLYwJpCJ.chunk.js.map → CyKAODDv.chunk.js.map} +1 -1
  40. package/dist/scripts/{C35iCvXx2.chunk.js → Cys9_W-O2.chunk.js} +2 -2
  41. package/dist/scripts/{C35iCvXx2.chunk.js.map → Cys9_W-O2.chunk.js.map} +1 -1
  42. package/dist/scripts/{BnR_Hzcf.chunk.js → D9P9eNbi.chunk.js} +2 -2
  43. package/dist/scripts/{BnR_Hzcf.chunk.js.map → D9P9eNbi.chunk.js.map} +1 -1
  44. package/dist/scripts/{iEP6nnLh2.chunk.js → D9POCoFw2.chunk.js} +2 -2
  45. package/dist/scripts/{iEP6nnLh2.chunk.js.map → D9POCoFw2.chunk.js.map} +1 -1
  46. package/dist/scripts/{B6I8Vh8n.chunk.js → DB8xYV5H.chunk.js} +2 -2
  47. package/dist/scripts/{B6I8Vh8n.chunk.js.map → DB8xYV5H.chunk.js.map} +1 -1
  48. package/dist/scripts/{CTpJ4vP62.chunk.js → DT8lKxmy2.chunk.js} +2 -2
  49. package/dist/scripts/{CTpJ4vP62.chunk.js.map → DT8lKxmy2.chunk.js.map} +1 -1
  50. package/dist/scripts/{ByLl4bms2.chunk.js → DWQkljeD2.chunk.js} +2 -2
  51. package/dist/scripts/{ByLl4bms2.chunk.js.map → DWQkljeD2.chunk.js.map} +1 -1
  52. package/dist/scripts/{DQNW-R2Y.chunk.js → DdVzer9F.chunk.js} +2 -2
  53. package/dist/scripts/{DQNW-R2Y.chunk.js.map → DdVzer9F.chunk.js.map} +1 -1
  54. package/dist/scripts/{cu48iYhG.chunk.js → DkA7_vQC.chunk.js} +3 -3
  55. package/dist/scripts/{cu48iYhG.chunk.js.map → DkA7_vQC.chunk.js.map} +1 -1
  56. package/dist/scripts/{CecBf_FP.chunk.js → DqZVK9mn.chunk.js} +2 -2
  57. package/dist/scripts/{CecBf_FP.chunk.js.map → DqZVK9mn.chunk.js.map} +1 -1
  58. package/dist/scripts/{CB13vtRK.chunk.js → DuFYtiN6.chunk.js} +2 -2
  59. package/dist/scripts/{CB13vtRK.chunk.js.map → DuFYtiN6.chunk.js.map} +1 -1
  60. package/dist/scripts/{DcWcozji.chunk.js → DwNluqCs.chunk.js} +2 -2
  61. package/dist/scripts/{DcWcozji.chunk.js.map → DwNluqCs.chunk.js.map} +1 -1
  62. package/dist/scripts/{P9unbQX_2.chunk.js → FxuURp3k2.chunk.js} +2 -2
  63. package/dist/scripts/{P9unbQX_2.chunk.js.map → FxuURp3k2.chunk.js.map} +1 -1
  64. package/dist/scripts/{D_Txk-Lv.chunk.js → WDOpswDS.chunk.js} +2 -2
  65. package/dist/scripts/{D_Txk-Lv.chunk.js.map → WDOpswDS.chunk.js.map} +1 -1
  66. package/dist/scripts/{app-uVIoLFQW.js → app-Bsq2dxSw.js} +4 -4
  67. package/dist/scripts/{app-uVIoLFQW.js.map → app-Bsq2dxSw.js.map} +1 -1
  68. package/dist/scripts/{CZGYNiTy2.chunk.js → oqpijUVC2.chunk.js} +2 -2
  69. package/dist/scripts/{CZGYNiTy2.chunk.js.map → oqpijUVC2.chunk.js.map} +1 -1
  70. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import"./DAXXjFlN.chunk.js";import{n as e}from"./B785hxeE.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{d as r,f as i}from"./CEamUdnf.chunk.js";import{y as a}from"./BHvdJc9z.chunk.js";import{t as o}from"./Dn1hp1IN2.chunk.js";import{t as s}from"./C1HfCcUR.chunk.js";import{t as c}from"./C5kGxy6G.chunk.js";import{t as l}from"./By12qobm.chunk.js";import{t as u}from"./Bjt_-lTs.chunk.js";import{t as d}from"./D_gWf2lC.chunk.js";import{t as f}from"./fTs56Htp.chunk.js";import{n as p,t as m}from"./Dy8J1lcl.chunk.js";import{t as h}from"./BQAs90Va.chunk.js";import{t as g}from"./BKSSWxpx2.chunk.js";import{l as _,r as v}from"./CHZLAcZ_2.chunk.js";import{t as y}from"./B6thlK3b2.chunk.js";import{t as b}from"./DMRw6Y9I.chunk.js";import{t as x}from"./B5GLYnGs.chunk.js";import{n as S}from"./CuwbnVWn2.chunk.js";import{t as C}from"./DMaQV7L2.chunk.js";import{t as w}from"./BPQPzqBZ.chunk.js";import{t as T}from"./7E_Q1-g92.chunk.js";import{t as E}from"./CC5Dr9aG2.chunk.js";import{t as D}from"./MBoxVxPO2.chunk.js";import{b as O}from"./kjKFfyCC2.chunk.js";import{n as k,r as A,t as j}from"./DQNW-R2Y.chunk.js";t();var M=n();function N(t){let{commonVideoProps:n,hasCommonVideoPropsCompleted:N}=T({locationContext:a.VideoThumbnail}),{hasPermissions:P}=g(),ee=O(),{activePresentation:F}=f(),{hasPlayPageTranscript:I,hasNewSearch:L}=o(null),R=r(u.currentUser()),z=r(l.sharedVideo(t.objectId,t.shareId)),B=b({objectId:z.data?.id,objectTypeId:z.data?.typeId}),V=r(B.canViewClips&&s.videoClips(t.objectId)),H=r(B.canViewInteractives&&c.videoInteractives(t.objectId)),U=v({video:z.data,context:t.queryParams.context,contextId:t.queryParams.contextId,moviesAndTv:t.queryParams.mtv,currentUser:R.data}),W=_(t.objectId),G=r(!!F&&C.audiencesByPresentationId(F.id)),{shouldFetchTranscript:K,shouldShowTranscript:q}=j(t.objectId,t.shareId),{subtitles:J,chapters:Y}=r(K&&R.data?.contentRegion&&A.chaptersAndSubtitles(t.objectId,R.data.contentRegion))?.data||{},X=J?.filter(e=>!e.customer),Z=i(X&&X.length>0?X.map(e=>A.subtitleVtt(e.url,e)):[]),Q=X?.filter(e=>Z.data.find(t=>t.id===e.id))||[],$=r(d.config());m(p.getVideoMetadata({content:z.data,canonicalLink:y.getCanonicalLink({stripPresentationSlug:!0}),allowIndexing:!1})),D(U.videos??[]),h(z,{private:x}),S({id:t.objectId,app:`videos`,shareId:t.shareId});let te=E({name:z.data?.name}),ne=w(t.objectId);return z.data&&R.hasCompleted&&W.hasCompleted&&N?(0,M.jsx)(`div`,{className:`px-3`,children:(0,M.jsx)(k,{presentationSlug:null,video:z.data,clips:V.data?.data,interactives:H.data?.data,curriculums:ne,relatedVideos:U,currentUser:R.data,pointsOfInterest:W?.items,playNext:t.queryParams?.playNext,shareId:t.shareId,featureAccess:B,audiences:G.data,params:t.queryParams,canManageVideoAccess:P(e.ManageVideoAccess),tableOfContentsId:t.queryParams?.tocId,shouldShowSideTableOfContents:ee,breadcrumbs:te,commonVideoProps:n,hasTheatreMode:I,shouldShowTranscript:q&&(!K||Z.data?.length>0),vttSubtitles:Z.data||[],subtitles:Q,chapters:Y,isBot:y.isBot(),playerApiUrl:$.data?.playerApiUrl,hasNewSearch:L,liteUrl:$.data.liteUrl})}):(0,M.jsx)(M.Fragment,{})}export{N as PlaySharedVideoView};
2
- //# sourceMappingURL=B6I8Vh8n.chunk.js.map
1
+ import"./DAXXjFlN.chunk.js";import{n as e}from"./B785hxeE.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{d as r,f as i}from"./CEamUdnf.chunk.js";import{y as a}from"./BHvdJc9z.chunk.js";import{t as o}from"./Dn1hp1IN2.chunk.js";import{t as s}from"./C1HfCcUR.chunk.js";import{t as c}from"./C5kGxy6G.chunk.js";import{t as l}from"./By12qobm.chunk.js";import{t as u}from"./Bjt_-lTs.chunk.js";import{t as d}from"./D_gWf2lC.chunk.js";import{t as f}from"./fTs56Htp.chunk.js";import{n as p,t as m}from"./Dy8J1lcl.chunk.js";import{t as h}from"./BQAs90Va.chunk.js";import{t as g}from"./BKSSWxpx2.chunk.js";import{l as _,r as v}from"./B-V5u42C2.chunk.js";import{t as y}from"./B6thlK3b2.chunk.js";import{t as b}from"./DMRw6Y9I.chunk.js";import{t as x}from"./B5GLYnGs.chunk.js";import{n as S}from"./CuwbnVWn2.chunk.js";import{t as C}from"./DMaQV7L2.chunk.js";import{t as w}from"./BPQPzqBZ.chunk.js";import{t as T}from"./7E_Q1-g92.chunk.js";import{t as E}from"./CC5Dr9aG2.chunk.js";import{t as D}from"./MBoxVxPO2.chunk.js";import{b as O}from"./BS-WKys42.chunk.js";import{n as k,r as A,t as j}from"./DdVzer9F.chunk.js";t();var M=n();function N(t){let{commonVideoProps:n,hasCommonVideoPropsCompleted:N}=T({locationContext:a.VideoThumbnail}),{hasPermissions:P}=g(),ee=O(),{activePresentation:F}=f(),{hasPlayPageTranscript:I,hasNewSearch:L}=o(null),R=r(u.currentUser()),z=r(l.sharedVideo(t.objectId,t.shareId)),B=b({objectId:z.data?.id,objectTypeId:z.data?.typeId}),V=r(B.canViewClips&&s.videoClips(t.objectId)),H=r(B.canViewInteractives&&c.videoInteractives(t.objectId)),U=v({video:z.data,context:t.queryParams.context,contextId:t.queryParams.contextId,moviesAndTv:t.queryParams.mtv,currentUser:R.data}),W=_(t.objectId),G=r(!!F&&C.audiencesByPresentationId(F.id)),{shouldFetchTranscript:K,shouldShowTranscript:q}=j(t.objectId,t.shareId),{subtitles:J,chapters:Y}=r(K&&R.data?.contentRegion&&A.chaptersAndSubtitles(t.objectId,R.data.contentRegion))?.data||{},X=J?.filter(e=>!e.customer),Z=i(X&&X.length>0?X.map(e=>A.subtitleVtt(e.url,e)):[]),Q=X?.filter(e=>Z.data.find(t=>t.id===e.id))||[],$=r(d.config());m(p.getVideoMetadata({content:z.data,canonicalLink:y.getCanonicalLink({stripPresentationSlug:!0}),allowIndexing:!1})),D(U.videos??[]),h(z,{private:x}),S({id:t.objectId,app:`videos`,shareId:t.shareId});let te=E({name:z.data?.name}),ne=w(t.objectId);return z.data&&R.hasCompleted&&W.hasCompleted&&N?(0,M.jsx)(`div`,{className:`px-3`,children:(0,M.jsx)(k,{presentationSlug:null,video:z.data,clips:V.data?.data,interactives:H.data?.data,curriculums:ne,relatedVideos:U,currentUser:R.data,pointsOfInterest:W?.items,playNext:t.queryParams?.playNext,shareId:t.shareId,featureAccess:B,audiences:G.data,params:t.queryParams,canManageVideoAccess:P(e.ManageVideoAccess),tableOfContentsId:t.queryParams?.tocId,shouldShowSideTableOfContents:ee,breadcrumbs:te,commonVideoProps:n,hasTheatreMode:I,shouldShowTranscript:q&&(!K||Z.data?.length>0),vttSubtitles:Z.data||[],subtitles:Q,chapters:Y,isBot:y.isBot(),playerApiUrl:$.data?.playerApiUrl,hasNewSearch:L,liteUrl:$.data.liteUrl})}):(0,M.jsx)(M.Fragment,{})}export{N as PlaySharedVideoView};
2
+ //# sourceMappingURL=DB8xYV5H.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"B6I8Vh8n.chunk.js","names":[],"sources":["../../src/apps/share/views/play-shared-video/PlaySharedVideoView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Flight } from 'libs/common/flight';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { ClipRequests } from 'libs/shared/flight-requests/ClipRequests';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { ClipCollection, Config, CurrentUser, InteractiveCollection, PresentationAudience, Video, VttSubtitleResponse } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { TranscriptRequests, TranscriptResponse } from 'shared/flight-requests/TranscriptRequests';\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useCurriculums } from 'shared/hooks/useCurriculums';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useFetchPointsOfInterest } from 'shared/hooks/useFetchPointsOfInterest';\nimport { useGetRelatedVideos } from 'shared/hooks/useGetRelatedVideos';\nimport { useVideoFeatureAccess } from 'shared/hooks/useVideoFeatureAccess';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { PlayPage } from 'shared/views/play/components/play-page/PlayPage';\nimport { useShouldShowSideTableOfContents } from 'shared/views/play/hooks/useShouldShowTableOfContents';\nimport { useShowTranscriptForVideo } from 'shared/views/play/hooks/useShowVideoTranscript';\n\nimport { ShareLinkPrivateError } from 'apps/share/errors/share-link-private/ShareLinkPrivateError';\nimport { ShareLinkViewProps } from 'apps/share/interfaces/ShareLinkViewProps';\n\nexport function PlaySharedVideoView(props: ShareLinkViewProps): React.ReactElement {\n const {\n commonVideoProps,\n hasCommonVideoPropsCompleted\n } = useCommonVideoProps({ locationContext: LocationContext.VideoThumbnail });\n\n const { hasPermissions } = usePermissions();\n\n const shouldShowSideTableOfContents = useShouldShowSideTableOfContents();\n\n const { activePresentation } = useActivePresentation();\n const { hasPlayPageTranscript, hasNewSearch } = useSettings(null);\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const video = Flight.useBasicFetch<Video>(\n VideoRequests.sharedVideo(props.objectId, props.shareId)\n );\n\n const featureAccess = useVideoFeatureAccess({\n objectId: video.data?.id,\n objectTypeId: video.data?.typeId\n });\n \n const clips = Flight.useBasicFetch<ClipCollection>(\n featureAccess.canViewClips && ClipRequests.videoClips(props.objectId)\n );\n const interactives = Flight.useBasicFetch<InteractiveCollection>(\n featureAccess.canViewInteractives && InteractiveRequests.videoInteractives(props.objectId)\n );\n const relatedVideos = useGetRelatedVideos({\n video: video.data,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n moviesAndTv: props.queryParams.mtv,\n currentUser: currentUser.data\n });\n const pointsOfInterest = useFetchPointsOfInterest(props.objectId);\n \n const audiences = Flight.useBasicFetch<PresentationAudience[]>(\n !!activePresentation &&\n AudienceRequests.audiencesByPresentationId(activePresentation.id)\n );\n\n const { shouldFetchTranscript, shouldShowTranscript } = useShowTranscriptForVideo(props.objectId, props.shareId);\n const transcript = Flight.useBasicFetch<TranscriptResponse>(\n shouldFetchTranscript && currentUser.data?.contentRegion &&\n TranscriptRequests.chaptersAndSubtitles(props.objectId, currentUser.data.contentRegion)\n );\n const { subtitles: allSubtitles, chapters } = transcript?.data || {};\n // only show transcript for ClickView produced subtitle \n const subtitles = allSubtitles?.filter(subtitle => !subtitle.customer);\n \n const captionsRequests = (subtitles && subtitles.length > 0) ?\n subtitles.map(subtitle => TranscriptRequests.subtitleVtt(subtitle.url, subtitle)) :\n [];\n const captions = Flight.useBasicFetchAll<VttSubtitleResponse>(captionsRequests);\n const filteredSubtitles = subtitles?.filter(\n subtitle => captions.data.find(caption => caption.id === subtitle.id)\n ) || [];\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n\n useSetPageMetadata(PageMetadataHelper.getVideoMetadata({\n content: video.data,\n canonicalLink: SeoHelper.getCanonicalLink({ stripPresentationSlug: true }),\n allowIndexing: false\n }));\n\n useVideoMixin(relatedVideos.videos ?? []);\n useCannotConsumeError(video, { private: ShareLinkPrivateError });\n useDeepLinks({ id: props.objectId, app: 'videos', shareId: props.shareId });\n\n const breadcrumbs = useBreadcrumbs({ name: video.data?.name });\n\n const curriculums = useCurriculums(props.objectId);\n\n const dataLoaded = (\n video.data &&\n currentUser.hasCompleted &&\n pointsOfInterest.hasCompleted &&\n hasCommonVideoPropsCompleted\n );\n\n if (!dataLoaded)\n return <></>;\n\n return (\n <div className='px-3'>\n <PlayPage\n presentationSlug={null}\n video={video.data}\n clips={clips.data?.data}\n interactives={interactives.data?.data}\n curriculums={curriculums}\n relatedVideos={relatedVideos}\n currentUser={currentUser.data}\n pointsOfInterest={pointsOfInterest?.items}\n playNext={props.queryParams?.playNext}\n shareId={props.shareId}\n featureAccess={featureAccess}\n audiences={audiences.data}\n params={props.queryParams}\n canManageVideoAccess={hasPermissions(PermissionName.ManageVideoAccess)}\n tableOfContentsId={props.queryParams?.tocId}\n shouldShowSideTableOfContents={shouldShowSideTableOfContents}\n breadcrumbs={breadcrumbs}\n commonVideoProps={commonVideoProps}\n hasTheatreMode={hasPlayPageTranscript}\n shouldShowTranscript={shouldShowTranscript && (!shouldFetchTranscript || captions.data?.length > 0)}\n vttSubtitles={captions.data || []}\n subtitles={filteredSubtitles}\n chapters={chapters}\n isBot={SeoHelper.isBot()}\n playerApiUrl={config.data?.playerApiUrl}\n hasNewSearch={hasNewSearch}\n liteUrl={config.data.liteUrl}\n />\n </div>\n );\n}\n"],"mappings":"yoCAsCA,SAAgB,EAAoB,EAA+C,CACjF,GAAM,CACJ,mBACA,gCACE,EAAoB,CAAE,gBAAiB,EAAgB,cAAe,CAAC,EAErE,CAAE,kBAAmB,EAAe,EAEpC,GAAgC,EAAiC,EAEjE,CAAE,sBAAuB,EAAsB,EAC/C,CAAE,wBAAuB,gBAAiB,EAAY,IAAI,EAE1D,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAQ,EACZ,EAAc,YAAY,EAAM,SAAU,EAAM,OAAO,CACzD,EAEM,EAAgB,EAAsB,CAC1C,SAAU,EAAM,MAAM,GACtB,aAAc,EAAM,MAAM,MAC5B,CAAC,EAEK,EAAQ,EACZ,EAAc,cAAgB,EAAa,WAAW,EAAM,QAAQ,CACtE,EACM,EAAe,EACnB,EAAc,qBAAuB,EAAoB,kBAAkB,EAAM,QAAQ,CAC3F,EACM,EAAgB,EAAoB,CACxC,MAAO,EAAM,KACb,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,YAAa,EAAM,YAAY,IAC/B,YAAa,EAAY,IAC3B,CAAC,EACK,EAAmB,EAAyB,EAAM,QAAQ,EAE1D,EAAY,EAChB,CAAC,CAAC,GACF,EAAiB,0BAA0B,EAAmB,EAAE,CAClE,EAEM,CAAE,wBAAuB,wBAAyB,EAA0B,EAAM,SAAU,EAAM,OAAO,EAKzG,CAAE,UAAW,EAAc,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AAgB,EAChB,qBAAsB,IAAyB,CAAC,GAAyB,EAAS,MAAM,OAAS,GACjG,aAAc,EAAS,MAAQ,CAAC,EAChC,UAAW,EACD,WACV,MAAO,EAAU,MAAM,EACvB,aAAc,EAAO,MAAM,aACb,eACd,QAAS,EAAO,KAAK,OACtB,CAAA,CACE,CAAA,GAjCE,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAmCf"}
1
+ {"version":3,"file":"DB8xYV5H.chunk.js","names":[],"sources":["../../src/apps/share/views/play-shared-video/PlaySharedVideoView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Flight } from 'libs/common/flight';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { ClipRequests } from 'libs/shared/flight-requests/ClipRequests';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { ClipCollection, Config, CurrentUser, InteractiveCollection, PresentationAudience, Video, VttSubtitleResponse } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { TranscriptRequests, TranscriptResponse } from 'shared/flight-requests/TranscriptRequests';\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useCurriculums } from 'shared/hooks/useCurriculums';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useFetchPointsOfInterest } from 'shared/hooks/useFetchPointsOfInterest';\nimport { useGetRelatedVideos } from 'shared/hooks/useGetRelatedVideos';\nimport { useVideoFeatureAccess } from 'shared/hooks/useVideoFeatureAccess';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { PlayPage } from 'shared/views/play/components/play-page/PlayPage';\nimport { useShouldShowSideTableOfContents } from 'shared/views/play/hooks/useShouldShowTableOfContents';\nimport { useShowTranscriptForVideo } from 'shared/views/play/hooks/useShowVideoTranscript';\n\nimport { ShareLinkPrivateError } from 'apps/share/errors/share-link-private/ShareLinkPrivateError';\nimport { ShareLinkViewProps } from 'apps/share/interfaces/ShareLinkViewProps';\n\nexport function PlaySharedVideoView(props: ShareLinkViewProps): React.ReactElement {\n const {\n commonVideoProps,\n hasCommonVideoPropsCompleted\n } = useCommonVideoProps({ locationContext: LocationContext.VideoThumbnail });\n\n const { hasPermissions } = usePermissions();\n\n const shouldShowSideTableOfContents = useShouldShowSideTableOfContents();\n\n const { activePresentation } = useActivePresentation();\n const { hasPlayPageTranscript, hasNewSearch } = useSettings(null);\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const video = Flight.useBasicFetch<Video>(\n VideoRequests.sharedVideo(props.objectId, props.shareId)\n );\n\n const featureAccess = useVideoFeatureAccess({\n objectId: video.data?.id,\n objectTypeId: video.data?.typeId\n });\n \n const clips = Flight.useBasicFetch<ClipCollection>(\n featureAccess.canViewClips && ClipRequests.videoClips(props.objectId)\n );\n const interactives = Flight.useBasicFetch<InteractiveCollection>(\n featureAccess.canViewInteractives && InteractiveRequests.videoInteractives(props.objectId)\n );\n const relatedVideos = useGetRelatedVideos({\n video: video.data,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n moviesAndTv: props.queryParams.mtv,\n currentUser: currentUser.data\n });\n const pointsOfInterest = useFetchPointsOfInterest(props.objectId);\n \n const audiences = Flight.useBasicFetch<PresentationAudience[]>(\n !!activePresentation &&\n AudienceRequests.audiencesByPresentationId(activePresentation.id)\n );\n\n const { shouldFetchTranscript, shouldShowTranscript } = useShowTranscriptForVideo(props.objectId, props.shareId);\n const transcript = Flight.useBasicFetch<TranscriptResponse>(\n shouldFetchTranscript && currentUser.data?.contentRegion &&\n TranscriptRequests.chaptersAndSubtitles(props.objectId, currentUser.data.contentRegion)\n );\n const { subtitles: allSubtitles, chapters } = transcript?.data || {};\n // only show transcript for ClickView produced subtitle \n const subtitles = allSubtitles?.filter(subtitle => !subtitle.customer);\n \n const captionsRequests = (subtitles && subtitles.length > 0) ?\n subtitles.map(subtitle => TranscriptRequests.subtitleVtt(subtitle.url, subtitle)) :\n [];\n const captions = Flight.useBasicFetchAll<VttSubtitleResponse>(captionsRequests);\n const filteredSubtitles = subtitles?.filter(\n subtitle => captions.data.find(caption => caption.id === subtitle.id)\n ) || [];\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n\n useSetPageMetadata(PageMetadataHelper.getVideoMetadata({\n content: video.data,\n canonicalLink: SeoHelper.getCanonicalLink({ stripPresentationSlug: true }),\n allowIndexing: false\n }));\n\n useVideoMixin(relatedVideos.videos ?? []);\n useCannotConsumeError(video, { private: ShareLinkPrivateError });\n useDeepLinks({ id: props.objectId, app: 'videos', shareId: props.shareId });\n\n const breadcrumbs = useBreadcrumbs({ name: video.data?.name });\n\n const curriculums = useCurriculums(props.objectId);\n\n const dataLoaded = (\n video.data &&\n currentUser.hasCompleted &&\n pointsOfInterest.hasCompleted &&\n hasCommonVideoPropsCompleted\n );\n\n if (!dataLoaded)\n return <></>;\n\n return (\n <div className='px-3'>\n <PlayPage\n presentationSlug={null}\n video={video.data}\n clips={clips.data?.data}\n interactives={interactives.data?.data}\n curriculums={curriculums}\n relatedVideos={relatedVideos}\n currentUser={currentUser.data}\n pointsOfInterest={pointsOfInterest?.items}\n playNext={props.queryParams?.playNext}\n shareId={props.shareId}\n featureAccess={featureAccess}\n audiences={audiences.data}\n params={props.queryParams}\n canManageVideoAccess={hasPermissions(PermissionName.ManageVideoAccess)}\n tableOfContentsId={props.queryParams?.tocId}\n shouldShowSideTableOfContents={shouldShowSideTableOfContents}\n breadcrumbs={breadcrumbs}\n commonVideoProps={commonVideoProps}\n hasTheatreMode={hasPlayPageTranscript}\n shouldShowTranscript={shouldShowTranscript && (!shouldFetchTranscript || captions.data?.length > 0)}\n vttSubtitles={captions.data || []}\n subtitles={filteredSubtitles}\n chapters={chapters}\n isBot={SeoHelper.isBot()}\n playerApiUrl={config.data?.playerApiUrl}\n hasNewSearch={hasNewSearch}\n liteUrl={config.data.liteUrl}\n />\n </div>\n );\n}\n"],"mappings":"yoCAsCA,SAAgB,EAAoB,EAA+C,CACjF,GAAM,CACJ,mBACA,gCACE,EAAoB,CAAE,gBAAiB,EAAgB,cAAe,CAAC,EAErE,CAAE,kBAAmB,EAAe,EAEpC,GAAgC,EAAiC,EAEjE,CAAE,sBAAuB,EAAsB,EAC/C,CAAE,wBAAuB,gBAAiB,EAAY,IAAI,EAE1D,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAQ,EACZ,EAAc,YAAY,EAAM,SAAU,EAAM,OAAO,CACzD,EAEM,EAAgB,EAAsB,CAC1C,SAAU,EAAM,MAAM,GACtB,aAAc,EAAM,MAAM,MAC5B,CAAC,EAEK,EAAQ,EACZ,EAAc,cAAgB,EAAa,WAAW,EAAM,QAAQ,CACtE,EACM,EAAe,EACnB,EAAc,qBAAuB,EAAoB,kBAAkB,EAAM,QAAQ,CAC3F,EACM,EAAgB,EAAoB,CACxC,MAAO,EAAM,KACb,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,YAAa,EAAM,YAAY,IAC/B,YAAa,EAAY,IAC3B,CAAC,EACK,EAAmB,EAAyB,EAAM,QAAQ,EAE1D,EAAY,EAChB,CAAC,CAAC,GACF,EAAiB,0BAA0B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,KACrB,OAAQ,EAAM,YACd,qBAAsB,EAAe,EAAe,iBAAiB,EACrE,kBAAmB,EAAM,aAAa,MACP,iCAClB,eACK,mBAClB,eAAgB,EAChB,qBAAsB,IAAyB,CAAC,GAAyB,EAAS,MAAM,OAAS,GACjG,aAAc,EAAS,MAAQ,CAAC,EAChC,UAAW,EACD,WACV,MAAO,EAAU,MAAM,EACvB,aAAc,EAAO,MAAM,aACb,eACd,QAAS,EAAO,KAAK,OACtB,CAAA,CACE,CAAA,GAjCE,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAmCf"}
@@ -1,2 +1,2 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{n as t,r as n,t as r}from"./CvE4SVf2.chunk.js";import{n as i}from"./B785hxeE.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{d as u}from"./CEamUdnf.chunk.js";import{i as d,t as f}from"./DxTLIRiK2.chunk.js";import{t as p}from"./BDwjs8qz2.chunk.js";import{t as m}from"./CVHQXNzi2.chunk.js";import{t as h}from"./quMwO3lt2.chunk.js";import{t as g}from"./Bjt_-lTs.chunk.js";import{t as _}from"./CVtvY0gg.chunk.js";import{t as v}from"./QCFxJYkI2.chunk.js";import{t as y}from"./B8AENY2U.chunk.js";import{t as b}from"./BKSSWxpx2.chunk.js";import{t as x}from"./CHZLAcZ_2.chunk.js";import{t as S}from"./ClCnzU6R2.chunk.js";import{n as C,t as w}from"./CpFtf-tI2.chunk.js";import{t as T}from"./C9JLrtps2.chunk.js";import{t as E}from"./DX2KH4av2.chunk.js";import{n as D,r as O}from"./BGswYbRT.chunk.js";import{n as k}from"./DAcNgjTQ.chunk.js";import{t as A}from"./BqbRZ5hB.chunk.js";import{l as j,o as M}from"./BcrXhug9.chunk.js";import{t as N}from"./BTFvVc1Z.chunk.js";import{n as P,t as F}from"./DLpjTXb22.chunk.js";import{t as I}from"./pP_cpHCu2.chunk.js";import{a as L,i as R,n as z,r as B,t as V}from"./C1SMWeap2.chunk.js";import{t as H}from"./7I0L5W4N2.chunk.js";function U(e){let{hasPermissions:t}=b(),{hasProduct:n}=S(),r=u(g.currentUser());return!t(i.StudentExperience)&&n(v.Primary)&&r.data.isAuthenticated&&(!e||e.version===`v1`)}var W=e(s(),1),G=c(),K=`interactives.interactiveTitleAndActions`;function q(e){let t,n;return e._parentClip?(t=e._parentClip.name,n={application:l.CLIPS,action:_.Clips.PLAY_CLIP,args:[e._parentClip.id,o.slugify(e._parentClip.name)]}):(t=e._parentVideo.name,n={application:l.VIDEOS,action:_.Videos.PLAY_VIDEO,args:[null,e._parentVideo.id,o.slugify(e._parentVideo.name)]}),[t,n]}function J(e){let{hasPermissions:t}=b(),n=P({location:e.location,shareId:e.shareId,presentationSlug:null}),r=t(i.StudentExperience),a=e.interactive.status===p.Draft,[o,s]=q(e.interactive);return(0,G.jsx)(w.Provider,{value:K,children:(0,G.jsx)(`div`,{className:`d-flex justify-content-between align-items-center`,children:(0,G.jsxs)(`div`,{className:`inline-block w-100`,children:[(0,G.jsx)(`div`,{className:`ms-2 float-end`,children:!r&&(0,G.jsx)(A,{actions:n.getVideoActions(e.interactive),actionsDropdownClassName:`btn btn-outline-dark`,fetchMore:()=>n.fetchMoreActions(e.interactive)})}),(0,G.jsxs)(`h1`,{className:`h3 mb-2`,children:[a&&(0,G.jsx)(`div`,{className:`badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base`,children:(0,G.jsx)(C,{phrase:`draft`})}),e.interactive.name,!r&&(0,G.jsx)(M,{tooltipPlacement:`right`,className:`ps-1 d-inline-block`,video:e.interactive,yearGroups:e.commonVideoProps.yearGroups})]}),h.canViewOriginalVideo(e.interactive)&&(0,G.jsxs)(`div`,{className:`mb-1 me-3 clamp-1`,children:[(0,G.jsx)(C,{phrase:`viewOriginal`}),`\xA0`,(0,G.jsx)(y,{appLink:s,className:`text-info`,children:o})]})]})})})}function Y(e){let[t,n]=W.useState(!0),r=h.isVideoTypeArchived(e.interactive),a=W.useMemo(()=>O(),[]),{hasPermissions:o}=b();function s(e){n(!e)}return(0,G.jsxs)(`div`,{className:`px-3`,children:[r&&(0,G.jsx)(L,{typeId:e.interactive.typeId,hasStudentExperience:!0}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(x,{config:e.config,video:e.interactive,currentUser:e.currentUser,shareLink:e.shareLink,viewKey:e.viewKey,startTime:e.startTime,presentationSlug:null,context:e.queryParams?.context,contextId:e.queryParams?.contextId,playNext:e.queryParams?.playNext,mode:`default`,relatedVideos:e.relatedVideos?.videos,onShowSummary:s,summaryPortalNode:a,token:e.token,collectAnonResults:e.collectAnonResults})}),(0,G.jsx)(`div`,{children:t&&(0,G.jsx)(J,{interactive:e.interactive,location:F.PlayPage,commonVideoProps:e.commonVideoProps,shareId:e.shareLink?.id})}),(0,G.jsx)(D,{node:a}),!o(i.StudentExperience)&&(0,G.jsx)(R,{presentationSlug:null,currentVideo:e.interactive,currentUser:e.currentUser,relatedVideos:e.relatedVideos,audiences:e.audiences,getVideoAppLink:(t,n)=>T.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareLink?.id,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]})}var X=a.encloseNamespace(`interactives.previewInteractive`);function Z(e){return(0,G.jsxs)(`div`,{className:`alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center`,role:`alert`,children:[e.isArchived?(0,G.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,G.jsx)(r,{svg:I,size:t.Standard,className:`me-2 svg-container`}),(0,G.jsxs)(`div`,{className:`w-100`,children:[(0,G.jsx)(`p`,{className:`fw-semibold mb-0`,children:X(`archivedInfoTitle`)}),(0,G.jsx)(`p`,{className:`mb-1`,children:X(`archivedInfo`)})]})]}):(0,G.jsx)(C,{phrase:`alert`}),e.isPreviewPreventScrubbingEnabled&&(0,G.jsx)(n,{title:X(`previewPreventScrubbingExplain`),trigger:[`hover`,`focus`],spanHack:!0,children:(0,G.jsxs)(`div`,{className:`d-flex mt-1 mt-lg-0`,children:[(0,G.jsx)(`div`,{className:`me-2`,children:(0,G.jsx)(C,{phrase:`previewPreventScrubbing`})}),(0,G.jsx)(E,{on:e.isPreviewingPreventScrubbing,onClick:e.toggleStudentMode})]})})]})}function Q(e,t){W.useEffect(()=>{t()},[e])}var $=`interactives.previewInteractive`,ee=a.encloseNamespace($);function te(e){let t=k(),[n,r]=W.useState(!1),{canConsume:i}=h.getCanBeConsumed(e.interactive);Q(n,a);function a(){t.playerRef?.current?.togglePreviewPreventScrubbing?.()}function s(){r(!n)}let c=e.interactives?.filter(t=>t.id.toString()!==e.interactive.id.toString());return(0,G.jsx)(w.Provider,{value:$,children:(0,G.jsxs)(`div`,{className:`px-4`,children:[!!e.breadcrumbs?.length&&(0,G.jsx)(`div`,{className:`mb-2`,children:(0,G.jsx)(N,{breadcrumbs:e.breadcrumbs})}),(0,G.jsx)(V,{restrictions:e.interactive._restrictions,yearGroups:e.commonVideoProps.yearGroups,objectId:e.interactive.id,objectTypeId:m.Interactive,canManageVideoAccess:e.canManageVideoAccess}),(0,G.jsx)(Z,{isPreviewPreventScrubbingEnabled:e.isPreviewPreventScrubbingEnabled,isPreviewingPreventScrubbing:n,toggleStudentMode:s,isArchived:h.isVideoTypeArchived(e.interactive)}),(0,G.jsx)(`div`,{className:`mb-3`,children:i&&(0,G.jsx)(j,{objectId:e.interactive.id,objectTypeId:e.interactive.typeId,shareId:e.shareId,startTime:e.queryParams.t??e.queryParams.startTime,context:e.queryParams?.context,contextId:e.queryParams?.contextId,playNext:e.queryParams?.playNext,mode:`default`,location:`play-page`,token:e.token},e.interactive.id)}),(0,G.jsx)(J,{interactive:e.interactive,location:F.PlayPage,shareId:e.shareId,commonVideoProps:e.commonVideoProps}),e.interactive.description&&(0,G.jsx)(H,{lines:5,children:()=>(0,G.jsx)(`p`,{className:`mb-0 d-inline`,children:e.interactive.description})}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(D,{node:t.questionListPortalNode})}),!!c?.length&&(0,G.jsx)(`div`,{className:`pb-3`,children:(0,G.jsx)(f,{name:ee(`otherInteractives`,{count:c.length}),contents:d.Interactives,collection:c,prefetched:!0,getChildAppLink:e=>({application:l.INTERACTIVES,action:_.Interactives.VIEW_INTERACTIVE,args:[e.id,o.slugify(e.name)]}),childComponent:B,extraChildComponentProps:{questionsAppLink:{application:l.INTERACTIVES,action:_.Interactives.PREVIEW_QUESTIONS},commonVideoProps:e.commonVideoProps},analyticsData:{widgetId:`interactives`}})}),!h.isUgc(e.interactive)&&(0,G.jsx)(z,{media:e.interactive,parentVideo:e.interactive._parentClip||e.interactive._parentVideo,contentRegion:e.currentUser.contentRegion,shareId:e.shareId,presentationSlug:null}),(0,G.jsx)(R,{presentationSlug:null,currentVideo:e.interactive,currentUser:e.currentUser,audiences:e.audiences,relatedVideos:e.relatedVideos,getVideoAppLink:(t,n)=>T.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareId,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]})})}export{Y as n,U as r,te as t};
2
- //# sourceMappingURL=CTpJ4vP62.chunk.js.map
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{n as t,r as n,t as r}from"./CvE4SVf2.chunk.js";import{n as i}from"./B785hxeE.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{d as u}from"./CEamUdnf.chunk.js";import{i as d,t as f}from"./DxTLIRiK2.chunk.js";import{t as p}from"./BDwjs8qz2.chunk.js";import{t as m}from"./CVHQXNzi2.chunk.js";import{t as h}from"./quMwO3lt2.chunk.js";import{t as g}from"./Bjt_-lTs.chunk.js";import{t as _}from"./CVtvY0gg.chunk.js";import{t as v}from"./QCFxJYkI2.chunk.js";import{t as y}from"./B8AENY2U.chunk.js";import{t as b}from"./BKSSWxpx2.chunk.js";import{t as x}from"./B-V5u42C2.chunk.js";import{t as S}from"./ClCnzU6R2.chunk.js";import{n as C,t as w}from"./CpFtf-tI2.chunk.js";import{t as T}from"./C9JLrtps2.chunk.js";import{t as E}from"./DX2KH4av2.chunk.js";import{n as D,r as O}from"./BGswYbRT.chunk.js";import{n as k}from"./DAcNgjTQ.chunk.js";import{t as A}from"./BqbRZ5hB.chunk.js";import{l as j,o as M}from"./BcrXhug9.chunk.js";import{t as N}from"./BTFvVc1Z.chunk.js";import{n as P,t as F}from"./DLpjTXb22.chunk.js";import{t as I}from"./pP_cpHCu2.chunk.js";import{a as L,i as R,n as z,r as B,t as V}from"./C1SMWeap2.chunk.js";import{t as H}from"./7I0L5W4N2.chunk.js";function U(e){let{hasPermissions:t}=b(),{hasProduct:n}=S(),r=u(g.currentUser());return!t(i.StudentExperience)&&n(v.Primary)&&r.data.isAuthenticated&&(!e||e.version===`v1`)}var W=e(s(),1),G=c(),K=`interactives.interactiveTitleAndActions`;function q(e){let t,n;return e._parentClip?(t=e._parentClip.name,n={application:l.CLIPS,action:_.Clips.PLAY_CLIP,args:[e._parentClip.id,o.slugify(e._parentClip.name)]}):(t=e._parentVideo.name,n={application:l.VIDEOS,action:_.Videos.PLAY_VIDEO,args:[null,e._parentVideo.id,o.slugify(e._parentVideo.name)]}),[t,n]}function J(e){let{hasPermissions:t}=b(),n=P({location:e.location,shareId:e.shareId,presentationSlug:null}),r=t(i.StudentExperience),a=e.interactive.status===p.Draft,[o,s]=q(e.interactive);return(0,G.jsx)(w.Provider,{value:K,children:(0,G.jsx)(`div`,{className:`d-flex justify-content-between align-items-center`,children:(0,G.jsxs)(`div`,{className:`inline-block w-100`,children:[(0,G.jsx)(`div`,{className:`ms-2 float-end`,children:!r&&(0,G.jsx)(A,{actions:n.getVideoActions(e.interactive),actionsDropdownClassName:`btn btn-outline-dark`,fetchMore:()=>n.fetchMoreActions(e.interactive)})}),(0,G.jsxs)(`h1`,{className:`h3 mb-2`,children:[a&&(0,G.jsx)(`div`,{className:`badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base`,children:(0,G.jsx)(C,{phrase:`draft`})}),e.interactive.name,!r&&(0,G.jsx)(M,{tooltipPlacement:`right`,className:`ps-1 d-inline-block`,video:e.interactive,yearGroups:e.commonVideoProps.yearGroups})]}),h.canViewOriginalVideo(e.interactive)&&(0,G.jsxs)(`div`,{className:`mb-1 me-3 clamp-1`,children:[(0,G.jsx)(C,{phrase:`viewOriginal`}),`\xA0`,(0,G.jsx)(y,{appLink:s,className:`text-info`,children:o})]})]})})})}function Y(e){let[t,n]=W.useState(!0),r=h.isVideoTypeArchived(e.interactive),a=W.useMemo(()=>O(),[]),{hasPermissions:o}=b();function s(e){n(!e)}return(0,G.jsxs)(`div`,{className:`px-3`,children:[r&&(0,G.jsx)(L,{typeId:e.interactive.typeId,hasStudentExperience:!0}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(x,{config:e.config,video:e.interactive,currentUser:e.currentUser,shareLink:e.shareLink,viewKey:e.viewKey,startTime:e.startTime,presentationSlug:null,context:e.queryParams?.context,contextId:e.queryParams?.contextId,playNext:e.queryParams?.playNext,mode:`default`,relatedVideos:e.relatedVideos?.videos,onShowSummary:s,summaryPortalNode:a,token:e.token,collectAnonResults:e.collectAnonResults})}),(0,G.jsx)(`div`,{children:t&&(0,G.jsx)(J,{interactive:e.interactive,location:F.PlayPage,commonVideoProps:e.commonVideoProps,shareId:e.shareLink?.id})}),(0,G.jsx)(D,{node:a}),!o(i.StudentExperience)&&(0,G.jsx)(R,{presentationSlug:null,currentVideo:e.interactive,currentUser:e.currentUser,relatedVideos:e.relatedVideos,audiences:e.audiences,getVideoAppLink:(t,n)=>T.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareLink?.id,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]})}var X=a.encloseNamespace(`interactives.previewInteractive`);function Z(e){return(0,G.jsxs)(`div`,{className:`alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center`,role:`alert`,children:[e.isArchived?(0,G.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,G.jsx)(r,{svg:I,size:t.Standard,className:`me-2 svg-container`}),(0,G.jsxs)(`div`,{className:`w-100`,children:[(0,G.jsx)(`p`,{className:`fw-semibold mb-0`,children:X(`archivedInfoTitle`)}),(0,G.jsx)(`p`,{className:`mb-1`,children:X(`archivedInfo`)})]})]}):(0,G.jsx)(C,{phrase:`alert`}),e.isPreviewPreventScrubbingEnabled&&(0,G.jsx)(n,{title:X(`previewPreventScrubbingExplain`),trigger:[`hover`,`focus`],spanHack:!0,children:(0,G.jsxs)(`div`,{className:`d-flex mt-1 mt-lg-0`,children:[(0,G.jsx)(`div`,{className:`me-2`,children:(0,G.jsx)(C,{phrase:`previewPreventScrubbing`})}),(0,G.jsx)(E,{on:e.isPreviewingPreventScrubbing,onClick:e.toggleStudentMode})]})})]})}function Q(e,t){W.useEffect(()=>{t()},[e])}var $=`interactives.previewInteractive`,ee=a.encloseNamespace($);function te(e){let t=k(),[n,r]=W.useState(!1),{canConsume:i}=h.getCanBeConsumed(e.interactive);Q(n,a);function a(){t.playerRef?.current?.togglePreviewPreventScrubbing?.()}function s(){r(!n)}let c=e.interactives?.filter(t=>t.id.toString()!==e.interactive.id.toString());return(0,G.jsx)(w.Provider,{value:$,children:(0,G.jsxs)(`div`,{className:`px-4`,children:[!!e.breadcrumbs?.length&&(0,G.jsx)(`div`,{className:`mb-2`,children:(0,G.jsx)(N,{breadcrumbs:e.breadcrumbs})}),(0,G.jsx)(V,{restrictions:e.interactive._restrictions,yearGroups:e.commonVideoProps.yearGroups,objectId:e.interactive.id,objectTypeId:m.Interactive,canManageVideoAccess:e.canManageVideoAccess}),(0,G.jsx)(Z,{isPreviewPreventScrubbingEnabled:e.isPreviewPreventScrubbingEnabled,isPreviewingPreventScrubbing:n,toggleStudentMode:s,isArchived:h.isVideoTypeArchived(e.interactive)}),(0,G.jsx)(`div`,{className:`mb-3`,children:i&&(0,G.jsx)(j,{objectId:e.interactive.id,objectTypeId:e.interactive.typeId,shareId:e.shareId,startTime:e.queryParams.t??e.queryParams.startTime,context:e.queryParams?.context,contextId:e.queryParams?.contextId,playNext:e.queryParams?.playNext,mode:`default`,location:`play-page`,token:e.token},e.interactive.id)}),(0,G.jsx)(J,{interactive:e.interactive,location:F.PlayPage,shareId:e.shareId,commonVideoProps:e.commonVideoProps}),e.interactive.description&&(0,G.jsx)(H,{lines:5,children:()=>(0,G.jsx)(`p`,{className:`mb-0 d-inline`,children:e.interactive.description})}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(D,{node:t.questionListPortalNode})}),!!c?.length&&(0,G.jsx)(`div`,{className:`pb-3`,children:(0,G.jsx)(f,{name:ee(`otherInteractives`,{count:c.length}),contents:d.Interactives,collection:c,prefetched:!0,getChildAppLink:e=>({application:l.INTERACTIVES,action:_.Interactives.VIEW_INTERACTIVE,args:[e.id,o.slugify(e.name)]}),childComponent:B,extraChildComponentProps:{questionsAppLink:{application:l.INTERACTIVES,action:_.Interactives.PREVIEW_QUESTIONS},commonVideoProps:e.commonVideoProps},analyticsData:{widgetId:`interactives`}})}),!h.isUgc(e.interactive)&&(0,G.jsx)(z,{media:e.interactive,parentVideo:e.interactive._parentClip||e.interactive._parentVideo,contentRegion:e.currentUser.contentRegion,shareId:e.shareId,presentationSlug:null}),(0,G.jsx)(R,{presentationSlug:null,currentVideo:e.interactive,currentUser:e.currentUser,audiences:e.audiences,relatedVideos:e.relatedVideos,getVideoAppLink:(t,n)=>T.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareId,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]})})}export{Y as n,U as r,te as t};
2
+ //# sourceMappingURL=DT8lKxmy2.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CTpJ4vP62.chunk.js","names":[],"sources":["../../src/shared/hooks/useShouldPreviewInteractive.ts","../../src/apps/interactives/components/interactive-title-and-actions/InteractiveTitleAndActions.tsx","../../src/apps/interactives/components/play-interactive/PlayInteractive.tsx","../../src/apps/interactives/components/preview-interactive/InteractiveAlertBanner.tsx","../../src/apps/interactives/hooks/interactiveHooks.tsx","../../src/apps/interactives/components/preview-interactive/PreviewInteractive.tsx"],"sourcesContent":["import { Flight } from 'libs/common/flight';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useProducts } from 'libs/shared/hooks/UseProducts';\nimport { CurrentUser, UnionShareObject } from 'libs/shared/interfaces';\n\nexport function useShouldPreviewInteractive(shareLink?: UnionShareObject) {\n const { hasPermissions } = usePermissions();\n const { hasProduct } = useProducts();\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n return !hasPermissions(PermissionName.StudentExperience) &&\n hasProduct(ProductId.Primary) &&\n currentUser.data.isAuthenticated &&\n (!shareLink || shareLink.version === 'v1'); // Previewing shares is not supported for Share 2.0 links\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Actions as ActionsComponent } from 'libs/shared/components/actions/Actions';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\nimport { RestrictionPadlock } from 'libs/shared/components/video-list/components/restriction-padlock/RestrictionPadlock';\nimport { CurationStatus } from 'libs/shared/enums/CurationStatus';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { InteractiveMetadata } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\n\nconst namespace = 'interactives.interactiveTitleAndActions';\n\nfunction getBackToData(interactive: InteractiveMetadata): [name: string, appLink: Core.AppLink] {\n let name: string;\n let appLink: Core.AppLink;\n \n if (interactive._parentClip) {\n name = interactive._parentClip.name;\n appLink = {\n application: AppChannels.CLIPS,\n action: Actions.Clips.PLAY_CLIP,\n args: [ interactive._parentClip.id, TextHelper.slugify(interactive._parentClip.name) ]\n };\n } else {\n name = interactive._parentVideo.name;\n appLink = {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [\n null,\n interactive._parentVideo.id,\n TextHelper.slugify(interactive._parentVideo.name)\n ]\n };\n }\n\n return [ name, appLink ];\n}\n\ninterface InteractiveTitleAndActionsProps {\n interactive: InteractiveMetadata;\n location: VideoActionsLocation;\n shareId?: string;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function InteractiveTitleAndActions(props: InteractiveTitleAndActionsProps): JSX.Element {\n const { hasPermissions } = usePermissions();\n const videoActions = useVideoActions({\n location: props.location,\n shareId: props.shareId,\n presentationSlug: null\n });\n\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n const isDraft = props.interactive.status === CurationStatus.Draft;\n const [ backToName, backToAppLink ] = getBackToData(props.interactive);\n \n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='d-flex justify-content-between align-items-center'>\n <div className='inline-block w-100'>\n <div className='ms-2 float-end'>\n {!hasStudentExperience &&\n <ActionsComponent\n actions={videoActions.getVideoActions(props.interactive)}\n actionsDropdownClassName='btn btn-outline-dark'\n fetchMore={() => videoActions.fetchMoreActions(props.interactive)}\n />\n }\n </div>\n\n <h1 className='h3 mb-2'>\n {isDraft && (\n <div className='badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base'>\n <Text phrase='draft' />\n </div>\n )}\n {props.interactive.name}\n {!hasStudentExperience && (\n <RestrictionPadlock\n tooltipPlacement='right'\n className='ps-1 d-inline-block'\n video={props.interactive}\n yearGroups={props.commonVideoProps.yearGroups}\n />\n )}\n </h1>\n {VideoHelper.canViewOriginalVideo(props.interactive) &&\n <div className='mb-1 me-3 clamp-1'>\n <Text phrase='viewOriginal' />&nbsp;<AppLink appLink={backToAppLink} className='text-info'>{backToName}</AppLink>\n </div>\n }\n </div>\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n","import React from 'react';\nimport { createHtmlPortalNode, OutPortal } from 'react-reverse-portal';\n\nimport { CheckMarkStatus } from 'libs/shared/components/check-mark-button/CheckMarkButton';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Config, CurrentUser, InteractiveMetadata, PlayerViewKey, PresentationAudience, UnionShareObject, YearGroup } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { ArchivedBanner } from 'shared/components/play-page/ArchivedBanner';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { LitePlayerView } from 'shared/views/lite-player/LitePlayerView';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\ninterface PlayInteractiveProps {\n interactive: InteractiveMetadata;\n yearGroups: YearGroup[];\n currentUser: CurrentUser;\n token: AuthToken;\n config: Config;\n audiences: PresentationAudience[];\n queryParams: PlayViewQueryParams;\n viewKey: PlayerViewKey;\n startTime?: string;\n endTime?: string;\n relatedVideos: RelatedVideosHash;\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareLink?: UnionShareObject;\n sharerInstanceRegion?: string;\n checkMarkStatus?: CheckMarkStatus;\n collectAnonResults?: boolean;\n\n publicName?: string;\n profileId?: string;\n}\n\nexport function PlayInteractive(props: PlayInteractiveProps): JSX.Element {\n const [ showHeading, setShowHeading ] = React.useState(true);\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.interactive);\n\n const summaryPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n\n const { hasPermissions } = usePermissions();\n\n function onShowSummary(showing: boolean): void {\n setShowHeading(!showing);\n }\n\n return (\n <div className='px-3'>\n {isArchived && <ArchivedBanner typeId={props.interactive.typeId} hasStudentExperience />}\n\n <div className='mb-3'>\n <LitePlayerView\n config={props.config}\n video={props.interactive}\n currentUser={props.currentUser}\n shareLink={props.shareLink}\n viewKey={props.viewKey}\n startTime={props.startTime}\n presentationSlug={null}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n relatedVideos={props.relatedVideos?.videos}\n onShowSummary={onShowSummary}\n summaryPortalNode={summaryPortalNode}\n token={props.token}\n collectAnonResults={props.collectAnonResults}\n />\n </div>\n\n {/* This wrapping div is here because react seems to not want to play nice\n with adding or removing a node just ahead of an OutPortal */}\n <div>\n {showHeading && (\n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n commonVideoProps={props.commonVideoProps}\n shareId={props.shareLink?.id}\n />\n )}\n </div>\n \n <OutPortal node={summaryPortalNode}></OutPortal>\n\n {!hasPermissions(PermissionName.StudentExperience) && (\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n relatedVideos={props.relatedVideos}\n audiences={props.audiences}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareLink?.id,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ToggleSwitch } from 'libs/shared/components/toggle-switch/ToggleSwitch';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { ArchiveSvg } from 'libs/shared/images/svg/objects/ArchiveSvg';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface InteractiveAlertBannerProps {\n isPreviewPreventScrubbingEnabled: boolean;\n isPreviewingPreventScrubbing: boolean;\n toggleStudentMode: () => void;\n isArchived: boolean;\n}\n\nexport function InteractiveAlertBanner(props: InteractiveAlertBannerProps): JSX.Element {\n return (\n <div className='alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center' role='alert'>\n {!props.isArchived ? <Text phrase='alert' /> : (\n <div className='d-flex 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')}</p>\n <p className='mb-1'>{getPhrase('archivedInfo')}</p>\n </div>\n </div>\n )}\n {props.isPreviewPreventScrubbingEnabled && (\n <Tooltip\n title={getPhrase('previewPreventScrubbingExplain')}\n trigger={[ 'hover', 'focus' ]}\n spanHack\n >\n <div className='d-flex mt-1 mt-lg-0'>\n <div className='me-2'><Text phrase='previewPreventScrubbing'/></div>\n <ToggleSwitch on={props.isPreviewingPreventScrubbing} onClick={props.toggleStudentMode} />\n </div>\n </Tooltip>\n )}\n </div>\n );\n}\n","import React from 'react';\n\nexport function usePreviewPreventInteractive(\n previewPreventInteractive: boolean,\n togglePreviewPreventInteractive: () => void\n): void {\n React.useEffect(() => {\n togglePreviewPreventInteractive();\n }, [previewPreventInteractive]);\n}\n","import * as React from 'react';\nimport { OutPortal } from 'react-reverse-portal';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { ExpandableText } from 'libs/shared/components/expandable-text/ExpandableText';\nimport { InteractiveWidgetItem } from 'libs/shared/components/play-page/interactives-widget/InteractiveWidgetItem';\nimport { LanguageNamespaceContext } from 'libs/shared/components/text/Text';\nimport { FixedWidget } from 'libs/shared/components/widgets/fixed-widget';\nimport { GlobalPlayerConsumer } from 'libs/shared/context/player-context/components/GlobalPlayerConsumer';\nimport { usePlayerContext } from 'libs/shared/context/player-context/PlayerContext';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { WidgetContents } from 'libs/shared/enums/WidgetContents';\nimport { CurrentUser, Interactive, InteractiveMetadata, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { CitationWidget } from 'shared/components/citations/CitationWidget';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { InteractiveAlertBanner } from 'apps/interactives/components/preview-interactive/InteractiveAlertBanner';\nimport { usePreviewPreventInteractive } from 'apps/interactives/hooks/interactiveHooks';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface PreviewInteractiveProps {\n interactive: InteractiveMetadata;\n interactives: InteractiveMetadata[];\n token?: AuthToken;\n currentUser: CurrentUser;\n queryParams: PlayViewQueryParams;\n audiences: PresentationAudience[];\n isPreviewPreventScrubbingEnabled: boolean;\n relatedVideos: RelatedVideosHash;\n canManageVideoAccess: boolean;\n breadcrumbs?: Breadcrumb[];\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareId?: string;\n}\n\nexport function PreviewInteractive(props: PreviewInteractiveProps): JSX.Element {\n const playerContext = usePlayerContext();\n\n const [ isPreviewingPreventScrubbing, setIsPreviewingPreventScrubbing ] = React.useState(false);\n\n const { canConsume } = VideoHelper.getCanBeConsumed(props.interactive);\n\n usePreviewPreventInteractive(isPreviewingPreventScrubbing, togglePreviewPreventScrubbing);\n\n function togglePreviewPreventScrubbing() {\n playerContext.playerRef?.current?.togglePreviewPreventScrubbing?.();\n }\n\n function toggleStudentMode() {\n setIsPreviewingPreventScrubbing(!isPreviewingPreventScrubbing);\n }\n \n const otherInteractives: InteractiveMetadata[] = props.interactives?.filter(i => {\n return i.id.toString() !== props.interactive.id.toString();\n });\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='px-4'>\n {!!props.breadcrumbs?.length &&\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n }\n\n <RestrictionBanner\n restrictions={props.interactive._restrictions}\n yearGroups={props.commonVideoProps.yearGroups}\n objectId={props.interactive.id}\n objectTypeId={MasterType.Interactive}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n\n <InteractiveAlertBanner\n isPreviewPreventScrubbingEnabled={props.isPreviewPreventScrubbingEnabled}\n isPreviewingPreventScrubbing={isPreviewingPreventScrubbing}\n toggleStudentMode={toggleStudentMode}\n isArchived={VideoHelper.isVideoTypeArchived(props.interactive)}\n />\n\n <div className='mb-3'>\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.interactive.id}\n objectId={props.interactive.id}\n objectTypeId={props.interactive.typeId}\n shareId={props.shareId}\n startTime={props.queryParams.t ?? props.queryParams.startTime}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n location='play-page'\n token={props.token}\n />\n )}\n </div>\n \n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n shareId={props.shareId}\n commonVideoProps={props.commonVideoProps}\n />\n\n {props.interactive.description && (\n <ExpandableText lines={5}>\n {() => <p className='mb-0 d-inline'>{props.interactive.description}</p>}\n </ExpandableText>\n )}\n\n <div className='mb-3'>\n <OutPortal node={playerContext.questionListPortalNode}></OutPortal>\n </div>\n\n {!!otherInteractives?.length && (\n <div className='pb-3'>\n \n <FixedWidget\n name={getPhrase('otherInteractives', { count: otherInteractives.length })}\n contents={WidgetContents.Interactives}\n collection={otherInteractives}\n prefetched\n getChildAppLink={(interactive: Interactive) => {\n return {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.VIEW_INTERACTIVE,\n args: [ interactive.id, TextHelper.slugify(interactive.name) ]\n };\n }}\n childComponent={InteractiveWidgetItem}\n extraChildComponentProps={{\n questionsAppLink: {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.PREVIEW_QUESTIONS\n },\n commonVideoProps: props.commonVideoProps\n }}\n analyticsData={{ widgetId: 'interactives' }}\n />\n </div>\n )}\n\n {!VideoHelper.isUgc(props.interactive) && (\n <CitationWidget\n media={props.interactive}\n parentVideo={props.interactive._parentClip || props.interactive._parentVideo}\n contentRegion={props.currentUser.contentRegion}\n shareId={props.shareId}\n presentationSlug={null}\n />\n )}\n\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n audiences={props.audiences}\n relatedVideos={props.relatedVideos}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n"],"mappings":"41CASA,SAAgB,EAA4B,EAA8B,CACxE,GAAM,CAAE,kBAAmB,EAAe,EACpC,CAAE,cAAe,EAAY,EAC7B,EAAc,EAAkC,EAAa,YAAY,CAAC,EAEhF,MAAO,CAAC,EAAe,EAAe,iBAAiB,GACrD,EAAW,EAAU,OAAO,GAC5B,EAAY,KAAK,kBAChB,CAAC,GAAa,EAAU,UAAY,KACzC,sBCEM,EAAY,0CAElB,SAAS,EAAc,EAAyE,CAC9F,IAAI,EACA,EAsBJ,OApBI,EAAY,aACd,EAAO,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,GACA,gBAAkB,IACT,CACL,YAAa,EAAY,aACzB,OAAQ,EAAQ,aAAa,iBAC7B,KAAM,CAAE,EAAY,GAAI,EAAW,QAAQ,EAAY,IAAI,CAAE,CAC/D,GAEF,eAAgB,EAChB,yBAA0B,CACxB,iBAAkB,CAChB,YAAa,EAAY,aACzB,OAAQ,EAAQ,aAAa,iBAC/B,EACA,iBAAkB,EAAM,gBAC1B,EACA,cAAe,CAAE,SAAU,cAAe,CAC3C,CAAA,CACE,CAAA,EAGN,CAAC,EAAY,MAAM,EAAM,WAAW,IACnC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,MAAO,EAAM,YACb,YAAa,EAAM,YAAY,aAAe,EAAM,YAAY,aAChE,cAAe,EAAM,YAAY,cACjC,QAAS,EAAM,QACf,iBAAkB,IACnB,CAAA,GAGH,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,iBAAkB,KAClB,aAAc,EAAM,YACpB,YAAa,EAAM,YACnB,UAAW,EAAM,UACjB,cAAe,EAAM,cACrB,iBAAkB,EAAG,IAAS,EAAmB,WAAW,EAAG,CAC7D,GAAG,EACH,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACP,YAAa,EAAM,YAAY,IAC/B,iBAAkB,EAAM,gBACzB,CAAA,CACE,GAC4B,CAAA,CAEvC"}
1
+ {"version":3,"file":"DT8lKxmy2.chunk.js","names":[],"sources":["../../src/shared/hooks/useShouldPreviewInteractive.ts","../../src/apps/interactives/components/interactive-title-and-actions/InteractiveTitleAndActions.tsx","../../src/apps/interactives/components/play-interactive/PlayInteractive.tsx","../../src/apps/interactives/components/preview-interactive/InteractiveAlertBanner.tsx","../../src/apps/interactives/hooks/interactiveHooks.tsx","../../src/apps/interactives/components/preview-interactive/PreviewInteractive.tsx"],"sourcesContent":["import { Flight } from 'libs/common/flight';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useProducts } from 'libs/shared/hooks/UseProducts';\nimport { CurrentUser, UnionShareObject } from 'libs/shared/interfaces';\n\nexport function useShouldPreviewInteractive(shareLink?: UnionShareObject) {\n const { hasPermissions } = usePermissions();\n const { hasProduct } = useProducts();\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n return !hasPermissions(PermissionName.StudentExperience) &&\n hasProduct(ProductId.Primary) &&\n currentUser.data.isAuthenticated &&\n (!shareLink || shareLink.version === 'v1'); // Previewing shares is not supported for Share 2.0 links\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Actions as ActionsComponent } from 'libs/shared/components/actions/Actions';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\nimport { RestrictionPadlock } from 'libs/shared/components/video-list/components/restriction-padlock/RestrictionPadlock';\nimport { CurationStatus } from 'libs/shared/enums/CurationStatus';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { InteractiveMetadata } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\n\nconst namespace = 'interactives.interactiveTitleAndActions';\n\nfunction getBackToData(interactive: InteractiveMetadata): [name: string, appLink: Core.AppLink] {\n let name: string;\n let appLink: Core.AppLink;\n \n if (interactive._parentClip) {\n name = interactive._parentClip.name;\n appLink = {\n application: AppChannels.CLIPS,\n action: Actions.Clips.PLAY_CLIP,\n args: [ interactive._parentClip.id, TextHelper.slugify(interactive._parentClip.name) ]\n };\n } else {\n name = interactive._parentVideo.name;\n appLink = {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [\n null,\n interactive._parentVideo.id,\n TextHelper.slugify(interactive._parentVideo.name)\n ]\n };\n }\n\n return [ name, appLink ];\n}\n\ninterface InteractiveTitleAndActionsProps {\n interactive: InteractiveMetadata;\n location: VideoActionsLocation;\n shareId?: string;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function InteractiveTitleAndActions(props: InteractiveTitleAndActionsProps): JSX.Element {\n const { hasPermissions } = usePermissions();\n const videoActions = useVideoActions({\n location: props.location,\n shareId: props.shareId,\n presentationSlug: null\n });\n\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n const isDraft = props.interactive.status === CurationStatus.Draft;\n const [ backToName, backToAppLink ] = getBackToData(props.interactive);\n \n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='d-flex justify-content-between align-items-center'>\n <div className='inline-block w-100'>\n <div className='ms-2 float-end'>\n {!hasStudentExperience &&\n <ActionsComponent\n actions={videoActions.getVideoActions(props.interactive)}\n actionsDropdownClassName='btn btn-outline-dark'\n fetchMore={() => videoActions.fetchMoreActions(props.interactive)}\n />\n }\n </div>\n\n <h1 className='h3 mb-2'>\n {isDraft && (\n <div className='badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base'>\n <Text phrase='draft' />\n </div>\n )}\n {props.interactive.name}\n {!hasStudentExperience && (\n <RestrictionPadlock\n tooltipPlacement='right'\n className='ps-1 d-inline-block'\n video={props.interactive}\n yearGroups={props.commonVideoProps.yearGroups}\n />\n )}\n </h1>\n {VideoHelper.canViewOriginalVideo(props.interactive) &&\n <div className='mb-1 me-3 clamp-1'>\n <Text phrase='viewOriginal' />&nbsp;<AppLink appLink={backToAppLink} className='text-info'>{backToName}</AppLink>\n </div>\n }\n </div>\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n","import React from 'react';\nimport { createHtmlPortalNode, OutPortal } from 'react-reverse-portal';\n\nimport { CheckMarkStatus } from 'libs/shared/components/check-mark-button/CheckMarkButton';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Config, CurrentUser, InteractiveMetadata, PlayerViewKey, PresentationAudience, UnionShareObject, YearGroup } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { ArchivedBanner } from 'shared/components/play-page/ArchivedBanner';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { LitePlayerView } from 'shared/views/lite-player/LitePlayerView';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\ninterface PlayInteractiveProps {\n interactive: InteractiveMetadata;\n yearGroups: YearGroup[];\n currentUser: CurrentUser;\n token: AuthToken;\n config: Config;\n audiences: PresentationAudience[];\n queryParams: PlayViewQueryParams;\n viewKey: PlayerViewKey;\n startTime?: string;\n endTime?: string;\n relatedVideos: RelatedVideosHash;\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareLink?: UnionShareObject;\n sharerInstanceRegion?: string;\n checkMarkStatus?: CheckMarkStatus;\n collectAnonResults?: boolean;\n\n publicName?: string;\n profileId?: string;\n}\n\nexport function PlayInteractive(props: PlayInteractiveProps): JSX.Element {\n const [ showHeading, setShowHeading ] = React.useState(true);\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.interactive);\n\n const summaryPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n\n const { hasPermissions } = usePermissions();\n\n function onShowSummary(showing: boolean): void {\n setShowHeading(!showing);\n }\n\n return (\n <div className='px-3'>\n {isArchived && <ArchivedBanner typeId={props.interactive.typeId} hasStudentExperience />}\n\n <div className='mb-3'>\n <LitePlayerView\n config={props.config}\n video={props.interactive}\n currentUser={props.currentUser}\n shareLink={props.shareLink}\n viewKey={props.viewKey}\n startTime={props.startTime}\n presentationSlug={null}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n relatedVideos={props.relatedVideos?.videos}\n onShowSummary={onShowSummary}\n summaryPortalNode={summaryPortalNode}\n token={props.token}\n collectAnonResults={props.collectAnonResults}\n />\n </div>\n\n {/* This wrapping div is here because react seems to not want to play nice\n with adding or removing a node just ahead of an OutPortal */}\n <div>\n {showHeading && (\n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n commonVideoProps={props.commonVideoProps}\n shareId={props.shareLink?.id}\n />\n )}\n </div>\n \n <OutPortal node={summaryPortalNode}></OutPortal>\n\n {!hasPermissions(PermissionName.StudentExperience) && (\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n relatedVideos={props.relatedVideos}\n audiences={props.audiences}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareLink?.id,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ToggleSwitch } from 'libs/shared/components/toggle-switch/ToggleSwitch';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { ArchiveSvg } from 'libs/shared/images/svg/objects/ArchiveSvg';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface InteractiveAlertBannerProps {\n isPreviewPreventScrubbingEnabled: boolean;\n isPreviewingPreventScrubbing: boolean;\n toggleStudentMode: () => void;\n isArchived: boolean;\n}\n\nexport function InteractiveAlertBanner(props: InteractiveAlertBannerProps): JSX.Element {\n return (\n <div className='alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center' role='alert'>\n {!props.isArchived ? <Text phrase='alert' /> : (\n <div className='d-flex 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')}</p>\n <p className='mb-1'>{getPhrase('archivedInfo')}</p>\n </div>\n </div>\n )}\n {props.isPreviewPreventScrubbingEnabled && (\n <Tooltip\n title={getPhrase('previewPreventScrubbingExplain')}\n trigger={[ 'hover', 'focus' ]}\n spanHack\n >\n <div className='d-flex mt-1 mt-lg-0'>\n <div className='me-2'><Text phrase='previewPreventScrubbing'/></div>\n <ToggleSwitch on={props.isPreviewingPreventScrubbing} onClick={props.toggleStudentMode} />\n </div>\n </Tooltip>\n )}\n </div>\n );\n}\n","import React from 'react';\n\nexport function usePreviewPreventInteractive(\n previewPreventInteractive: boolean,\n togglePreviewPreventInteractive: () => void\n): void {\n React.useEffect(() => {\n togglePreviewPreventInteractive();\n }, [previewPreventInteractive]);\n}\n","import * as React from 'react';\nimport { OutPortal } from 'react-reverse-portal';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { ExpandableText } from 'libs/shared/components/expandable-text/ExpandableText';\nimport { InteractiveWidgetItem } from 'libs/shared/components/play-page/interactives-widget/InteractiveWidgetItem';\nimport { LanguageNamespaceContext } from 'libs/shared/components/text/Text';\nimport { FixedWidget } from 'libs/shared/components/widgets/fixed-widget';\nimport { GlobalPlayerConsumer } from 'libs/shared/context/player-context/components/GlobalPlayerConsumer';\nimport { usePlayerContext } from 'libs/shared/context/player-context/PlayerContext';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { WidgetContents } from 'libs/shared/enums/WidgetContents';\nimport { CurrentUser, Interactive, InteractiveMetadata, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { CitationWidget } from 'shared/components/citations/CitationWidget';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { InteractiveAlertBanner } from 'apps/interactives/components/preview-interactive/InteractiveAlertBanner';\nimport { usePreviewPreventInteractive } from 'apps/interactives/hooks/interactiveHooks';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface PreviewInteractiveProps {\n interactive: InteractiveMetadata;\n interactives: InteractiveMetadata[];\n token?: AuthToken;\n currentUser: CurrentUser;\n queryParams: PlayViewQueryParams;\n audiences: PresentationAudience[];\n isPreviewPreventScrubbingEnabled: boolean;\n relatedVideos: RelatedVideosHash;\n canManageVideoAccess: boolean;\n breadcrumbs?: Breadcrumb[];\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareId?: string;\n}\n\nexport function PreviewInteractive(props: PreviewInteractiveProps): JSX.Element {\n const playerContext = usePlayerContext();\n\n const [ isPreviewingPreventScrubbing, setIsPreviewingPreventScrubbing ] = React.useState(false);\n\n const { canConsume } = VideoHelper.getCanBeConsumed(props.interactive);\n\n usePreviewPreventInteractive(isPreviewingPreventScrubbing, togglePreviewPreventScrubbing);\n\n function togglePreviewPreventScrubbing() {\n playerContext.playerRef?.current?.togglePreviewPreventScrubbing?.();\n }\n\n function toggleStudentMode() {\n setIsPreviewingPreventScrubbing(!isPreviewingPreventScrubbing);\n }\n \n const otherInteractives: InteractiveMetadata[] = props.interactives?.filter(i => {\n return i.id.toString() !== props.interactive.id.toString();\n });\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='px-4'>\n {!!props.breadcrumbs?.length &&\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n }\n\n <RestrictionBanner\n restrictions={props.interactive._restrictions}\n yearGroups={props.commonVideoProps.yearGroups}\n objectId={props.interactive.id}\n objectTypeId={MasterType.Interactive}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n\n <InteractiveAlertBanner\n isPreviewPreventScrubbingEnabled={props.isPreviewPreventScrubbingEnabled}\n isPreviewingPreventScrubbing={isPreviewingPreventScrubbing}\n toggleStudentMode={toggleStudentMode}\n isArchived={VideoHelper.isVideoTypeArchived(props.interactive)}\n />\n\n <div className='mb-3'>\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.interactive.id}\n objectId={props.interactive.id}\n objectTypeId={props.interactive.typeId}\n shareId={props.shareId}\n startTime={props.queryParams.t ?? props.queryParams.startTime}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n location='play-page'\n token={props.token}\n />\n )}\n </div>\n \n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n shareId={props.shareId}\n commonVideoProps={props.commonVideoProps}\n />\n\n {props.interactive.description && (\n <ExpandableText lines={5}>\n {() => <p className='mb-0 d-inline'>{props.interactive.description}</p>}\n </ExpandableText>\n )}\n\n <div className='mb-3'>\n <OutPortal node={playerContext.questionListPortalNode}></OutPortal>\n </div>\n\n {!!otherInteractives?.length && (\n <div className='pb-3'>\n \n <FixedWidget\n name={getPhrase('otherInteractives', { count: otherInteractives.length })}\n contents={WidgetContents.Interactives}\n collection={otherInteractives}\n prefetched\n getChildAppLink={(interactive: Interactive) => {\n return {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.VIEW_INTERACTIVE,\n args: [ interactive.id, TextHelper.slugify(interactive.name) ]\n };\n }}\n childComponent={InteractiveWidgetItem}\n extraChildComponentProps={{\n questionsAppLink: {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.PREVIEW_QUESTIONS\n },\n commonVideoProps: props.commonVideoProps\n }}\n analyticsData={{ widgetId: 'interactives' }}\n />\n </div>\n )}\n\n {!VideoHelper.isUgc(props.interactive) && (\n <CitationWidget\n media={props.interactive}\n parentVideo={props.interactive._parentClip || props.interactive._parentVideo}\n contentRegion={props.currentUser.contentRegion}\n shareId={props.shareId}\n presentationSlug={null}\n />\n )}\n\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n audiences={props.audiences}\n relatedVideos={props.relatedVideos}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n"],"mappings":"41CASA,SAAgB,EAA4B,EAA8B,CACxE,GAAM,CAAE,kBAAmB,EAAe,EACpC,CAAE,cAAe,EAAY,EAC7B,EAAc,EAAkC,EAAa,YAAY,CAAC,EAEhF,MAAO,CAAC,EAAe,EAAe,iBAAiB,GACrD,EAAW,EAAU,OAAO,GAC5B,EAAY,KAAK,kBAChB,CAAC,GAAa,EAAU,UAAY,KACzC,sBCEM,EAAY,0CAElB,SAAS,EAAc,EAAyE,CAC9F,IAAI,EACA,EAsBJ,OApBI,EAAY,aACd,EAAO,EAAY,YAAY,KAC/B,EAAU,CACR,YAAa,EAAY,MACzB,OAAQ,EAAQ,MAAM,UACtB,KAAM,CAAE,EAAY,YAAY,GAAI,EAAW,QAAQ,EAAY,YAAY,IAAI,CAAE,CACvF,IAEA,EAAO,EAAY,aAAa,KAChC,EAAU,CACR,YAAa,EAAY,OACzB,OAAQ,EAAQ,OAAO,WACvB,KAAM,CACJ,KACA,EAAY,aAAa,GACzB,EAAW,QAAQ,EAAY,aAAa,IAAI,CAClD,CACF,GAGK,CAAE,EAAM,CAAQ,CACzB,CASA,SAAgB,EAA2B,EAAqD,CAC9F,GAAM,CAAE,kBAAmB,EAAe,EACpC,EAAe,EAAgB,CACnC,SAAU,EAAM,SAChB,QAAS,EAAM,QACf,iBAAkB,IACpB,CAAC,EAEK,EAAuB,EAAe,EAAe,iBAAiB,EAEtE,EAAU,EAAM,YAAY,SAAW,EAAe,MACtD,CAAE,EAAY,GAAkB,EAAc,EAAM,WAAW,EAErE,OACE,EAAA,EAAA,IAAA,CAAC,EAAyB,SAA1B,CAAmC,MAAO,YACxC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,8DACb,EAAA,EA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,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACP,YAAa,EAAM,YAAY,IAC/B,iBAAkB,EAAM,gBACzB,CAAA,CACE,GAC4B,CAAA,CAEvC"}
@@ -1,2 +1,2 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{_ as t,y as n}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t as r}from"./CQyJ7YGa.chunk.js";import{t as i}from"./ChzgIDQv.chunk.js";import{t as a}from"./C2w0pmFW.chunk.js";import{t as o}from"./wrLrTezN.chunk.js";import{t as s}from"./BXTI9cmX.chunk.js";import{d as c,r as l,y as u}from"./CEamUdnf.chunk.js";import{U as d,l as f,y as p,z as m}from"./BHvdJc9z.chunk.js";import{t as h}from"./Dn1hp1IN2.chunk.js";import{t as g}from"./BDwjs8qz2.chunk.js";import{t as _}from"./C5kGxy6G.chunk.js";import{t as v}from"./Bjt_-lTs.chunk.js";import{t as y}from"./CVtvY0gg.chunk.js";import{t as b}from"./D_gWf2lC.chunk.js";import{t as x}from"./hQ9iY4r0.chunk.js";import{t as S}from"./Dy8J1lcl.chunk.js";import{n as C,t as w}from"./BWWumAle.chunk.js";import{t as T}from"./Ctbl-14w.chunk.js";import{t as E}from"./BTKyXi9U2.chunk.js";import{t as D}from"./CgW21-1J.chunk.js";import{n as O,r as k}from"./BGswYbRT.chunk.js";import{t as A}from"./C9XBZFiR.chunk.js";import{t as j}from"./CyQQ1zIG.chunk.js";import{t as M}from"./B4aT7OU0.chunk.js";import{ClickViewInteractivePlayer as N,t as P}from"./BfK63iLm2.chunk.js";import{t as F}from"./DJXt6rKd2.chunk.js";var I=e(a(),1),L=`shared.cannotEditPublishedInteractive`,R=class extends i{constructor(){super(r.getPhrase(L,`title`))}get name(){return`CannotEditPublishedInteractiveError`}get heading(){return r.getPhrase(L,`heading`)}get description(){return r.getPhrase(L,`description`)}},z=`shared.cannotEditInteractive`,B=class extends i{constructor(){super(r.getPhrase(z,`title`))}get name(){return`CannnotEditInteractiveError`}get heading(){return r.getPhrase(z,`heading`)}get description(){return r.getPhrase(z,`description`)}},V=e=>{let n=u(),[r,i]=I.useState(!1),[a,o]=I.useState(!1);return I.useEffect(()=>{if(!e||a||r)return;if(e.originType===j.Original){o(!0);return}let s=()=>{t.throw(new B)};i(!0),l(n,_.copyInteractive(e.interactiveId,t=>{let r={originType:j.Original,interactiveId:t.id};l(n,_.updateInteractiveMetadata(e.id,r,()=>o(!0),s))},s))},[e]),a},H=o(),U=r.encloseNamespace(`interactives.editInteractiveView`),W={application:s.INTERACTIVES,action:y.Interactives.EDIT_INTERACTIVE_DETAILS},G={notFound:D,forbidden:{privacy:T}};function K(e){let[r,i]=I.useState(!1),[a,o]=I.useState(!1),s=I.useRef(null),{experimentalInteractiveQuestions:l}=h(null),u=c(b.config()),y=c(v.currentUser()),T=c(!!y.data&&_.interactiveMetadata(e.id));S({title:T.data?U(`pageTitle`,{name:T.data.name}):null});let D=c(V(T.data)?w.createViewKey(T.data.id,C.MasterObject):null),j=c(v.token()),L=I.useMemo(()=>k(),[]),z=I.useMemo(()=>k(),[]),B=I.useRef(null);A(T,G);function K(e){s.current=e,i(!0),B.current=new E({player:e,video:T.data,analyticsLocation:p.EditInteractive})}if(!D.data||!u.data||!T.data||!j.data)return(0,H.jsx)(F,{});if(!a&&(o(!0),T.data.status!==g.Draft))return t.throw(new R),null;let q=M(T.data),J={entity:f.Interactive,location:p.EditInteractive,workflowPhase:d.Start};function Y(){x.logUserAction(q,{actionType:m.Edit,...J}),n.trigger({...W,args:[e.id]})}function X(){x.logUserAction(q,{actionType:m.Publish,...J}),n.trigger({...W,args:[e.id],params:{publish:!0}})}return(0,H.jsxs)(H.Fragment,{children:[!r&&(0,H.jsx)(F,{}),(0,H.jsxs)(`div`,{className:`px-3 ${r?``:`d-none`}`,children:[(0,H.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center mb-3`,children:[(0,H.jsx)(`h1`,{className:`h3 text-truncate mb-0 pb-1`,children:T.data.name}),(0,H.jsx)(`div`,{className:`flex-shrink-0`,children:(0,H.jsx)(O,{node:L})})]}),(0,H.jsx)(N,{viewKey:D.data.viewKey,imageApi:new URL(u.data.imageCdnUrl),playerApi:new URL(u.data.playerApiUrl),hotkeyElQuerySelector:`body`,autoplay:!0,onReady:K,currentUser:y.data,mode:P.Create,actionsPortalNode:L,questionListPortalNode:z,authToken:j.data.value,onClickEditDetails:Y,onClickPublish:X,enableImmersiveReader:!0,experimentalInteractiveQuestions:l,hasAiInteractives:!1}),(0,H.jsx)(O,{node:z})]})]})}export{K as EditInteractiveView};
2
- //# sourceMappingURL=ByLl4bms2.chunk.js.map
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{_ as t,y as n}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t as r}from"./CQyJ7YGa.chunk.js";import{t as i}from"./ChzgIDQv.chunk.js";import{t as a}from"./C2w0pmFW.chunk.js";import{t as o}from"./wrLrTezN.chunk.js";import{t as s}from"./BXTI9cmX.chunk.js";import{d as c,r as l,y as u}from"./CEamUdnf.chunk.js";import{U as d,l as f,y as p,z as m}from"./BHvdJc9z.chunk.js";import{t as h}from"./Dn1hp1IN2.chunk.js";import{t as g}from"./BDwjs8qz2.chunk.js";import{t as _}from"./C5kGxy6G.chunk.js";import{t as v}from"./Bjt_-lTs.chunk.js";import{t as y}from"./CVtvY0gg.chunk.js";import{t as b}from"./D_gWf2lC.chunk.js";import{t as x}from"./hQ9iY4r0.chunk.js";import{t as S}from"./Dy8J1lcl.chunk.js";import{n as C,t as w}from"./BWWumAle.chunk.js";import{t as T}from"./Ctbl-14w.chunk.js";import{t as E}from"./BTKyXi9U2.chunk.js";import{t as D}from"./CgW21-1J.chunk.js";import{n as O,r as k}from"./BGswYbRT.chunk.js";import{t as A}from"./C9XBZFiR.chunk.js";import{t as j}from"./CyQQ1zIG.chunk.js";import{t as M}from"./B4aT7OU0.chunk.js";import{ClickViewInteractivePlayer as N,t as P}from"./BuzAbtqC2.chunk.js";import{t as F}from"./DJXt6rKd2.chunk.js";var I=e(a(),1),L=`shared.cannotEditPublishedInteractive`,R=class extends i{constructor(){super(r.getPhrase(L,`title`))}get name(){return`CannotEditPublishedInteractiveError`}get heading(){return r.getPhrase(L,`heading`)}get description(){return r.getPhrase(L,`description`)}},z=`shared.cannotEditInteractive`,B=class extends i{constructor(){super(r.getPhrase(z,`title`))}get name(){return`CannnotEditInteractiveError`}get heading(){return r.getPhrase(z,`heading`)}get description(){return r.getPhrase(z,`description`)}},V=e=>{let n=u(),[r,i]=I.useState(!1),[a,o]=I.useState(!1);return I.useEffect(()=>{if(!e||a||r)return;if(e.originType===j.Original){o(!0);return}let s=()=>{t.throw(new B)};i(!0),l(n,_.copyInteractive(e.interactiveId,t=>{let r={originType:j.Original,interactiveId:t.id};l(n,_.updateInteractiveMetadata(e.id,r,()=>o(!0),s))},s))},[e]),a},H=o(),U=r.encloseNamespace(`interactives.editInteractiveView`),W={application:s.INTERACTIVES,action:y.Interactives.EDIT_INTERACTIVE_DETAILS},G={notFound:D,forbidden:{privacy:T}};function K(e){let[r,i]=I.useState(!1),[a,o]=I.useState(!1),s=I.useRef(null),{experimentalInteractiveQuestions:l}=h(null),u=c(b.config()),y=c(v.currentUser()),T=c(!!y.data&&_.interactiveMetadata(e.id));S({title:T.data?U(`pageTitle`,{name:T.data.name}):null});let D=c(V(T.data)?w.createViewKey(T.data.id,C.MasterObject):null),j=c(v.token()),L=I.useMemo(()=>k(),[]),z=I.useMemo(()=>k(),[]),B=I.useRef(null);A(T,G);function K(e){s.current=e,i(!0),B.current=new E({player:e,video:T.data,analyticsLocation:p.EditInteractive})}if(!D.data||!u.data||!T.data||!j.data)return(0,H.jsx)(F,{});if(!a&&(o(!0),T.data.status!==g.Draft))return t.throw(new R),null;let q=M(T.data),J={entity:f.Interactive,location:p.EditInteractive,workflowPhase:d.Start};function Y(){x.logUserAction(q,{actionType:m.Edit,...J}),n.trigger({...W,args:[e.id]})}function X(){x.logUserAction(q,{actionType:m.Publish,...J}),n.trigger({...W,args:[e.id],params:{publish:!0}})}return(0,H.jsxs)(H.Fragment,{children:[!r&&(0,H.jsx)(F,{}),(0,H.jsxs)(`div`,{className:`px-3 ${r?``:`d-none`}`,children:[(0,H.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center mb-3`,children:[(0,H.jsx)(`h1`,{className:`h3 text-truncate mb-0 pb-1`,children:T.data.name}),(0,H.jsx)(`div`,{className:`flex-shrink-0`,children:(0,H.jsx)(O,{node:L})})]}),(0,H.jsx)(N,{viewKey:D.data.viewKey,imageApi:new URL(u.data.imageCdnUrl),playerApi:new URL(u.data.playerApiUrl),hotkeyElQuerySelector:`body`,autoplay:!0,onReady:K,currentUser:y.data,mode:P.Create,actionsPortalNode:L,questionListPortalNode:z,authToken:j.data.value,onClickEditDetails:Y,onClickPublish:X,enableImmersiveReader:!0,experimentalInteractiveQuestions:l,hasAiInteractives:!1}),(0,H.jsx)(O,{node:z})]})]})}export{K as EditInteractiveView};
2
+ //# sourceMappingURL=DWQkljeD2.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ByLl4bms2.chunk.js","names":[],"sources":["../../src/shared/errors/interactives/cannot-edit-published-interactive/CannotEditPublishInteractiveError.ts","../../src/shared/errors/interactives/cannot-edit/CannotEditError.ts","../../src/apps/interactives/views/edit-interactive/useEnsureOriginal.ts","../../src/apps/interactives/views/edit-interactive/EditInteractiveView.tsx"],"sourcesContent":["import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { ErrorPageError } from 'libs/shared/errors/primitives/ErrorPageError';\n\nconst namespace = 'shared.cannotEditPublishedInteractive';\n\nexport class CannotEditPublishInteractiveError extends ErrorPageError {\n constructor() {\n super(LanguageService.getPhrase(namespace, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'CannotEditPublishedInteractiveError';\n }\n\n // @ts-ignore\n public get heading(): string {\n return LanguageService.getPhrase(namespace, 'heading');\n }\n\n // @ts-ignore\n public get description(): string {\n return LanguageService.getPhrase(namespace, 'description');\n }\n}\n","import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { ErrorPageError } from 'libs/shared/errors/primitives/ErrorPageError';\n\nconst namespace = 'shared.cannotEditInteractive';\n\nexport class CannotEditInteractiveError extends ErrorPageError {\n constructor() {\n super(LanguageService.getPhrase(namespace, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'CannnotEditInteractiveError';\n }\n\n // @ts-ignore\n public get heading(): string {\n return LanguageService.getPhrase(namespace, 'heading');\n }\n\n // @ts-ignore\n public get description(): string {\n return LanguageService.getPhrase(namespace, 'description');\n }\n}\n","import React from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\n\nimport { InteractiveOriginType } from 'libs/shared/enums/InteractiveOriginType';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { EditInteractiveMetadataOriginRequest, Interactive, InteractiveMetadata } from 'libs/shared/interfaces';\n\nimport { CannotEditInteractiveError } from 'shared/errors/interactives/cannot-edit/CannotEditError';\n\nexport const useEnsureOriginal = (\n interactiveMetadata: InteractiveMetadata\n) => {\n const dispatch = useDispatch();\n\n /* Used to ensure only one request */\n const [ requested, setRequest ] = React.useState(false);\n const [ ready, setReady ] = React.useState(false);\n\n React.useEffect(() => {\n if (!interactiveMetadata || ready || requested)\n return;\n\n if (interactiveMetadata.originType === InteractiveOriginType.Original) {\n setReady(true);\n return;\n }\n\n const error = () => {\n Core.ErrorHelper.throw(new CannotEditInteractiveError());\n };\n\n const success = (resp: Interactive) => {\n const data: EditInteractiveMetadataOriginRequest = {\n originType: InteractiveOriginType.Original,\n interactiveId: resp.id\n };\n\n Flight.fetch(\n dispatch,\n InteractiveRequests.updateInteractiveMetadata(\n interactiveMetadata.id,\n data,\n () => setReady(true),\n error\n )\n );\n };\n\n setRequest(true);\n Flight.fetch(dispatch, InteractiveRequests.copyInteractive(\n interactiveMetadata.interactiveId,\n success,\n error\n ));\n }, [interactiveMetadata]);\n\n return ready;\n};\n","import React from 'react';\nimport { createHtmlPortalNode, OutPortal } from 'react-reverse-portal';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, UserAction, WorkflowPhase } from 'libs/analytics/interfaces';\n\nimport { CurationStatus } from 'libs/shared/enums/CurationStatus';\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { VideoNotFoundError } from 'libs/shared/errors/videos/video-not-found/VideoNotFoundError';\nimport { VideoPrivateError } from 'libs/shared/errors/videos/video-private/VideoPrivateError';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { Config, CurrentUser, InteractiveMetadata, PlayerViewKey } from 'libs/shared/interfaces';\nimport { PlayerAnalyticsTracker } from 'libs/shared/utils/PlayerAnalyticsTracker';\n\nimport { InteractivePlayer } from 'projects/player/players/interactive-player';\nimport { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';\nimport { ClickViewInteractivePlayer } from 'projects/player/react/InteractivePlayer';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CannotEditPublishInteractiveError } from 'shared/errors/interactives/cannot-edit-published-interactive/CannotEditPublishInteractiveError';\n\nimport { InteractivePartialLoading } from 'apps/interactives/components/interactive-partial-loading/InteractivePartialLoading';\nimport { getInteractiveAnalyticsData } from 'apps/interactives/utils/getInteractiveAnalyticsData';\n\nimport { useEnsureOriginal } from './useEnsureOriginal';\n\nconst namespace = 'interactives.editInteractiveView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst EDIT_APPLINK = {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.EDIT_INTERACTIVE_DETAILS\n};\n\nconst videoErrors = {\n notFound: VideoNotFoundError,\n forbidden: {\n privacy: VideoPrivateError\n }\n};\n\ninterface EditInteractiveProps {\n id: string;\n}\n\nexport function EditInteractiveView(props: EditInteractiveProps): React.ReactElement {\n const [ ready, setReady ] = React.useState(false);\n\n const [ hasCheckedStatus, setHasCheckedStatus ] = React.useState(false);\n const playerRef = React.useRef<InteractivePlayer>(null);\n\n const { experimentalInteractiveQuestions } = useSettings(null);\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n const interactiveMetadata = Flight.useBasicFetch<InteractiveMetadata>(!!currentUser.data &&\n InteractiveRequests.interactiveMetadata(props.id));\n\n useSetPageMetadata({\n title: interactiveMetadata.data ? getPhrase('pageTitle', { name: interactiveMetadata.data.name }) : null\n });\n\n /**\n * This will check if the interactive is a copy or not\n * and update it to original if it is a copy.\n */\n const isOriginal = useEnsureOriginal(interactiveMetadata.data);\n\n /**\n * We don't fetch our view key until we know our interactive has been upgraded\n * to an original\n */\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(isOriginal ?\n PlayerRequests.createViewKey(interactiveMetadata.data.id, MediaIdType.MasterObject) : null);\n\n const token = Flight.useBasicFetch<HashObject>(UserRequests.token());\n\n const actionsPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n const questionListPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n\n const analyticsTracker = React.useRef<PlayerAnalyticsTracker>(null);\n\n useHandleObjectError(interactiveMetadata, videoErrors);\n\n function onReady(player: InteractivePlayer): void {\n playerRef.current = player;\n\n setReady(true);\n\n analyticsTracker.current = new PlayerAnalyticsTracker({\n player,\n video: interactiveMetadata.data,\n analyticsLocation: LocationContext.EditInteractive\n });\n }\n\n if (!viewKey.data || !config.data || !interactiveMetadata.data || !token.data)\n return <InteractivePartialLoading />;\n\n /**\n * We do this because when the publish popup publishes\n * the flight state updates and this briefly re-renders\n * with data.status being published\n */\n if (!hasCheckedStatus) {\n setHasCheckedStatus(true);\n if (interactiveMetadata.data.status !== CurationStatus.Draft) {\n Core.ErrorHelper.throw(new CannotEditPublishInteractiveError());\n return null;\n }\n }\n\n const analyticsData = getInteractiveAnalyticsData(interactiveMetadata.data);\n\n const baseAnalyticsOptions = {\n entity: EntityType.Interactive,\n location: LocationContext.EditInteractive,\n workflowPhase: WorkflowPhase.Start\n };\n\n function onClickEditDetails(): void {\n AnalyticsHelper.logUserAction(analyticsData, {\n actionType: UserAction.Edit,\n ...baseAnalyticsOptions\n });\n\n Core.AppLinkHelper.trigger({\n ...EDIT_APPLINK,\n args: [props.id]\n });\n }\n\n function onClickPublish(): void {\n AnalyticsHelper.logUserAction(analyticsData, {\n actionType: UserAction.Publish,\n ...baseAnalyticsOptions\n });\n\n Core.AppLinkHelper.trigger({\n ...EDIT_APPLINK,\n args: [props.id],\n params: { publish: true }\n });\n }\n\n return (\n <>\n {!ready && <InteractivePartialLoading />}\n <div className={`px-3 ${ready ? '' : 'd-none'}`}>\n <div className='d-flex justify-content-between align-items-center mb-3'>\n <h1 className='h3 text-truncate mb-0 pb-1'>{interactiveMetadata.data.name}</h1>\n <div className='flex-shrink-0'>\n <OutPortal node={actionsPortalNode} />\n </div>\n </div>\n <ClickViewInteractivePlayer\n viewKey={viewKey.data.viewKey}\n imageApi={new URL(config.data.imageCdnUrl)}\n playerApi={new URL(config.data.playerApiUrl)}\n hotkeyElQuerySelector='body'\n autoplay\n onReady={onReady}\n currentUser={currentUser.data}\n mode={InteractiveMode.Create}\n actionsPortalNode={actionsPortalNode}\n questionListPortalNode={questionListPortalNode}\n authToken={token.data.value}\n onClickEditDetails={onClickEditDetails}\n onClickPublish={onClickPublish}\n enableImmersiveReader\n experimentalInteractiveQuestions={experimentalInteractiveQuestions}\n // todo use real customer setting when we start to implement lite\n hasAiInteractives={false}\n />\n <OutPortal node={questionListPortalNode} />\n </div>\n </>\n );\n}\n"],"mappings":"gsCAIM,EAAY,wCAEL,EAAb,cAAuD,CAAe,CACpE,aAAc,CACZ,MAAM,EAAgB,UAAU,EAAW,OAAO,CAAC,CACrD,CAGA,IAAW,MAAe,CACxB,MAAO,qCACT,CAGA,IAAW,SAAkB,CAC3B,OAAO,EAAgB,UAAU,EAAW,SAAS,CACvD,CAGA,IAAW,aAAsB,CAC/B,OAAO,EAAgB,UAAU,EAAW,aAAa,CAC3D,CACF,ECrBM,EAAY,+BAEL,EAAb,cAAgD,CAAe,CAC7D,aAAc,CACZ,MAAM,EAAgB,UAAU,EAAW,OAAO,CAAC,CACrD,CAGA,IAAW,MAAe,CACxB,MAAO,6BACT,CAGA,IAAW,SAAkB,CAC3B,OAAO,EAAgB,UAAU,EAAW,SAAS,CACvD,CAGA,IAAW,aAAsB,CAC/B,OAAO,EAAgB,UAAU,EAAW,aAAa,CAC3D,CACF,ECba,EACX,GACG,CACH,IAAM,EAAW,EAAY,EAGvB,CAAE,EAAW,GAAA,EAAqB,SAAS,EAAK,EAChD,CAAE,EAAO,GAAA,EAAmB,SAAS,EAAK,EAwChD,OAtCA,EAAM,cAAgB,CACpB,GAAI,CAAC,GAAuB,GAAS,EACnC,OAEF,GAAI,EAAoB,aAAe,EAAsB,SAAU,CACrE,EAAS,EAAI,EACb,MACF,CAEA,IAAM,MAAc,CAClB,EAAiB,MAAM,IAAI,CAA4B,CACzD,EAmBA,EAAW,EAAI,EACf,EAAa,EAAU,EAAoB,gBACzC,EAAoB,cAnB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,CAAA,CACF,KACL,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,QAAS,EAAQ,KAAK,QACtB,SAAU,IAAI,IAAI,EAAO,KAAK,WAAW,EACzC,UAAW,IAAI,IAAI,EAAO,KAAK,YAAY,EAC3C,sBAAsB,OACtB,SAAA,GACS,UACT,YAAa,EAAY,KACzB,KAAM,EAAgB,OACH,oBACK,yBACxB,UAAW,EAAM,KAAK,MACF,qBACJ,iBAChB,sBAAA,GACkC,mCAElC,kBAAmB,EACpB,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,EAAD,CAAW,KAAM,CAAyB,CAAA,CACvC,GACL,CAAA,CAAA,CAEN"}
1
+ {"version":3,"file":"DWQkljeD2.chunk.js","names":[],"sources":["../../src/shared/errors/interactives/cannot-edit-published-interactive/CannotEditPublishInteractiveError.ts","../../src/shared/errors/interactives/cannot-edit/CannotEditError.ts","../../src/apps/interactives/views/edit-interactive/useEnsureOriginal.ts","../../src/apps/interactives/views/edit-interactive/EditInteractiveView.tsx"],"sourcesContent":["import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { ErrorPageError } from 'libs/shared/errors/primitives/ErrorPageError';\n\nconst namespace = 'shared.cannotEditPublishedInteractive';\n\nexport class CannotEditPublishInteractiveError extends ErrorPageError {\n constructor() {\n super(LanguageService.getPhrase(namespace, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'CannotEditPublishedInteractiveError';\n }\n\n // @ts-ignore\n public get heading(): string {\n return LanguageService.getPhrase(namespace, 'heading');\n }\n\n // @ts-ignore\n public get description(): string {\n return LanguageService.getPhrase(namespace, 'description');\n }\n}\n","import { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { ErrorPageError } from 'libs/shared/errors/primitives/ErrorPageError';\n\nconst namespace = 'shared.cannotEditInteractive';\n\nexport class CannotEditInteractiveError extends ErrorPageError {\n constructor() {\n super(LanguageService.getPhrase(namespace, 'title'));\n }\n\n // @ts-ignore\n public get name(): string {\n return 'CannnotEditInteractiveError';\n }\n\n // @ts-ignore\n public get heading(): string {\n return LanguageService.getPhrase(namespace, 'heading');\n }\n\n // @ts-ignore\n public get description(): string {\n return LanguageService.getPhrase(namespace, 'description');\n }\n}\n","import React from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\n\nimport { InteractiveOriginType } from 'libs/shared/enums/InteractiveOriginType';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { EditInteractiveMetadataOriginRequest, Interactive, InteractiveMetadata } from 'libs/shared/interfaces';\n\nimport { CannotEditInteractiveError } from 'shared/errors/interactives/cannot-edit/CannotEditError';\n\nexport const useEnsureOriginal = (\n interactiveMetadata: InteractiveMetadata\n) => {\n const dispatch = useDispatch();\n\n /* Used to ensure only one request */\n const [ requested, setRequest ] = React.useState(false);\n const [ ready, setReady ] = React.useState(false);\n\n React.useEffect(() => {\n if (!interactiveMetadata || ready || requested)\n return;\n\n if (interactiveMetadata.originType === InteractiveOriginType.Original) {\n setReady(true);\n return;\n }\n\n const error = () => {\n Core.ErrorHelper.throw(new CannotEditInteractiveError());\n };\n\n const success = (resp: Interactive) => {\n const data: EditInteractiveMetadataOriginRequest = {\n originType: InteractiveOriginType.Original,\n interactiveId: resp.id\n };\n\n Flight.fetch(\n dispatch,\n InteractiveRequests.updateInteractiveMetadata(\n interactiveMetadata.id,\n data,\n () => setReady(true),\n error\n )\n );\n };\n\n setRequest(true);\n Flight.fetch(dispatch, InteractiveRequests.copyInteractive(\n interactiveMetadata.interactiveId,\n success,\n error\n ));\n }, [interactiveMetadata]);\n\n return ready;\n};\n","import React from 'react';\nimport { createHtmlPortalNode, OutPortal } from 'react-reverse-portal';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, UserAction, WorkflowPhase } from 'libs/analytics/interfaces';\n\nimport { CurationStatus } from 'libs/shared/enums/CurationStatus';\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { VideoNotFoundError } from 'libs/shared/errors/videos/video-not-found/VideoNotFoundError';\nimport { VideoPrivateError } from 'libs/shared/errors/videos/video-private/VideoPrivateError';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { Config, CurrentUser, InteractiveMetadata, PlayerViewKey } from 'libs/shared/interfaces';\nimport { PlayerAnalyticsTracker } from 'libs/shared/utils/PlayerAnalyticsTracker';\n\nimport { InteractivePlayer } from 'projects/player/players/interactive-player';\nimport { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';\nimport { ClickViewInteractivePlayer } from 'projects/player/react/InteractivePlayer';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CannotEditPublishInteractiveError } from 'shared/errors/interactives/cannot-edit-published-interactive/CannotEditPublishInteractiveError';\n\nimport { InteractivePartialLoading } from 'apps/interactives/components/interactive-partial-loading/InteractivePartialLoading';\nimport { getInteractiveAnalyticsData } from 'apps/interactives/utils/getInteractiveAnalyticsData';\n\nimport { useEnsureOriginal } from './useEnsureOriginal';\n\nconst namespace = 'interactives.editInteractiveView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst EDIT_APPLINK = {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.EDIT_INTERACTIVE_DETAILS\n};\n\nconst videoErrors = {\n notFound: VideoNotFoundError,\n forbidden: {\n privacy: VideoPrivateError\n }\n};\n\ninterface EditInteractiveProps {\n id: string;\n}\n\nexport function EditInteractiveView(props: EditInteractiveProps): React.ReactElement {\n const [ ready, setReady ] = React.useState(false);\n\n const [ hasCheckedStatus, setHasCheckedStatus ] = React.useState(false);\n const playerRef = React.useRef<InteractivePlayer>(null);\n\n const { experimentalInteractiveQuestions } = useSettings(null);\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n const interactiveMetadata = Flight.useBasicFetch<InteractiveMetadata>(!!currentUser.data &&\n InteractiveRequests.interactiveMetadata(props.id));\n\n useSetPageMetadata({\n title: interactiveMetadata.data ? getPhrase('pageTitle', { name: interactiveMetadata.data.name }) : null\n });\n\n /**\n * This will check if the interactive is a copy or not\n * and update it to original if it is a copy.\n */\n const isOriginal = useEnsureOriginal(interactiveMetadata.data);\n\n /**\n * We don't fetch our view key until we know our interactive has been upgraded\n * to an original\n */\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(isOriginal ?\n PlayerRequests.createViewKey(interactiveMetadata.data.id, MediaIdType.MasterObject) : null);\n\n const token = Flight.useBasicFetch<HashObject>(UserRequests.token());\n\n const actionsPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n const questionListPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n\n const analyticsTracker = React.useRef<PlayerAnalyticsTracker>(null);\n\n useHandleObjectError(interactiveMetadata, videoErrors);\n\n function onReady(player: InteractivePlayer): void {\n playerRef.current = player;\n\n setReady(true);\n\n analyticsTracker.current = new PlayerAnalyticsTracker({\n player,\n video: interactiveMetadata.data,\n analyticsLocation: LocationContext.EditInteractive\n });\n }\n\n if (!viewKey.data || !config.data || !interactiveMetadata.data || !token.data)\n return <InteractivePartialLoading />;\n\n /**\n * We do this because when the publish popup publishes\n * the flight state updates and this briefly re-renders\n * with data.status being published\n */\n if (!hasCheckedStatus) {\n setHasCheckedStatus(true);\n if (interactiveMetadata.data.status !== CurationStatus.Draft) {\n Core.ErrorHelper.throw(new CannotEditPublishInteractiveError());\n return null;\n }\n }\n\n const analyticsData = getInteractiveAnalyticsData(interactiveMetadata.data);\n\n const baseAnalyticsOptions = {\n entity: EntityType.Interactive,\n location: LocationContext.EditInteractive,\n workflowPhase: WorkflowPhase.Start\n };\n\n function onClickEditDetails(): void {\n AnalyticsHelper.logUserAction(analyticsData, {\n actionType: UserAction.Edit,\n ...baseAnalyticsOptions\n });\n\n Core.AppLinkHelper.trigger({\n ...EDIT_APPLINK,\n args: [props.id]\n });\n }\n\n function onClickPublish(): void {\n AnalyticsHelper.logUserAction(analyticsData, {\n actionType: UserAction.Publish,\n ...baseAnalyticsOptions\n });\n\n Core.AppLinkHelper.trigger({\n ...EDIT_APPLINK,\n args: [props.id],\n params: { publish: true }\n });\n }\n\n return (\n <>\n {!ready && <InteractivePartialLoading />}\n <div className={`px-3 ${ready ? '' : 'd-none'}`}>\n <div className='d-flex justify-content-between align-items-center mb-3'>\n <h1 className='h3 text-truncate mb-0 pb-1'>{interactiveMetadata.data.name}</h1>\n <div className='flex-shrink-0'>\n <OutPortal node={actionsPortalNode} />\n </div>\n </div>\n <ClickViewInteractivePlayer\n viewKey={viewKey.data.viewKey}\n imageApi={new URL(config.data.imageCdnUrl)}\n playerApi={new URL(config.data.playerApiUrl)}\n hotkeyElQuerySelector='body'\n autoplay\n onReady={onReady}\n currentUser={currentUser.data}\n mode={InteractiveMode.Create}\n actionsPortalNode={actionsPortalNode}\n questionListPortalNode={questionListPortalNode}\n authToken={token.data.value}\n onClickEditDetails={onClickEditDetails}\n onClickPublish={onClickPublish}\n enableImmersiveReader\n experimentalInteractiveQuestions={experimentalInteractiveQuestions}\n // todo use real customer setting when we start to implement lite\n hasAiInteractives={false}\n />\n <OutPortal node={questionListPortalNode} />\n </div>\n </>\n );\n}\n"],"mappings":"gsCAIM,EAAY,wCAEL,EAAb,cAAuD,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,EAAD,CAAW,KAAM,CAAyB,CAAA,CACvC,GACL,CAAA,CAAA,CAEN"}
@@ -1,2 +1,2 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n}from"./B785hxeE.chunk.js";import{t as r}from"./C2w0pmFW.chunk.js";import{t as i}from"./wrLrTezN.chunk.js";import{t as a}from"./BXTI9cmX.chunk.js";import{d as o}from"./CEamUdnf.chunk.js";import{l as ee,y as s,z as te}from"./BHvdJc9z.chunk.js";import{t as ne}from"./Dn1hp1IN2.chunk.js";import{t as c}from"./DZX1tZ-D2.chunk.js";import{t as l}from"./CVHQXNzi2.chunk.js";import{t as u}from"./DbSUQ2A12.chunk.js";import{t as d}from"./quMwO3lt2.chunk.js";import{t as f}from"./By12qobm.chunk.js";import{t as p}from"./Bjt_-lTs.chunk.js";import{t as m}from"./CVtvY0gg.chunk.js";import{t as re}from"./CgCqPbjJ.chunk.js";import{t as ie}from"./BYQ4R4H_2.chunk.js";import{t as ae}from"./B2INd6bh.chunk.js";import{t as oe}from"./BKSSWxpx2.chunk.js";import{i as h}from"./CHZLAcZ_2.chunk.js";import{n as g,t as se}from"./CpFtf-tI2.chunk.js";import{t as _}from"./C9JLrtps2.chunk.js";import{t as v}from"./DMRw6Y9I.chunk.js";import{r as y}from"./CIY9cqem2.chunk.js";import{n as ce}from"./DAcNgjTQ.chunk.js";import{t as b}from"./jAbfamoi.chunk.js";import{t as le}from"./WvK58Ge12.chunk.js";import{t as x}from"./BdLlcPC3.chunk.js";import"./ZR0OBQ2I.chunk.js";import{t as ue}from"./DvqomG3B.chunk.js";import{l as de}from"./BcrXhug9.chunk.js";import{t as S}from"./BTFvVc1Z.chunk.js";import{n as C}from"./BEEqOJxf.chunk.js";import{t as fe}from"./VZcMg4Fw.chunk.js";import{t as w}from"./BAkU_szZ.chunk.js";import{a as pe,i as me,n as he,t as ge}from"./C1SMWeap2.chunk.js";import{_ as _e,a as ve,c as T,d as ye,f as be,g as xe,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as Se,s as Ce,t as we,u as N,v as Te,y as P}from"./kjKFfyCC2.chunk.js";import{n as Ee,t as De}from"./DqlcyPD1.chunk.js";import{n as Oe,r as ke}from"./CafgzmZf.chunk.js";import{t as Ae}from"./ItTple-a.chunk.js";import{t as F}from"./DkxWaE9O.chunk.js";var I={chaptersAndSubtitles(e,t){let n={query:`subtitles[customer],chapters`,permissionFilterOption:u.StripMetadata,contentRegion:t};return{url:c.urlBuilder(`{gateway}/v1/objects/${e}`,n),publicUrl:c.urlBuilder(`/api/objects/${e}/subtitles`,n),key:`videos:${e}:subtitles:chapters:${u.StripMetadata}`,formatData:e=>({subtitles:e.subtitles.data,chapters:e.chapters.data})}},subtitleVtt(e,t){return{url:c.urlBuilder(`{player}/srt-to-vtt`,{url:e,fullSentences:!0}),publicUrl:c.urlBuilder(`/api/player/srt-to-vtt`,{url:e,fullSentences:!0}),key:`subtitle:${e}`,formatData:e=>({...t,vtt:e})}}},L=e(r()),R=b(),z={dropdown:`_dropdown_zu639_1`},B=i(),V=`shared.curriculumLinks`;function je(e){let{preferredCurriculum:t,availableCurriculums:n,curriculumLinks:r,updateCurriculum:i}=e.curriculums;function a(t){i(t,{shouldLog:!0,locationContext:s.PlayPage,video:e.video})}return!e.canViewCurriculumLinks||!r?.length&&!e.curriculums.mappedCurriculums.length?(0,B.jsx)(B.Fragment,{}):(0,B.jsxs)(`section`,{id:w.CurriculumLinks,ref:t=>{t&&e.headingRef?.current&&e.headingRef.current.set(w.CurriculumLinks,t)},className:`play-page-section`,children:[(0,B.jsx)(`h2`,{className:`h4 me-2 h-100`,children:(0,B.jsx)(g,{namespace:V,phrase:`heading`})}),(0,B.jsx)(F,{availableCurriculums:n,onChangeCurriculum:a,selectedCurriculum:t,className:z.dropdown}),(0,B.jsx)(`div`,{className:`rounded border position-relative`,children:(0,B.jsx)(R.Scrollbars,{autoHeight:!0,autoHeightMax:e.height,children:(0,B.jsx)(`div`,{className:`p-3`,children:(0,B.jsx)(C,{curriculumLinks:e.curriculums.curriculumLinks,onChangeCurriculum:a,hasCompleted:e.curriculums.hasCompleted,mappedCurriculums:e.curriculums.mappedCurriculums,isFetching:e.curriculums.isFetching,getCodeAppLink:(t,n)=>e.hasNewSearch?x.getSearchAppLink(t,{[y]:n}):null,locationContext:s.PlayPage})})})})]})}var Me=`shared.play`;function H(e){let r=ce(),i=r.playerRef.current?.isPaused?.(),o=r.playerRef?.current?.hasStarted?.(),{hasPermissions:c}=oe(),u=ne(null),{canConsume:f}=d.getCanBeConsumed(e.video),p=j(e.hasTheatreMode,r),g=A(e.hasTheatreMode,r.mode,r.defaultDisplayMode);function v(e){e||y(!1),r.setDefaultDisplayMode?.(e?`theatre`:`normal`),r.playerRef?.current?.toggleTheatreMode?.(e)}function y(e){r.playerRef?.current?.toggleTranscript?.(e)}let{tableOfContentsActiveId:b,setTableOfContentsActiveId:x,controlledId:C,setControlledId:F,tableOfContentsExpanded:I,onToggleTableOfContents:R}=D(e.tableOfContentsId,e.hasTheatreMode,p),z=Te(e.video)&&e.featureAccess.canViewGlance,{headingRef:V,headingElements:H}=Se(z),U=H.map(t=>({id:t.id,name:we.getSectionHeading(t.id,{clips:e.clips,interactives:e.interactives,resources:[...e.video.resources?.data??[],...e.video.links?.data??[]]})})),Ne=d.isVideoTypeArchived(e.video),Pe=c(n.StudentExperience);ke({setActiveId:x,headingElements:H,controlledId:C,setControlledId:F}),Oe(H,C);let W=L.useRef(!1),G=h({settings:u,presentationSlug:e.presentationSlug}),K=G.getResourceAppLink(e.video.id,e.shareId,e.featureAccess.canViewResourceItems);O({resourcePopupId:e.resourcePopupId,resources:e.video.resources?.data,getResourceAppLink:K});function q(){W.current=!r?.playerRef?.current?.isPaused(),r?.playerRef?.current?.pause()}function J(){W.current&&r?.playerRef?.current?.play()}let Y={hasTheatreMode:e.hasTheatreMode,shouldShowSideTableOfContents:e.shouldShowSideTableOfContents,tableOfContentsExpanded:I,theatreMode:g},Fe=Ce(Y),Ie=ve(Y),Le=r.mode===`picture-in-picture`||e.featureAccess.canViewPublicLayout&&!e.video._canBeConsumed.value,[,X]=ie(re.PLAY_PAGE_CONTAINER_CLASS_NAME),Re=e.commonVideoProps.getSubTextType?.(e.video),ze=e.commonVideoProps.getSubTextAppLink(e.video),Be=e.commonVideoProps.getCompanyLogoFallbackUrl?.(e.video),Z=Ee(e.video,c(n.StudentExperience)),Q=Z.filter(le.isResource),$=e.shouldShowSideTableOfContents&&e.relatedTopics?.length>0,Ve=!e.shouldShowSideTableOfContents&&e.relatedTopics?.length>0;L.useEffect(()=>{X(p?T.theatreModePlayPageContainer:``)},[p]),L.useEffect(()=>()=>X(``),[]);function He(){t.trigger({action:m.SignUp.SIGN_UP,application:a.SIGN_UP})}function Ue(){if(!f)return He();o||r.playerRef.current?.play(),y(!0),window.scrollTo({top:0,behavior:`smooth`})}function We(e){r.playerRef.current?.currentTime(e)}function Ge(){if(Q.length===1){ue.downloadResource(Q[0],{videoId:e.video?.id,videoName:e.video.name},{location:s.PlayPage,actionType:te.Download,entity:ee.Resource});return}t.trigger({application:a.VIDEOS,action:m.Videos.RESOURCE_DOWNLOAD,args:[e.video?.id,e.shareId]})}return(0,B.jsx)(se.Provider,{value:Me,children:(0,B.jsxs)(`div`,{className:`px-4 play-page-sections-container ${e.shouldShowSideTableOfContents?`row g-0`:``}`,children:[(0,B.jsxs)(`main`,{className:`${T.main} ${Fe}`,children:[!!e.breadcrumbs?.length&&(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(S,{breadcrumbs:e.breadcrumbs})}),(0,B.jsx)(ge,{restrictions:e.video._restrictions,yearGroups:e.commonVideoProps.yearGroups,objectId:e.video.id,objectTypeId:l.Video,canManageVideoAccess:e.canManageVideoAccess}),Ne&&(0,B.jsx)(pe,{typeId:e.video.typeId,hasStudentExperience:Pe}),(0,B.jsxs)(`section`,{id:w.Video,className:`mb-3 ${ae.GLOBAL_PLAYER_SELECTOR}`,ref:e=>{e&&V?.current&&V.current.set(w.Video,e)},children:[f&&(0,B.jsx)(de,{objectId:e.video.id,objectTypeId:e.video.typeId,shareId:e.shareId,context:e.params?.context,contextId:e.params?.contextId,playNext:e.params?.playNext,moviesAndTv:e.params?.mtv,startTime:e.params?.t??e.params?.startTime,endTime:e.params?.endTime,mode:`default`,location:`play-page`},e.video.id),(0,B.jsx)(`div`,{className:Le?``:`d-none`,children:(0,B.jsx)(be,{video:e.video,appLink:{application:a.SIGN_UP,action:m.SignUp.SIGN_UP},type:r.mode===`picture-in-picture`?`pip`:`public`})})]}),(0,B.jsxs)(`div`,{className:Ie,children:[(0,B.jsxs)(`div`,{className:g?`${T.theatreModeLeftContent}`:`w-100`,children:[(0,B.jsx)(M,{presentationSlug:e.presentationSlug,media:e.video,subTextType:Re,subtextAppLink:ze,yearGroups:e.commonVideoProps.yearGroups,audiences:e.audiences,featureAccess:e.featureAccess,shareId:e.shareId,showTitlePadlock:!e.commonVideoProps.hasStudentExperience&&!e.commonVideoProps.hasGuestExperience,companyLogoFallbackUrl:Be,imageCdnUrl:e.commonVideoProps.imageCdnUrl}),z?(0,B.jsx)(_e,{video:e.video,pointsOfInterest:e.pointsOfInterest,setStartTime:e=>r.playerRef.current?.currentTime(e),getTagAppLink:G.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,canViewGlance:z}):(0,B.jsx)(P,{video:e.video,currentUser:e.currentUser,headingRef:V,onLaunchImmersiveReader:q,onExitImmersiveReader:J,getTagAppLink:G.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,getPartnerProfileAppLink:G.getPartnerProfileAppLink,getPartnerDashboardHubAppLink:G.getPartnerDashboardHubAppLink,getLibraryAppLink:c(n.ViewLibraries)?G.getLibraryAppLink:null,getFolderAppLink:c(n.ViewLibraries)?G.getFolderAppLink:null}),(0,B.jsx)(je,{height:368,curriculums:e.curriculums,canViewCurriculumLinks:e.featureAccess.canViewCurriculumLinks,headingRef:V,video:e.video,hasNewSearch:e.hasNewSearch}),(0,B.jsx)(De,{headingRef:V,video:e.video,canViewResources:e.featureAccess.canViewResourceItems,imageCdnUrl:e.commonVideoProps.imageCdnUrl,getAppLink:K,analyticsData:{videoId:e.video.id,videoName:e.video.name},getImageThumbnailFallbackUrl:Ae.getImageThumbnailFallbackUrl,onDownloadClick:Ge,resources:Z,downloadableResources:Q,aboutResourcesAppLink:_.getAboutResourceAppLink()}),(0,B.jsx)(E,{presentationSlug:e.presentationSlug,headingRef:V,video:e.video,interactives:e.interactives,analyticsData:{videoId:e.video.id,videoName:e.video.name},canViewInteractives:e.featureAccess.canViewInteractives,commonVideoProps:e.commonVideoProps}),(0,B.jsx)(xe,{presentationSlug:e.presentationSlug,video:e.video,headingRef:V,clips:e.clips,canViewClips:e.featureAccess.canViewClips,audiences:e.audiences,analyticsData:{videoId:e.video.id,videoName:e.video.name},commonVideoProps:e.commonVideoProps}),z&&(0,B.jsx)(P,{video:e.video,currentUser:e.currentUser,headingRef:V,onLaunchImmersiveReader:q,onExitImmersiveReader:J,getTagAppLink:G.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,showHeading:!0,getPartnerProfileAppLink:G.getPartnerProfileAppLink,getPartnerDashboardHubAppLink:G.getPartnerDashboardHubAppLink,getLibraryAppLink:G.getLibraryAppLink,getFolderAppLink:G.getFolderAppLink}),e.shouldShowTranscript&&(0,B.jsx)(fe,{headingRef:V,video:e.video,subtitles:e.subtitles,vttSubtitles:e.vttSubtitles,chapters:e.chapters,onShowInVideo:Ue,signUpLink:{action:m.SignUp.SIGN_UP,application:a.SIGN_UP},setStartTime:We,isBot:e.isBot,isPaused:i,isAuthenticated:e.currentUser.isAuthenticated,playerApiUrl:e.playerApiUrl}),e.featureAccess.canViewCitations&&(0,B.jsx)(he,{headingRef:V,media:e.video,contentRegion:e.currentUser.contentRegion,shareId:e.shareId,presentationSlug:e.presentationSlug}),Ve&&(0,B.jsx)(ye,{topics:e.relatedTopics,getAppLink:e.getRelatedTopicAppLink}),(0,B.jsx)(me,{presentationSlug:e.presentationSlug,currentVideo:e.video,headingRef:V,commonVideoProps:e.commonVideoProps,relatedVideos:e.relatedVideos,currentUser:e.currentUser,getVideoAppLink:(t,n)=>_.getAppLink(t,{...n,context:e.params.context,contextId:e.params.contextId,playNext:e.params.playNext,shareId:e.shareId,moviesAndTv:e.params.mtv,includeContext:e.currentUser?.isAuthenticated},e.presentationSlug),audiences:e.audiences,moviesAndTv:e.params.mtv})]}),p&&(0,B.jsx)(k,{isExpanded:I,setIsExpanded:R,toggleTheatreMode:e.hasTheatreMode?v:null,items:U,activeId:b,setControlledId:F,analyticsData:{videoId:e.video.id,videoName:e.video.name},showInSide:e.shouldShowSideTableOfContents,isTheatreMode:!1,hasTranscription:e.hasTheatreMode,shouldShowToc:U.length>=3,additionalComponents:[$?(0,B.jsx)(N,{className:`mt-2`,topics:e.relatedTopics,getAppLink:e.getRelatedTopicAppLink}):void 0]})]})]}),!p&&(0,B.jsx)(k,{isExpanded:I,setIsExpanded:R,toggleTheatreMode:e.hasTheatreMode?v:null,items:U,activeId:b,setControlledId:F,analyticsData:{videoId:e.video.id,videoName:e.video.name},showInSide:e.shouldShowSideTableOfContents,isTheatreMode:!1,hasTranscription:e.hasTheatreMode,shouldShowToc:U.length>=3,additionalComponents:[$?(0,B.jsx)(N,{className:`mt-2`,topics:e.relatedTopics,getAppLink:e.getRelatedTopicAppLink}):void 0]})]})})}function U(e,t){let n=o(p.currentUser()),{canViewTranscript:r}=v({objectId:e,objectTypeId:l.Video}),i=o(t?f.sharedVideo(e,t):f.video(e)),a=r&&!!i.data?._curationTags?.value?.isClickViewCurated;return{shouldShowTranscript:a,shouldFetchTranscript:a&&!n.data?.isAuthenticated}}export{H as n,I as r,U as t};
2
- //# sourceMappingURL=DQNW-R2Y.chunk.js.map
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n}from"./B785hxeE.chunk.js";import{t as r}from"./C2w0pmFW.chunk.js";import{t as i}from"./wrLrTezN.chunk.js";import{t as a}from"./BXTI9cmX.chunk.js";import{d as o}from"./CEamUdnf.chunk.js";import{l as ee,y as s,z as te}from"./BHvdJc9z.chunk.js";import{t as ne}from"./Dn1hp1IN2.chunk.js";import{t as c}from"./DZX1tZ-D2.chunk.js";import{t as l}from"./CVHQXNzi2.chunk.js";import{t as u}from"./DbSUQ2A12.chunk.js";import{t as d}from"./quMwO3lt2.chunk.js";import{t as f}from"./By12qobm.chunk.js";import{t as p}from"./Bjt_-lTs.chunk.js";import{t as m}from"./CVtvY0gg.chunk.js";import{t as re}from"./CgCqPbjJ.chunk.js";import{t as ie}from"./BYQ4R4H_2.chunk.js";import{t as ae}from"./B2INd6bh.chunk.js";import{t as oe}from"./BKSSWxpx2.chunk.js";import{i as h}from"./B-V5u42C2.chunk.js";import{n as g,t as se}from"./CpFtf-tI2.chunk.js";import{t as _}from"./C9JLrtps2.chunk.js";import{t as v}from"./DMRw6Y9I.chunk.js";import{r as y}from"./CIY9cqem2.chunk.js";import{n as ce}from"./DAcNgjTQ.chunk.js";import{t as b}from"./jAbfamoi.chunk.js";import{t as le}from"./WvK58Ge12.chunk.js";import{t as x}from"./BdLlcPC3.chunk.js";import"./ZR0OBQ2I.chunk.js";import{t as ue}from"./DvqomG3B.chunk.js";import{l as de}from"./BcrXhug9.chunk.js";import{t as S}from"./BTFvVc1Z.chunk.js";import{n as C}from"./BEEqOJxf.chunk.js";import{t as fe}from"./VZcMg4Fw.chunk.js";import{t as w}from"./BAkU_szZ.chunk.js";import{a as pe,i as me,n as he,t as ge}from"./C1SMWeap2.chunk.js";import{_ as _e,a as ve,c as T,d as ye,f as be,g as xe,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as Se,s as Ce,t as we,u as N,v as Te,y as P}from"./BS-WKys42.chunk.js";import{n as Ee,t as De}from"./DqlcyPD1.chunk.js";import{n as Oe,r as ke}from"./CafgzmZf.chunk.js";import{t as Ae}from"./ItTple-a.chunk.js";import{t as F}from"./DkxWaE9O.chunk.js";var I={chaptersAndSubtitles(e,t){let n={query:`subtitles[customer],chapters`,permissionFilterOption:u.StripMetadata,contentRegion:t};return{url:c.urlBuilder(`{gateway}/v1/objects/${e}`,n),publicUrl:c.urlBuilder(`/api/objects/${e}/subtitles`,n),key:`videos:${e}:subtitles:chapters:${u.StripMetadata}`,formatData:e=>({subtitles:e.subtitles.data,chapters:e.chapters.data})}},subtitleVtt(e,t){return{url:c.urlBuilder(`{player}/srt-to-vtt`,{url:e,fullSentences:!0}),publicUrl:c.urlBuilder(`/api/player/srt-to-vtt`,{url:e,fullSentences:!0}),key:`subtitle:${e}`,formatData:e=>({...t,vtt:e})}}},L=e(r()),R=b(),z={dropdown:`_dropdown_zu639_1`},B=i(),V=`shared.curriculumLinks`;function je(e){let{preferredCurriculum:t,availableCurriculums:n,curriculumLinks:r,updateCurriculum:i}=e.curriculums;function a(t){i(t,{shouldLog:!0,locationContext:s.PlayPage,video:e.video})}return!e.canViewCurriculumLinks||!r?.length&&!e.curriculums.mappedCurriculums.length?(0,B.jsx)(B.Fragment,{}):(0,B.jsxs)(`section`,{id:w.CurriculumLinks,ref:t=>{t&&e.headingRef?.current&&e.headingRef.current.set(w.CurriculumLinks,t)},className:`play-page-section`,children:[(0,B.jsx)(`h2`,{className:`h4 me-2 h-100`,children:(0,B.jsx)(g,{namespace:V,phrase:`heading`})}),(0,B.jsx)(F,{availableCurriculums:n,onChangeCurriculum:a,selectedCurriculum:t,className:z.dropdown}),(0,B.jsx)(`div`,{className:`rounded border position-relative`,children:(0,B.jsx)(R.Scrollbars,{autoHeight:!0,autoHeightMax:e.height,children:(0,B.jsx)(`div`,{className:`p-3`,children:(0,B.jsx)(C,{curriculumLinks:e.curriculums.curriculumLinks,onChangeCurriculum:a,hasCompleted:e.curriculums.hasCompleted,mappedCurriculums:e.curriculums.mappedCurriculums,isFetching:e.curriculums.isFetching,getCodeAppLink:(t,n)=>e.hasNewSearch?x.getSearchAppLink(t,{[y]:n}):null,locationContext:s.PlayPage})})})})]})}var Me=`shared.play`;function H(e){let r=ce(),i=r.playerRef.current?.isPaused?.(),o=r.playerRef?.current?.hasStarted?.(),{hasPermissions:c}=oe(),u=ne(null),{canConsume:f}=d.getCanBeConsumed(e.video),p=j(e.hasTheatreMode,r),g=A(e.hasTheatreMode,r.mode,r.defaultDisplayMode);function v(e){e||y(!1),r.setDefaultDisplayMode?.(e?`theatre`:`normal`),r.playerRef?.current?.toggleTheatreMode?.(e)}function y(e){r.playerRef?.current?.toggleTranscript?.(e)}let{tableOfContentsActiveId:b,setTableOfContentsActiveId:x,controlledId:C,setControlledId:F,tableOfContentsExpanded:I,onToggleTableOfContents:R}=D(e.tableOfContentsId,e.hasTheatreMode,p),z=Te(e.video)&&e.featureAccess.canViewGlance,{headingRef:V,headingElements:H}=Se(z),U=H.map(t=>({id:t.id,name:we.getSectionHeading(t.id,{clips:e.clips,interactives:e.interactives,resources:[...e.video.resources?.data??[],...e.video.links?.data??[]]})})),Ne=d.isVideoTypeArchived(e.video),Pe=c(n.StudentExperience);ke({setActiveId:x,headingElements:H,controlledId:C,setControlledId:F}),Oe(H,C);let W=L.useRef(!1),G=h({settings:u,presentationSlug:e.presentationSlug}),K=G.getResourceAppLink(e.video.id,e.shareId,e.featureAccess.canViewResourceItems);O({resourcePopupId:e.resourcePopupId,resources:e.video.resources?.data,getResourceAppLink:K});function q(){W.current=!r?.playerRef?.current?.isPaused(),r?.playerRef?.current?.pause()}function J(){W.current&&r?.playerRef?.current?.play()}let Y={hasTheatreMode:e.hasTheatreMode,shouldShowSideTableOfContents:e.shouldShowSideTableOfContents,tableOfContentsExpanded:I,theatreMode:g},Fe=Ce(Y),Ie=ve(Y),Le=r.mode===`picture-in-picture`||e.featureAccess.canViewPublicLayout&&!e.video._canBeConsumed.value,[,X]=ie(re.PLAY_PAGE_CONTAINER_CLASS_NAME),Re=e.commonVideoProps.getSubTextType?.(e.video),ze=e.commonVideoProps.getSubTextAppLink(e.video),Be=e.commonVideoProps.getCompanyLogoFallbackUrl?.(e.video),Z=Ee(e.video,c(n.StudentExperience)),Q=Z.filter(le.isResource),$=e.shouldShowSideTableOfContents&&e.relatedTopics?.length>0,Ve=!e.shouldShowSideTableOfContents&&e.relatedTopics?.length>0;L.useEffect(()=>{X(p?T.theatreModePlayPageContainer:``)},[p]),L.useEffect(()=>()=>X(``),[]);function He(){t.trigger({action:m.SignUp.SIGN_UP,application:a.SIGN_UP})}function Ue(){if(!f)return He();o||r.playerRef.current?.play(),y(!0),window.scrollTo({top:0,behavior:`smooth`})}function We(e){r.playerRef.current?.currentTime(e)}function Ge(){if(Q.length===1){ue.downloadResource(Q[0],{videoId:e.video?.id,videoName:e.video.name},{location:s.PlayPage,actionType:te.Download,entity:ee.Resource});return}t.trigger({application:a.VIDEOS,action:m.Videos.RESOURCE_DOWNLOAD,args:[e.video?.id,e.shareId]})}return(0,B.jsx)(se.Provider,{value:Me,children:(0,B.jsxs)(`div`,{className:`px-4 play-page-sections-container ${e.shouldShowSideTableOfContents?`row g-0`:``}`,children:[(0,B.jsxs)(`main`,{className:`${T.main} ${Fe}`,children:[!!e.breadcrumbs?.length&&(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(S,{breadcrumbs:e.breadcrumbs})}),(0,B.jsx)(ge,{restrictions:e.video._restrictions,yearGroups:e.commonVideoProps.yearGroups,objectId:e.video.id,objectTypeId:l.Video,canManageVideoAccess:e.canManageVideoAccess}),Ne&&(0,B.jsx)(pe,{typeId:e.video.typeId,hasStudentExperience:Pe}),(0,B.jsxs)(`section`,{id:w.Video,className:`mb-3 ${ae.GLOBAL_PLAYER_SELECTOR}`,ref:e=>{e&&V?.current&&V.current.set(w.Video,e)},children:[f&&(0,B.jsx)(de,{objectId:e.video.id,objectTypeId:e.video.typeId,shareId:e.shareId,context:e.params?.context,contextId:e.params?.contextId,playNext:e.params?.playNext,moviesAndTv:e.params?.mtv,startTime:e.params?.t??e.params?.startTime,endTime:e.params?.endTime,mode:`default`,location:`play-page`},e.video.id),(0,B.jsx)(`div`,{className:Le?``:`d-none`,children:(0,B.jsx)(be,{video:e.video,appLink:{application:a.SIGN_UP,action:m.SignUp.SIGN_UP},type:r.mode===`picture-in-picture`?`pip`:`public`})})]}),(0,B.jsxs)(`div`,{className:Ie,children:[(0,B.jsxs)(`div`,{className:g?`${T.theatreModeLeftContent}`:`w-100`,children:[(0,B.jsx)(M,{presentationSlug:e.presentationSlug,media:e.video,subTextType:Re,subtextAppLink:ze,yearGroups:e.commonVideoProps.yearGroups,audiences:e.audiences,featureAccess:e.featureAccess,shareId:e.shareId,showTitlePadlock:!e.commonVideoProps.hasStudentExperience&&!e.commonVideoProps.hasGuestExperience,companyLogoFallbackUrl:Be,imageCdnUrl:e.commonVideoProps.imageCdnUrl}),z?(0,B.jsx)(_e,{video:e.video,pointsOfInterest:e.pointsOfInterest,setStartTime:e=>r.playerRef.current?.currentTime(e),getTagAppLink:G.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,canViewGlance:z}):(0,B.jsx)(P,{video:e.video,currentUser:e.currentUser,headingRef:V,onLaunchImmersiveReader:q,onExitImmersiveReader:J,getTagAppLink:G.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,getPartnerProfileAppLink:G.getPartnerProfileAppLink,getPartnerDashboardHubAppLink:G.getPartnerDashboardHubAppLink,getLibraryAppLink:c(n.ViewLibraries)?G.getLibraryAppLink:null,getFolderAppLink:c(n.ViewLibraries)?G.getFolderAppLink:null}),(0,B.jsx)(je,{height:368,curriculums:e.curriculums,canViewCurriculumLinks:e.featureAccess.canViewCurriculumLinks,headingRef:V,video:e.video,hasNewSearch:e.hasNewSearch}),(0,B.jsx)(De,{headingRef:V,video:e.video,canViewResources:e.featureAccess.canViewResourceItems,imageCdnUrl:e.commonVideoProps.imageCdnUrl,getAppLink:K,analyticsData:{videoId:e.video.id,videoName:e.video.name},getImageThumbnailFallbackUrl:Ae.getImageThumbnailFallbackUrl,onDownloadClick:Ge,resources:Z,downloadableResources:Q,aboutResourcesAppLink:_.getAboutResourceAppLink()}),(0,B.jsx)(E,{presentationSlug:e.presentationSlug,headingRef:V,video:e.video,interactives:e.interactives,analyticsData:{videoId:e.video.id,videoName:e.video.name},canViewInteractives:e.featureAccess.canViewInteractives,commonVideoProps:e.commonVideoProps}),(0,B.jsx)(xe,{presentationSlug:e.presentationSlug,video:e.video,headingRef:V,clips:e.clips,canViewClips:e.featureAccess.canViewClips,audiences:e.audiences,analyticsData:{videoId:e.video.id,videoName:e.video.name},commonVideoProps:e.commonVideoProps}),z&&(0,B.jsx)(P,{video:e.video,currentUser:e.currentUser,headingRef:V,onLaunchImmersiveReader:q,onExitImmersiveReader:J,getTagAppLink:G.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,showHeading:!0,getPartnerProfileAppLink:G.getPartnerProfileAppLink,getPartnerDashboardHubAppLink:G.getPartnerDashboardHubAppLink,getLibraryAppLink:G.getLibraryAppLink,getFolderAppLink:G.getFolderAppLink}),e.shouldShowTranscript&&(0,B.jsx)(fe,{headingRef:V,video:e.video,subtitles:e.subtitles,vttSubtitles:e.vttSubtitles,chapters:e.chapters,onShowInVideo:Ue,signUpLink:{action:m.SignUp.SIGN_UP,application:a.SIGN_UP},setStartTime:We,isBot:e.isBot,isPaused:i,isAuthenticated:e.currentUser.isAuthenticated,playerApiUrl:e.playerApiUrl}),e.featureAccess.canViewCitations&&(0,B.jsx)(he,{headingRef:V,media:e.video,contentRegion:e.currentUser.contentRegion,shareId:e.shareId,presentationSlug:e.presentationSlug}),Ve&&(0,B.jsx)(ye,{topics:e.relatedTopics,getAppLink:e.getRelatedTopicAppLink}),(0,B.jsx)(me,{presentationSlug:e.presentationSlug,currentVideo:e.video,headingRef:V,commonVideoProps:e.commonVideoProps,relatedVideos:e.relatedVideos,currentUser:e.currentUser,getVideoAppLink:(t,n)=>_.getAppLink(t,{...n,context:e.params.context,contextId:e.params.contextId,playNext:e.params.playNext,shareId:e.shareId,moviesAndTv:e.params.mtv,includeContext:e.currentUser?.isAuthenticated},e.presentationSlug),audiences:e.audiences,moviesAndTv:e.params.mtv})]}),p&&(0,B.jsx)(k,{isExpanded:I,setIsExpanded:R,toggleTheatreMode:e.hasTheatreMode?v:null,items:U,activeId:b,setControlledId:F,analyticsData:{videoId:e.video.id,videoName:e.video.name},showInSide:e.shouldShowSideTableOfContents,isTheatreMode:!1,hasTranscription:e.hasTheatreMode,shouldShowToc:U.length>=3,additionalComponents:[$?(0,B.jsx)(N,{className:`mt-2`,topics:e.relatedTopics,getAppLink:e.getRelatedTopicAppLink}):void 0]})]})]}),!p&&(0,B.jsx)(k,{isExpanded:I,setIsExpanded:R,toggleTheatreMode:e.hasTheatreMode?v:null,items:U,activeId:b,setControlledId:F,analyticsData:{videoId:e.video.id,videoName:e.video.name},showInSide:e.shouldShowSideTableOfContents,isTheatreMode:!1,hasTranscription:e.hasTheatreMode,shouldShowToc:U.length>=3,additionalComponents:[$?(0,B.jsx)(N,{className:`mt-2`,topics:e.relatedTopics,getAppLink:e.getRelatedTopicAppLink}):void 0]})]})})}function U(e,t){let n=o(p.currentUser()),{canViewTranscript:r}=v({objectId:e,objectTypeId:l.Video}),i=o(t?f.sharedVideo(e,t):f.video(e)),a=r&&!!i.data?._curationTags?.value?.isClickViewCurated;return{shouldShowTranscript:a,shouldFetchTranscript:a&&!n.data?.isAuthenticated}}export{H as n,I as r,U as t};
2
+ //# sourceMappingURL=DdVzer9F.chunk.js.map