{"version":3,"file":"index-UjeMqyC8.js","sources":["../../../../libs/ui/src/components/Video/utils.ts","../../../../libs/ui/src/components/VideoCard/Meta.tsx","../../../../libs/ui/src/components/VideoCard/VideoCard.tsx"],"sourcesContent":["import type {PlayerSrc} from '@vidstack/react'\nimport type {VideoType} from './VideoTypes'\n\nexport const defaultVideoValues: VideoType = {\n url: '',\n autoplay: false,\n muted: false,\n noControls: false,\n standalone: false,\n stopOnLeave: false,\n loop: false,\n}\n\nexport const getVideoProviderEnum = (url: PlayerSrc) => {\n if (typeof url === 'string') {\n if (url.includes('.mp4')) return 'HTML5'\n if (url.includes('vimeo.')) return 'VIMEO'\n return 'YOUTUBE'\n }\n if (Array.isArray(url)) {\n return 'URLSET'\n }\n return url.type\n}\n","import {parseSecondsHumanReadableString, twMerge} from '@sdox/utils'\n\nimport {RichText} from '../RichText'\n\nexport interface MetaProps {\n url: string | null\n openInNewTab: boolean\n title: string | null\n sourceName: string | null\n duration: number | null\n disclaimers: string[] | null\n}\n\nexport const Meta = (props: MetaProps) => {\n const {duration, sourceName, title, disclaimers, openInNewTab, url} = props\n\n const hasMeta = !!duration || !!sourceName || !!title || !!disclaimers\n\n if (!hasMeta) {\n return null\n }\n\n const hasDivider = !!sourceName && !!duration\n const hasLink = !!sourceName && !!url\n\n return (\n \n

{title}

\n
\n {hasLink && (\n \n {sourceName}\n \n )}\n {!hasLink && !!sourceName && (\n {sourceName}\n )}\n {hasDivider && |}\n {duration && (\n \n {parseSecondsHumanReadableString(duration)}\n \n )}\n
\n {disclaimers?.map((content, i) =>\n content ? (\n \n ) : null,\n )}\n \n )\n}\n","import {defaultComposer} from 'default-composer'\n\nimport {twMerge} from '@sdox/utils'\n\nimport {Meta} from './Meta'\nimport Player from '../Player'\nimport {defaultVideoValues, getVideoProviderEnum} from '../Video/utils'\n\nimport type {ClassNameValue} from 'tailwind-merge'\nimport type {VideoType} from '../Video/VideoTypes'\n\nexport interface VideoCardProps extends VideoType {\n showBottomBorder?: boolean\n className?: ClassNameValue\n placeholderThumbnail?: string\n disclaimer: string | null\n pullout: boolean\n openInNewTab: boolean\n optionalTitle: string | null\n videoDescription: string | null\n duration: number | null\n source: {\n __typename?: 'SourceType'\n id: string\n title: string\n url: string | null\n } | null\n}\n\nexport const VideoCard = (props: VideoCardProps) => {\n const {\n className,\n videoDescription,\n openInNewTab,\n duration,\n disclaimer,\n source,\n optionalTitle,\n url,\n autoplay,\n muted,\n loop,\n thumbnail,\n noControls,\n standalone,\n meta,\n showBottomBorder = false,\n } = defaultComposer(props, defaultVideoValues)\n\n const hasMeta = (!!duration || !!source?.title || !!optionalTitle || !!disclaimer || !!videoDescription)\n\n const isYoutube = getVideoProviderEnum(url) === 'YOUTUBE'\n\n const disclaimers: string[] = [(disclaimer ?? ''), ...(videoDescription?.split('\\n') ?? [])].filter(v => !!v)\n\n return (\n
\n \n \n \n
\n 0 ? disclaimers : null}\n />\n \n \n )\n}\n"],"names":["defaultVideoValues","getVideoProviderEnum","url","Meta","props","duration","sourceName","title","disclaimers","openInNewTab","hasDivider","hasLink","jsxs","twMerge","jsx","parseSecondsHumanReadableString","content","i","RichText","VideoCard","className","videoDescription","disclaimer","source","optionalTitle","autoplay","muted","loop","thumbnail","noControls","standalone","meta","showBottomBorder","defaultComposer","hasMeta","isYoutube","v","Player"],"mappings":"+ZAGO,MAAMA,EAAgC,CAC3C,IAAK,GACL,SAAU,GACV,MAAO,GACP,WAAY,GACZ,WAAY,GACZ,YAAa,GACb,KAAM,EACR,EAEaC,EAAwBC,GAC/B,OAAOA,GAAQ,SACbA,EAAI,SAAS,MAAM,EAAU,QAC7BA,EAAI,SAAS,QAAQ,EAAU,QAC5B,UAEL,MAAM,QAAQA,CAAG,EACZ,SAEFA,EAAI,KCTAC,EAAQC,GAAqB,CACxC,KAAM,CAAC,SAAAC,EAAU,WAAAC,EAAY,MAAAC,EAAO,YAAAC,EAAa,aAAAC,EAAc,IAAAP,GAAOE,EAItE,GAAI,EAFY,CAAC,CAACC,GAAY,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