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0M,YAAW,KAAMC,EAAAA,EAAAA,IAAepD,EAAWqD,UAAU,GAAG,KAEnD,WAAjBrC,EAAOsC,QAAuB1J,EAAAA,cAAoB2J,EAAAA,EAAkB,CAAEC,MAAO,WAAiBC,OAAQ,WAC1G,IAAyBd,EAAAC,CAEzB,G","sources":["webpack://royal-college-radiologists/./src/helpers/aspectRatio.ts","webpack://royal-college-radiologists/./src/helpers/date.ts","webpack://royal-college-radiologists/./src/helpers/image.ts","webpack://royal-college-radiologists/./src/stories/Components/General/CategoryPills/CategoryPills.tsx","webpack://royal-college-radiologists/./src/stories/Components/Cards/ArticleCard/ArticleCard.styles.ts","webpack://royal-college-radiologists/./src/stories/Components/Cards/ArticleCard/ArticleCard.tsx","webpack://royal-college-radiologists/./src/stories/Widgets/NewsListing/NewsListing.styles.ts","webpack://royal-college-radiologists/./src/stories/Widgets/NewsListing/NewsListing.tsx"],"sourcesContent":["import { css } from 'styled-components';\r\nimport { fluidUnit } from './fluid';\r\n/**\r\n * Returns the aspect ratio of the given width and height as a percentage.\r\n */\r\nexport function aspectRatio(width, height) {\r\n return (height / width) * 100;\r\n}\r\n/**\r\n * Re-usable styles for image container where the\r\n * image needs to maintain it's aspect ratio\r\n *\r\n * @param width\r\n * @param height\r\n * @returns\r\n */\r\nexport function imageWrapperPreserveRatio(width, height, \r\n/**\r\n * Additonal values to use if the ratio increases over time\r\n */\r\nmaxWidth, maxHeight) {\r\n if (!width && !height) {\r\n return null;\r\n }\r\n let padding;\r\n if (maxWidth && maxHeight) {\r\n padding = `${fluidUnit(aspectRatio(width, height), aspectRatio(maxWidth, maxHeight), '%')}`;\r\n }\r\n else {\r\n padding = `${aspectRatio(width, height)}%`;\r\n }\r\n return css `\r\n position: relative;\r\n height: 0;\r\n width: 100%;\r\n overflow: hidden;\r\n overflow: clip;\r\n padding-bottom: ${padding};\r\n `;\r\n}\r\n/**\r\n * Re-usable styles for an image placed within\r\n * a container maintaining aspect ratio\r\n */\r\nexport const imageCoverContainer = (relative) => css `\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n ${!relative && 'position: absolute; top: 0;left: 0;'}\r\n`;\r\n","import format from 'date-fns/format';\r\nexport function formatDateISO(value) {\r\n const date = ensureDate(value);\r\n return date.toISOString();\r\n}\r\nexport function formatDate(value, formatString = 'MMMM do yyyy', removeTimeZone = false) {\r\n const date = ensureDate(value, removeTimeZone);\r\n return format(date, formatString);\r\n}\r\nexport function ensureDate(value, removeTimeZone = false) {\r\n let date = value;\r\n if (typeof date === 'string') {\r\n date = new Date(date);\r\n if (removeTimeZone && date.toISOString().includes(\"T\")) {\r\n date = new Date(date.toISOString().slice(0, -5));\r\n }\r\n }\r\n return date;\r\n}\r\nexport function equalDates(startDate, endDate) {\r\n const sd = ensureDate(startDate);\r\n const ed = ensureDate(endDate);\r\n return sd.toDateString() === ed.toDateString();\r\n}\r\n","import queryString from 'query-string';\r\n/**\r\n * Create an image URL for ImageProcessor\r\n * @param image The image model\r\n * @param imageParams The image parameters\r\n * @returns The image URL\r\n */\r\nexport function imageUrl(image, imageParams) {\r\n if (!image) {\r\n return '';\r\n }\r\n const params = {\r\n center: image.focalPoint ? `${image.focalPoint.top},${image.focalPoint.left}` : undefined,\r\n ...imageParams,\r\n };\r\n const paramsString = queryString.stringify(params);\r\n return `${image.src}${paramsString ? `?${queryString.stringify(params)}` : ''}`;\r\n}\r\nexport function getSrcs(image, upper, lower, steps, ratio, params) {\r\n const sizes = getRange(upper, lower, steps);\r\n return sizes.map((size) => `${imageUrl(image, {\r\n width: size,\r\n height: ratio ? size * ratio : undefined,\r\n ...params,\r\n })} ${size}w`);\r\n}\r\nfunction getRange(upper, lower, steps) {\r\n const difference = upper - lower;\r\n const increment = difference / (steps - 1);\r\n return [\r\n lower,\r\n ...Array(steps - 2)\r\n .fill('')\r\n .map((_, index) => Math.ceil(lower + increment * (index + 1))),\r\n upper,\r\n ];\r\n}\r\nexport function getRetinaSrcs(image, width, height) {\r\n const dprs = [1, 1.5, 2, 2.5, 3];\r\n return dprs.map((dpr) => `${imageUrl(image, {\r\n width: width * dpr,\r\n height: height ? height * dpr : undefined,\r\n })} ${dpr}x`);\r\n}\r\n","import * as React from 'react';\r\nimport { FocusRing } from 'react-aria';\r\nimport S from './CategoryPills.styles';\r\nconst CategoryPills = (props) => {\r\n if (props.links == null || props.links.length === 0) {\r\n return null;\r\n }\r\n return (React.createElement(S.Container, null, props.links.map((link) => (React.createElement(FocusRing, { key: link.id, focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Pill, { onClick: (e) => followLink(e, link), tabIndex: props.tabIndex, pillColour: link.pillColour || undefined }, link.text))))));\r\n /* Use JS to open link due to pills appearing inside link cards */\r\n function followLink(e, link) {\r\n e.preventDefault();\r\n window.open(link.url, link.target)?.focus();\r\n }\r\n};\r\nexport default CategoryPills;\r\n","import { transition } from '@helpers/animate';\r\nimport { imageCoverContainer, imageWrapperPreserveRatio } from '@helpers/aspectRatio';\r\nimport brand from '@helpers/brand';\r\nimport { fluid } from '@helpers/fluid';\r\nimport { Device, from, until } from '@helpers/media';\r\nimport { h4, paragraphSmall } from '@helpers/typography';\r\nimport CategoryPillsStyles from '@stories/Components/General/CategoryPills/CategoryPills.styles';\r\nimport styled from 'styled-components';\r\nconst Wrapper = styled.article ``;\r\nconst Container = styled.a `\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n text-decoration: none;\r\n color: var(--fgColour);\r\n\r\n &.focus-ring {\r\n outline: auto;\r\n outline-offset: 3px;\r\n outline-style: solid;\r\n outline-width: 2px;\r\n }\r\n\r\n /* Mobile click styles - button should mimic press */\r\n @media ${until(Device.TabletLarge)} {\r\n ${transition('transform', 0.15)};\r\n\r\n &:active {\r\n transform: translateY(1.5px);\r\n }\r\n }\r\n`;\r\nconst ImageWrapper = styled.div `\r\n ${imageWrapperPreserveRatio(419, 241)};\r\n\r\n > svg {\r\n ${transition('transform')};\r\n\r\n position: absolute;\r\n\r\n path {\r\n stroke-width: 0.5;\r\n }\r\n\r\n path:last-of-type {\r\n stroke: var(--lineColour, currentColor);\r\n }\r\n\r\n &:first-of-type {\r\n top: 6px;\r\n left: 6px;\r\n width: 50%;\r\n transform: rotate(7deg);\r\n }\r\n\r\n &:last-of-type {\r\n right: 8px;\r\n bottom: 8px;\r\n width: 33%;\r\n transform: rotate(-9deg);\r\n }\r\n }\r\n\r\n ${Container}.focus-ring &,\r\n ${Container}:hover & {\r\n > svg:first-of-type {\r\n transform: rotate(32deg);\r\n }\r\n\r\n > svg:last-of-type {\r\n transform: rotate(-24deg);\r\n }\r\n }\r\n`;\r\nconst Image = styled.img `\r\n ${imageCoverContainer()};\r\n`;\r\nconst TopCluster = styled.div `\r\n position: absolute;\r\n top: 0;\r\n right: ${fluid(12, 16)};\r\n background-color: var(--bgColourTint);\r\n border-radius: 0 0 4px 4px;\r\n display: flex;\r\n align-items: center;\r\n\r\n @media ${from(Device.Tablet)} {\r\n margin-left: auto;\r\n }\r\n`;\r\nconst AccessIcon = styled.div `\r\n svg {\r\n height: 32px;\r\n }\r\n`;\r\nconst DateTimeWrapper = styled.div `\r\n ${paragraphSmall};\r\n\r\n \r\n background-color: ${brand.primary.purple};\r\n color: ${brand.primary.offWhite};\r\n padding: 6px 10px 7px;\r\n margin: 0;\r\n border-radius: 0 0 4px 4px;\r\n`;\r\nconst BottomWrapper = styled.div `\r\n ${transition('background-color')};\r\n\r\n flex: 1;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: flex-start;\r\n padding: 16px 20px;\r\n background-color: var(--bgColourTint);\r\n\r\n > svg {\r\n ${transition('transform')};\r\n\r\n display: block;\r\n width: ${fluid(18, 20)};\r\n margin: auto 0 0 auto;\r\n }\r\n\r\n ${Container}.focus-ring &,\r\n ${Container}:hover & {\r\n background-color: var(--bgColourTint);\r\n\r\n > svg {\r\n transform: translateX(15%);\r\n }\r\n }\r\n\r\n ${CategoryPillsStyles.Container} {\r\n margin: 0 0 20px;\r\n }\r\n\r\n @media ${from(Device.Tablet)} {\r\n background-color: var(--bgColour);\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n }\r\n`;\r\nconst Title = styled.h3 `\r\n ${transition('text-decoration-color')};\r\n\r\n ${h4};\r\n\r\n margin: 0 0 ${fluid(6, 16)};\r\n text-decoration: underline;\r\n text-decoration-color: transparent;\r\n text-underline-offset: 2px;\r\n\r\n ${Container}.focus-ring &,\r\n ${Container}:hover & {\r\n text-decoration-color: currentColor;\r\n }\r\n`;\r\nconst Authors = styled.span `\r\n ${paragraphSmall};\r\n\r\n margin: 0 0 ${fluid(6, 16)};\r\n`;\r\nconst ArticleCardStyles = {\r\n AccessIcon,\r\n Authors,\r\n BottomWrapper,\r\n Container,\r\n DateTimeWrapper,\r\n Image,\r\n ImageWrapper,\r\n Title,\r\n TopCluster,\r\n Wrapper,\r\n};\r\nexport default ArticleCardStyles;\r\n","import brand from '@helpers/brand';\r\nimport { formatDate, formatDateISO } from '@helpers/date';\r\nimport { getSrcs } from '@helpers/image';\r\nimport { Device, until } from '@helpers/media';\r\nimport { getSvgFromSystem, SystemIcon } from '@helpers/systemIcons';\r\nimport { generateAuthorsString } from '@helpers/utils';\r\nimport SvgWheel from '@img/branding-graphics/curves-wheel.svg';\r\nimport CategoryPills from '@stories/Components/General/CategoryPills/CategoryPills';\r\nimport * as React from 'react';\r\nimport { FocusRing } from 'react-aria';\r\nimport S from './ArticleCard.styles';\r\nconst HighlightColours = [brand.tertiary.darkBlue, brand.secondary.red];\r\nconst ArticleCard = (props) => {\r\n const srcs = props.image ? getSrcs(props.image, 483, 339, 3, 241 / 419) : [];\r\n const sizes = `${until(Device.MobileLarge)} 100vw, ${until(Device.TabletLarge)} 50vw, ${until(Device.Desktop)} 33vw, ${until(Device.DesktopLarge)} 25vw, 405px`;\r\n /* randomise which colour is used for each wheel */\r\n const lineColours = HighlightColours.sort(() => Math.random() - 0.5);\r\n return (React.createElement(S.Wrapper, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Container, { href: props.cta.url, target: props.cta.target },\r\n React.createElement(S.ImageWrapper, null,\r\n props.image ? (React.createElement(S.Image, { src: srcs[0].split(' ')[0], srcSet: srcs.join(','), sizes: sizes, alt: props.image.altText ?? props.title, loading: 'lazy' })) : (React.createElement(React.Fragment, null,\r\n React.createElement(SvgWheel, { style: { '--lineColour': lineColours[0] } }),\r\n React.createElement(SvgWheel, { style: { '--lineColour': lineColours[1] } }))),\r\n React.createElement(S.TopCluster, null,\r\n props.loggedIn || !props.authorizedOnly ? null : (React.createElement(S.AccessIcon, null, getSvgFromSystem(SystemIcon.LockClose))),\r\n React.createElement(S.DateTimeWrapper, null,\r\n React.createElement(\"time\", { dateTime: formatDateISO(props.date) }, formatDate(props.date, 'd LLL yyyy')),\r\n ' ',\r\n \"| \",\r\n React.createElement(\"span\", null, props.readTime)))),\r\n React.createElement(S.BottomWrapper, null,\r\n React.createElement(CategoryPills, { links: props.categories }),\r\n React.createElement(S.Title, null, props.title),\r\n props.authors.length > 0 && (React.createElement(S.Authors, { dangerouslySetInnerHTML: { __html: generateAuthorsString(props.authors) } })),\r\n getSvgFromSystem(SystemIcon.ArrowRight))))));\r\n};\r\nexport default ArticleCard;\r\n","import { fluid } from '@helpers/fluid';\r\nimport { Device, from } from '@helpers/media';\r\nimport { paragraphLarge } from '@helpers/typography';\r\nimport SectionWrapper from '@stories/Components/Global/SectionWrapper/SectionWrapper';\r\nimport styled from 'styled-components';\r\nconst Container = styled(SectionWrapper) ``;\r\nconst ArticlesContainer = styled.div `\r\n display: grid;\r\n gap: var(--gutterWidth);\r\n scroll-margin: var(--stickyHeaderHeight) 0 0;\r\n\r\n @media ${from(Device.MobileLarge)} {\r\n grid-template-columns: repeat(2, 1fr);\r\n }\r\n\r\n @media ${from(Device.TabletLarge)} {\r\n grid-template-columns: repeat(3, 1fr);\r\n }\r\n`;\r\nconst NoResultsText = styled.p `\r\n ${paragraphLarge};\r\n\r\n text-align: center;\r\n margin-top: ${fluid(16, 24)};\r\n`;\r\nconst NewsListingStyles = {\r\n Container,\r\n NoResultsText,\r\n ArticlesContainer,\r\n};\r\nexport default NewsListingStyles;\r\n","import { scrollIntoView } from '@helpers/animate';\r\nimport { API_URLS } from '@helpers/api';\r\nimport { withQueryParams } from '@hoc/withQueryParams';\r\nimport { useApi } from '@hooks/useApi';\r\nimport ArticleCard from '@stories/Components/Cards/ArticleCard/ArticleCard';\r\nimport LoadingIndicator from '@stories/Components/General/LoadingIndicator/LoadingIndicator';\r\nimport Pagination from '@stories/Components/General/Pagination/Pagination';\r\nimport HorizontalDesktopFilters from '@stories/Components/Listings/HorizontalDesktopFilters/HorizontalDesktopFilters';\r\nimport MobileFilters from '@stories/Components/Listings/MobileFilters/MobileFilters';\r\nimport qs from 'query-string';\r\nimport * as React from 'react';\r\nimport { ArrayParam, NumberParam, StringParam, useQueryParams, withDefault, } from 'use-query-params';\r\nimport S from './NewsListing.styles';\r\nconst NewsListing = (props) => {\r\n const resultsRef = React.useRef(null);\r\n const [params, setParams] = useQueryParams(Object.assign({\r\n location: withDefault(StringParam, props.location ?? props.initialData.location),\r\n pageIndex: withDefault(NumberParam, 1),\r\n pageSize: withDefault(NumberParam, 12),\r\n }, ...props.filters.filters.map((f) => ({\r\n [f.name]: withDefault(ArrayParam, []),\r\n }))));\r\n const result = useApi({\r\n initialData: props.initialData,\r\n url: `${API_URLS.getArticles}?${qs.stringify(params)}`,\r\n });\r\n const onResetClick = () => {\r\n const resetParams = Object.keys(params)\r\n .map((x) => {\r\n return { [x]: Array.isArray(params[x]) ? [] : undefined };\r\n })\r\n .reduce((acc, cur) => {\r\n return { ...acc, ...cur };\r\n }, {});\r\n setParams({ ...resetParams, pageIndex: 1 }, 'push');\r\n };\r\n const filterOptions = props.filters.filters.map((f) => ({\r\n ...f,\r\n value: params[f.name],\r\n onChange: (value) => {\r\n const values = params[f.name];\r\n if (value === '') {\r\n setParams({ [f.name]: [value] }, 'pushIn');\r\n }\r\n else if (values.includes(value)) {\r\n setParams({ [f.name]: values.filter((v) => v !== value) }, 'pushIn');\r\n }\r\n else {\r\n setParams({ [f.name]: [...values, value] }, 'pushIn');\r\n }\r\n },\r\n }));\r\n return (React.createElement(S.Container, { variant: props.variant },\r\n React.createElement(HorizontalDesktopFilters, { title: props.filters.desktopTitle, filters: filterOptions, onClearClick: onResetClick }),\r\n React.createElement(MobileFilters, { multiTitle: props.filters.mobileTitle, filters: filterOptions, onClearClick: onResetClick }),\r\n result.data && (React.createElement(React.Fragment, null,\r\n renderResults(),\r\n result.data.totalCount > params.pageSize && (React.createElement(Pagination, { pageIndex: params.pageIndex, pageSize: params.pageSize, totalCount: result.data.totalCount, onPageChange: (value) => {\r\n setParams({ pageIndex: value }, 'pushIn');\r\n /** timeout required to ensure scrolling occurs on prev/next buttons */\r\n setTimeout(() => scrollIntoView(resultsRef.current), 50);\r\n } })))),\r\n result.status == 'loading' && React.createElement(LoadingIndicator, { label: \"Loading\\u2026\", layout: \"fixed\" })));\r\n function renderResults() {\r\n return (React.createElement(S.ArticlesContainer, { ref: resultsRef }, !result.data?.items?.length ? (React.createElement(S.NoResultsText, null, \"No results found.\")) : (React.createElement(React.Fragment, null, result.data.items.map((item) => (React.createElement(ArticleCard, { key: item.id, ...item })))))));\r\n }\r\n};\r\nexport default withQueryParams(NewsListing);\r\n"],"names":["aspectRatio","width","height","imageWrapperPreserveRatio","maxWidth","maxHeight","padding","fluidUnit","css","imageCoverContainer","relative","formatDateISO","value","ensureDate","toISOString","formatDate","formatString","arguments","length","undefined","date","format","removeTimeZone","Date","includes","slice","equalDates","startDate","endDate","sd","ed","toDateString","imageUrl","image","imageParams","params","center","focalPoint","top","left","paramsString","queryString","src","getSrcs","upper","lower","steps","ratio","sizes","increment","Array","fill","map","_","index","Math","ceil","getRange","size","getRetinaSrcs","dpr","props","links","React","S","Container","link","FocusRing","key","id","focusRingClass","Pill","onClick","e","_window$open","preventDefault","window","open","url","target","focus","followLink","tabIndex","pillColour","text","Wrapper","styled","article","withConfig","displayName","componentId","a","until","Device","TabletLarge","transition","ImageWrapper","div","Image","img","TopCluster","fluid","from","Tablet","AccessIcon","DateTimeWrapper","paragraphSmall","brand","primary","purple","offWhite","BottomWrapper","CategoryPillsStyles","Title","h3","h4","Authors","span","HighlightColours","tertiary","darkBlue","secondary","red","_props$image$altText","srcs","MobileLarge","Desktop","DesktopLarge","lineColours","sort","random","href","cta","split","srcSet","join","alt","altText","title","loading","SvgWheel","style","loggedIn","authorizedOnly","getSvgFromSystem","SystemIcon","LockClose","dateTime","readTime","CategoryPills","categories","authors","dangerouslySetInnerHTML","__html","generateAuthorsString","ArrowRight","SectionWrapper","ArticlesContainer","NoResultsText","p","paragraphLarge","withQueryParams","_props$location","resultsRef","setParams","useQueryParams","Object","assign","location","withDefault","StringParam","initialData","pageIndex","NumberParam","pageSize","filters","f","name","ArrayParam","result","useApi","API_URLS","getArticles","qs","onResetClick","resetParams","keys","x","isArray","reduce","acc","cur","filterOptions","onChange","values","filter","v","variant","HorizontalDesktopFilters","desktopTitle","onClearClick","MobileFilters","multiTitle","mobileTitle","data","ref","_result$data","_result$data$items","items","item","ArticleCard","totalCount","Pagination","onPageChange","setTimeout","scrollIntoView","current","status","LoadingIndicator","label","layout"],"sourceRoot":""}