{"version":3,"sources":["containers/Accessibility/styles/srActionDescriptor.ts","containers/Accessibility/SrActionDescriptor.tsx","components/DocumentList/StyledDocumentList.ts","components/DocumentList/helpers.tsx","components/DocumentList/Document.tsx","containers/DomElements/styles/styledAnchorEndIcon.ts","containers/DomElements/AnchorEndIcon.tsx","components/DocumentList/ExternalDocument.tsx","components/DocumentList/index.tsx"],"names":["StyledContainer","styled","span","SrActionDescriptor","title","className","ListWrapper","div","theme","documentList","border","DownloadWrapper","spacing","p","mq","IconWrapper","svg","iconColor","lessThan","TextWrapper","ml","xs","md","avoidPageBreakOnPrint","DownloadIconWrapper","desktopOnly","mobileOnly","css","colors","link","featured","color","DownloadTitle","fixedTitle16","DownloadAttributesWrapper","mt","DownloadAttributes","fixedTitle12","downloadAttributes","DownloadDescription","textBody2","downloadDescription","mr","DownloadLink","a","downloadLink","secondary","colorHover","colorVisited","DownloadHeader","EditorDiv","getIcon","format","toLowerCase","Icon","ariaHidden","name","EditorText","compose","withEditModeNotice","DownloadIcon","DownloadLinkWrapper","children","href","onClick","type","target","renderDownloadItem","datasource","editMode","digitalData","isAuthenticatedContent","setDigitalData","id","jss","file","description","extension","size","src","mimeType","hasFileAttached","analyticsFileName","value","URL","pathname","substring","lastIndexOf","origin","searchParams","toString","downloadLinkProps","setObjectData","fileName","fileTitle","emitTrackEvent","Fragment","key","noticeEnabled","noticeMessage","AuthenticatedContentIcon","iconStyleConfig","iconSize","top","isAuthenticated","Text","field","toUpperCase","fileSize","unit","byteConverter","LongForm","ShortForm","renderSize","withAuthenticatedCheck","withEditMode","withDigitalDataContext","StyledAnchor","AnchorEndIcon","text","endIcon","handleClick","attributes","IconWithSrSupport","getExternalExtension","fileDownloadAnalytics","rendering","heading","fields","data","headingLevel","params","documents","filter","externalFile","isValidDownload","uid","length","HeadingWithDescription","headingField","descriptionField","map","doc","undefined","linkType","url","anchor","accessRestrictedTo"],"mappings":"oOAEO,MAAMA,EAAkBC,UAAOC,KAAV,mQCebC,I,4BAAAA,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E,EAA8BpB,KACpCG,OAAQ4E,SAAF,UAAEA,EAAKR,aAAa5D,WAApB,iBAAE,EAAuBS,aAAzB,aAAE,EAA8BjB,OAEtC8E,SAAUF,SAAF,UAAEA,EAAKR,oBAAP,iBAAE,EAAmB5D,WAArB,iBAAE,EAAwBS,aAA1B,aAAE,EAA+B6D,SACzCC,IAAKH,SAAF,UAAEA,EAAKR,oBAAP,iBAAE,EAAmB5D,WAArB,iBAAE,EAAwBS,aAA1B,aAAE,EAA+B8D,IACpCC,OAAQJ,SAAF,UAAEA,EAAKR,oBAAP,iBAAE,EAAmB5D,WAArB,iBAAE,EAAwBS,aAA1B,aAAE,EAA+B+D,QAGzC,OAAO,kBAAC,GAAD,CACHjD,IAAK6C,EAAIrE,GACTA,GAAIqE,EAAIrE,GACRrE,OAAO0I,SAAA,UAAAA,EAAK1I,aAAL,mBAAYsE,WAAZ,eAAiBS,QAAS,GACjCuC,WAAYA,EACZ9C,YAAW,UAAEkE,EAAIlE,mBAAN,iBAAE,EAAiBF,WAAnB,aAAE,EAAsBS,QAIvC,OAAO,kBAAC,EAAD,CACLgE,mBAAoBL,SAAF,UAAEA,EAAKnE,YAAP,aAAE,EAAWwE,mBAC/B/E,WAAY0E,EACZzE,SAAUA,EACV4B,IAAK6C,EAAIrE,WAWpB","file":"static/js/DocumentList.6d4c85d8.chunk.js","sourcesContent":["import styled from 'styled-components';\r\n\r\nexport const StyledContainer = styled.span`\r\n position: absolute !important;\r\n clip: rect(1px,1px,1px,1px);\r\n width: 1px !important;\r\n height: 1px !important;\r\n padding: 0 !important;\r\n border: 0 !important;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n`;","import React, { FC } from 'react';\r\nimport { StyledContainer } from './styles/srActionDescriptor';\r\n\r\ninterface SrActionDescriptorProps {\r\n title: string;\r\n}\r\n\r\nconst SrActionDescriptor: FC = ({\r\n title = 'download',\r\n}): JSX.Element => {\r\n return (\r\n \r\n {title}\r\n \r\n );\r\n};\r\n\r\nexport default SrActionDescriptor;","import styled, { css } from 'styled-components';\r\n\r\nimport { spacing } from '_utils/props';\r\nimport {\r\n avoidPageBreakOnPrint,\r\n fixedTitle12,\r\n fixedTitle16,\r\n mq,\r\n svg,\r\n textBody2,\r\n} from '_utils/styles/';\r\n\r\nexport const ListWrapper = styled.div`\r\n border: 1px solid ${({ theme }) => theme.documentList.border};\r\n border-radius: 4px;\r\n width: 100%;\r\n`;\r\n\r\nexport const DownloadWrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n\r\n ${({ theme }) => spacing({ theme, p: 2 })};\r\n\r\n ${mq('md')} {\r\n align-items: flex-start;\r\n flex-direction: row;\r\n }\r\n\r\n & + & {\r\n border-top: 1px solid ${({ theme }) => theme.documentList.border};\r\n }\r\n`;\r\n\r\nexport const IconWrapper = styled.div`\r\n ${svg(32, 32)}\r\n flex-shrink: 0;\r\n width: 32px;\r\n\r\n path {\r\n fill: ${({ theme }) => theme.documentList.iconColor};\r\n }\r\n\r\n ${mq.lessThan('md')} {\r\n margin-bottom: 18px;\r\n display: none;\r\n }\r\n`;\r\n\r\nexport const TextWrapper = styled.div`\r\n flex-grow: 1;\r\n margin: 0;\r\n\r\n ${({ theme }) => spacing({ theme, ml: { xs: 0, md: 2 } })};\r\n\r\n ${avoidPageBreakOnPrint}\r\n`;\r\n\r\nexport const DownloadIconWrapper = styled.span`\r\n ${svg(24, 24)}\r\n display: flex;\r\n flex-shrink: 0;\r\n margin-left: 12px;\r\n width: 24px;\r\n\r\n ${({ desktopOnly, mobileOnly }) => {\r\n if (mobileOnly) {\r\n return css`\r\n ${mq('md')} {\r\n display: none;\r\n }\r\n `;\r\n }\r\n\r\n if (desktopOnly) {\r\n return css`\r\n ${mq.lessThan('md')} {\r\n display: none;\r\n }\r\n `;\r\n }\r\n }};\r\n\r\n path {\r\n fill: ${({ theme }) => theme.colors.link.featured.color};\r\n }\r\n`;\r\n\r\nexport const DownloadTitle = styled.span`\r\n ${fixedTitle16}\r\n color: ${({ theme }) => theme.colors.link.featured.color};\r\n display: block;\r\n font-weight: bold;\r\n margin: 0;\r\n transition: color 0.2s linear;\r\n`;\r\n\r\nexport const DownloadAttributesWrapper = styled.div`\r\n align-items: center;\r\n display: flex;\r\n justify-content: space-between;\r\n\r\n ${({ theme }) => spacing({\r\n theme,\r\n mt: {\r\n xs: '6px',\r\n md: 0,\r\n },\r\n ml: {\r\n xs: 0,\r\n md: 2,\r\n },\r\n})};\r\n\r\n ${mq('md')} {\r\n flex: 0 0 200px;\r\n }\r\n`;\r\n\r\nexport const DownloadAttributes = styled.span`\r\n ${fixedTitle12};\r\n color: ${({ theme }) => theme.documentList.downloadAttributes.color};\r\n display: block;\r\n`;\r\n\r\nexport const DownloadDescription = styled.p`\r\n ${textBody2}\r\n color: ${({ theme }) => theme.documentList.downloadDescription.color};\r\n margin: 0;\r\n\r\n ${({ theme }) => spacing({\r\n theme,\r\n mt: 1,\r\n mr: {\r\n md: 4,\r\n },\r\n})};\r\n`;\r\n\r\nexport const DownloadLink = styled.a`\r\n align-items: center;\r\n color: ${({ theme }) => theme.documentList.downloadLink.color};\r\n display: flex;\r\n justify-content: space-between;\r\n text-decoration: none;\r\n\r\n &:hover,\r\n &:active {\r\n color: ${({ theme }) => theme.colors.link.secondary.colorHover};\r\n }\r\n\r\n &:visited {\r\n color: ${({ theme }) => theme.colors.link.secondary.colorVisited};\r\n }\r\n`;\r\n\r\nexport const DownloadHeader = styled.div`\r\n display: flex;\r\n\r\n ${mq.lessThan('md')} {\r\n flex-direction: column;\r\n }\r\n\r\n ${mq('md')} {\r\n align-items: flex-start;\r\n justify-content: space-between;\r\n }\r\n`;\r\n\r\nexport const EditorDiv = styled.div``;\r\n","import React, { ReactNode } from 'react';\r\n\r\nimport Icon from '_components/Icon';\r\nimport { byteConverter, dateConverter } from '_utils/helpers';\r\nimport { emitTrackEvent, setObjectData } from '_utils/helpers/analytics';\r\n\r\nimport { DownloadableFile } from './definitions';\r\n\r\nconst getIcon = (format: string): ReactNode => {\r\n switch (format.toLowerCase()) {\r\n case 'xls':\r\n case 'xlsm':\r\n return ;\r\n case 'doc':\r\n case 'docm':\r\n case 'docx':\r\n return ;\r\n case 'avi':\r\n case 'mp4':\r\n return ;\r\n case 'pdf':\r\n return ;\r\n case 'jpg':\r\n case 'jpeg':\r\n case 'png':\r\n case 'tiff':\r\n case 'svg':\r\n case 'gif':\r\n return ;\r\n case 'zip':\r\n case 'gz':\r\n case '7z':\r\n return ;\r\n default:\r\n return ;\r\n }\r\n};\r\n\r\n/**\r\n * @description Determines if each document node has all the appropriate data attributes.\r\n * @param {boolean} editMode \r\n * @param {DownloadableFile} file \r\n * @returns a boolean response based on calculated logic.\r\n */\r\nconst isValidDownload = (editMode: boolean, file: DownloadableFile): boolean => {\r\n return editMode \r\n || (!!file.file?.jss?.value \r\n && !!file.title?.jss?.value \r\n || !!file?.externalFile?.jss?.value);\r\n}\r\n \r\n\r\nconst renderSize = (fileSize: string | number): ReactNode => {\r\n const { size, unit } = byteConverter(fileSize, 1);\r\n\r\n return (\r\n \r\n {size} {unit.ShortForm}\r\n \r\n );\r\n};\r\n\r\nconst renderDate = (date: string): ReactNode => {\r\n const convertedDate = dateConverter(date);\r\n\r\n if (convertedDate === null) {\r\n return null;\r\n }\r\n\r\n return ;\r\n};\r\n\r\nconst getExternalExtension = (href: string): string => {\r\n return href.substring(href.lastIndexOf('.')+1);\r\n}\r\n\r\n\r\nconst fileDownloadAnalytics = (fileName: string, fileTitle: string, setDigitalData: any, digitalData: any): void => {\r\n if (typeof setDigitalData === 'function') {\r\n setDigitalData(\r\n setObjectData(\r\n ['download'],\r\n {\r\n fileName,\r\n fileTitle\r\n },\r\n digitalData)\r\n );\r\n\r\n emitTrackEvent('fileDownload');\r\n }\r\n\r\n};\r\nexport { isValidDownload, getIcon, renderDate, renderSize, getExternalExtension, fileDownloadAnalytics };\r\n","import { Text } from '@sitecore-jss/sitecore-jss-react';\r\nimport { compose } from 'ramda';\r\nimport React, {\r\n FC,\r\n ReactNode,\r\n} from 'react';\r\n\r\nimport Icon from '_components/Icon';\r\n\r\nimport { withAuthenticatedCheck, withEditMode, withEditModeNotice } from '_containers/BaseComponent';\r\nimport { withDigitalDataContext } from '_containers/DigitalDataContext';\r\n\r\nimport { AuthenticatedContentIcon } from '_utils/components/AuthenticatedContentIcon';\r\nimport { emitTrackEvent, setObjectData } from '_utils/helpers/analytics';\r\n\r\nimport { DocumentProps, DownloadableFile } from './definitions';\r\nimport SrActionDescriptor from '_containers/Accessibility/SrActionDescriptor';\r\nimport {\r\n DownloadHeader,\r\n DownloadWrapper,\r\n DownloadLink,\r\n DownloadTitle,\r\n DownloadAttributesWrapper,\r\n DownloadAttributes,\r\n DownloadIconWrapper,\r\n DownloadDescription,\r\n EditorDiv,\r\n IconWrapper,\r\n TextWrapper\r\n} from './StyledDocumentList';\r\nimport { getIcon, renderSize } from './helpers';\r\n\r\nconst EditorText = compose(withEditModeNotice)(EditorDiv);\r\n\r\ninterface DownloadIconProps {\r\n desktopOnly?: boolean,\r\n mobileOnly?: boolean,\r\n title?: string,\r\n}\r\nconst DownloadIcon: FC = ({\r\n desktopOnly,\r\n mobileOnly,\r\n title,\r\n}): JSX.Element => (\r\n \r\n \r\n \r\n \r\n);\r\n\r\nconst DownloadLinkWrapper = ({\r\n children,\r\n href,\r\n onClick,\r\n type,\r\n}) => (\r\n \r\n {children}\r\n \r\n);\r\n\r\nconst renderDownloadItem = (\r\n datasource: DownloadableFile,\r\n editMode: boolean,\r\n digitalData: any,\r\n isAuthenticatedContent,\r\n setDigitalData,\r\n): ReactNode => {\r\n const {\r\n id,\r\n title: { jss: title },\r\n file: { jss: file },\r\n description\r\n } = datasource;\r\n let hasFileAttached = true;\r\n let extension;\r\n let size;\r\n let src;\r\n let mimeType;\r\n let analyticsFileName = '';\r\n\r\n try {\r\n extension = file.value.extension;\r\n size = file.value.size;\r\n mimeType = file.value.mimeType;\r\n\r\n src = file.value.src;\r\n\r\n if (!editMode) {\r\n // Add `download-true` for IE support\r\n src = new URL(file.value.src);\r\n\r\n // strip off hostname to reduce noise in analytics report\r\n analyticsFileName = src?.pathname.substring(src?.pathname.lastIndexOf('/') + 1);\r\n\r\n src = `${src.origin}${src.pathname}?${src.searchParams.toString()}`;\r\n }\r\n } catch {\r\n hasFileAttached = false;\r\n }\r\n\r\n const handleDownloadClick = () => {\r\n if (typeof setDigitalData === 'function') {\r\n setDigitalData(\r\n setObjectData(\r\n ['download'],\r\n {\r\n fileName: analyticsFileName,\r\n fileTitle: title?.value ?? '',\r\n },\r\n digitalData)\r\n );\r\n\r\n emitTrackEvent('fileDownload');\r\n }\r\n };\r\n\r\n const downloadLinkProps = {\r\n onClick: handleDownloadClick,\r\n href: src,\r\n type: mimeType,\r\n }\r\n\r\n return (\r\n \r\n \r\n {hasFileAttached && getIcon(extension)}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n {hasFileAttached && }\r\n \r\n\r\n {hasFileAttached && (\r\n \r\n \r\n {extension ? extension.toUpperCase() : 'UNKNOWN'} ยท {renderSize(size)}\r\n \r\n\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n\r\n {(description?.jss?.value || editMode) && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst Document: React.FC = ({\r\n datasource,\r\n isAuthenticatedContent,\r\n editMode,\r\n digitalData,\r\n setDigitalData\r\n}) => {\r\n\r\n if (datasource === null) {\r\n if (editMode) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {renderDownloadItem(datasource, editMode, digitalData, isAuthenticatedContent, setDigitalData)}\r\n \r\n );\r\n};\r\n\r\nexport default compose(\r\n withAuthenticatedCheck,\r\n withEditMode,\r\n withDigitalDataContext\r\n)(Document);\r\n","import styled from 'styled-components';\r\nimport { fixedTitle16 } from '_utils/styles/';\r\n\r\nexport const StyledAnchor = styled.a`\r\n ${fixedTitle16}\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n width: 100%;\r\n \r\n color: ${({ theme }) => theme.colors.link.featured.color};\r\n font-weight: bold;\r\n margin: 0;\r\n transition: color 0.2s linear;\r\n text-decoration: none;\r\n`;","import React, {\r\n FC,\r\n ReactNode,\r\n} from 'react';\r\n\r\nimport { StyledAnchor } from './styles/styledAnchorEndIcon';\r\n\r\ninterface AnchorEndIconProps {\r\n href: string;\r\n text: string;\r\n endIcon: ReactNode;\r\n target?: string;\r\n handleClick?: () => void;\r\n}\r\n\r\nconst AnchorEndIcon: FC = ({\r\n href,\r\n text,\r\n endIcon,\r\n target = '_blank',\r\n handleClick = () => null,\r\n}): JSX.Element => {\r\n\r\n return (\r\n handleClick()}\r\n >\r\n {text}\r\n {endIcon}\r\n \r\n );\r\n};\r\n\r\nexport default AnchorEndIcon;","import React, { FC } from 'react';\r\nimport { compose } from 'ramda';\r\nimport { withDigitalDataContext } from '_containers/DigitalDataContext';\r\nimport { ExternalFile } from './definitions';\r\nimport AnchorEndIcon from '_containers/DomElements/AnchorEndIcon';\r\nimport Icon from '_components/Icon';\r\nimport {\r\n getExternalExtension,\r\n getIcon,\r\n fileDownloadAnalytics,\r\n} from './helpers';\r\nimport SrActionDescriptor from '_containers/Accessibility/SrActionDescriptor';\r\nimport {\r\n DownloadWrapper,\r\n IconWrapper,\r\n TextWrapper,\r\n DownloadDescription,\r\n} from './StyledDocumentList';\r\n\r\n\r\ninterface ExternalDocumentProps {\r\n id: string;\r\n title: string;\r\n attributes: ExternalFile;\r\n description?: string;\r\n digitalData: any;\r\n setDigitalData: any;\r\n}\r\nconst ExternalDocument: FC = ({\r\n id,\r\n title,\r\n attributes,\r\n digitalData,\r\n setDigitalData,\r\n description = undefined,\r\n}): JSX.Element => {\r\n const {\r\n href,\r\n target, \r\n } = attributes;\r\n\r\n const handleClickForAnalytics = (): void => {\r\n fileDownloadAnalytics(\r\n href,\r\n href,\r\n setDigitalData,\r\n digitalData,\r\n );\r\n };\r\n\r\n const IconWithSrSupport = <>\r\n \r\n \r\n ;\r\n\r\n return (\r\n \r\n {getIcon(getExternalExtension(href))}\r\n \r\n \r\n\r\n {description &&\r\n {description}\r\n }\r\n \r\n \r\n );\r\n};\r\n\r\n// export default ExternalDocument;\r\nexport default compose(withDigitalDataContext)(ExternalDocument);","import { compose } from 'ramda';\r\nimport React from 'react';\r\n\r\nimport HeadingWithDescription from '_utils/components/HeadingWithDescription';\r\nimport { withEditMode, withEditModeNotice } from '_containers/BaseComponent';\r\n\r\nimport Document from './Document';\r\nimport { DocumentListProps, ExternalFile } from './definitions';\r\nimport { isValidDownload } from './helpers';\r\nimport { EditorDiv, ListWrapper } from './StyledDocumentList';\r\nimport ExternalDocument from './ExternalDocument';\r\n\r\nconst EditorText = compose(withEditModeNotice)(EditorDiv);\r\n\r\nconst DocumentList: React.FC = ({ rendering, editMode }) => {\r\n const heading = rendering?.fields?.data?.datasource?.heading?.data;\r\n const headingLevel = rendering?.params?.headingLevel || 'h3';\r\n const description = rendering?.fields?.data?.datasource?.description?.data;\r\n const documents = rendering?.fields?.data?.datasource?.documents\r\n ?.filter((file) => isValidDownload(editMode, file)) || [];\r\n const uid = rendering?.uid;\r\n\r\n if (editMode || documents.length >= 1) {\r\n return (\r\n \r\n \r\n \r\n {(documents.length >= 1) &&\r\n \r\n {documents?.map((doc) => {\r\n if(doc.externalFile !== null && doc.externalFile !== undefined && doc.externalFile?.jss?.value?.href !== \"\"){\r\n\r\n const attributes: ExternalFile = {\r\n href: doc.externalFile?.jss?.value?.href,\r\n target: doc?.externalFile.jss?.value?.target,\r\n // TODO: What are these for? Still waiting on response\r\n linkType: doc?.externalFile?.jss?.value?.linkType,\r\n url: doc?.externalFile?.jss?.value?.url,\r\n anchor: doc?.externalFile?.jss?.value?.anchor,\r\n };\r\n \r\n return \r\n \r\n } else {\r\n return \r\n }\r\n })}\r\n \r\n }\r\n \r\n \r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport default compose(withEditMode)(DocumentList);\r\n"],"sourceRoot":""}