@clickview/exchange 0.62.0-rc.0 → 0.62.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 (123) hide show
  1. package/dist/.vite/manifest.json +531 -531
  2. package/dist/bundles.json +1 -1
  3. package/dist/css/Crtlho0p.chunk.css +8 -0
  4. package/dist/en.json +1 -1
  5. package/dist/scripts/{cIPkkuhG.chunk.js → 1iKkdpYv.chunk.js} +2 -2
  6. package/dist/scripts/{cIPkkuhG.chunk.js.map → 1iKkdpYv.chunk.js.map} +1 -1
  7. package/dist/scripts/{uPFXIvcK2.chunk.js → 8pXw5z942.chunk.js} +2 -2
  8. package/dist/scripts/{uPFXIvcK2.chunk.js.map → 8pXw5z942.chunk.js.map} +1 -1
  9. package/dist/scripts/{DVVx1aiS2.chunk.js → B7m3cCi42.chunk.js} +2 -2
  10. package/dist/scripts/{DVVx1aiS2.chunk.js.map → B7m3cCi42.chunk.js.map} +1 -1
  11. package/dist/scripts/{DBJfKQKx.chunk.js → BAN6QE-X.chunk.js} +2 -2
  12. package/dist/scripts/{DBJfKQKx.chunk.js.map → BAN6QE-X.chunk.js.map} +1 -1
  13. package/dist/scripts/{YGLkoFLc.chunk.js → BHbt9wzx.chunk.js} +2 -2
  14. package/dist/scripts/{YGLkoFLc.chunk.js.map → BHbt9wzx.chunk.js.map} +1 -1
  15. package/dist/scripts/{DeevL6eQ.chunk.js → BINz0dmF.chunk.js} +2 -2
  16. package/dist/scripts/{DeevL6eQ.chunk.js.map → BINz0dmF.chunk.js.map} +1 -1
  17. package/dist/scripts/{Dg-h5qnR.chunk.js → BPYdRA7H.chunk.js} +2 -2
  18. package/dist/scripts/{Dg-h5qnR.chunk.js.map → BPYdRA7H.chunk.js.map} +1 -1
  19. package/dist/scripts/{CkH6ird3.chunk.js → BS8sYAAh.chunk.js} +2 -2
  20. package/dist/scripts/{CkH6ird3.chunk.js.map → BS8sYAAh.chunk.js.map} +1 -1
  21. package/dist/scripts/{CKrB9r9w.chunk.js → BaSi1pig.chunk.js} +2 -2
  22. package/dist/scripts/{CKrB9r9w.chunk.js.map → BaSi1pig.chunk.js.map} +1 -1
  23. package/dist/scripts/{BRQhDr-02.chunk.js → BbrEvwAi2.chunk.js} +2 -2
  24. package/dist/scripts/{BRQhDr-02.chunk.js.map → BbrEvwAi2.chunk.js.map} +1 -1
  25. package/dist/scripts/{Ct8ETEOn2.chunk.js → Bi8itw8v2.chunk.js} +2 -2
  26. package/dist/scripts/{Ct8ETEOn2.chunk.js.map → Bi8itw8v2.chunk.js.map} +1 -1
  27. package/dist/scripts/{Co_6cSBX2.chunk.js → BlOKamx72.chunk.js} +2 -2
  28. package/dist/scripts/{Co_6cSBX2.chunk.js.map → BlOKamx72.chunk.js.map} +1 -1
  29. package/dist/scripts/{B0hNKKDw2.chunk.js → BobZ5p_m2.chunk.js} +2 -2
  30. package/dist/scripts/{B0hNKKDw2.chunk.js.map → BobZ5p_m2.chunk.js.map} +1 -1
  31. package/dist/scripts/{Nx0q4bij.chunk.js → BsLLiG1-.chunk.js} +2 -2
  32. package/dist/scripts/{Nx0q4bij.chunk.js.map → BsLLiG1-.chunk.js.map} +1 -1
  33. package/dist/scripts/{D0H6Hjd-2.chunk.js → BtdygabL2.chunk.js} +2 -2
  34. package/dist/scripts/{D0H6Hjd-2.chunk.js.map → BtdygabL2.chunk.js.map} +1 -1
  35. package/dist/scripts/{UjMbny4R.chunk.js → Bue5_bLM.chunk.js} +2 -2
  36. package/dist/scripts/{UjMbny4R.chunk.js.map → Bue5_bLM.chunk.js.map} +1 -1
  37. package/dist/scripts/{DBKlntFN2.chunk.js → BvamDkjt2.chunk.js} +2 -2
  38. package/dist/scripts/{DBKlntFN2.chunk.js.map → BvamDkjt2.chunk.js.map} +1 -1
  39. package/dist/scripts/{NInuYe7b2.chunk.js → BzJLc19T2.chunk.js} +2 -2
  40. package/dist/scripts/{NInuYe7b2.chunk.js.map → BzJLc19T2.chunk.js.map} +1 -1
  41. package/dist/scripts/{DyRGf1o8.chunk.js → C03mMZ4k.chunk.js} +2 -2
  42. package/dist/scripts/{DyRGf1o8.chunk.js.map → C03mMZ4k.chunk.js.map} +1 -1
  43. package/dist/scripts/{BV2vTX2L.chunk.js → C2AXrtJf.chunk.js} +2 -2
  44. package/dist/scripts/{BV2vTX2L.chunk.js.map → C2AXrtJf.chunk.js.map} +1 -1
  45. package/dist/scripts/{Fu0bLEzl2.chunk.js → C3Hw2TpW2.chunk.js} +2 -2
  46. package/dist/scripts/{Fu0bLEzl2.chunk.js.map → C3Hw2TpW2.chunk.js.map} +1 -1
  47. package/dist/scripts/{DoTtsl0X.chunk.js → CKL4ViMC.chunk.js} +2 -2
  48. package/dist/scripts/{DoTtsl0X.chunk.js.map → CKL4ViMC.chunk.js.map} +1 -1
  49. package/dist/scripts/{DtYC8Udi2.chunk.js → CKZJ2qae2.chunk.js} +2 -2
  50. package/dist/scripts/{DtYC8Udi2.chunk.js.map → CKZJ2qae2.chunk.js.map} +1 -1
  51. package/dist/scripts/{CyAM5o2e.chunk.js → CK_CN_mA.chunk.js} +2 -2
  52. package/dist/scripts/{CyAM5o2e.chunk.js.map → CK_CN_mA.chunk.js.map} +1 -1
  53. package/dist/scripts/{B6mSouu5.chunk.js → CL9SkODG.chunk.js} +2 -2
  54. package/dist/scripts/{B6mSouu5.chunk.js.map → CL9SkODG.chunk.js.map} +1 -1
  55. package/dist/scripts/{BHKm8WQq2.chunk.js → Ca_-2JTE2.chunk.js} +2 -2
  56. package/dist/scripts/{BHKm8WQq2.chunk.js.map → Ca_-2JTE2.chunk.js.map} +1 -1
  57. package/dist/scripts/{C7OCN_w_.chunk.js → CfNYdg0m.chunk.js} +2 -2
  58. package/dist/scripts/{C7OCN_w_.chunk.js.map → CfNYdg0m.chunk.js.map} +1 -1
  59. package/dist/scripts/{CUdaR862.chunk.js → Ct_4zyE3.chunk.js} +2 -2
  60. package/dist/scripts/{CUdaR862.chunk.js.map → Ct_4zyE3.chunk.js.map} +1 -1
  61. package/dist/scripts/{RiPZGw_q2.chunk.js → CxUrOnxW2.chunk.js} +2 -2
  62. package/dist/scripts/{RiPZGw_q2.chunk.js.map → CxUrOnxW2.chunk.js.map} +1 -1
  63. package/dist/scripts/{BJxTZJOX.chunk.js → DFXpg6rF.chunk.js} +2 -2
  64. package/dist/scripts/{BJxTZJOX.chunk.js.map → DFXpg6rF.chunk.js.map} +1 -1
  65. package/dist/scripts/{CKNdXwxe2.chunk.js → DG6L7zHU2.chunk.js} +2 -2
  66. package/dist/scripts/{CKNdXwxe2.chunk.js.map → DG6L7zHU2.chunk.js.map} +1 -1
  67. package/dist/scripts/{CvQQNf_J2.chunk.js → DKz4jhnr2.chunk.js} +2 -2
  68. package/dist/scripts/{CvQQNf_J2.chunk.js.map → DKz4jhnr2.chunk.js.map} +1 -1
  69. package/dist/scripts/{BOvQpQ21.chunk.js → DSZkTUVU.chunk.js} +2 -2
  70. package/dist/scripts/{BOvQpQ21.chunk.js.map → DSZkTUVU.chunk.js.map} +1 -1
  71. package/dist/scripts/{D5qMnGHT2.chunk.js → D_k-Kl3-2.chunk.js} +2 -2
  72. package/dist/scripts/{D5qMnGHT2.chunk.js.map → D_k-Kl3-2.chunk.js.map} +1 -1
  73. package/dist/scripts/{Dp0gbhZx2.chunk.js → DfOgl-0-2.chunk.js} +2 -2
  74. package/dist/scripts/{Dp0gbhZx2.chunk.js.map → DfOgl-0-2.chunk.js.map} +1 -1
  75. package/dist/scripts/{CeCXhgoJ.chunk.js → DkB0qBxI.chunk.js} +2 -2
  76. package/dist/scripts/{CeCXhgoJ.chunk.js.map → DkB0qBxI.chunk.js.map} +1 -1
  77. package/dist/scripts/{CeHHO1Hv.chunk.js → DmVXt6_V.chunk.js} +2 -2
  78. package/dist/scripts/{CeHHO1Hv.chunk.js.map → DmVXt6_V.chunk.js.map} +1 -1
  79. package/dist/scripts/{aDegERgV2.chunk.js → DqM6hYTJ2.chunk.js} +2 -2
  80. package/dist/scripts/{aDegERgV2.chunk.js.map → DqM6hYTJ2.chunk.js.map} +1 -1
  81. package/dist/scripts/{BPgKK-d32.chunk.js → DsHiClyc2.chunk.js} +2 -2
  82. package/dist/scripts/{BPgKK-d32.chunk.js.map → DsHiClyc2.chunk.js.map} +1 -1
  83. package/dist/scripts/{D9zlZIWi2.chunk.js → DuPL-nK72.chunk.js} +2 -2
  84. package/dist/scripts/{D9zlZIWi2.chunk.js.map → DuPL-nK72.chunk.js.map} +1 -1
  85. package/dist/scripts/{ZSP3Vfha2.chunk.js → EIJf9JbR2.chunk.js} +2 -2
  86. package/dist/scripts/{ZSP3Vfha2.chunk.js.map → EIJf9JbR2.chunk.js.map} +1 -1
  87. package/dist/scripts/{CqNKzFA4.chunk.js → EO2xPuAQ.chunk.js} +2 -2
  88. package/dist/scripts/{CqNKzFA4.chunk.js.map → EO2xPuAQ.chunk.js.map} +1 -1
  89. package/dist/scripts/{o2htB_49.chunk.js → F1LOVRO_.chunk.js} +2 -2
  90. package/dist/scripts/{o2htB_49.chunk.js.map → F1LOVRO_.chunk.js.map} +1 -1
  91. package/dist/scripts/{BggsU83p2.chunk.js → G-hiM6b42.chunk.js} +2 -2
  92. package/dist/scripts/{BggsU83p2.chunk.js.map → G-hiM6b42.chunk.js.map} +1 -1
  93. package/dist/scripts/{B0VKYPiu.chunk.js → MYu2AEsL.chunk.js} +2 -2
  94. package/dist/scripts/{B0VKYPiu.chunk.js.map → MYu2AEsL.chunk.js.map} +1 -1
  95. package/dist/scripts/{B9Rb6IIb.chunk.js → NtrZI2Ef.chunk.js} +2 -2
  96. package/dist/scripts/{B9Rb6IIb.chunk.js.map → NtrZI2Ef.chunk.js.map} +1 -1
  97. package/dist/scripts/{CRHkMr9_2.chunk.js → OBYDGOgI2.chunk.js} +2 -2
  98. package/dist/scripts/{CRHkMr9_2.chunk.js.map → OBYDGOgI2.chunk.js.map} +1 -1
  99. package/dist/scripts/{zp5MUThO.chunk.js → Pixwk-h-.chunk.js} +2 -2
  100. package/dist/scripts/{zp5MUThO.chunk.js.map → Pixwk-h-.chunk.js.map} +1 -1
  101. package/dist/scripts/{Ds3cFntF2.chunk.js → SDRXIwM22.chunk.js} +3 -3
  102. package/dist/scripts/{Ds3cFntF2.chunk.js.map → SDRXIwM22.chunk.js.map} +1 -1
  103. package/dist/scripts/{C1u2qBZg2.chunk.js → U0UyGd9c2.chunk.js} +2 -2
  104. package/dist/scripts/{C1u2qBZg2.chunk.js.map → U0UyGd9c2.chunk.js.map} +1 -1
  105. package/dist/scripts/{CYUx40jk.chunk.js → amjwjus3.chunk.js} +2 -2
  106. package/dist/scripts/{CYUx40jk.chunk.js.map → amjwjus3.chunk.js.map} +1 -1
  107. package/dist/scripts/{app-DDrsm5nt.js → app-BGxmHvGl.js} +3 -3
  108. package/dist/scripts/{app-DDrsm5nt.js.map → app-BGxmHvGl.js.map} +1 -1
  109. package/dist/scripts/{CgGl8jzo.chunk.js → eUKFc6dK.chunk.js} +2 -2
  110. package/dist/scripts/{CgGl8jzo.chunk.js.map → eUKFc6dK.chunk.js.map} +1 -1
  111. package/dist/scripts/{CWsmm40y.chunk.js → l7UAnIb0.chunk.js} +2 -2
  112. package/dist/scripts/{CWsmm40y.chunk.js.map → l7UAnIb0.chunk.js.map} +1 -1
  113. package/dist/scripts/{BsSKrRku2.chunk.js → nMyWveQA2.chunk.js} +2 -2
  114. package/dist/scripts/{BsSKrRku2.chunk.js.map → nMyWveQA2.chunk.js.map} +1 -1
  115. package/dist/scripts/{CKUk2HqE.chunk.js → pOL5_XNC.chunk.js} +2 -2
  116. package/dist/scripts/{CKUk2HqE.chunk.js.map → pOL5_XNC.chunk.js.map} +1 -1
  117. package/dist/scripts/{eLmgigsW.chunk.js → sViLex0Q.chunk.js} +2 -2
  118. package/dist/scripts/{eLmgigsW.chunk.js.map → sViLex0Q.chunk.js.map} +1 -1
  119. package/dist/scripts/{Xs1Bv1h-.chunk.js → vvCGyl_q.chunk.js} +2 -2
  120. package/dist/scripts/{Xs1Bv1h-.chunk.js.map → vvCGyl_q.chunk.js.map} +1 -1
  121. package/dist/scripts/{BijIuzIs2.chunk.js → xEGWFFpD2.chunk.js} +2 -2
  122. package/dist/scripts/{BijIuzIs2.chunk.js.map → xEGWFFpD2.chunk.js.map} +1 -1
  123. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CqNKzFA4.chunk.js","names":[],"sources":["../../../../libs/shared/src/interfaces/models/curated-widget/CuratedWidget.ts","../../../../libs/shared/src/apps/search/interfaces/SearchTypes.ts","../../../../libs/shared/src/apps/search/interfaces/SearchFilter.ts","../../../../libs/shared/src/enums/WidgetTemplate.ts","../../../../libs/shared/src/enums/WidgetTypeId.ts","../../../../libs/shared/src/utils/DashboardHelper.ts","../../../../libs/shared/src/constants/WidgetTypeIdConfig.ts","../../../../libs/shared/src/images/svg/status/WarningOutlineSvg.tsx","../../../../libs/shared/src/enums/WidgetStatus.ts","../../../../libs/shared/src/utils/WidgetHelper.ts","../../../../libs/shared/src/components/widgets/curated-widgets/components/header/widget-header.module.scss","../../../../libs/shared/src/components/widgets/curated-widgets/components/header/WidgetHeader.tsx","../../../../libs/shared/src/enums/TagType.ts","../../../../libs/shared/src/components/tags/tags.module.scss","../../../../libs/shared/src/components/tags/TagItem.tsx"],"sourcesContent":["import { HashObject } from 'libs/common/react/interfaces';\n\nimport { AllWidgetTemplateProps } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { ButtonIcon } from 'libs/shared/constants/WidgetThemingConstants';\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { CuratedObjectsWidgetData, CuratedWidgetContent, CuratedWidgetData } from 'libs/shared/interfaces';\n\nexport enum CuratedDashboardAppLink {\n LatestReleases = 'latest-releases',\n ExploreAllTopics = 'explore-all-topics',\n ClassificationLatestReleases = 'classification-latest-releases',\n ClassificationDirectory = 'classification-directory'\n}\n\nexport enum CuratedWidgetCtaAppLink {\n TopicDirectory = 'topic-directory',\n TopicNewReleases = 'topic-new-releases',\n CuratedTopic = 'curated-topic'\n}\n\nexport interface BaseWidget<TContent extends HashObject = HashObject> {\n index: number;\n templateId: WidgetTemplate;\n widgetId: WidgetTypeId;\n name: string;\n description?: string;\n content?: TContent;\n}\n\nexport interface WidgetCta {\n text?: string;\n href?: string;\n icon?: ButtonIcon;\n appLink?: CuratedWidgetCtaAppLink;\n}\n\nexport type WidgetMetadata = AllWidgetTemplateProps['metadata'] & {\n showInTableOfContents: boolean,\n tocIndentation: number,\n headingOptional: boolean,\n aiAddedVideo: boolean\n};\n\nexport interface WidgetPreference {\n id: string;\n index?: number;\n hidden?: boolean;\n}\n\nexport interface CuratedWidget<\n TData extends CuratedWidgetData = CuratedWidgetData,\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> extends BaseWidget<TContent> {\n id: string;\n dashboardId: string;\n data: TData;\n status: WidgetStatus;\n metadata?: Partial<WidgetMetadata>;\n preferences?: WidgetPreference[];\n cursor?: string;\n\n // If a widget has curriculum IDs set, then it won't be accessible to anyone who doesn't have one of those curriculums\n curriculumIds?: string[];\n}\n\nexport type CuratedMediaWidget<\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> = CuratedWidget<CuratedObjectsWidgetData, TContent>;\n","import { ObjectHash } from 'backbone';\nimport Bloodhound from 'bloodhound';\n\nimport { SearchIndices } from 'libs/shared/apps/search/interfaces';\n\nexport interface RemoteSearch<T> extends Bloodhound.BloodhoundOptions<T> {\n remote: Bloodhound.RemoteOptions<T>;\n}\n\nexport interface LocalSearch<T> extends Bloodhound.BloodhoundOptions<T> {\n local: T[] | (() => T[]);\n}\n\nexport type TypeaheadDataSource<T> = Bloodhound<T> |\n((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void);\n\nexport interface InstantSearchBloodhound<T> {\n bloodhound: TypeaheadDataSource<T>;\n name: string;\n}\n\nexport type TypeaheadConfig<T> = Twitter.Typeahead.Dataset<T>;\n\nexport interface TypeaheadConfigHandler<T> {\n (source?: InstantSearchBloodhound<T>, index?: number, options?: ObjectHash): Twitter.Typeahead.Dataset<T>;\n}\n\nexport interface BloodhoundConfigHandler<T> {\n (source: string, options?: ObjectHash): LocalSearch<T> | RemoteSearch<T>;\n}\n\nexport interface TypeaheadSourceItem<T> {\n name: string;\n typeaheadConfig: TypeaheadConfigHandler<T>;\n bloodhoundConfig?: BloodhoundConfigHandler<T>;\n options?: ObjectHash;\n}\n\nexport const AllSearchIndicesVideoStyle: SearchIndices[] = [ 'video', 'clip', 'interactive' ];\nexport const AllSearchIndicesInSearch: SearchIndices[] = [ 'playlist', 'series', 'clip', 'classification', 'interactive', 'video', 'company', 'category', 'partner_profile' ];\nexport const AllSearchIndicesInUserManager: SearchIndices[] = ['user'];\n","import { SvgIcon } from 'libs/shared/utils/SvgHelper';\n\nimport { FilterStateHash } from '../reducers';\n\nimport { FilterProps } from './FilterProps';\nimport { SearchIndices } from './SearchResults';\n\nconst FilterIdNames =\n [\n 'sort', // \"sort\" isn't even a filter but it tends to go with our filters in our designs\n 'classification',\n 'presentation',\n 'audience',\n 'yearGroup',\n 'moviesAndTv',\n 'type',\n 'rating',\n 'interactives',\n 'clips',\n 'classroom',\n 'hasResources',\n 'hasSubtitles',\n 'productionYear',\n 'isHd',\n 'producedByClickView',\n 'duration',\n 'tagOrClassification',\n 'status',\n 'isAdmin',\n 'bulkActionType',\n 'userType',\n 'filter',\n 'channel',\n 'dateBroadcast',\n 'categoryId',\n 'hasInteractives',\n 'jobStatus',\n 'source',\n 'customerStatus',\n 'specialEventType',\n 'customerType',\n 'seriesId',\n 'scopeId'\n ] as const;\n\n/**\n * Any filters that shouldn't be sent to the backend as a filter\n * and are instead handled differently by the frontend\n */\nconst FilterBlacklist: Partial<Record<FilterIds, boolean>> = {\n type: true\n};\n\nexport type FilterIds = typeof FilterIdNames[number];\n\nexport const FilterWhitelist = FilterIdNames.reduce((acc, prev) => {\n return {\n ...acc,\n [prev]: !FilterBlacklist[prev]\n };\n}, {} as Record<FilterIds, boolean>);\n\nexport type FilterType = 'radio' | 'checkbox' | 'nested-checkbox' | 'grouped-checkbox' | 'switch' | 'more-filters' | 'rating' | 'dropdown' | 'tag' | 'button';\n\nexport interface SearchFilter<TFilterOptionId = string> {\n id: FilterIds;\n type: FilterType;\n compatibleIndices: SearchIndices[];\n\n name?: string;\n icon?: SvgIcon;\n description?: string;\n options?: FilterOption<TFilterOptionId>[];\n labelPrefix?: string;\n\n // For second layer options, for example 'presentation' checkbox filter has 'audience' as second layer option\n secondaryId?: FilterIds;\n\n customComponent?: (props: FilterProps) => JSX.Element;\n disabled?: boolean;\n disableOptions?: (options: FilterOption[], filters: SearchFilter[], state: FilterStateHash) => FilterOption[];\n}\n\nexport interface MoreFilters extends Omit<SearchFilter, 'id' | 'compatibleIndices'> {\n filters: SearchFilter[];\n id: string;\n}\n\nexport interface FilterOption<TId = string> {\n id: TId;\n name: string;\n default?: boolean;\n disabled?: boolean;\n secondLayerSelection?: FilterOption[];\n secondLayerOptions?: FilterOption[];\n group?: string;\n}\n\nexport type ProductionYearFilterOptions =\n 'any-year' |\n 'this-year' |\n 'last-3-years' |\n 'last-5-years';\n\nexport type DurationFilterOptions =\n 'bite-sized' |\n 'short' |\n 'medium' |\n 'long';\n\nexport enum SourceFilterOptions {\n MyVideos = 'my-videos',\n School = 'school',\n ExchangeArchive = 'exchange-archive',\n ClickView = 'clickview',\n LiveStreams = 'livestreams'\n}\n\nexport enum TypeFilterOptions {\n Video = 'video',\n Series = 'series',\n Playlist = 'playlist',\n Classification = 'classification',\n Clip = 'clip',\n Interactive = 'interactive',\n Company = 'company',\n Category = 'category',\n PartnerProfile = 'partner_profile'\n}\n","export enum WidgetTemplate {\n // Videos\n ThumbnailHeroMedia = 'thumbnail_hero_media',\n ThumbnailFeaturedMedia = 'thumbnail_featured_media',\n ThumbnailSlidingListSmall = 'thumbnail_sliding_list_small',\n ThumbnailSlidingListSmallV2 = 'thumbnail_sliding_list_small_v2',\n ThumbnailSlidingListLarge = 'thumbnail_sliding_list_large',\n ThumbnailFixedListMediaSmall = 'thumbnail_fixed_list_media_small',\n ThumbnailFixedListMediaLarge = 'thumbnail_fixed_list_media_large',\n ThumbnailFixedListFolderSmall = 'thumbnail_fixed_list_folder_small',\n ThumbnailVerticalList = 'thumbnail_vertical_list',\n PopoutThumbnailSlidingListLarge = 'popout_thumbnail_sliding_list_large',\n PopoutThumbnailSlidingListSmall = 'popout_thumbnail_sliding_list_small',\n FeaturedThumbnailSlidingList = 'featured_thumbnail_sliding_list',\n ThumbnailFixedListXLarge = 'thumbnail_fixed_list_xlarge',\n\n // Topics\n CoverSlidingPillListSmall = 'cover_sliding_pill_list_small',\n CoverFixedPillListLarge = 'cover_fixed_pill_list_large',\n StatsCoverFixedPillListLarge = 'stats_cover_fixed_pill_list_large',\n CoverFixedPillListXSmall = 'cover_fixed_pill_list_xsmall',\n ThumbnailFixedListLarge = 'thumbnail_fixed_list_large',\n ThumbnailFixedListSmall = 'thumbnail_fixed_list_small',\n EditableCoverFixedPillListSmall = 'editable_cover_fixed_pill_list_small',\n HeroBanner = 'hero_banner',\n HeroThumbnailSmall = 'hero_thumbnail_small',\n HeroBlockColourSmall = 'hero_block_colour_small',\n\n // Curriculum\n CurriculumResourcesAccordion = 'curriculum_resources_accordion',\n CurriculumCodeSearchResults = 'curriculum_code_search_results',\n\n // Playlists\n CoverFixedTileList = 'cover_fixed_tile_list',\n\n // Topics & Series\n PosterSlidingListLarge = 'poster_sliding_list_large',\n PosterSlidingListMedium = 'poster_sliding_list_medium',\n PosterSlidingListSmall = 'poster_sliding_list_small',\n PosterFixedListLarge = 'poster_fixed_list_large',\n\n // Blurbs & Topics\n HeroBannerSmall = 'hero_banner_small',\n\n // Text-based blurbs\n Heading = 'heading',\n AuthorReviewer = 'author_reviewer',\n Question = 'question',\n QuestionAccordion = 'question_accordion',\n\n // Companies / Studios / Content Partners\n CircleLogoSlidingList = 'circle_logo_sliding_list',\n RectangularLogoSlidingList = 'rectangular_logo_sliding_list',\n RectangularLogoFixedList = 'rectangular_logo_fixed_list',\n ThumbnailFixedListSearchCta = 'thumbnail_fixed_list_search_cta',\n InfiniteThumbnailVerticalList = 'infinite_thumbnail_vertical_list',\n\n // Rating filters\n FilterSlidingPillListSmall = 'filter_sliding_pill_list_small',\n\n // Special events\n EventIconSlidingList = 'event_icon_sliding_list',\n\n // Tags filter\n TagSlidingList = 'tag_sliding_list',\n\n SearchSuggestionsBlurb = 'search_suggestions_blurb'\n}\n","export enum WidgetTypeId {\n // Video group\n CuratedMedia = 'curated_media',\n PlaylistMedia = 'playlist_media',\n SeriesMedia = 'series_media',\n ClassificationMedia = 'classification_media',\n LatestReleasedVideos = 'latest_released_videos',\n ContinueWatching = 'continue_watching_videos',\n CompanyLatestReleasedVideo = 'company_latest_released_video',\n CompanyVideos = 'company_videos',\n ClassificationLatestReleasedVideo = 'classification_latest_released_video',\n ClassificationLatestReleasedVideosV2 = 'classification_latest_released_videos_v2',\n CompanyClassificationVideos = 'company_classification_videos',\n ClassificationDashboardMedia = 'classification_dashboard_media',\n ClassificationDashboardExternalMedia = 'classification_dashboard_external_media',\n SeasonalClassificationMedia = 'seasonal_classification_media',\n TrendingClassificationsMedia = 'trending_classifications_media',\n ClassificationCurriculumMedia = 'classification_curriculum_media',\n\n // Topics group\n CuratedClassifications = 'curated_classifications',\n Classifications = 'classifications',\n ClassificationLatestReleasedVideos = 'classification_latest_released_videos',\n SpecialEventClassifications = 'special_event_classifications',\n LatestReleasedClassifications = 'latest_released_classifications',\n TrendingClassifications = 'trending_classifications',\n\n // Series group\n CuratedSeries = 'curated_series',\n\n // Playlists group\n CuratedPlaylists = 'curated_playlists',\n\n // Blurb group\n Blurb = 'blurb',\n DynamicBlurb = 'dynamic_blurb',\n AuthorReviewer = 'author_reviewer',\n Faq = 'faq',\n\n // Network group\n CuratedCompanies = 'curated_companies',\n\n // Partner Profile group\n CuratedContentPartners = 'curated_content_partners',\n ContentPartnerLatestReleasedVideos = 'content_partner_latest_released_videos',\n ContentPartnerSeries = 'content_partner_series',\n ContentPartnerVideos = 'content_partner_videos',\n SpotlightContentPartners = 'spotlight_curated_content_partners',\n ContentPartners = 'content_partners',\n ContentPartnersHub = 'content_partners_hub',\n TrendingContentPartnersVideo = 'content_partner_trending_videos',\n ContentPartnerAllVideos = 'content_partner_all_videos',\n\n // Search filter group\n Ratings = 'ratings',\n\n // Presentations group\n Presentations = 'presentations',\n\n // Livestreams group\n UpcomingLivestreams = 'upcoming_livestreams',\n\n // Multimedia group\n CuratedMultimedia = 'curated_multimedia',\n\n // Legacy widget types\n ClassificationPlaylists = 'classification_playlists',\n ClassificationSeries = 'classification_series',\n ClassificationFeaturedVideo = 'classification_featured_video',\n ClassificationPinnedVideos = 'classification_pinned_videos',\n\n // Search widget types\n SearchRelevantTopics = 'search_relevant_topics',\n SearchCompanies = 'search_companies',\n SearchTopResults = 'search_top_results',\n SearchSeries = 'search_series',\n SearchPlaylists = 'search_playlists',\n SearchMyVideosFolder = 'search_my_videos_folders',\n SearchMySchoolLibraryFolder = 'search_my_school_library_folders',\n SearchMyVideos = 'search_my_videos',\n SearchMySchoolLibraryVideos = 'search_my_school_library_videos',\n SearchExchangeArchive = 'search_exchange_archive',\n SearchRelatedResults = 'search_related_results',\n SearchTags = 'search_tags',\n SearchCurriculumCode = 'search_curriculum_code',\n SearchSuggestions = 'search_suggestions',\n SearchContentPartners = 'search_content_partners'\n}\n","import { FormikContextType } from 'formik';\n\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SearchResultObjectTypes } from 'libs/shared/apps/search/interfaces';\nimport { GetCustomParamOptions, WidgetTypeIdConfig } from 'libs/shared/constants/WidgetTypeIdConfig';\nimport { UserGroup } from 'libs/shared/enums/UserGroup';\nimport { OnlineUserRole } from 'libs/shared/enums/UserRole';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { SettingsHash } from 'libs/shared/hooks/useSettings';\nimport { BaseObject, ClassificationCurriculumInfo, ClassificationDashboardInfo, ClassificationDirectoryInfo, CuratedDashboard, CuratedMediaWidget, CuratedWidget, CuratedWidgetQueryParams, DashboardTargetInfo, DashboardTargetType, PartnerProfileDashboardInfo, UnknownDashboardTargetInfo } from 'libs/shared/interfaces';\n\ninterface LatestReleasesTimeRange {\n from: string;\n to: string;\n}\n\nexport const DashboardHelper = {\n\n /**\n * Same implementation as GetUserGroup() in Online.\n * @param userRole \n */\n getUserGroup(userRole: OnlineUserRole): UserGroup {\n if (userRole === OnlineUserRole.Student)\n return UserGroup.Learner;\n\n return UserGroup.Staff;\n }\n};\n\nexport const CuratedDashboardHelper = {\n onSelectCuratedObject(\n selectedObj: SearchResultObjectTypes | BaseObject,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const data = {\n ...formikProps.values.data,\n objectIds: ArrayHelper.addOrRemoveImmutable(formikProps.values.data.objectIds || [], selectedObj.id)\n };\n \n formikProps.setFieldValue('data', data);\n \n formikProps.setTouched({\n ...formikProps.touched,\n data: {\n objectIds: true\n }\n });\n },\n\n onRemoveCuratedObject(\n objectId: string,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const newData = {\n ...formikProps.values.data,\n objectIds: formikProps.values.data.objectIds.filter(id => id !== objectId)\n };\n\n formikProps.setFieldValue('data', newData);\n },\n\n getDashboardTarget(info: DashboardTargetInfo): string {\n if (info.targetType === DashboardTargetType.Discover)\n return `discover:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Classification)\n return `classification:${info.classificationId}`;\n\n if (info.targetType === DashboardTargetType.ClassificationDirectory)\n return `classification:${info.classificationId}:directory`;\n\n if (info.targetType === DashboardTargetType.ClassificationCurriculum)\n return `classification:${info.classificationId}:curriculum`;\n\n if (info.targetType === DashboardTargetType.MoviesAndTv)\n return `moviesAndTv:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Company)\n return `company:${info.companyId}:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.PartnerProfile)\n return `partnerprofile:${info.slug}`;\n\n if (info.targetType === DashboardTargetType.DiscoverPartnerProfiles)\n return `discover:partners`;\n\n if (info.targetType === DashboardTargetType.PartnerProfileHub)\n return `discover:partners:hub`;\n\n return null;\n },\n\n getUnknownDashboardTarget(options: UnknownDashboardTargetInfo): string {\n const {\n presentationId,\n companyId,\n targetType,\n classificationId,\n slug\n } = options;\n\n if (targetType === DashboardTargetType.Discover) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Discover,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.MoviesAndTv) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.Company) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Company,\n presentationId,\n companyId\n });\n }\n \n if (targetType === DashboardTargetType.Classification) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Classification,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationDirectory) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationCurriculum) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfile) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfile,\n slug\n });\n }\n\n if (targetType === DashboardTargetType.DiscoverPartnerProfiles) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.DiscoverPartnerProfiles\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfileHub) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfileHub\n });\n }\n },\n\n getDashboardTargetInfo(dashboard: CuratedDashboard): DashboardTargetInfo {\n const type = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n const split = dashboard?.target?.split(':');\n\n if (type === DashboardTargetType.Discover) {\n return {\n targetType: DashboardTargetType.Discover,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Classification) {\n return {\n targetType: DashboardTargetType.Classification,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationDirectory) {\n return {\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationCurriculum) {\n return {\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.MoviesAndTv) {\n return {\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Company) {\n return {\n targetType: DashboardTargetType.Company,\n companyId: split[1],\n presentationId: split[3]\n };\n }\n\n if (type === DashboardTargetType.PartnerProfile) {\n return {\n targetType: DashboardTargetType.PartnerProfile,\n slug: split[1]\n };\n }\n\n return null;\n },\n\n getDashboardTargetType(dashboard: CuratedDashboard): DashboardTargetType {\n if (!dashboard?.target)\n return null;\n\n if (dashboard.target.startsWith('discover')) {\n if (dashboard.target.endsWith('partners'))\n return DashboardTargetType.DiscoverPartnerProfiles;\n\n if (dashboard.target.endsWith('hub'))\n return DashboardTargetType.PartnerProfileHub;\n\n return DashboardTargetType.Discover;\n }\n\n if (dashboard.target.startsWith('classification')) {\n if (dashboard.target.endsWith('directory'))\n return DashboardTargetType.ClassificationDirectory;\n\n if (dashboard.target.endsWith('curriculum'))\n return DashboardTargetType.ClassificationCurriculum;\n\n return DashboardTargetType.Classification;\n }\n\n if (dashboard.target.startsWith('moviesAndTv'))\n return DashboardTargetType.MoviesAndTv;\n\n if (dashboard.target.startsWith('company')) {\n return DashboardTargetType.Company;\n }\n\n if (dashboard.target.startsWith('partnerprofile'))\n return DashboardTargetType.PartnerProfile;\n\n return null;\n },\n\n isType(dashboard: CuratedDashboard, target: DashboardTargetType): boolean {\n return CuratedDashboardHelper.getDashboardTargetType(dashboard) === target;\n },\n\n isCuratedDashboard(obj: BaseObject): obj is CuratedDashboard {\n const dashboard = obj as CuratedDashboard;\n\n const targetType = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n\n if (targetType === DashboardTargetType.Discover)\n return true;\n\n if (targetType === DashboardTargetType.Classification)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationDirectory)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationCurriculum)\n return true;\n\n if (targetType === DashboardTargetType.MoviesAndTv)\n return true;\n\n if (targetType === DashboardTargetType.Company)\n return true;\n\n return false;\n },\n\n getLatestReleasedTimeRange(): LatestReleasesTimeRange {\n const now = new Date();\n const from = DateHelper.format(DateHelper.endOf(DateHelper.subtract(now, 2, 'month'), 'day'), 'YYYY-MM-DD');\n const to = DateHelper.format(DateHelper.endOf(now, 'day'), 'YYYY-MM-DD');\n return { from, to };\n },\n\n getWidgetParams(\n widgetTypeId: WidgetTypeId,\n templateId: WidgetTemplate,\n target: DashboardTargetType,\n audienceIds?: string | string[],\n preferredCurriculumId?: string,\n options?: GetCustomParamOptions\n ): CuratedWidgetQueryParams {\n const params: CuratedWidgetQueryParams = { };\n\n if (audienceIds)\n params.audienceId = audienceIds;\n\n if (widgetTypeId === WidgetTypeId.ClassificationCurriculumMedia)\n params.curriculumPresentationId = preferredCurriculumId;\n\n return {\n ...params,\n ...WidgetTypeIdConfig[widgetTypeId]?.getCustomParams?.(templateId, target, options)\n };\n },\n\n isSystemGeneratedDashboard(widgets: CuratedWidget[]): boolean {\n const systemGeneratedClassificationWidgetTypes = new Set<WidgetTypeId>([\n WidgetTypeId.ClassificationFeaturedVideo,\n WidgetTypeId.ClassificationPinnedVideos,\n WidgetTypeId.ClassificationPlaylists,\n WidgetTypeId.ClassificationSeries\n ]);\n\n return widgets?.some(widget => systemGeneratedClassificationWidgetTypes.has(widget.widgetId));\n },\n\n isClassificationDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDashboardInfo | ClassificationDirectoryInfo | ClassificationCurriculumInfo {\n return [\n DashboardTargetType.Classification,\n DashboardTargetType.ClassificationDirectory,\n DashboardTargetType.ClassificationCurriculum\n ].includes(targetInfo?.targetType);\n },\n\n isContentPartnerDashboard(targetInfo: DashboardTargetInfo): targetInfo is PartnerProfileDashboardInfo {\n return targetInfo?.targetType === DashboardTargetType.PartnerProfile;\n },\n\n isDirectoryDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDirectoryInfo {\n return targetInfo?.targetType === DashboardTargetType.ClassificationDirectory;\n },\n\n isWidgetTypeEnabled(\n widgetTypeId: WidgetTypeId,\n settingsHash: SettingsHash,\n targetType: DashboardTargetType\n ): boolean {\n const config = WidgetTypeIdConfig[widgetTypeId];\n \n return config?.predicate?.({ settingsHash, targetType }) ?? true;\n }\n};\n","import { Core } from 'libs/common/backbone/index';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SourceFilterOptions, TypeFilterOptions } from '../apps/search/interfaces';\nimport { WidgetAppLinks } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTemplate } from '../enums/WidgetTemplate';\nimport { WidgetTypeId } from '../enums/WidgetTypeId';\nimport { SettingsHash } from '../hooks/useSettings';\nimport { CuratedWidgetContent, CuratedWidgetQueryParams, DashboardTargetType, Series } from '../interfaces';\nimport { CuratedDashboardHelper } from '../utils/DashboardHelper';\n\ninterface WidgetTypeIdPredicateOptions {\n settingsHash: SettingsHash;\n targetType: DashboardTargetType;\n}\n\nexport interface GetCustomParamOptions {\n params?: CuratedWidgetQueryParams;\n}\n\ninterface WidgetTypeIdConfigType {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => CuratedWidgetQueryParams;\n minContent?: number;\n getCollectionAppLink?: (\n appLinks: Partial<WidgetAppLinks>,\n content?: CuratedWidgetContent\n ) => Core.AppLink;\n /**\n * Predicate used to determine if the widget\n * should be displayed based on the target\n * type and settings. Useful for feature flagging widgets.\n */\n predicate?: (options: WidgetTypeIdPredicateOptions) => boolean;\n}\n\nfunction partnerProfileWidgetTypeIdPredicate(options: WidgetTypeIdPredicateOptions): boolean {\n return options.settingsHash?.hasPartnerProfiles ?? false;\n}\n\nexport const WidgetTypeIdConfig: Record<WidgetTypeId, WidgetTypeIdConfigType> = {\n [WidgetTypeId.CuratedMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.PlaylistMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SeriesMedia]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n switch (widgetTemplate) {\n case WidgetTemplate.ThumbnailFixedListMediaLarge:\n return { limit: 2 };\n case WidgetTemplate.ThumbnailHeroMedia:\n case WidgetTemplate.ThumbnailFeaturedMedia:\n return { limit: 1 };\n default:\n return { limit: 12 };\n }\n },\n getCollectionAppLink: (appLinks, content) => appLinks?.series?.(ArrayHelper.first(content) as Series)\n },\n [WidgetTypeId.ClassificationMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.LatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.ContinueWatching]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks?.watchHistory?.()\n },\n [WidgetTypeId.CompanyLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.CompanyVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideosV2]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.SeasonalClassificationMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.CompanyClassificationVideos]: {\n getCustomParams: () => ({}),\n minContent: 4\n },\n [WidgetTypeId.TrendingClassificationsMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n\n [WidgetTypeId.CuratedClassifications]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.TrendingClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n [WidgetTypeId.Classifications]: {\n getCustomParams: (template: WidgetTemplate, targetType: DashboardTargetType) => {\n if (targetType === DashboardTargetType.Discover) {\n if (template === WidgetTemplate.EditableCoverFixedPillListSmall) {\n return {\n canBePreferred: true,\n isFollowing: true\n };\n }\n\n if ([ WidgetTemplate.PosterSlidingListSmall, WidgetTemplate.CoverFixedPillListXSmall ].includes(template)) {\n return {\n canBePreferred: true\n };\n }\n }\n\n return {};\n }\n },\n [WidgetTypeId.ClassificationLatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.SpecialEventClassifications]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n [WidgetTypeId.LatestReleasedClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n\n [WidgetTypeId.CuratedSeries]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedPlaylists]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Blurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.DynamicBlurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.AuthorReviewer]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.Faq]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedCompanies]: {\n getCustomParams: () => ({}),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n\n [WidgetTypeId.Ratings]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Presentations]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.UpcomingLivestreams]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n\n [WidgetTypeId.CuratedMultimedia]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.ClassificationPlaylists]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationSeries]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationFeaturedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationPinnedVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardExternalMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardMedia]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.SearchRelevantTopics]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchRelevantTopics],\n type: [TypeFilterOptions.Classification]\n })\n },\n [WidgetTypeId.SearchCompanies]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchCompanies],\n type: [TypeFilterOptions.Company]\n }),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n [WidgetTypeId.SearchSeries]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchSeries],\n type: [TypeFilterOptions.Series]\n })\n },\n [WidgetTypeId.SearchPlaylists]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchPlaylists],\n type: [TypeFilterOptions.Playlist]\n })\n },\n [WidgetTypeId.SearchMyVideosFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideosFolder],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryFolder],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchMyVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideos],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryVideos],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchExchangeArchive]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchExchangeArchive],\n source: [SourceFilterOptions.ExchangeArchive]\n })\n },\n [WidgetTypeId.SearchRelatedResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTopResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationCurriculumMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTags]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchCurriculumCode]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchSuggestions]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchContentPartners]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchContentPartners],\n type: [TypeFilterOptions.PartnerProfile]\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.CuratedContentPartners]: {\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerLatestReleasedVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerSeries]: {\n getCollectionAppLink: appLinks => {\n return appLinks?.scopedSearchHome?.({\n type: [TypeFilterOptions.Series]\n });\n },\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.SpotlightContentPartners]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartners]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => ({\n letterPrefix: options?.params?.letterPrefix,\n sort: options?.params?.sort\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnersHub]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => {\n if (targetType !== DashboardTargetType.PartnerProfileHub)\n return {};\n\n return {\n objectId: options?.params?.objectId\n };\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.TrendingContentPartnersVideo]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerAllVideos]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n if (widgetTemplate === WidgetTemplate.ThumbnailFixedListSearchCta)\n return { limit: 3 };\n\n return {};\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n }\n};\n","import React from 'react';\n\nexport function WarningOutlineSvg(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg {...props}>\n <path\n d='m13.026 4.377 8.5 14A1.2 1.2 0 0 1 20.5 20.2h-17a1.2 1.2 0 0 1-1.026-1.823l8.5-14a1.2 1.2 0 0 1 2.052 0M12 5 3.5 19h17zm0 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2m.75-3.677a.69.69 0 0 1-.7.677.69.69 0 0 1-.7-.677V8.677c0-.374.313-.677.7-.677s.7.303.7.677z'\n fill='currentColor'\n />\n </svg>\n );\n}\n","export enum WidgetStatus {\n Draft = 0,\n Published = 1,\n Archived = 2\n}\n\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { AnalyticsOptions, ClickDescriptor, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { Breakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { BaseWidget, CuratedDashboardAppLink, CuratedWidget, CuratedWidgetContent, Playlist, Presentation, Series, Video, VideoTypes, VideoWidgetTemplateContent, WidgetMetadata, WidgetPreference } from 'libs/shared/interfaces';\n\nimport { AnyWidgetTemplateProps } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTypeIdConfig } from '../constants/WidgetTypeIdConfig';\nimport { MasterType } from '../enums/MasterType';\n\nimport { MasterTypeHelper } from './MasterTypeHelper';\n\nenum WidgetStatusString {\n Draft = 'Draft',\n Published = 'Published',\n Archived = 'Archived'\n}\n\nexport const WidgetHelper = {\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Slide\n }),\n\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderItemAnalyticsOptions: (): AnalyticsOptions => ({\n location: LocationContext.SlidingListItem\n }),\n\n getSliderHeadingAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Title\n }),\n\n useGetContent(\n content: CuratedWidgetContent,\n widgetTypeId: WidgetTypeId,\n isPreviewing: boolean,\n preferences: WidgetPreference[],\n removedItemIds: string[]\n ): { content: CuratedWidgetContent, unfilteredContent: CuratedWidgetContent } {\n return React.useMemo(() => {\n if (!content)\n return { content: null, unfilteredContent: null };\n\n if (!Array.isArray(content))\n return { content, unfilteredContent: content };\n\n const preferencesHash = preferences?.reduce((acc: HashObject, current) => {\n acc[current.id] = current;\n return acc;\n }, {}) ?? {};\n\n const removedItemIdsHash = removedItemIds.reduce((acc: HashObject, current) => {\n acc[current] = true;\n return acc;\n }, {});\n\n const contentCopy = [...content];\n \n const sortedContent = contentCopy.sort((a, b) => {\n if (!('id' in a) || !('id' in b))\n return 0;\n\n const aIndex = preferencesHash[a.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === a.id);\n const bIndex = preferencesHash[b.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === b.id);\n\n if (aIndex < bIndex)\n return -1;\n\n if (aIndex > bIndex)\n return 1;\n\n return 0;\n });\n\n if (WidgetHelper.isBelowContentMinimum(sortedContent, widgetTypeId) && !isPreviewing) {\n return {\n content: [],\n unfilteredContent: sortedContent\n };\n }\n\n const filteredContent = sortedContent.filter(item => {\n if (preferencesHash['id' in item && item.id]?.hidden)\n return false;\n\n if (removedItemIdsHash['id' in item && item.id])\n return false;\n\n return true;\n });\n\n return {\n content: filteredContent,\n unfilteredContent: sortedContent\n };\n }, [ content, preferences ]);\n },\n\n isBelowContentMinimum(content: CuratedWidgetContent, widgetTypeId: WidgetTypeId): boolean {\n const minContent = WidgetTypeIdConfig[widgetTypeId]?.minContent || 0;\n return content?.length < minContent;\n },\n\n getCustomAppLink(props: AnyWidgetTemplateProps): Core.AppLink | null {\n if (\n !('metadata' in props) ||\n !('appLinks' in props) ||\n !('appLink' in props.metadata)\n ) {\n return null;\n }\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.LatestReleases && 'latestReleases' in props.appLinks)\n return props.appLinks?.latestReleases?.();\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.ExploreAllTopics && 'allTopics' in props.appLinks && 'presentation' in props)\n return props.appLinks?.allTopics?.(props.presentation.id);\n\n return null;\n },\n\n getWidgetStatus(widget: CuratedWidget): WidgetStatus {\n let status = widget.status;\n\n if (typeof (status) === 'string') {\n switch (status) {\n case WidgetStatusString.Archived:\n status = WidgetStatus.Archived;\n break;\n case WidgetStatusString.Published:\n status = WidgetStatus.Published;\n break;\n case WidgetStatusString.Draft:\n status = WidgetStatus.Draft;\n break;\n }\n }\n\n return status;\n },\n\n formatResponseData(widget: CuratedWidget, presentation?: Presentation): CuratedWidget {\n const content = widget.content;\n\n if (!content)\n return widget;\n\n if ('author' in content) {\n widget.content = [content] as CuratedWidgetContent;\n return widget;\n }\n\n if ('data' in content)\n widget.content = content.data as CuratedWidgetContent;\n else if (!Array.isArray(content))\n widget.content = [content]; // Handle `classification_featured_video` widgets, which don't return content as an array\n\n switch (widget.widgetId) {\n case WidgetTypeId.ClassificationSeries:\n widget.content = widget.content.filter((c): c is Series => 'tallPoster' in c && !!c.tallPoster?.id);\n break;\n case WidgetTypeId.ClassificationPlaylists:\n widget.content = widget.content.filter((c): c is Playlist => 'cover' in c && !!c.cover?.id);\n break;\n case WidgetTypeId.ContinueWatching:\n widget.content = widget.content.map(c => 'object' in c && c.object);\n default:\n break;\n case WidgetTypeId.Presentations:\n widget.content = widget.content.filter((c): c is Presentation => 'id' in c && c.id.toString() !== presentation?.id?.toString());\n break;\n }\n\n return widget;\n },\n \n isWidgetInTableOfContents(metadata: Partial<WidgetMetadata>): boolean {\n return !!metadata?.showInTableOfContents;\n },\n\n /**\n * Widget container view won't render a widget with no content typically,\n * but some widgets (such as blurbs) have no content, but should render anyway.\n */\n hasNoContent(widgetTypeId: WidgetTypeId): boolean {\n if (widgetTypeId === WidgetTypeId.Blurb)\n return true;\n\n return false;\n },\n\n /**\n * If any widgets should be hidden on smaller screen sizes, add them here.\n * If this needs to be more flexible at some point, it should be added to\n * the widget settings and metadata object.\n */\n canDisplayOnScreenSize(\n breakpoints: Breakpoints,\n widgetTypeId: WidgetTypeId,\n widgetTemplate: WidgetTemplate\n ): boolean {\n if (widgetTypeId === WidgetTypeId.Blurb && widgetTemplate === WidgetTemplate.HeroBannerSmall)\n return !breakpoints.xs && !breakpoints.sm;\n\n return true;\n },\n\n isCompanyWidget(widgetTypeId: WidgetTypeId): boolean {\n switch (widgetTypeId) {\n case WidgetTypeId.CompanyLatestReleasedVideo:\n case WidgetTypeId.CompanyVideos:\n case WidgetTypeId.UpcomingLivestreams:\n return true;\n default:\n return false;\n }\n },\n\n getVideoContent(content: VideoWidgetTemplateContent): VideoTypes[] {\n const firstItem = ArrayHelper.first<Video | Series>(content);\n\n if (MasterTypeHelper.isType<Series>(firstItem, MasterType.Series))\n return firstItem.videos.data;\n\n return content as VideoTypes[];\n },\n\n showRemoveButton(widgetTypeId: WidgetTypeId): boolean {\n return widgetTypeId === WidgetTypeId.ContinueWatching;\n },\n\n /**\n * Paginated data returns more widgets so if we dont merge the widget content by widget type id,\n * it would add another widget to the page rather than appending content to the relevant\n * search result index\n * \n * For example:\n * Say we receive these widgets for a query:\n * - topics widget\n * - related results widget\n * \n * If a user scrolls down to the end of page we fetch more items from the last widget\n * which in this case is 'related results widget'. \n * Now our overall response looks like this\n * - topics widget\n * - related results widget\n * - related results widget\n * \n * Since this is a new widget item entry it will be rendered as a new widget with seprate headings etc.\n * In this case we want to combine these two widgets data into one so its looks like this again:\n * - topics widget\n * - related results widget (data is combined)\n * \n * But what if widget we get recieve has a different widget template id. This currently happens for\n * the 'series widget' - series widget can have the tall poster template or the thumbnail like template.\n * \n * so to visualize this it can be like:\n * - topics widget\n * - top results widget\n * - series widget (template: tall poster)\n * - series widget (template: thumbnail)\n * \n * Since they technically will look different based on the template id we will not merge the data in this case.\n * It will merge the data to the same widget as long as the combination of widget Id + template Id is the same.\n * \n * Since they are separate widgets they will render duplicate headings - we handle this in css instead which\n * checks for adjacent siblings and if its the same widget - it hides the widget heading so it will look\n * like its a single widget rather than separate widgets.\n * \n * - Nish\n */\n mergeWidgets<T extends BaseWidget>(\n items: T[],\n mergeContent: (target: T, source: T) => void\n ): T[] {\n const widgets = ObjectHelper.deepClone(items);\n const groupedWidgets = ArrayHelper.groupBy(widgets, 'widgetId');\n const mergedWidgets: T[] = [];\n\n for (const widgetGroup of Object.values(groupedWidgets)) {\n let currentMergedWidget: T | null = null;\n const groupMergedWidgets: T[] = [];\n\n for (const widget of widgetGroup) {\n if (!currentMergedWidget) {\n currentMergedWidget = widget;\n continue;\n }\n\n if (widget.templateId !== currentMergedWidget.templateId) {\n groupMergedWidgets.push(currentMergedWidget);\n currentMergedWidget = widget;\n continue;\n }\n\n mergeContent(currentMergedWidget, widget);\n }\n\n if (currentMergedWidget) {\n groupMergedWidgets.push(currentMergedWidget);\n }\n mergedWidgets.push(...groupMergedWidgets);\n }\n\n return mergedWidgets;\n }\n};\n",":local {\n .widgetTextButton {\n margin-top: 0.1rem;\n flex-shrink: 0;\n }\n}","import React from 'react';\nimport { Spinner } from 'react-bootstrap';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { FunctionHelper } from 'libs/common/backbone/utils/FunctionHelper';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { AnalyticsOptions, ClickDescriptor, LocationContext } from 'libs/analytics/interfaces';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { WidgetTypeIdConfig } from 'libs/shared/constants/WidgetTypeIdConfig';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { WarningOutlineSvg } from 'libs/shared/images/svg/status/WarningOutlineSvg';\nimport { WidgetHelper } from 'libs/shared/utils/WidgetHelper';\n\nimport styles from './widget-header.module.scss';\n\nconst namespace = 'shared.widgetHeader';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface WidgetHeaderProps {\n name: string;\n description?: string | JSX.Element;\n isPreviewing?: boolean;\n content?: any[];\n widgetTypeId?: WidgetTypeId;\n badgeComponent?: JSX.Element;\n\n appLink?: Core.AppLink;\n onAppLinkClick?: () => void;\n analyticsData?: HashObject;\n analyticsOptions?: AnalyticsOptions;\n \n showSeeMoreLink?: boolean;\n onClose?: () => void;\n onFollow?: (shouldFollow: boolean) => void;\n isFollowing?: boolean;\n showFollowSpinner?: boolean;\n}\n\nfunction SeeMore(props: WidgetHeaderProps) {\n return (\n <div className={`ms-3 ${styles.widgetTextButton}`}>\n <AppLink\n appLink={props.appLink}\n analyticsData={props.analyticsData }\n analyticsOptions={{\n location: LocationContext.SlidingList,\n ...props.analyticsOptions,\n descriptor: ClickDescriptor.SeeMore\n }}\n className={`text-decoration-none ${props.appLink ? 'curated-widget-link' : ''}`}\n >\n <p className='hover-text-underline text-dark curated-widget-heading'>{getPhrase('seeAll')}</p>\n </AppLink>\n </div>\n );\n}\n\nfunction CloseWidgetButton(props: { onClose: () => void }) {\n return (\n <div className={`ms-3 ${styles.widgetTextButton} text-decoration-none cursor-pointer`} onClick={props.onClose}>\n <p className='hover-text-underline text-dark curated-widget-heading'>{getPhrase('hide')}</p>\n </div>\n );\n}\n\nfunction FollowWidgetButton(props: {\n isFollowing: boolean,\n onFollow: (shouldFollow: boolean) => void,\n showFollowSpinner: boolean\n}) {\n return (\n <div className={`ms-3 ${styles.widgetTextButton} text-decoration-none`}>\n {\n props.showFollowSpinner ?\n <Spinner as='span' animation='border' role='status' size='sm' /> :\n <p className='hover-text-underline text-dark curated-widget-heading cursor-pointer' onClick={() => props.onFollow(!props.isFollowing)}>\n {getPhrase(props.isFollowing ? 'unfollow' : 'follow')}\n </p>\n }\n </div>\n );\n}\n\nexport function WidgetHeader(props: WidgetHeaderProps): JSX.Element {\n const hasDescription = !!props.description;\n\n if (!props.name && !props.description)\n return <></>;\n\n const isBelowMinimum = WidgetHelper.isBelowContentMinimum(props.content, props.widgetTypeId);\n const minContent = WidgetTypeIdConfig[props.widgetTypeId]?.minContent ?? 0;\n\n return (\n <div className='curated-widget-header'>\n <div className='d-flex justify-content-between'>\n {!!props.name && (\n <div className='d-flex align-items-center'>\n <AppLink\n appLink={props.appLink}\n analyticsData={props.analyticsData}\n className={`text-decoration-none ${props.appLink ? 'curated-widget-link text-reset' : ''}`}\n onClick={props.onAppLinkClick}\n >\n <h2 className='h4 curated-widget-heading'>\n {props.isPreviewing && isBelowMinimum && (\n <SvgContainer\n svg={WarningOutlineSvg}\n title={`Widget is below the minimum content threshold of ${minContent} and won't be displayed.`}\n tooltipSpanHack\n tooltipSpanHackClassName='d-inline text-danger me-1'\n />\n )}\n {props.name}\n </h2>\n </AppLink>\n {!!React.isValidElement(props.badgeComponent) && props.badgeComponent}\n </div>\n )}\n <div className='d-flex justify-content-between align-items-center gap-2'>\n {!!props.appLink && !hasDescription && !!props.showSeeMoreLink && <SeeMore {...props}/>}\n {FunctionHelper.isFunction(props.onFollow) &&\n <FollowWidgetButton\n isFollowing={props.isFollowing}\n onFollow={props.onFollow}\n showFollowSpinner={props.showFollowSpinner}\n />\n }\n {FunctionHelper.isFunction(props.onClose) && <CloseWidgetButton onClose={props.onClose}/>}\n </div>\n </div>\n \n {hasDescription && (\n <div className='d-flex justify-content-between align-items-end'>\n <p className='description curated-widget-description'>\n <span>{props.description}</span>\n </p>\n {!!props.appLink && !!props.showSeeMoreLink && <SeeMore {...props}/> }\n </div>\n )}\n </div>\n );\n}\n","export enum TagType {\n Normal = 'normal',\n Pedagogy = 'pedagogy',\n Hidden = 'hidden',\n Skill = 'skill',\n Curation = 'curation'\n}\n\n/**\n * This should **only** be used to create new tags in master (as it only accepts enum values).\n * Use the string enum above for all other cases.\n */\nexport enum TagTypeNumber {\n Normal = 0,\n Pedagogy = 1,\n Hidden = 2,\n Skill = 3,\n Curation = 4\n}\n",":local {\n $badge-base-height: 1.5rem;\n\n .tagList {\n display: flex;\n flex-wrap: wrap;\n }\n\n .badgeBase {\n height: $badge-base-height;\n }\n \n .disabled {\n background-color: $gray-200;\n color: $gray-500;\n\n &:hover {\n background-color: $gray-200;\n color: $gray-500;\n }\n }\n\n .partialTag {\n width: 5rem;\n }\n\n .removeBadge {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .removeBadgeText {\n line-height: $badge-base-height;\n }\n \n .close {\n opacity: 1;\n background-size: 0.625rem;\n\n &:not(:disabled):hover {\n opacity: 1;\n }\n }\n}","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { TagType } from 'libs/shared/enums/TagType';\nimport { Tag, ThemeColours } from 'libs/shared/interfaces';\n\nimport { DivButton } from '../div-button/DivButton';\n\nimport styles from './tags.module.scss';\n\nconst namespace = 'shared.tags';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface TagItemProps {\n tag: Tag;\n themeColours?: ThemeColours;\n appLink?: Core.AppLink;\n onClick?: () => void;\n onRemove?: () => void;\n disabled?: boolean;\n tagClass?: string;\n}\n\nfunction getTagTypeClass(tagType: TagType, hasThemeColour: boolean): string {\n switch (tagType) {\n case TagType.Pedagogy:\n case TagType.Skill:\n return 'pedagogy-tag text-white';\n\n case TagType.Hidden:\n return 'hidden-tag fw-normal';\n\n case TagType.Normal:\n if (!hasThemeColour)\n return 'bg-gray-100 fw-normal';\n return '';\n\n default:\n return '';\n }\n}\n\nexport function TagItem(props: TagItemProps): JSX.Element {\n const { tag, appLink, onClick, disabled, tagClass = 'tag' } = props;\n\n const name = tag.name.toLowerCase();\n const tagType = tag.tagType?.toLowerCase() as TagType;\n\n const hasThemeColour = (tagType === TagType.Normal && props.themeColours) && !!props.themeColours?.secondary;\n let classNames = `${styles.badgeBase} rounded-pill py-1 px-2 my-1 me-1 ${tagClass} ${getTagTypeClass(tagType, hasThemeColour)}`;\n let textContainerClass = `text-truncate text-nowrap`;\n\n if (hasThemeColour)\n classNames += ' text-white';\n\n if ((appLink || onClick) && !disabled)\n classNames += ' cursor-pointer';\n\n if (disabled)\n classNames += ' ' + styles.disabled;\n\n if (props.onRemove) {\n classNames += ' ' + styles.removeBadge;\n textContainerClass += ' ' + `${styles.removeBadgeText} d-inline-flex align-items-center lh-1`;\n }\n if (!appLink)\n classNames += ' d-inline-block';\n\n const style: React.CSSProperties = hasThemeColour ?\n { backgroundColor: props.themeColours.secondary } :\n {};\n\n if (appLink) {\n return (\n <AppLink\n onClick={onClick}\n appLink={appLink}\n className={classNames}\n title={name}\n style={style}\n >\n <span className={textContainerClass}>{name}</span>\n </AppLink>\n );\n }\n\n return (\n <button\n onClick={onClick}\n className={classNames}\n title={name}\n style={style}\n aria-label={`${getPhrase('ariaFilter')} ${name}`}\n >\n <span className={textContainerClass}>\n {name}\n {props.onRemove &&\n <DivButton\n onClick={props.onRemove}\n className={`${styles.close} btn-close font-size-normal`}\n role='button'\n aria-label='Close'\n />\n }\n </span>\n </button>\n );\n}\n"],"mappings":"oaASA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,eAAA,kBACA,EAAA,iBAAA,qBACA,EAAA,6BAAA,iCACA,EAAA,wBAAA,iCACD,CCwBY,EAA8C,CAAE,QAAS,OAAQ,cAAe,CAChF,EAA4C,CAAE,WAAY,SAAU,OAAQ,iBAAkB,cAAe,QAAS,UAAW,WAAY,kBAAmB,CAChK,EAAiD,CAAC,OAAO,CCjChE,EACJ,kYAmCC,CAMG,EAAuD,CA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ACX,MAAO,0BAET,KAAK,EAAQ,OACX,MAAO,uBAET,KAAK,EAAQ,OAGX,OAFK,EAEE,GADE,wBAGX,QACE,MAAO,IAIb,SAAgB,EAAQ,EAAkC,CACxD,GAAM,CAAE,MAAK,UAAS,UAAS,WAAU,WAAW,OAAU,EAExD,EAAO,EAAI,KAAK,aAAa,CAC7B,EAAU,EAAI,SAAS,aAAa,CAEpC,EAAkB,IAAY,EAAQ,QAAU,EAAM,cAAiB,CAAC,CAAC,EAAM,cAAc,UAC/F,EAAa,GAAG,EAAO,UAAU,oCAAoC,EAAS,GAAG,EAAgB,EAAS,EAAe,GACzH,EAAqB,4BAErB,IACF,GAAc,gBAEX,GAAW,IAAY,CAAC,IAC3B,GAAc,mBAEZ,IACF,GAAc,IAAM,EAAO,UAEzB,EAAM,WACR,GAAc,IAAM,EAAO,YAC3B,GAAsB,IAAS,EAAO,gBAAgB,yCAEnD,IACH,GAAc,mBAEhB,IAAM,EAA6B,EACjC,CAAE,gBAAiB,EAAM,aAAa,UAAW,CACjD,EAAE,CAgBJ,OAdI,GAEA,EAAA,EAAA,KAAC,EAAD,CACW,UACA,UACT,UAAW,EACX,MAAO,EACA,kBAEP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,WAAqB,EAAY,CAAA,CAC1C,CAAA,EAKZ,EAAA,EAAA,KAAC,SAAD,CACW,UACT,UAAW,EACX,MAAO,EACA,QACP,aAAY,GAAG,EAAU,aAAa,CAAC,GAAG,cAE1C,EAAA,EAAA,MAAC,OAAD,CAAM,UAAW,WAAjB,CACG,EACA,EAAM,WACL,EAAA,EAAA,KAAC,EAAD,CACE,QAAS,EAAM,SACf,UAAW,GAAG,EAAO,MAAM,6BAC3B,KAAK,SACL,aAAW,QACX,CAAA,CAAA,GAGC,CAAA"}
1
+ {"version":3,"file":"EO2xPuAQ.chunk.js","names":[],"sources":["../../../../libs/shared/src/interfaces/models/curated-widget/CuratedWidget.ts","../../../../libs/shared/src/apps/search/interfaces/SearchTypes.ts","../../../../libs/shared/src/apps/search/interfaces/SearchFilter.ts","../../../../libs/shared/src/enums/WidgetTemplate.ts","../../../../libs/shared/src/enums/WidgetTypeId.ts","../../../../libs/shared/src/utils/DashboardHelper.ts","../../../../libs/shared/src/constants/WidgetTypeIdConfig.ts","../../../../libs/shared/src/images/svg/status/WarningOutlineSvg.tsx","../../../../libs/shared/src/enums/WidgetStatus.ts","../../../../libs/shared/src/utils/WidgetHelper.ts","../../../../libs/shared/src/components/widgets/curated-widgets/components/header/widget-header.module.scss","../../../../libs/shared/src/components/widgets/curated-widgets/components/header/WidgetHeader.tsx","../../../../libs/shared/src/enums/TagType.ts","../../../../libs/shared/src/components/tags/tags.module.scss","../../../../libs/shared/src/components/tags/TagItem.tsx"],"sourcesContent":["import { HashObject } from 'libs/common/react/interfaces';\n\nimport { AllWidgetTemplateProps } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { ButtonIcon } from 'libs/shared/constants/WidgetThemingConstants';\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { CuratedObjectsWidgetData, CuratedWidgetContent, CuratedWidgetData } from 'libs/shared/interfaces';\n\nexport enum CuratedDashboardAppLink {\n LatestReleases = 'latest-releases',\n ExploreAllTopics = 'explore-all-topics',\n ClassificationLatestReleases = 'classification-latest-releases',\n ClassificationDirectory = 'classification-directory'\n}\n\nexport enum CuratedWidgetCtaAppLink {\n TopicDirectory = 'topic-directory',\n TopicNewReleases = 'topic-new-releases',\n CuratedTopic = 'curated-topic'\n}\n\nexport interface BaseWidget<TContent extends HashObject = HashObject> {\n index: number;\n templateId: WidgetTemplate;\n widgetId: WidgetTypeId;\n name: string;\n description?: string;\n content?: TContent;\n}\n\nexport interface WidgetCta {\n text?: string;\n href?: string;\n icon?: ButtonIcon;\n appLink?: CuratedWidgetCtaAppLink;\n}\n\nexport type WidgetMetadata = AllWidgetTemplateProps['metadata'] & {\n showInTableOfContents: boolean,\n tocIndentation: number,\n headingOptional: boolean,\n aiAddedVideo: boolean\n};\n\nexport interface WidgetPreference {\n id: string;\n index?: number;\n hidden?: boolean;\n}\n\nexport interface CuratedWidget<\n TData extends CuratedWidgetData = CuratedWidgetData,\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> extends BaseWidget<TContent> {\n id: string;\n dashboardId: string;\n data: TData;\n status: WidgetStatus;\n metadata?: Partial<WidgetMetadata>;\n preferences?: WidgetPreference[];\n cursor?: string;\n\n // If a widget has curriculum IDs set, then it won't be accessible to anyone who doesn't have one of those curriculums\n curriculumIds?: string[];\n}\n\nexport type CuratedMediaWidget<\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> = CuratedWidget<CuratedObjectsWidgetData, TContent>;\n","import { ObjectHash } from 'backbone';\nimport Bloodhound from 'bloodhound';\n\nimport { SearchIndices } from 'libs/shared/apps/search/interfaces';\n\nexport interface RemoteSearch<T> extends Bloodhound.BloodhoundOptions<T> {\n remote: Bloodhound.RemoteOptions<T>;\n}\n\nexport interface LocalSearch<T> extends Bloodhound.BloodhoundOptions<T> {\n local: T[] | (() => T[]);\n}\n\nexport type TypeaheadDataSource<T> = Bloodhound<T> |\n((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void);\n\nexport interface InstantSearchBloodhound<T> {\n bloodhound: TypeaheadDataSource<T>;\n name: string;\n}\n\nexport type TypeaheadConfig<T> = Twitter.Typeahead.Dataset<T>;\n\nexport interface TypeaheadConfigHandler<T> {\n (source?: InstantSearchBloodhound<T>, index?: number, options?: ObjectHash): Twitter.Typeahead.Dataset<T>;\n}\n\nexport interface BloodhoundConfigHandler<T> {\n (source: string, options?: ObjectHash): LocalSearch<T> | RemoteSearch<T>;\n}\n\nexport interface TypeaheadSourceItem<T> {\n name: string;\n typeaheadConfig: TypeaheadConfigHandler<T>;\n bloodhoundConfig?: BloodhoundConfigHandler<T>;\n options?: ObjectHash;\n}\n\nexport const AllSearchIndicesVideoStyle: SearchIndices[] = [ 'video', 'clip', 'interactive' ];\nexport const AllSearchIndicesInSearch: SearchIndices[] = [ 'playlist', 'series', 'clip', 'classification', 'interactive', 'video', 'company', 'category', 'partner_profile' ];\nexport const AllSearchIndicesInUserManager: SearchIndices[] = ['user'];\n","import { SvgIcon } from 'libs/shared/utils/SvgHelper';\n\nimport { FilterStateHash } from '../reducers';\n\nimport { FilterProps } from './FilterProps';\nimport { SearchIndices } from './SearchResults';\n\nconst FilterIdNames =\n [\n 'sort', // \"sort\" isn't even a filter but it tends to go with our filters in our designs\n 'classification',\n 'presentation',\n 'audience',\n 'yearGroup',\n 'moviesAndTv',\n 'type',\n 'rating',\n 'interactives',\n 'clips',\n 'classroom',\n 'hasResources',\n 'hasSubtitles',\n 'productionYear',\n 'isHd',\n 'producedByClickView',\n 'duration',\n 'tagOrClassification',\n 'status',\n 'isAdmin',\n 'bulkActionType',\n 'userType',\n 'filter',\n 'channel',\n 'dateBroadcast',\n 'categoryId',\n 'hasInteractives',\n 'jobStatus',\n 'source',\n 'customerStatus',\n 'specialEventType',\n 'customerType',\n 'seriesId',\n 'scopeId'\n ] as const;\n\n/**\n * Any filters that shouldn't be sent to the backend as a filter\n * and are instead handled differently by the frontend\n */\nconst FilterBlacklist: Partial<Record<FilterIds, boolean>> = {\n type: true\n};\n\nexport type FilterIds = typeof FilterIdNames[number];\n\nexport const FilterWhitelist = FilterIdNames.reduce((acc, prev) => {\n return {\n ...acc,\n [prev]: !FilterBlacklist[prev]\n };\n}, {} as Record<FilterIds, boolean>);\n\nexport type FilterType = 'radio' | 'checkbox' | 'nested-checkbox' | 'grouped-checkbox' | 'switch' | 'more-filters' | 'rating' | 'dropdown' | 'tag' | 'button';\n\nexport interface SearchFilter<TFilterOptionId = string> {\n id: FilterIds;\n type: FilterType;\n compatibleIndices: SearchIndices[];\n\n name?: string;\n icon?: SvgIcon;\n description?: string;\n options?: FilterOption<TFilterOptionId>[];\n labelPrefix?: string;\n\n // For second layer options, for example 'presentation' checkbox filter has 'audience' as second layer option\n secondaryId?: FilterIds;\n\n customComponent?: (props: FilterProps) => JSX.Element;\n disabled?: boolean;\n disableOptions?: (options: FilterOption[], filters: SearchFilter[], state: FilterStateHash) => FilterOption[];\n}\n\nexport interface MoreFilters extends Omit<SearchFilter, 'id' | 'compatibleIndices'> {\n filters: SearchFilter[];\n id: string;\n}\n\nexport interface FilterOption<TId = string> {\n id: TId;\n name: string;\n default?: boolean;\n disabled?: boolean;\n secondLayerSelection?: FilterOption[];\n secondLayerOptions?: FilterOption[];\n group?: string;\n}\n\nexport type ProductionYearFilterOptions =\n 'any-year' |\n 'this-year' |\n 'last-3-years' |\n 'last-5-years';\n\nexport type DurationFilterOptions =\n 'bite-sized' |\n 'short' |\n 'medium' |\n 'long';\n\nexport enum SourceFilterOptions {\n MyVideos = 'my-videos',\n School = 'school',\n ExchangeArchive = 'exchange-archive',\n ClickView = 'clickview',\n LiveStreams = 'livestreams'\n}\n\nexport enum TypeFilterOptions {\n Video = 'video',\n Series = 'series',\n Playlist = 'playlist',\n Classification = 'classification',\n Clip = 'clip',\n Interactive = 'interactive',\n Company = 'company',\n Category = 'category',\n PartnerProfile = 'partner_profile'\n}\n","export enum WidgetTemplate {\n // Videos\n ThumbnailHeroMedia = 'thumbnail_hero_media',\n ThumbnailFeaturedMedia = 'thumbnail_featured_media',\n ThumbnailSlidingListSmall = 'thumbnail_sliding_list_small',\n ThumbnailSlidingListSmallV2 = 'thumbnail_sliding_list_small_v2',\n ThumbnailSlidingListLarge = 'thumbnail_sliding_list_large',\n ThumbnailFixedListMediaSmall = 'thumbnail_fixed_list_media_small',\n ThumbnailFixedListMediaLarge = 'thumbnail_fixed_list_media_large',\n ThumbnailFixedListFolderSmall = 'thumbnail_fixed_list_folder_small',\n ThumbnailVerticalList = 'thumbnail_vertical_list',\n PopoutThumbnailSlidingListLarge = 'popout_thumbnail_sliding_list_large',\n PopoutThumbnailSlidingListSmall = 'popout_thumbnail_sliding_list_small',\n FeaturedThumbnailSlidingList = 'featured_thumbnail_sliding_list',\n ThumbnailFixedListXLarge = 'thumbnail_fixed_list_xlarge',\n\n // Topics\n CoverSlidingPillListSmall = 'cover_sliding_pill_list_small',\n CoverFixedPillListLarge = 'cover_fixed_pill_list_large',\n StatsCoverFixedPillListLarge = 'stats_cover_fixed_pill_list_large',\n CoverFixedPillListXSmall = 'cover_fixed_pill_list_xsmall',\n ThumbnailFixedListLarge = 'thumbnail_fixed_list_large',\n ThumbnailFixedListSmall = 'thumbnail_fixed_list_small',\n EditableCoverFixedPillListSmall = 'editable_cover_fixed_pill_list_small',\n HeroBanner = 'hero_banner',\n HeroThumbnailSmall = 'hero_thumbnail_small',\n HeroBlockColourSmall = 'hero_block_colour_small',\n\n // Curriculum\n CurriculumResourcesAccordion = 'curriculum_resources_accordion',\n CurriculumCodeSearchResults = 'curriculum_code_search_results',\n\n // Playlists\n CoverFixedTileList = 'cover_fixed_tile_list',\n\n // Topics & Series\n PosterSlidingListLarge = 'poster_sliding_list_large',\n PosterSlidingListMedium = 'poster_sliding_list_medium',\n PosterSlidingListSmall = 'poster_sliding_list_small',\n PosterFixedListLarge = 'poster_fixed_list_large',\n\n // Blurbs & Topics\n HeroBannerSmall = 'hero_banner_small',\n\n // Text-based blurbs\n Heading = 'heading',\n AuthorReviewer = 'author_reviewer',\n Question = 'question',\n QuestionAccordion = 'question_accordion',\n\n // Companies / Studios / Content Partners\n CircleLogoSlidingList = 'circle_logo_sliding_list',\n RectangularLogoSlidingList = 'rectangular_logo_sliding_list',\n RectangularLogoFixedList = 'rectangular_logo_fixed_list',\n ThumbnailFixedListSearchCta = 'thumbnail_fixed_list_search_cta',\n InfiniteThumbnailVerticalList = 'infinite_thumbnail_vertical_list',\n\n // Rating filters\n FilterSlidingPillListSmall = 'filter_sliding_pill_list_small',\n\n // Special events\n EventIconSlidingList = 'event_icon_sliding_list',\n\n // Tags filter\n TagSlidingList = 'tag_sliding_list',\n\n SearchSuggestionsBlurb = 'search_suggestions_blurb'\n}\n","export enum WidgetTypeId {\n // Video group\n CuratedMedia = 'curated_media',\n PlaylistMedia = 'playlist_media',\n SeriesMedia = 'series_media',\n ClassificationMedia = 'classification_media',\n LatestReleasedVideos = 'latest_released_videos',\n ContinueWatching = 'continue_watching_videos',\n CompanyLatestReleasedVideo = 'company_latest_released_video',\n CompanyVideos = 'company_videos',\n ClassificationLatestReleasedVideo = 'classification_latest_released_video',\n ClassificationLatestReleasedVideosV2 = 'classification_latest_released_videos_v2',\n CompanyClassificationVideos = 'company_classification_videos',\n ClassificationDashboardMedia = 'classification_dashboard_media',\n ClassificationDashboardExternalMedia = 'classification_dashboard_external_media',\n SeasonalClassificationMedia = 'seasonal_classification_media',\n TrendingClassificationsMedia = 'trending_classifications_media',\n ClassificationCurriculumMedia = 'classification_curriculum_media',\n\n // Topics group\n CuratedClassifications = 'curated_classifications',\n Classifications = 'classifications',\n ClassificationLatestReleasedVideos = 'classification_latest_released_videos',\n SpecialEventClassifications = 'special_event_classifications',\n LatestReleasedClassifications = 'latest_released_classifications',\n TrendingClassifications = 'trending_classifications',\n\n // Series group\n CuratedSeries = 'curated_series',\n\n // Playlists group\n CuratedPlaylists = 'curated_playlists',\n\n // Blurb group\n Blurb = 'blurb',\n DynamicBlurb = 'dynamic_blurb',\n AuthorReviewer = 'author_reviewer',\n Faq = 'faq',\n\n // Network group\n CuratedCompanies = 'curated_companies',\n\n // Partner Profile group\n CuratedContentPartners = 'curated_content_partners',\n ContentPartnerLatestReleasedVideos = 'content_partner_latest_released_videos',\n ContentPartnerSeries = 'content_partner_series',\n ContentPartnerVideos = 'content_partner_videos',\n SpotlightContentPartners = 'spotlight_curated_content_partners',\n ContentPartners = 'content_partners',\n ContentPartnersHub = 'content_partners_hub',\n TrendingContentPartnersVideo = 'content_partner_trending_videos',\n ContentPartnerAllVideos = 'content_partner_all_videos',\n\n // Search filter group\n Ratings = 'ratings',\n\n // Presentations group\n Presentations = 'presentations',\n\n // Livestreams group\n UpcomingLivestreams = 'upcoming_livestreams',\n\n // Multimedia group\n CuratedMultimedia = 'curated_multimedia',\n\n // Legacy widget types\n ClassificationPlaylists = 'classification_playlists',\n ClassificationSeries = 'classification_series',\n ClassificationFeaturedVideo = 'classification_featured_video',\n ClassificationPinnedVideos = 'classification_pinned_videos',\n\n // Search widget types\n SearchRelevantTopics = 'search_relevant_topics',\n SearchCompanies = 'search_companies',\n SearchTopResults = 'search_top_results',\n SearchSeries = 'search_series',\n SearchPlaylists = 'search_playlists',\n SearchMyVideosFolder = 'search_my_videos_folders',\n SearchMySchoolLibraryFolder = 'search_my_school_library_folders',\n SearchMyVideos = 'search_my_videos',\n SearchMySchoolLibraryVideos = 'search_my_school_library_videos',\n SearchExchangeArchive = 'search_exchange_archive',\n SearchRelatedResults = 'search_related_results',\n SearchTags = 'search_tags',\n SearchCurriculumCode = 'search_curriculum_code',\n SearchSuggestions = 'search_suggestions',\n SearchContentPartners = 'search_content_partners'\n}\n","import { FormikContextType } from 'formik';\n\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SearchResultObjectTypes } from 'libs/shared/apps/search/interfaces';\nimport { GetCustomParamOptions, WidgetTypeIdConfig } from 'libs/shared/constants/WidgetTypeIdConfig';\nimport { UserGroup } from 'libs/shared/enums/UserGroup';\nimport { OnlineUserRole } from 'libs/shared/enums/UserRole';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { SettingsHash } from 'libs/shared/hooks/useSettings';\nimport { BaseObject, ClassificationCurriculumInfo, ClassificationDashboardInfo, ClassificationDirectoryInfo, CuratedDashboard, CuratedMediaWidget, CuratedWidget, CuratedWidgetQueryParams, DashboardTargetInfo, DashboardTargetType, PartnerProfileDashboardInfo, UnknownDashboardTargetInfo } from 'libs/shared/interfaces';\n\ninterface LatestReleasesTimeRange {\n from: string;\n to: string;\n}\n\nexport const DashboardHelper = {\n\n /**\n * Same implementation as GetUserGroup() in Online.\n * @param userRole \n */\n getUserGroup(userRole: OnlineUserRole): UserGroup {\n if (userRole === OnlineUserRole.Student)\n return UserGroup.Learner;\n\n return UserGroup.Staff;\n }\n};\n\nexport const CuratedDashboardHelper = {\n onSelectCuratedObject(\n selectedObj: SearchResultObjectTypes | BaseObject,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const data = {\n ...formikProps.values.data,\n objectIds: ArrayHelper.addOrRemoveImmutable(formikProps.values.data.objectIds || [], selectedObj.id)\n };\n \n formikProps.setFieldValue('data', data);\n \n formikProps.setTouched({\n ...formikProps.touched,\n data: {\n objectIds: true\n }\n });\n },\n\n onRemoveCuratedObject(\n objectId: string,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const newData = {\n ...formikProps.values.data,\n objectIds: formikProps.values.data.objectIds.filter(id => id !== objectId)\n };\n\n formikProps.setFieldValue('data', newData);\n },\n\n getDashboardTarget(info: DashboardTargetInfo): string {\n if (info.targetType === DashboardTargetType.Discover)\n return `discover:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Classification)\n return `classification:${info.classificationId}`;\n\n if (info.targetType === DashboardTargetType.ClassificationDirectory)\n return `classification:${info.classificationId}:directory`;\n\n if (info.targetType === DashboardTargetType.ClassificationCurriculum)\n return `classification:${info.classificationId}:curriculum`;\n\n if (info.targetType === DashboardTargetType.MoviesAndTv)\n return `moviesAndTv:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Company)\n return `company:${info.companyId}:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.PartnerProfile)\n return `partnerprofile:${info.slug}`;\n\n if (info.targetType === DashboardTargetType.DiscoverPartnerProfiles)\n return `discover:partners`;\n\n if (info.targetType === DashboardTargetType.PartnerProfileHub)\n return `discover:partners:hub`;\n\n return null;\n },\n\n getUnknownDashboardTarget(options: UnknownDashboardTargetInfo): string {\n const {\n presentationId,\n companyId,\n targetType,\n classificationId,\n slug\n } = options;\n\n if (targetType === DashboardTargetType.Discover) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Discover,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.MoviesAndTv) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.Company) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Company,\n presentationId,\n companyId\n });\n }\n \n if (targetType === DashboardTargetType.Classification) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Classification,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationDirectory) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationCurriculum) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfile) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfile,\n slug\n });\n }\n\n if (targetType === DashboardTargetType.DiscoverPartnerProfiles) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.DiscoverPartnerProfiles\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfileHub) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfileHub\n });\n }\n },\n\n getDashboardTargetInfo(dashboard: CuratedDashboard): DashboardTargetInfo {\n const type = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n const split = dashboard?.target?.split(':');\n\n if (type === DashboardTargetType.Discover) {\n return {\n targetType: DashboardTargetType.Discover,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Classification) {\n return {\n targetType: DashboardTargetType.Classification,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationDirectory) {\n return {\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationCurriculum) {\n return {\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.MoviesAndTv) {\n return {\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Company) {\n return {\n targetType: DashboardTargetType.Company,\n companyId: split[1],\n presentationId: split[3]\n };\n }\n\n if (type === DashboardTargetType.PartnerProfile) {\n return {\n targetType: DashboardTargetType.PartnerProfile,\n slug: split[1]\n };\n }\n\n return null;\n },\n\n getDashboardTargetType(dashboard: CuratedDashboard): DashboardTargetType {\n if (!dashboard?.target)\n return null;\n\n if (dashboard.target.startsWith('discover')) {\n if (dashboard.target.endsWith('partners'))\n return DashboardTargetType.DiscoverPartnerProfiles;\n\n if (dashboard.target.endsWith('hub'))\n return DashboardTargetType.PartnerProfileHub;\n\n return DashboardTargetType.Discover;\n }\n\n if (dashboard.target.startsWith('classification')) {\n if (dashboard.target.endsWith('directory'))\n return DashboardTargetType.ClassificationDirectory;\n\n if (dashboard.target.endsWith('curriculum'))\n return DashboardTargetType.ClassificationCurriculum;\n\n return DashboardTargetType.Classification;\n }\n\n if (dashboard.target.startsWith('moviesAndTv'))\n return DashboardTargetType.MoviesAndTv;\n\n if (dashboard.target.startsWith('company')) {\n return DashboardTargetType.Company;\n }\n\n if (dashboard.target.startsWith('partnerprofile'))\n return DashboardTargetType.PartnerProfile;\n\n return null;\n },\n\n isType(dashboard: CuratedDashboard, target: DashboardTargetType): boolean {\n return CuratedDashboardHelper.getDashboardTargetType(dashboard) === target;\n },\n\n isCuratedDashboard(obj: BaseObject): obj is CuratedDashboard {\n const dashboard = obj as CuratedDashboard;\n\n const targetType = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n\n if (targetType === DashboardTargetType.Discover)\n return true;\n\n if (targetType === DashboardTargetType.Classification)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationDirectory)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationCurriculum)\n return true;\n\n if (targetType === DashboardTargetType.MoviesAndTv)\n return true;\n\n if (targetType === DashboardTargetType.Company)\n return true;\n\n return false;\n },\n\n getLatestReleasedTimeRange(): LatestReleasesTimeRange {\n const now = new Date();\n const from = DateHelper.format(DateHelper.endOf(DateHelper.subtract(now, 2, 'month'), 'day'), 'YYYY-MM-DD');\n const to = DateHelper.format(DateHelper.endOf(now, 'day'), 'YYYY-MM-DD');\n return { from, to };\n },\n\n getWidgetParams(\n widgetTypeId: WidgetTypeId,\n templateId: WidgetTemplate,\n target: DashboardTargetType,\n audienceIds?: string | string[],\n preferredCurriculumId?: string,\n options?: GetCustomParamOptions\n ): CuratedWidgetQueryParams {\n const params: CuratedWidgetQueryParams = { };\n\n if (audienceIds)\n params.audienceId = audienceIds;\n\n if (widgetTypeId === WidgetTypeId.ClassificationCurriculumMedia)\n params.curriculumPresentationId = preferredCurriculumId;\n\n return {\n ...params,\n ...WidgetTypeIdConfig[widgetTypeId]?.getCustomParams?.(templateId, target, options)\n };\n },\n\n isSystemGeneratedDashboard(widgets: CuratedWidget[]): boolean {\n const systemGeneratedClassificationWidgetTypes = new Set<WidgetTypeId>([\n WidgetTypeId.ClassificationFeaturedVideo,\n WidgetTypeId.ClassificationPinnedVideos,\n WidgetTypeId.ClassificationPlaylists,\n WidgetTypeId.ClassificationSeries\n ]);\n\n return widgets?.some(widget => systemGeneratedClassificationWidgetTypes.has(widget.widgetId));\n },\n\n isClassificationDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDashboardInfo | ClassificationDirectoryInfo | ClassificationCurriculumInfo {\n return [\n DashboardTargetType.Classification,\n DashboardTargetType.ClassificationDirectory,\n DashboardTargetType.ClassificationCurriculum\n ].includes(targetInfo?.targetType);\n },\n\n isContentPartnerDashboard(targetInfo: DashboardTargetInfo): targetInfo is PartnerProfileDashboardInfo {\n return targetInfo?.targetType === DashboardTargetType.PartnerProfile;\n },\n\n isDirectoryDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDirectoryInfo {\n return targetInfo?.targetType === DashboardTargetType.ClassificationDirectory;\n },\n\n isWidgetTypeEnabled(\n widgetTypeId: WidgetTypeId,\n settingsHash: SettingsHash,\n targetType: DashboardTargetType\n ): boolean {\n const config = WidgetTypeIdConfig[widgetTypeId];\n \n return config?.predicate?.({ settingsHash, targetType }) ?? true;\n }\n};\n","import { Core } from 'libs/common/backbone/index';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SourceFilterOptions, TypeFilterOptions } from '../apps/search/interfaces';\nimport { WidgetAppLinks } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTemplate } from '../enums/WidgetTemplate';\nimport { WidgetTypeId } from '../enums/WidgetTypeId';\nimport { SettingsHash } from '../hooks/useSettings';\nimport { CuratedWidgetContent, CuratedWidgetQueryParams, DashboardTargetType, Series } from '../interfaces';\nimport { CuratedDashboardHelper } from '../utils/DashboardHelper';\n\ninterface WidgetTypeIdPredicateOptions {\n settingsHash: SettingsHash;\n targetType: DashboardTargetType;\n}\n\nexport interface GetCustomParamOptions {\n params?: CuratedWidgetQueryParams;\n}\n\ninterface WidgetTypeIdConfigType {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => CuratedWidgetQueryParams;\n minContent?: number;\n getCollectionAppLink?: (\n appLinks: Partial<WidgetAppLinks>,\n content?: CuratedWidgetContent\n ) => Core.AppLink;\n /**\n * Predicate used to determine if the widget\n * should be displayed based on the target\n * type and settings. Useful for feature flagging widgets.\n */\n predicate?: (options: WidgetTypeIdPredicateOptions) => boolean;\n}\n\nfunction partnerProfileWidgetTypeIdPredicate(options: WidgetTypeIdPredicateOptions): boolean {\n return options.settingsHash?.hasPartnerProfiles ?? false;\n}\n\nexport const WidgetTypeIdConfig: Record<WidgetTypeId, WidgetTypeIdConfigType> = {\n [WidgetTypeId.CuratedMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.PlaylistMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SeriesMedia]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n switch (widgetTemplate) {\n case WidgetTemplate.ThumbnailFixedListMediaLarge:\n return { limit: 2 };\n case WidgetTemplate.ThumbnailHeroMedia:\n case WidgetTemplate.ThumbnailFeaturedMedia:\n return { limit: 1 };\n default:\n return { limit: 12 };\n }\n },\n getCollectionAppLink: (appLinks, content) => appLinks?.series?.(ArrayHelper.first(content) as Series)\n },\n [WidgetTypeId.ClassificationMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.LatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.ContinueWatching]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks?.watchHistory?.()\n },\n [WidgetTypeId.CompanyLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.CompanyVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideosV2]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.SeasonalClassificationMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.CompanyClassificationVideos]: {\n getCustomParams: () => ({}),\n minContent: 4\n },\n [WidgetTypeId.TrendingClassificationsMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n\n [WidgetTypeId.CuratedClassifications]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.TrendingClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n [WidgetTypeId.Classifications]: {\n getCustomParams: (template: WidgetTemplate, targetType: DashboardTargetType) => {\n if (targetType === DashboardTargetType.Discover) {\n if (template === WidgetTemplate.EditableCoverFixedPillListSmall) {\n return {\n canBePreferred: true,\n isFollowing: true\n };\n }\n\n if ([ WidgetTemplate.PosterSlidingListSmall, WidgetTemplate.CoverFixedPillListXSmall ].includes(template)) {\n return {\n canBePreferred: true\n };\n }\n }\n\n return {};\n }\n },\n [WidgetTypeId.ClassificationLatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.SpecialEventClassifications]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n [WidgetTypeId.LatestReleasedClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n\n [WidgetTypeId.CuratedSeries]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedPlaylists]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Blurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.DynamicBlurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.AuthorReviewer]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.Faq]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedCompanies]: {\n getCustomParams: () => ({}),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n\n [WidgetTypeId.Ratings]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Presentations]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.UpcomingLivestreams]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n\n [WidgetTypeId.CuratedMultimedia]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.ClassificationPlaylists]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationSeries]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationFeaturedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationPinnedVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardExternalMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardMedia]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.SearchRelevantTopics]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchRelevantTopics],\n type: [TypeFilterOptions.Classification]\n })\n },\n [WidgetTypeId.SearchCompanies]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchCompanies],\n type: [TypeFilterOptions.Company]\n }),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n [WidgetTypeId.SearchSeries]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchSeries],\n type: [TypeFilterOptions.Series]\n })\n },\n [WidgetTypeId.SearchPlaylists]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchPlaylists],\n type: [TypeFilterOptions.Playlist]\n })\n },\n [WidgetTypeId.SearchMyVideosFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideosFolder],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryFolder],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchMyVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideos],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryVideos],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchExchangeArchive]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchExchangeArchive],\n source: [SourceFilterOptions.ExchangeArchive]\n })\n },\n [WidgetTypeId.SearchRelatedResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTopResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationCurriculumMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTags]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchCurriculumCode]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchSuggestions]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchContentPartners]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchContentPartners],\n type: [TypeFilterOptions.PartnerProfile]\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.CuratedContentPartners]: {\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerLatestReleasedVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerSeries]: {\n getCollectionAppLink: appLinks => {\n return appLinks?.scopedSearchHome?.({\n type: [TypeFilterOptions.Series]\n });\n },\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.SpotlightContentPartners]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartners]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => ({\n letterPrefix: options?.params?.letterPrefix,\n sort: options?.params?.sort\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnersHub]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => {\n if (targetType !== DashboardTargetType.PartnerProfileHub)\n return {};\n\n return {\n objectId: options?.params?.objectId\n };\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.TrendingContentPartnersVideo]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerAllVideos]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n if (widgetTemplate === WidgetTemplate.ThumbnailFixedListSearchCta)\n return { limit: 3 };\n\n return {};\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n }\n};\n","import React from 'react';\n\nexport function WarningOutlineSvg(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg {...props}>\n <path\n d='m13.026 4.377 8.5 14A1.2 1.2 0 0 1 20.5 20.2h-17a1.2 1.2 0 0 1-1.026-1.823l8.5-14a1.2 1.2 0 0 1 2.052 0M12 5 3.5 19h17zm0 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2m.75-3.677a.69.69 0 0 1-.7.677.69.69 0 0 1-.7-.677V8.677c0-.374.313-.677.7-.677s.7.303.7.677z'\n fill='currentColor'\n />\n </svg>\n );\n}\n","export enum WidgetStatus {\n Draft = 0,\n Published = 1,\n Archived = 2\n}\n\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { AnalyticsOptions, ClickDescriptor, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { Breakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { BaseWidget, CuratedDashboardAppLink, CuratedWidget, CuratedWidgetContent, Playlist, Presentation, Series, Video, VideoTypes, VideoWidgetTemplateContent, WidgetMetadata, WidgetPreference } from 'libs/shared/interfaces';\n\nimport { AnyWidgetTemplateProps } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTypeIdConfig } from '../constants/WidgetTypeIdConfig';\nimport { MasterType } from '../enums/MasterType';\n\nimport { MasterTypeHelper } from './MasterTypeHelper';\n\nenum WidgetStatusString {\n Draft = 'Draft',\n Published = 'Published',\n Archived = 'Archived'\n}\n\nexport const WidgetHelper = {\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Slide\n }),\n\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderItemAnalyticsOptions: (): AnalyticsOptions => ({\n location: LocationContext.SlidingListItem\n }),\n\n getSliderHeadingAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Title\n }),\n\n useGetContent(\n content: CuratedWidgetContent,\n widgetTypeId: WidgetTypeId,\n isPreviewing: boolean,\n preferences: WidgetPreference[],\n removedItemIds: string[]\n ): { content: CuratedWidgetContent, unfilteredContent: CuratedWidgetContent } {\n return React.useMemo(() => {\n if (!content)\n return { content: null, unfilteredContent: null };\n\n if (!Array.isArray(content))\n return { content, unfilteredContent: content };\n\n const preferencesHash = preferences?.reduce((acc: HashObject, current) => {\n acc[current.id] = current;\n return acc;\n }, {}) ?? {};\n\n const removedItemIdsHash = removedItemIds.reduce((acc: HashObject, current) => {\n acc[current] = true;\n return acc;\n }, {});\n\n const contentCopy = [...content];\n \n const sortedContent = contentCopy.sort((a, b) => {\n if (!('id' in a) || !('id' in b))\n return 0;\n\n const aIndex = preferencesHash[a.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === a.id);\n const bIndex = preferencesHash[b.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === b.id);\n\n if (aIndex < bIndex)\n return -1;\n\n if (aIndex > bIndex)\n return 1;\n\n return 0;\n });\n\n if (WidgetHelper.isBelowContentMinimum(sortedContent, widgetTypeId) && !isPreviewing) {\n return {\n content: [],\n unfilteredContent: sortedContent\n };\n }\n\n const filteredContent = sortedContent.filter(item => {\n if (preferencesHash['id' in item && item.id]?.hidden)\n return false;\n\n if (removedItemIdsHash['id' in item && item.id])\n return false;\n\n return true;\n });\n\n return {\n content: filteredContent,\n unfilteredContent: sortedContent\n };\n }, [ content, preferences ]);\n },\n\n isBelowContentMinimum(content: CuratedWidgetContent, widgetTypeId: WidgetTypeId): boolean {\n const minContent = WidgetTypeIdConfig[widgetTypeId]?.minContent || 0;\n return content?.length < minContent;\n },\n\n getCustomAppLink(props: AnyWidgetTemplateProps): Core.AppLink | null {\n if (\n !('metadata' in props) ||\n !('appLinks' in props) ||\n !('appLink' in props.metadata)\n ) {\n return null;\n }\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.LatestReleases && 'latestReleases' in props.appLinks)\n return props.appLinks?.latestReleases?.();\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.ExploreAllTopics && 'allTopics' in props.appLinks && 'presentation' in props)\n return props.appLinks?.allTopics?.(props.presentation.id);\n\n return null;\n },\n\n getWidgetStatus(widget: CuratedWidget): WidgetStatus {\n let status = widget.status;\n\n if (typeof (status) === 'string') {\n switch (status) {\n case WidgetStatusString.Archived:\n status = WidgetStatus.Archived;\n break;\n case WidgetStatusString.Published:\n status = WidgetStatus.Published;\n break;\n case WidgetStatusString.Draft:\n status = WidgetStatus.Draft;\n break;\n }\n }\n\n return status;\n },\n\n formatResponseData(widget: CuratedWidget, presentation?: Presentation): CuratedWidget {\n const content = widget.content;\n\n if (!content)\n return widget;\n\n if ('author' in content) {\n widget.content = [content] as CuratedWidgetContent;\n return widget;\n }\n\n if ('data' in content)\n widget.content = content.data as CuratedWidgetContent;\n else if (!Array.isArray(content))\n widget.content = [content]; // Handle `classification_featured_video` widgets, which don't return content as an array\n\n switch (widget.widgetId) {\n case WidgetTypeId.ClassificationSeries:\n widget.content = widget.content.filter((c): c is Series => 'tallPoster' in c && !!c.tallPoster?.id);\n break;\n case WidgetTypeId.ClassificationPlaylists:\n widget.content = widget.content.filter((c): c is Playlist => 'cover' in c && !!c.cover?.id);\n break;\n case WidgetTypeId.ContinueWatching:\n widget.content = widget.content.map(c => 'object' in c && c.object);\n default:\n break;\n case WidgetTypeId.Presentations:\n widget.content = widget.content.filter((c): c is Presentation => 'id' in c && c.id.toString() !== presentation?.id?.toString());\n break;\n }\n\n return widget;\n },\n \n isWidgetInTableOfContents(metadata: Partial<WidgetMetadata>): boolean {\n return !!metadata?.showInTableOfContents;\n },\n\n /**\n * Widget container view won't render a widget with no content typically,\n * but some widgets (such as blurbs) have no content, but should render anyway.\n */\n hasNoContent(widgetTypeId: WidgetTypeId): boolean {\n if (widgetTypeId === WidgetTypeId.Blurb)\n return true;\n\n return false;\n },\n\n /**\n * If any widgets should be hidden on smaller screen sizes, add them here.\n * If this needs to be more flexible at some point, it should be added to\n * the widget settings and metadata object.\n */\n canDisplayOnScreenSize(\n breakpoints: Breakpoints,\n widgetTypeId: WidgetTypeId,\n widgetTemplate: WidgetTemplate\n ): boolean {\n if (widgetTypeId === WidgetTypeId.Blurb && widgetTemplate === WidgetTemplate.HeroBannerSmall)\n return !breakpoints.xs && !breakpoints.sm;\n\n return true;\n },\n\n isCompanyWidget(widgetTypeId: WidgetTypeId): boolean {\n switch (widgetTypeId) {\n case WidgetTypeId.CompanyLatestReleasedVideo:\n case WidgetTypeId.CompanyVideos:\n case WidgetTypeId.UpcomingLivestreams:\n return true;\n default:\n return false;\n }\n },\n\n getVideoContent(content: VideoWidgetTemplateContent): VideoTypes[] {\n const firstItem = ArrayHelper.first<Video | Series>(content);\n\n if (MasterTypeHelper.isType<Series>(firstItem, MasterType.Series))\n return firstItem.videos.data;\n\n return content as VideoTypes[];\n },\n\n showRemoveButton(widgetTypeId: WidgetTypeId): boolean {\n return widgetTypeId === WidgetTypeId.ContinueWatching;\n },\n\n /**\n * Paginated data returns more widgets so if we dont merge the widget content by widget type id,\n * it would add another widget to the page rather than appending content to the relevant\n * search result index\n * \n * For example:\n * Say we receive these widgets for a query:\n * - topics widget\n * - related results widget\n * \n * If a user scrolls down to the end of page we fetch more items from the last widget\n * which in this case is 'related results widget'. \n * Now our overall response looks like this\n * - topics widget\n * - related results widget\n * - related results widget\n * \n * Since this is a new widget item entry it will be rendered as a new widget with seprate headings etc.\n * In this case we want to combine these two widgets data into one so its looks like this again:\n * - topics widget\n * - related results widget (data is combined)\n * \n * But what if widget we get recieve has a different widget template id. This currently happens for\n * the 'series widget' - series widget can have the tall poster template or the thumbnail like template.\n * \n * so to visualize this it can be like:\n * - topics widget\n * - top results widget\n * - series widget (template: tall poster)\n * - series widget (template: thumbnail)\n * \n * Since they technically will look different based on the template id we will not merge the data in this case.\n * It will merge the data to the same widget as long as the combination of widget Id + template Id is the same.\n * \n * Since they are separate widgets they will render duplicate headings - we handle this in css instead which\n * checks for adjacent siblings and if its the same widget - it hides the widget heading so it will look\n * like its a single widget rather than separate widgets.\n * \n * - Nish\n */\n mergeWidgets<T extends BaseWidget>(\n items: T[],\n mergeContent: (target: T, source: T) => void\n ): T[] {\n const widgets = ObjectHelper.deepClone(items);\n const groupedWidgets = ArrayHelper.groupBy(widgets, 'widgetId');\n const mergedWidgets: T[] = [];\n\n for (const widgetGroup of Object.values(groupedWidgets)) {\n let currentMergedWidget: T | null = null;\n const groupMergedWidgets: T[] = [];\n\n for (const widget of widgetGroup) {\n if (!currentMergedWidget) {\n currentMergedWidget = widget;\n continue;\n }\n\n if (widget.templateId !== currentMergedWidget.templateId) {\n groupMergedWidgets.push(currentMergedWidget);\n currentMergedWidget = widget;\n continue;\n }\n\n mergeContent(currentMergedWidget, widget);\n }\n\n if (currentMergedWidget) {\n groupMergedWidgets.push(currentMergedWidget);\n }\n mergedWidgets.push(...groupMergedWidgets);\n }\n\n return mergedWidgets;\n }\n};\n",":local {\n .widgetTextButton {\n margin-top: 0.1rem;\n flex-shrink: 0;\n }\n}","import React from 'react';\nimport { Spinner } from 'react-bootstrap';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { FunctionHelper } from 'libs/common/backbone/utils/FunctionHelper';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { AnalyticsOptions, ClickDescriptor, LocationContext } from 'libs/analytics/interfaces';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { WidgetTypeIdConfig } from 'libs/shared/constants/WidgetTypeIdConfig';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { WarningOutlineSvg } from 'libs/shared/images/svg/status/WarningOutlineSvg';\nimport { WidgetHelper } from 'libs/shared/utils/WidgetHelper';\n\nimport styles from './widget-header.module.scss';\n\nconst namespace = 'shared.widgetHeader';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface WidgetHeaderProps {\n name: string;\n description?: string | JSX.Element;\n isPreviewing?: boolean;\n content?: any[];\n widgetTypeId?: WidgetTypeId;\n badgeComponent?: JSX.Element;\n\n appLink?: Core.AppLink;\n onAppLinkClick?: () => void;\n analyticsData?: HashObject;\n analyticsOptions?: AnalyticsOptions;\n \n showSeeMoreLink?: boolean;\n onClose?: () => void;\n onFollow?: (shouldFollow: boolean) => void;\n isFollowing?: boolean;\n showFollowSpinner?: boolean;\n}\n\nfunction SeeMore(props: WidgetHeaderProps) {\n return (\n <div className={`ms-3 ${styles.widgetTextButton}`}>\n <AppLink\n appLink={props.appLink}\n analyticsData={props.analyticsData }\n analyticsOptions={{\n location: LocationContext.SlidingList,\n ...props.analyticsOptions,\n descriptor: ClickDescriptor.SeeMore\n }}\n className={`text-decoration-none ${props.appLink ? 'curated-widget-link' : ''}`}\n >\n <p className='hover-text-underline text-dark curated-widget-heading'>{getPhrase('seeAll')}</p>\n </AppLink>\n </div>\n );\n}\n\nfunction CloseWidgetButton(props: { onClose: () => void }) {\n return (\n <div className={`ms-3 ${styles.widgetTextButton} text-decoration-none cursor-pointer`} onClick={props.onClose}>\n <p className='hover-text-underline text-dark curated-widget-heading'>{getPhrase('hide')}</p>\n </div>\n );\n}\n\nfunction FollowWidgetButton(props: {\n isFollowing: boolean,\n onFollow: (shouldFollow: boolean) => void,\n showFollowSpinner: boolean\n}) {\n return (\n <div className={`ms-3 ${styles.widgetTextButton} text-decoration-none`}>\n {\n props.showFollowSpinner ?\n <Spinner as='span' animation='border' role='status' size='sm' /> :\n <p className='hover-text-underline text-dark curated-widget-heading cursor-pointer' onClick={() => props.onFollow(!props.isFollowing)}>\n {getPhrase(props.isFollowing ? 'unfollow' : 'follow')}\n </p>\n }\n </div>\n );\n}\n\nexport function WidgetHeader(props: WidgetHeaderProps): JSX.Element {\n const hasDescription = !!props.description;\n\n if (!props.name && !props.description)\n return <></>;\n\n const isBelowMinimum = WidgetHelper.isBelowContentMinimum(props.content, props.widgetTypeId);\n const minContent = WidgetTypeIdConfig[props.widgetTypeId]?.minContent ?? 0;\n\n return (\n <div className='curated-widget-header'>\n <div className='d-flex justify-content-between'>\n {!!props.name && (\n <div className='d-flex align-items-center'>\n <AppLink\n appLink={props.appLink}\n analyticsData={props.analyticsData}\n className={`text-decoration-none ${props.appLink ? 'curated-widget-link text-reset' : ''}`}\n onClick={props.onAppLinkClick}\n >\n <h2 className='h4 curated-widget-heading'>\n {props.isPreviewing && isBelowMinimum && (\n <SvgContainer\n svg={WarningOutlineSvg}\n title={`Widget is below the minimum content threshold of ${minContent} and won't be displayed.`}\n tooltipSpanHack\n tooltipSpanHackClassName='d-inline text-danger me-1'\n />\n )}\n {props.name}\n </h2>\n </AppLink>\n {!!React.isValidElement(props.badgeComponent) && props.badgeComponent}\n </div>\n )}\n <div className='d-flex justify-content-between align-items-center gap-2'>\n {!!props.appLink && !hasDescription && !!props.showSeeMoreLink && <SeeMore {...props}/>}\n {FunctionHelper.isFunction(props.onFollow) &&\n <FollowWidgetButton\n isFollowing={props.isFollowing}\n onFollow={props.onFollow}\n showFollowSpinner={props.showFollowSpinner}\n />\n }\n {FunctionHelper.isFunction(props.onClose) && <CloseWidgetButton onClose={props.onClose}/>}\n </div>\n </div>\n \n {hasDescription && (\n <div className='d-flex justify-content-between align-items-end'>\n <p className='description curated-widget-description'>\n <span>{props.description}</span>\n </p>\n {!!props.appLink && !!props.showSeeMoreLink && <SeeMore {...props}/> }\n </div>\n )}\n </div>\n );\n}\n","export enum TagType {\n Normal = 'normal',\n Pedagogy = 'pedagogy',\n Hidden = 'hidden',\n Skill = 'skill',\n Curation = 'curation'\n}\n\n/**\n * This should **only** be used to create new tags in master (as it only accepts enum values).\n * Use the string enum above for all other cases.\n */\nexport enum TagTypeNumber {\n Normal = 0,\n Pedagogy = 1,\n Hidden = 2,\n Skill = 3,\n Curation = 4\n}\n",":local {\n $badge-base-height: 1.5rem;\n\n .tagList {\n display: flex;\n flex-wrap: wrap;\n }\n\n .badgeBase {\n height: $badge-base-height;\n }\n \n .disabled {\n background-color: $gray-200;\n color: $gray-500;\n\n &:hover {\n background-color: $gray-200;\n color: $gray-500;\n }\n }\n\n .partialTag {\n width: 5rem;\n }\n\n .removeBadge {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .removeBadgeText {\n line-height: $badge-base-height;\n }\n \n .close {\n opacity: 1;\n background-size: 0.625rem;\n\n &:not(:disabled):hover {\n opacity: 1;\n }\n }\n}","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { TagType } from 'libs/shared/enums/TagType';\nimport { Tag, ThemeColours } from 'libs/shared/interfaces';\n\nimport { DivButton } from '../div-button/DivButton';\n\nimport styles from './tags.module.scss';\n\nconst namespace = 'shared.tags';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface TagItemProps {\n tag: Tag;\n themeColours?: ThemeColours;\n appLink?: Core.AppLink;\n onClick?: () => void;\n onRemove?: () => void;\n disabled?: boolean;\n tagClass?: string;\n}\n\nfunction getTagTypeClass(tagType: TagType, hasThemeColour: boolean): string {\n switch (tagType) {\n case TagType.Pedagogy:\n case TagType.Skill:\n return 'pedagogy-tag text-white';\n\n case TagType.Hidden:\n return 'hidden-tag fw-normal';\n\n case TagType.Normal:\n if (!hasThemeColour)\n return 'bg-gray-100 fw-normal';\n return '';\n\n default:\n return '';\n }\n}\n\nexport function TagItem(props: TagItemProps): JSX.Element {\n const { tag, appLink, onClick, disabled, tagClass = 'tag' } = props;\n\n const name = tag.name.toLowerCase();\n const tagType = tag.tagType?.toLowerCase() as TagType;\n\n const hasThemeColour = (tagType === TagType.Normal && props.themeColours) && !!props.themeColours?.secondary;\n let classNames = `${styles.badgeBase} rounded-pill py-1 px-2 my-1 me-1 ${tagClass} ${getTagTypeClass(tagType, hasThemeColour)}`;\n let textContainerClass = `text-truncate text-nowrap`;\n\n if (hasThemeColour)\n classNames += ' text-white';\n\n if ((appLink || onClick) && !disabled)\n classNames += ' cursor-pointer';\n\n if (disabled)\n classNames += ' ' + styles.disabled;\n\n if (props.onRemove) {\n classNames += ' ' + styles.removeBadge;\n textContainerClass += ' ' + `${styles.removeBadgeText} d-inline-flex align-items-center lh-1`;\n }\n if (!appLink)\n classNames += ' d-inline-block';\n\n const style: React.CSSProperties = hasThemeColour ?\n { backgroundColor: props.themeColours.secondary } :\n {};\n\n if (appLink) {\n return (\n <AppLink\n onClick={onClick}\n appLink={appLink}\n className={classNames}\n title={name}\n style={style}\n >\n <span className={textContainerClass}>{name}</span>\n </AppLink>\n );\n }\n\n return (\n <button\n onClick={onClick}\n className={classNames}\n title={name}\n style={style}\n aria-label={`${getPhrase('ariaFilter')} ${name}`}\n >\n <span className={textContainerClass}>\n {name}\n {props.onRemove &&\n <DivButton\n onClick={props.onRemove}\n className={`${styles.close} btn-close font-size-normal`}\n role='button'\n aria-label='Close'\n />\n }\n </span>\n </button>\n );\n}\n"],"mappings":"oaASA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,eAAA,kBACA,EAAA,iBAAA,qBACA,EAAA,6BAAA,iCACA,EAAA,wBAAA,iCACD,CCwBY,EAA8C,CAAE,QAAS,OAAQ,cAAe,CAChF,EAA4C,CAAE,WAAY,SAAU,OAAQ,iBAAkB,cAAe,QAAS,UAAW,WAAY,kBAAmB,CAChK,EAAiD,CAAC,OAAO,CCjChE,EACJ,kYAmCC,CAMG,EAAuD,CAC3D,KAAM,GACP,CAIY,EAAkB,EAAc,QAAQ,EAAK,KACjD,CACL,GAAG,GACF,GAAO,CAAC,EAAgB,GAC1B,EACA,EAAE,CAA+B,CAkDxB,EAAL,SAAA,EAAA,OACL,GAAA,SAAA,YACA,EAAA,OAAA,SACA,EAAA,gBAAA,mBACA,EAAA,UAAA,YACA,EAAA,YAAA,oBACD,CAEW,EAAL,SAAA,EAAA,OACL,GAAA,MAAA,QACA,EAAA,OAAA,SACA,EAAA,SAAA,WACA,EA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AC/F,EAAa,GAAG,EAAO,UAAU,oCAAoC,EAAS,GAAG,EAAgB,EAAS,EAAe,GACzH,EAAqB,4BAErB,IACF,GAAc,gBAEX,GAAW,IAAY,CAAC,IAC3B,GAAc,mBAEZ,IACF,GAAc,IAAM,EAAO,UAEzB,EAAM,WACR,GAAc,IAAM,EAAO,YAC3B,GAAsB,IAAS,EAAO,gBAAgB,yCAEnD,IACH,GAAc,mBAEhB,IAAM,EAA6B,EACjC,CAAE,gBAAiB,EAAM,aAAa,UAAW,CACjD,EAAE,CAgBJ,OAdI,GAEA,EAAA,EAAA,KAAC,EAAD,CACW,UACA,UACT,UAAW,EACX,MAAO,EACA,kBAEP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,WAAqB,EAAY,CAAA,CAC1C,CAAA,EAKZ,EAAA,EAAA,KAAC,SAAD,CACW,UACT,UAAW,EACX,MAAO,EACA,QACP,aAAY,GAAG,EAAU,aAAa,CAAC,GAAG,cAE1C,EAAA,EAAA,MAAC,OAAD,CAAM,UAAW,WAAjB,CACG,EACA,EAAM,WACL,EAAA,EAAA,KAAC,EAAD,CACE,QAAS,EAAM,SACf,UAAW,GAAG,EAAO,MAAM,6BAC3B,KAAK,SACL,aAAW,QACX,CAAA,CAAA,GAGC,CAAA"}
@@ -1,2 +1,2 @@
1
- import{C as e,D as t,St as n,b as r,d as i,mn as a,s as o,t as s,x as c}from"./CnnBLBPY.chunk.js";import{d as l,l as u}from"./D8clSITt.chunk.js";import{t as d}from"./GN6vNflP.chunk.js";import{t as f}from"./DRTfS6nN.chunk.js";import{I as p,M as m,U as h,Z as g}from"./app-DDrsm5nt.js";import{t as _}from"./CKNdXwxe2.chunk.js";import{t as v}from"./D9zlZIWi2.chunk.js";import{t as y}from"./DrVEkVd5.chunk.js";import{t as b}from"./CyAM5o2e.chunk.js";import{t as x}from"./B9Rb6IIb.chunk.js";var S=a(t()),C=e(),w=`exchange.add`,T=d.encloseNamespace(w);function E(e){let t=v(),a=l(),d=u(g.config()),E=u(b.exchange()),D=u(_.video(e.id)),[O,k]=S.useState(!1),[A,j]=S.useState(!1),[M,N]=S.useState(null),{previewContext:P,clearPreviewContext:F}=x(e.id,!1);S.useEffect(()=>{!D.data||A||I()},[D.data?.id]);async function I(){j(!0);try{let e=await a(b.addVideo(E.data.id,D.data.id));k(!0),N(e.id),s.logUserAction({id:D.data.id,name:D.data.name},{actionType:r.Submit,descriptor:c.AddToWorkspace,location:i.Popup,entity:o.Video})}catch{t.error(T(`error`)),e.closePopup()}}function L(){e.closePopup(),P?.appLink&&(y.preventScrollTop(),n.trigger(P.appLink),F())}return(0,C.jsx)(h,{title:T(`title`),closePopup:L,showLoadingSpinner:!O,children:O&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{className:`mx-auto w-75 mt-1 mb-2`,children:(0,C.jsx)(`img`,{src:f.General.CONFETTI,className:`img-fluid`,draggable:!1})}),(0,C.jsx)(`div`,{className:`text-center pb-3`,children:(0,C.jsx)(`h4`,{className:`mb-2`,children:(0,C.jsx)(p,{namespace:w,phrase:`added`})})}),(0,C.jsxs)(m,{children:[(0,C.jsx)(m.Cancel,{text:T(`close`),onClick:L,variant:`link`}),(0,C.jsx)(`a`,{href:`${d.data.liteUrl}/videos/${M}`,className:`btn btn-dark`,children:(0,C.jsx)(`span`,{className:`align-text-bottom me-1`,children:(0,C.jsx)(p,{namespace:w,phrase:`open`})})})]})]})})}export{E as ExchangeAddView};
2
- //# sourceMappingURL=o2htB_49.chunk.js.map
1
+ import{C as e,D as t,St as n,b as r,d as i,mn as a,s as o,t as s,x as c}from"./CnnBLBPY.chunk.js";import{d as l,l as u}from"./D8clSITt.chunk.js";import{t as d}from"./GN6vNflP.chunk.js";import{t as f}from"./DRTfS6nN.chunk.js";import{I as p,M as m,U as h,Z as g}from"./app-BGxmHvGl.js";import{t as _}from"./DG6L7zHU2.chunk.js";import{t as v}from"./DuPL-nK72.chunk.js";import{t as y}from"./DrVEkVd5.chunk.js";import{t as b}from"./CK_CN_mA.chunk.js";import{t as x}from"./NtrZI2Ef.chunk.js";var S=a(t()),C=e(),w=`exchange.add`,T=d.encloseNamespace(w);function E(e){let t=v(),a=l(),d=u(g.config()),E=u(b.exchange()),D=u(_.video(e.id)),[O,k]=S.useState(!1),[A,j]=S.useState(!1),[M,N]=S.useState(null),{previewContext:P,clearPreviewContext:F}=x(e.id,!1);S.useEffect(()=>{!D.data||A||I()},[D.data?.id]);async function I(){j(!0);try{let e=await a(b.addVideo(E.data.id,D.data.id));k(!0),N(e.id),s.logUserAction({id:D.data.id,name:D.data.name},{actionType:r.Submit,descriptor:c.AddToWorkspace,location:i.Popup,entity:o.Video})}catch{t.error(T(`error`)),e.closePopup()}}function L(){e.closePopup(),P?.appLink&&(y.preventScrollTop(),n.trigger(P.appLink),F())}return(0,C.jsx)(h,{title:T(`title`),closePopup:L,showLoadingSpinner:!O,children:O&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{className:`mx-auto w-75 mt-1 mb-2`,children:(0,C.jsx)(`img`,{src:f.General.CONFETTI,className:`img-fluid`,draggable:!1})}),(0,C.jsx)(`div`,{className:`text-center pb-3`,children:(0,C.jsx)(`h4`,{className:`mb-2`,children:(0,C.jsx)(p,{namespace:w,phrase:`added`})})}),(0,C.jsxs)(m,{children:[(0,C.jsx)(m.Cancel,{text:T(`close`),onClick:L,variant:`link`}),(0,C.jsx)(`a`,{href:`${d.data.liteUrl}/videos/${M}`,className:`btn btn-dark`,children:(0,C.jsx)(`span`,{className:`align-text-bottom me-1`,children:(0,C.jsx)(p,{namespace:w,phrase:`open`})})})]})]})})}export{E as ExchangeAddView};
2
+ //# sourceMappingURL=F1LOVRO_.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"o2htB_49.chunk.js","names":[],"sources":["../../src/apps/exchange/views/exchange-add/ExchangeAddView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { ScrollHelper } from 'libs/common/backbone/utils/ScrollHelper';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/react/index';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, UserAction, VideoActionDescriptor } from 'libs/analytics/interfaces';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { Config, Library, PopupViewProps, Video } from 'libs/shared/interfaces';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\n\nimport { ExchangeRequests } from 'apps/exchange/flight-requests/ExchangeRequests';\nimport { usePreviewContext } from 'apps/exchange/hooks/usePreviewContext';\n\nconst namespace = 'exchange.add';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface ExchangeAddViewProps extends PopupViewProps {\n id: string;\n}\n\nexport function ExchangeAddView(props: ExchangeAddViewProps): JSX.Element {\n const alerts = useAlerts();\n const fetchAsync = Flight.useGetFetchAsync();\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const exchange = Flight.useBasicFetch<Library>(ExchangeRequests.exchange());\n const video = Flight.useBasicFetch<Video>(VideoRequests.video(props.id));\n\n const [ added, setAdded ] = React.useState<boolean>(false);\n const [ adding, setAdding ] = React.useState<boolean>(false);\n const [ newVideoId, setNewVideoId ] = React.useState<string>(null);\n\n const { previewContext, clearPreviewContext } = usePreviewContext(props.id, false);\n\n React.useEffect(() => {\n if (!video.data || adding)\n return;\n\n addVideo();\n }, [video.data?.id]);\n\n async function addVideo() {\n setAdding(true);\n\n try {\n const newVideo = await fetchAsync<Video>(ExchangeRequests.addVideo(\n exchange.data.id,\n video.data.id\n ));\n\n setAdded(true);\n setNewVideoId(newVideo.id);\n\n AnalyticsHelper.logUserAction(\n { id: video.data.id, name: video.data.name },\n {\n actionType: UserAction.Submit,\n descriptor: VideoActionDescriptor.AddToWorkspace,\n location: LocationContext.Popup,\n entity: EntityType.Video\n }\n );\n } catch {\n alerts.error(getPhrase('error'));\n props.closePopup();\n }\n }\n\n /**\n * Because the add view can be navigated to from the ExchangePreviewView\n * which is an addressable popup, we need to navigate back to the \n * original route when this popup is closed - Sha\n */\n function closePopup(): void {\n props.closePopup();\n\n if (!previewContext?.appLink)\n return;\n\n ScrollHelper.preventScrollTop();\n Core.AppLinkHelper.trigger(previewContext.appLink);\n clearPreviewContext();\n }\n\n return (\n <Popup\n title={getPhrase('title')}\n closePopup={closePopup}\n showLoadingSpinner={!added}\n >\n {added &&\n <>\n <div className='mx-auto w-75 mt-1 mb-2'>\n <img src={ImageUrls.General.CONFETTI} className='img-fluid' draggable={false} />\n </div>\n\n <div className='text-center pb-3'>\n <h4 className='mb-2'>\n <Text namespace={namespace} phrase='added' />\n </h4>\n </div>\n\n <PopupButtons>\n <PopupButtons.Cancel\n text={getPhrase('close')}\n onClick={closePopup}\n variant='link'\n />\n <a href={`${config.data.liteUrl}/videos/${newVideoId}`} className='btn btn-dark'>\n <span className='align-text-bottom me-1'>\n <Text namespace={namespace} phrase='open' />\n </span>\n </a>\n </PopupButtons>\n </>\n }\n </Popup>\n );\n}\n"],"mappings":"yfAuBM,EAAY,eACZ,EAAY,EAAgB,iBAAiB,EAAU,CAM7D,SAAgB,EAAgB,EAA0C,CACxE,IAAM,EAAS,GAAW,CACpB,EAAa,GAAyB,CAEtC,EAAS,EAA6B,EAAe,QAAQ,CAAC,CAC9D,EAAW,EAA8B,EAAiB,UAAU,CAAC,CACrE,EAAQ,EAA4B,EAAc,MAAM,EAAM,GAAG,CAAC,CAElE,CAAE,EAAO,GAAA,EAAmB,SAAkB,GAAM,CACpD,CAAE,EAAQ,GAAA,EAAoB,SAAkB,GAAM,CACtD,CAAE,EAAY,GAAA,EAAwB,SAAiB,KAAK,CAE5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S,EACT,QAAQ,OACR,CAAA,EACF,EAAA,EAAA,KAAC,IAAD,CAAG,KAAM,GAAG,EAAO,KAAK,QAAQ,UAAU,IAAc,UAAU,yBAChE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mCACd,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,OAAS,CAAA,CACvC,CAAA,CACL,CAAA,CACS,CAAA,CAAA,CACd,CAAA,CAAA,CAEC,CAAA"}
1
+ {"version":3,"file":"F1LOVRO_.chunk.js","names":[],"sources":["../../src/apps/exchange/views/exchange-add/ExchangeAddView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { ScrollHelper } from 'libs/common/backbone/utils/ScrollHelper';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/react/index';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, UserAction, VideoActionDescriptor } from 'libs/analytics/interfaces';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { Config, Library, PopupViewProps, Video } from 'libs/shared/interfaces';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\n\nimport { ExchangeRequests } from 'apps/exchange/flight-requests/ExchangeRequests';\nimport { usePreviewContext } from 'apps/exchange/hooks/usePreviewContext';\n\nconst namespace = 'exchange.add';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface ExchangeAddViewProps extends PopupViewProps {\n id: string;\n}\n\nexport function ExchangeAddView(props: ExchangeAddViewProps): JSX.Element {\n const alerts = useAlerts();\n const fetchAsync = Flight.useGetFetchAsync();\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const exchange = Flight.useBasicFetch<Library>(ExchangeRequests.exchange());\n const video = Flight.useBasicFetch<Video>(VideoRequests.video(props.id));\n\n const [ added, setAdded ] = React.useState<boolean>(false);\n const [ adding, setAdding ] = React.useState<boolean>(false);\n const [ newVideoId, setNewVideoId ] = React.useState<string>(null);\n\n const { previewContext, clearPreviewContext } = usePreviewContext(props.id, false);\n\n React.useEffect(() => {\n if (!video.data || adding)\n return;\n\n addVideo();\n }, [video.data?.id]);\n\n async function addVideo() {\n setAdding(true);\n\n try {\n const newVideo = await fetchAsync<Video>(ExchangeRequests.addVideo(\n exchange.data.id,\n video.data.id\n ));\n\n setAdded(true);\n setNewVideoId(newVideo.id);\n\n AnalyticsHelper.logUserAction(\n { id: video.data.id, name: video.data.name },\n {\n actionType: UserAction.Submit,\n descriptor: VideoActionDescriptor.AddToWorkspace,\n location: LocationContext.Popup,\n entity: EntityType.Video\n }\n );\n } catch {\n alerts.error(getPhrase('error'));\n props.closePopup();\n }\n }\n\n /**\n * Because the add view can be navigated to from the ExchangePreviewView\n * which is an addressable popup, we need to navigate back to the \n * original route when this popup is closed - Sha\n */\n function closePopup(): void {\n props.closePopup();\n\n if (!previewContext?.appLink)\n return;\n\n ScrollHelper.preventScrollTop();\n Core.AppLinkHelper.trigger(previewContext.appLink);\n clearPreviewContext();\n }\n\n return (\n <Popup\n title={getPhrase('title')}\n closePopup={closePopup}\n showLoadingSpinner={!added}\n >\n {added &&\n <>\n <div className='mx-auto w-75 mt-1 mb-2'>\n <img src={ImageUrls.General.CONFETTI} className='img-fluid' draggable={false} />\n </div>\n\n <div className='text-center pb-3'>\n <h4 className='mb-2'>\n <Text namespace={namespace} phrase='added' />\n </h4>\n </div>\n\n <PopupButtons>\n <PopupButtons.Cancel\n text={getPhrase('close')}\n onClick={closePopup}\n variant='link'\n />\n <a href={`${config.data.liteUrl}/videos/${newVideoId}`} className='btn btn-dark'>\n <span className='align-text-bottom me-1'>\n <Text namespace={namespace} phrase='open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,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mCACb,EAAA,EAAA,KAAC,MAAD,CAAK,IAAK,EAAU,QAAQ,SAAU,UAAU,YAAY,UAAW,GAAS,CAAA,CAC5E,CAAA,EAEN,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,6BACb,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,iBACZ,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,QAAU,CAAA,CAC1C,CAAA,CACD,CAAA,EAEN,EAAA,EAAA,MAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAa,OAAd,CACE,KAAM,EAAU,QAAQ,CACxB,QAAS,EACT,QAAQ,OACR,CAAA,EACF,EAAA,EAAA,KAAC,IAAD,CAAG,KAAM,GAAG,EAAO,KAAK,QAAQ,UAAU,IAAc,UAAU,yBAChE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mCACd,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,OAAS,CAAA,CACvC,CAAA,CACL,CAAA,CACS,CAAA,CAAA,CACd,CAAA,CAAA,CAEC,CAAA"}
@@ -1,2 +1,2 @@
1
- import{_t as e,ft as t,s as n}from"./CnnBLBPY.chunk.js";import{y as r}from"./D8clSITt.chunk.js";import{t as i}from"./GN6vNflP.chunk.js";import{t as a}from"./xL848v0O.chunk.js";import{t as o}from"./CrBD6Z4s.chunk.js";import{t as s}from"./D_PyfoSL.chunk.js";import{c,tt as l}from"./app-DDrsm5nt.js";import{t as u}from"./CTTruW3_2.chunk.js";import{t as d}from"./D2DuwJJH2.chunk.js";import{t as f}from"./CKNdXwxe2.chunk.js";import{i as p,t as m}from"./CxfZJDOr2.chunk.js";var h=function(e){return e.Screenrights=`screenrights`,e.Era=`era`,e.ClickView=`clickview`,e}({}),g={clip(e,t){return{key:`clip:${e}:${t}`,url:o.urlBuilder(`{gateway}/v1/objects/${e}`,{query:c.CLIP,permissionFilterOption:t})}},videoClips(e,t,n){return{key:`video:${e}:clips:${t}:${n}`,url:o.urlBuilder(`{gateway}/v1/objects/${e}/clips`,{query:c.CLIP_COLLECTION,permissionFilterOption:t,cursor:n})}},clipWithAllInteractives(e,t){return{key:`clip:${e}:${t}:interactives`,url:o.urlBuilder(`{gateway}/v1/objects/${e}`,{query:`${c.CLIP},interactives{status:[0,1]}`,permissionFilterOption:t}),normalize:!1}},publicClip(e,t,n,r){return{key:`clip:${e}:public:${t}`,url:o.urlBuilder(`/api/objects/${e}`,{query:`_parentVideo,_canBeConsumed,_thumbnail`,permissionFilterOption:d.StripMetadata,shareId:t}),bootstrapName:`shared:object:${e}`,success:n,error:r}},sharedClip(e,t,n,r){return{key:`shared:clip:${e}`,url:o.urlBuilder(`/api/objects/${e}`,{shareId:t,query:c.CLIP}),success:n,error:r}},createClip(e,t,n,i,a){return{key:`create:clip`,url:`{gateway}/v1/objects/${e}/clips`,data:t,type:r.POST,invalidationKeys:[`videos:${e}`,`my:videos`],success:n,error:i,always:a}},updateClip(e,t,n,i,a){return{key:`update:clip`,url:`{gateway}/v1/objects/${e}`,data:t,type:r.PUT,invalidationKeys:[`clip:${e}`],success:n,error:i,always:a}},deleteClip(e,t,n,i,a){return{key:`delete:clip`,url:`{gateway}/v1/objects/${e}`,type:r.DELETE,invalidationKeys:[`videos:${t}`,`my:videos`,`videos`],success:n,error:i,always:a}}},_={interactiveMetadata(e,t){return{url:o.urlBuilder(`{gateway}/v1/objects/${e}`,{query:c.INTERACTIVE,permissionFilterOption:t}),key:`interactive:metadata:${e}:${t}`}},videoInteractives(e,t,n){return{key:`video:${e}:interactives:${t}:${n}`,url:o.urlBuilder(`{gateway}/v1/objects/${e}/interactives`,{query:c.INTERACTIVE_COLLECTION,cursor:n}),publicUrl:o.urlBuilder(`/api/objects/${e}/interactives`,{query:c.INTERACTIVE_COLLECTION,cursor:n})}},sharedInteractiveMetadata(e,t,n,r){return{url:o.urlBuilder(`/api/objects/${e}`,{shareId:t,query:c.INTERACTIVE}),key:`shared:interactive:metadata:${e}`,success:n,error:r}},publicInteractiveMetadata(e,t,n,r){return{url:o.urlBuilder(`/api/objects/${e}`,{query:`_parentVideo[_rating],_canBeConsumed,_thumbnail`,permissionFilterOption:d.StripMetadata,shareId:t}),key:`interactive:metadata:${e}:public:${t}`,bootstrapName:`shared:object:${e}`,success:n,error:r}},interactive(e){return{url:`/api/domain/v1/interactives/${e}`,key:`interactive:${e}`,normalize:!1}},createInteractive(e,t,n){return{url:`/api/domain/v1/interactives`,key:`create:interactive`,type:r.POST,invalidationKeys:[`my:videos`],data:e,success:t,error:n}},createInteractiveMetadata(e,t,n,i){return{url:`{gateway}/v1/objects/${e}/interactives`,key:`create:interactive:metadata`,type:r.POST,data:t,success:n,error:i}},updateInteractive(e,t,n,i){return{url:`/api/domain/v1/interactives/${e}`,key:`update:interactive`,type:r.PUT,data:t,success:n,error:i,formatData:()=>t,invalidationKeys:[`interactive:${e}`]}},updateInteractiveMetadata(e,t,n,i){return{url:`{gateway}/v1/objects/${e}`,key:`update:interactive:metadata`,type:r.PUT,data:t,success:n,error:i}},interactiveResultSet(e,t){return{url:`/api/domain/v1/analytics/interactives/${e}/metadata/${t}`,key:`interactive:result:set:${e}:${t}`}},copyInteractive(e,t,n){return{url:`/api/domain/v1/interactives/${e}/copy`,key:`copy:interactive`,type:r.POST,invalidationKeys:[`interactive:${e}`,`my:videos`],success:t,error:n}},deleteInteractiveMetadata(e,t,n){return{url:`{gateway}/v1/objects/${e}`,key:`delete:interactive`,type:r.DELETE,invalidationKeys:[`interactive:${e}`,`my:videos`,`videos`],success:t,error:n}},removeInteractiveMetadata({libraryId:e,categoryId:t,interactiveMetadataId:n}){return{url:o.urlBuilder(`/api/domain/v1/libraries/${e}/videos`,{categoryId:t,videoIds:n}),key:`remove:interactive:metadata:${n}`,type:r.DELETE,invalidationKeys:[`interactive:${n}`,`my:videos`,`videos`]}},contributeToCommunity(e){return{url:`/api/domain/v2/interactives/${e}/contribute`,key:`contribute:interactive`,type:r.POST}},revokefromCommunity(e){return{url:`/api/domain/v2/interactives/${e}/contribute`,key:`contribute:interactive`,type:r.DELETE}},isContributed(e){return{url:`/api/domain/v2/interactives/${e}/contributed`,key:`iscontributed:${e}`,normalize:!1}},updateInteraction(e){return{url:`/api/domain/v1/interactions/bulk/${e.id}`,key:`contribute:interactive`,data:e,type:r.PUT,invalidationKeys:[`interactive:${e.interactiveId}`]}}},v=i.encloseNamespace(`shared.shared-utils`),y={isVideo(e){return e?.typeId===l.Video},isClip(e){return e?.typeId===l.Clip},isInteractive(e){return e?.typeId===l.Interactive},isVideoTypeArchived(e){return e?.status===u.Archived},isVideoType(e){return y.isVideo(e)||y.isInteractive(e)||y.isClip(e)},hasSeries(e){return!!e?.series?.id},showVideoGuidance(e){return!e(s.StudentExperience)},showInteractivesGuidance(e){return!e||y.isInteractive(e)?!1:!!e.interactives?.data?.length},showResourcesGuidance(e){return!e||y.isInteractive(e)?!1:!!((e.resources?.data?.length||0)+(e.links?.data?.length||0))},canViewCurriculumLinks(e,t){return!(e(s.ViewCurriculums)&&e(s.ManagePresentations))||!t||!y.isVideo(t)?!1:!!t._hasCurriculumLinks?.value},getVideoProgress(e){return e?.lastProgressPoint?e?.lastProgressPoint:e?._videoProgress?.progress?e?._videoProgress?.progress:0},getThumbnail(e){if(!e)return null;if(y.isVideo(e))return e.thumbnail;if(e?._thumbnail)return e._thumbnail;if(y.isClip(e))return e.thumbnail||e._parentVideo?.thumbnail;if(y.isInteractive(e))return e._parentVideo?.thumbnail||e._parentClip?.thumbnail},getDuration(e){if(e){if(y.isVideo(e))return e.duration;if(y.isInteractive(e)){if(e._parentClip?.id)return(e._parentClip.endTime-e._parentClip.startTime)*1e3;if(e._parentVideo?.duration)return e._parentVideo.duration}if(y.isClip(e))return(e.endTime-e.startTime)*1e3}},getAnalyticsEntity(e){if(y.isVideo(e))return n.Video;if(y.isInteractive(e))return n.Interactive;if(y.isClip(e))return n.Clip},getAnalyticsData(e,t={}){if(y.isVideo(e))return{...t||{},id:e.id,name:e.name};if(y.isClip(e)){let n={...t||{},id:e.id,name:e.name};return e._parentVideo?.id&&(n.video={id:e._parentVideo?.id,name:e._parentVideo.name}),n}let n={...t,id:e.id,interactiveId:e.interactiveId,name:e.name,status:e.status,originType:e.originType};return e?._parentClip?.id&&(n.clip={id:e?._parentClip?.id,name:e?._parentClip.name}),e?._parentVideo?.id&&(n.video={id:e?._parentVideo?.id,name:e?._parentVideo.name}),n},getCanBeConsumed(e){return!e||!y.isVideoType(e)?{canNavigate:!1,canConsume:!1}:e._canBeConsumed?{canNavigate:e._canBeConsumed?.reason===`login-required`&&y.isVideo(e)||e._canBeConsumed.value===!0,canConsume:e._canBeConsumed.value,reason:e._canBeConsumed?.reason}:{canNavigate:!0,canConsume:!0}},getPrivacyReasoning(e,t=!1){let{canConsume:n,canNavigate:r,reason:i}=y.getCanBeConsumed(e),a=()=>y.isClip(e)?v(`clipParentDeleted`):y.isInteractive(e)?v(`interactiveParentDeleted`):v(`videoDeleted`),o=()=>y.isClip(e)?v(`clipLoginRequired`):y.isInteractive(e)?v(`interactiveLoginRequired`):v(`videoLoginRequired`);if(!n&&!r){if(t)return o();switch(i){case`rating-not-allowed`:return v(`ratingNotAllowed`);case`video-deleted`:return a();case`clickview-private`:return v(`clickViewPrivate`);case`private`:return v(`genericCannotAccess`);case`login-required`:return o();case`restricted-access`:return m.getWeightedRestriction(e._restrictions?.value)?.type===p.Custom?v(`awaitingApproval`):v(`restrictedAccess`);default:return v(`genericCannotAccess`)}}return y.isInteractive(e)&&e.status===u.Draft?v(`draftInteractive`):``},getTitle(e){if(e.name)return y.isInteractive(e)&&e.status===u.Draft?v(`draftInteractiveTitle`,{name:e.name}):e.name;let{canConsume:t,reason:n}=y.getCanBeConsumed(e);return v(!t&&n===`private`?`privateVideo`:!t&&n===`video-deleted`?`videoUnavailable`:`privateVideo`)},getParentVideo(e){if(y.isVideo(e))return e;if(y.isClip(e)||y.isInteractive(e))return e._parentVideo},getRating(e){return y.isVideo(e)?e._rating?.value||e.rating:e?._parentVideo?._rating?.value},getVideoRequest(n,r,i){if(i){switch(r){case l.Video:return f.sharedVideo(n,i);case l.Clip:return g.sharedClip(n,i);case l.Interactive:return _.sharedInteractiveMetadata(n,i)}e.throw(new t(`Unsupported master type`))}switch(r){case l.Video:return f.video(n);case l.Clip:return g.clip(n);case l.Interactive:return _.interactiveMetadata(n)}e.throw(new t(`Unsupported master type`))},isBroadcast(e){return!!e?.contentLicences?.data?.some(e=>e.systemName===h.Era||e.systemName===h.Screenrights)},isUgc(e){return!y.isBroadcast(e)&&!e?._isClickViewCurated?.value},getReleaseDate(e){return e&&e.dateReleased&&y.isBroadcast(e)?a.format(e.dateReleased,`DD/MM/YYYY`):``},canViewOriginalVideo(e){return!!e?._parentVideo?._canBeConsumed?.value},getTrackingCode(e){if(y.isVideo(e))return e.trackingCode;if(y.isClip(e)||y.isInteractive(e))return e._parentVideo.trackingCode},isInExchange(e){return!!e?.libraries?.data?.some(e=>e.typeId===l.ExchangeCollection)},canViewUploadDate(e){return!(!e||!e.dateCreated||!e._isClickViewCurated||e._isClickViewCurated.value)}};export{y as t};
2
- //# sourceMappingURL=BggsU83p2.chunk.js.map
1
+ import{_t as e,ft as t,s as n}from"./CnnBLBPY.chunk.js";import{y as r}from"./D8clSITt.chunk.js";import{t as i}from"./GN6vNflP.chunk.js";import{t as a}from"./xL848v0O.chunk.js";import{t as o}from"./CrBD6Z4s.chunk.js";import{t as s}from"./D_PyfoSL.chunk.js";import{c,tt as l}from"./app-BGxmHvGl.js";import{t as u}from"./CTTruW3_2.chunk.js";import{t as d}from"./D2DuwJJH2.chunk.js";import{t as f}from"./DG6L7zHU2.chunk.js";import{i as p,t as m}from"./CxfZJDOr2.chunk.js";var h=function(e){return e.Screenrights=`screenrights`,e.Era=`era`,e.ClickView=`clickview`,e}({}),g={clip(e,t){return{key:`clip:${e}:${t}`,url:o.urlBuilder(`{gateway}/v1/objects/${e}`,{query:c.CLIP,permissionFilterOption:t})}},videoClips(e,t,n){return{key:`video:${e}:clips:${t}:${n}`,url:o.urlBuilder(`{gateway}/v1/objects/${e}/clips`,{query:c.CLIP_COLLECTION,permissionFilterOption:t,cursor:n})}},clipWithAllInteractives(e,t){return{key:`clip:${e}:${t}:interactives`,url:o.urlBuilder(`{gateway}/v1/objects/${e}`,{query:`${c.CLIP},interactives{status:[0,1]}`,permissionFilterOption:t}),normalize:!1}},publicClip(e,t,n,r){return{key:`clip:${e}:public:${t}`,url:o.urlBuilder(`/api/objects/${e}`,{query:`_parentVideo,_canBeConsumed,_thumbnail`,permissionFilterOption:d.StripMetadata,shareId:t}),bootstrapName:`shared:object:${e}`,success:n,error:r}},sharedClip(e,t,n,r){return{key:`shared:clip:${e}`,url:o.urlBuilder(`/api/objects/${e}`,{shareId:t,query:c.CLIP}),success:n,error:r}},createClip(e,t,n,i,a){return{key:`create:clip`,url:`{gateway}/v1/objects/${e}/clips`,data:t,type:r.POST,invalidationKeys:[`videos:${e}`,`my:videos`],success:n,error:i,always:a}},updateClip(e,t,n,i,a){return{key:`update:clip`,url:`{gateway}/v1/objects/${e}`,data:t,type:r.PUT,invalidationKeys:[`clip:${e}`],success:n,error:i,always:a}},deleteClip(e,t,n,i,a){return{key:`delete:clip`,url:`{gateway}/v1/objects/${e}`,type:r.DELETE,invalidationKeys:[`videos:${t}`,`my:videos`,`videos`],success:n,error:i,always:a}}},_={interactiveMetadata(e,t){return{url:o.urlBuilder(`{gateway}/v1/objects/${e}`,{query:c.INTERACTIVE,permissionFilterOption:t}),key:`interactive:metadata:${e}:${t}`}},videoInteractives(e,t,n){return{key:`video:${e}:interactives:${t}:${n}`,url:o.urlBuilder(`{gateway}/v1/objects/${e}/interactives`,{query:c.INTERACTIVE_COLLECTION,cursor:n}),publicUrl:o.urlBuilder(`/api/objects/${e}/interactives`,{query:c.INTERACTIVE_COLLECTION,cursor:n})}},sharedInteractiveMetadata(e,t,n,r){return{url:o.urlBuilder(`/api/objects/${e}`,{shareId:t,query:c.INTERACTIVE}),key:`shared:interactive:metadata:${e}`,success:n,error:r}},publicInteractiveMetadata(e,t,n,r){return{url:o.urlBuilder(`/api/objects/${e}`,{query:`_parentVideo[_rating],_canBeConsumed,_thumbnail`,permissionFilterOption:d.StripMetadata,shareId:t}),key:`interactive:metadata:${e}:public:${t}`,bootstrapName:`shared:object:${e}`,success:n,error:r}},interactive(e){return{url:`/api/domain/v1/interactives/${e}`,key:`interactive:${e}`,normalize:!1}},createInteractive(e,t,n){return{url:`/api/domain/v1/interactives`,key:`create:interactive`,type:r.POST,invalidationKeys:[`my:videos`],data:e,success:t,error:n}},createInteractiveMetadata(e,t,n,i){return{url:`{gateway}/v1/objects/${e}/interactives`,key:`create:interactive:metadata`,type:r.POST,data:t,success:n,error:i}},updateInteractive(e,t,n,i){return{url:`/api/domain/v1/interactives/${e}`,key:`update:interactive`,type:r.PUT,data:t,success:n,error:i,formatData:()=>t,invalidationKeys:[`interactive:${e}`]}},updateInteractiveMetadata(e,t,n,i){return{url:`{gateway}/v1/objects/${e}`,key:`update:interactive:metadata`,type:r.PUT,data:t,success:n,error:i}},interactiveResultSet(e,t){return{url:`/api/domain/v1/analytics/interactives/${e}/metadata/${t}`,key:`interactive:result:set:${e}:${t}`}},copyInteractive(e,t,n){return{url:`/api/domain/v1/interactives/${e}/copy`,key:`copy:interactive`,type:r.POST,invalidationKeys:[`interactive:${e}`,`my:videos`],success:t,error:n}},deleteInteractiveMetadata(e,t,n){return{url:`{gateway}/v1/objects/${e}`,key:`delete:interactive`,type:r.DELETE,invalidationKeys:[`interactive:${e}`,`my:videos`,`videos`],success:t,error:n}},removeInteractiveMetadata({libraryId:e,categoryId:t,interactiveMetadataId:n}){return{url:o.urlBuilder(`/api/domain/v1/libraries/${e}/videos`,{categoryId:t,videoIds:n}),key:`remove:interactive:metadata:${n}`,type:r.DELETE,invalidationKeys:[`interactive:${n}`,`my:videos`,`videos`]}},contributeToCommunity(e){return{url:`/api/domain/v2/interactives/${e}/contribute`,key:`contribute:interactive`,type:r.POST}},revokefromCommunity(e){return{url:`/api/domain/v2/interactives/${e}/contribute`,key:`contribute:interactive`,type:r.DELETE}},isContributed(e){return{url:`/api/domain/v2/interactives/${e}/contributed`,key:`iscontributed:${e}`,normalize:!1}},updateInteraction(e){return{url:`/api/domain/v1/interactions/bulk/${e.id}`,key:`contribute:interactive`,data:e,type:r.PUT,invalidationKeys:[`interactive:${e.interactiveId}`]}}},v=i.encloseNamespace(`shared.shared-utils`),y={isVideo(e){return e?.typeId===l.Video},isClip(e){return e?.typeId===l.Clip},isInteractive(e){return e?.typeId===l.Interactive},isVideoTypeArchived(e){return e?.status===u.Archived},isVideoType(e){return y.isVideo(e)||y.isInteractive(e)||y.isClip(e)},hasSeries(e){return!!e?.series?.id},showVideoGuidance(e){return!e(s.StudentExperience)},showInteractivesGuidance(e){return!e||y.isInteractive(e)?!1:!!e.interactives?.data?.length},showResourcesGuidance(e){return!e||y.isInteractive(e)?!1:!!((e.resources?.data?.length||0)+(e.links?.data?.length||0))},canViewCurriculumLinks(e,t){return!(e(s.ViewCurriculums)&&e(s.ManagePresentations))||!t||!y.isVideo(t)?!1:!!t._hasCurriculumLinks?.value},getVideoProgress(e){return e?.lastProgressPoint?e?.lastProgressPoint:e?._videoProgress?.progress?e?._videoProgress?.progress:0},getThumbnail(e){if(!e)return null;if(y.isVideo(e))return e.thumbnail;if(e?._thumbnail)return e._thumbnail;if(y.isClip(e))return e.thumbnail||e._parentVideo?.thumbnail;if(y.isInteractive(e))return e._parentVideo?.thumbnail||e._parentClip?.thumbnail},getDuration(e){if(e){if(y.isVideo(e))return e.duration;if(y.isInteractive(e)){if(e._parentClip?.id)return(e._parentClip.endTime-e._parentClip.startTime)*1e3;if(e._parentVideo?.duration)return e._parentVideo.duration}if(y.isClip(e))return(e.endTime-e.startTime)*1e3}},getAnalyticsEntity(e){if(y.isVideo(e))return n.Video;if(y.isInteractive(e))return n.Interactive;if(y.isClip(e))return n.Clip},getAnalyticsData(e,t={}){if(y.isVideo(e))return{...t||{},id:e.id,name:e.name};if(y.isClip(e)){let n={...t||{},id:e.id,name:e.name};return e._parentVideo?.id&&(n.video={id:e._parentVideo?.id,name:e._parentVideo.name}),n}let n={...t,id:e.id,interactiveId:e.interactiveId,name:e.name,status:e.status,originType:e.originType};return e?._parentClip?.id&&(n.clip={id:e?._parentClip?.id,name:e?._parentClip.name}),e?._parentVideo?.id&&(n.video={id:e?._parentVideo?.id,name:e?._parentVideo.name}),n},getCanBeConsumed(e){return!e||!y.isVideoType(e)?{canNavigate:!1,canConsume:!1}:e._canBeConsumed?{canNavigate:e._canBeConsumed?.reason===`login-required`&&y.isVideo(e)||e._canBeConsumed.value===!0,canConsume:e._canBeConsumed.value,reason:e._canBeConsumed?.reason}:{canNavigate:!0,canConsume:!0}},getPrivacyReasoning(e,t=!1){let{canConsume:n,canNavigate:r,reason:i}=y.getCanBeConsumed(e),a=()=>y.isClip(e)?v(`clipParentDeleted`):y.isInteractive(e)?v(`interactiveParentDeleted`):v(`videoDeleted`),o=()=>y.isClip(e)?v(`clipLoginRequired`):y.isInteractive(e)?v(`interactiveLoginRequired`):v(`videoLoginRequired`);if(!n&&!r){if(t)return o();switch(i){case`rating-not-allowed`:return v(`ratingNotAllowed`);case`video-deleted`:return a();case`clickview-private`:return v(`clickViewPrivate`);case`private`:return v(`genericCannotAccess`);case`login-required`:return o();case`restricted-access`:return m.getWeightedRestriction(e._restrictions?.value)?.type===p.Custom?v(`awaitingApproval`):v(`restrictedAccess`);default:return v(`genericCannotAccess`)}}return y.isInteractive(e)&&e.status===u.Draft?v(`draftInteractive`):``},getTitle(e){if(e.name)return y.isInteractive(e)&&e.status===u.Draft?v(`draftInteractiveTitle`,{name:e.name}):e.name;let{canConsume:t,reason:n}=y.getCanBeConsumed(e);return v(!t&&n===`private`?`privateVideo`:!t&&n===`video-deleted`?`videoUnavailable`:`privateVideo`)},getParentVideo(e){if(y.isVideo(e))return e;if(y.isClip(e)||y.isInteractive(e))return e._parentVideo},getRating(e){return y.isVideo(e)?e._rating?.value||e.rating:e?._parentVideo?._rating?.value},getVideoRequest(n,r,i){if(i){switch(r){case l.Video:return f.sharedVideo(n,i);case l.Clip:return g.sharedClip(n,i);case l.Interactive:return _.sharedInteractiveMetadata(n,i)}e.throw(new t(`Unsupported master type`))}switch(r){case l.Video:return f.video(n);case l.Clip:return g.clip(n);case l.Interactive:return _.interactiveMetadata(n)}e.throw(new t(`Unsupported master type`))},isBroadcast(e){return!!e?.contentLicences?.data?.some(e=>e.systemName===h.Era||e.systemName===h.Screenrights)},isUgc(e){return!y.isBroadcast(e)&&!e?._isClickViewCurated?.value},getReleaseDate(e){return e&&e.dateReleased&&y.isBroadcast(e)?a.format(e.dateReleased,`DD/MM/YYYY`):``},canViewOriginalVideo(e){return!!e?._parentVideo?._canBeConsumed?.value},getTrackingCode(e){if(y.isVideo(e))return e.trackingCode;if(y.isClip(e)||y.isInteractive(e))return e._parentVideo.trackingCode},isInExchange(e){return!!e?.libraries?.data?.some(e=>e.typeId===l.ExchangeCollection)},canViewUploadDate(e){return!(!e||!e.dateCreated||!e._isClickViewCurated||e._isClickViewCurated.value)}};export{y as t};
2
+ //# sourceMappingURL=G-hiM6b42.chunk.js.map