{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/modules/press-release-listing/hooks/usePressReleaseListing.js","webpack://@verndale/toolkit/./src/js/modules/press-release-listing/PressReleaseListing.js","webpack://@verndale/toolkit/./src/js/modules/press-release-listing/index.js","webpack://@verndale/toolkit/./src/js/modules/react-components/pager/utils.js","webpack://@verndale/toolkit/./src/js/modules/react-components/pager/index.js"],"names":["usePressReleaseListing","props","url","filters","setFilters","useState","activeFilters","setActiveFilters","mainFacetPanelOpen","setMainFacetPanelOpen","facetLimit","setFacetLimit","items","setItems","term","setTerm","sorting","setSorting","page","setPage","totalPages","setTotalPages","searchSummary","setSearchSummary","termLength","error","setError","isLoading","setIsLoading","firstLoad","setFirstLoad","init","fetchData","scrollToTop","setUrlParam","updateUrl","handleClearAllFilters","e","handleClearFilter","filter","hideFilterClear","clearButton","showFilterClear","handleFacetContentToggle","getUrlParam","param","uri","result","value","handleFacetToggle","event","dataFilter","dataId","updatedFilters","type","year","$filter","$item","getFilterPanelState","checkActiveFilters","active","handleFilterPanelToggle","control","newFilters","expanded","handleFilterLimitToggle","limited","filterName","state","handleTermClear","handleTermKeyDown","handleTermSubmit","handleTermKeyUp","el","handleSortingChange","endpoint","currentUrl","activeType","activeYear","r","data","processData","paramName","useEffect","PressReleaseListing","config","dataLabels","noResultsMessage","errorMessage","facetItemsDisplayed","facets","React","item","summary","results","match","Pager","Module","getPageSpread","pages","current","getPages","total","n","pagerArrow","onChange","isPrevDisabled","isNextDisabled","handleButtonClick","previous","next","p"],"mappings":"wLAGA,SAASA,EAAuBC,EAAO,CACrC,MAAMC,EAAO,IAAI,IAAI,OAAO,QAAQ,EAK9B,CAAEC,EAASC,CAAW,G,EAAIC,YAAS,CAAC,CAAC,EACrC,CAAEC,EAAeC,CAAiB,G,EAAIF,YAAS,EAAK,EACpD,CAAEG,EAAoBC,CAAsB,G,EAAIJ,YAAS,EAAK,EAC9D,CAAEK,EAAYC,CAAc,G,EAAIN,YAASJ,EAAM,UAAU,EAIzD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AAC,EACzC,UAAU,gBACV,SAAUyF,EACV,aAAYH,GAAY,eACxB,gBAAeG,CAAC,EAEf1G,EAAM,UAAU,MAEnB,CACF,EAGF,OACE0F,gBAAC,MAAG,UAAU,QAAQ,GAAG,QAAQ,KAAK,aAAa,aAAW,YAAY,EACvEkB,EACAV,EAAM,IAAIY,GACTpB,gBAAC,MAAG,IAAK,GAAGoB,EAAE,QAAQA,EAAE,WAAa,WAAa,KAAM,UAAW,cAAcA,EAAE,UAAY,wBAA0B,MAAMA,EAAE,WAAa,yBAA2B,MACvKpB,gBAAC,UAAO,aAAY,GAAGa,GAAY,aAAaO,EAAE,OAAQ,SAAUA,EAAE,UAAW,QAAS,IAAMN,EAASM,EAAE,IAAI,EAAG,UAAU,gBAAgB,eAAcA,EAAE,UAAY,OAAS,IAAI,EAClLA,EAAE,WAAa,MAAQA,EAAE,IAC5B,CACF,CACD,EACAD,CACH,CAEJ,C","file":"scripts/265.d6e7b4c0.js","sourcesContent":["/* eslint-disable no-use-before-define */\nimport { useState, useEffect } from 'react';\n\nfunction usePressReleaseListing(props) {\n const url = (new URL(window.location));\n // ========================================================================\n // Filters/Facets Setup\n // ========================================================================\n // // Filters\n const [ filters, setFilters ] = useState([]);\n const [ activeFilters, setActiveFilters ] = useState(false);\n const [ mainFacetPanelOpen, setMainFacetPanelOpen ] = useState(false);\n const [ facetLimit, setFacetLimit ] = useState(props.facetLimit);\n // ========================================================================\n // Results, Term, Sorting Page and URL Control Setup\n // ========================================================================\n const [ items, setItems ] = useState([]);\n const [ term, setTerm ] = useState(url.searchParams.get('term') || []);\n const [ sorting, setSorting ] = useState(url.searchParams.get('sorting') || 'date');\n const [ page, setPage ] = useState(parseInt(window.location.search.split('page=')[1], 10) || 1);\n const [ totalPages, setTotalPages ] = useState(0);\n const [ searchSummary, setSearchSummary ] = useState('');\n let termLength = term.length;\n // ========================================================================\n // Misc: Error and Loading States Setup\n // ========================================================================\n const [ error, setError ] = useState(false);\n const [ isLoading, setIsLoading ] = useState(false);\n const [ firstLoad, setFirstLoad ] = useState(false);\n\n // ========================================================================\n // Init Method\n // ========================================================================\n const init = () => {\n if(termLength > 0) {\n document.getElementById('press-release-listing__search-field').classList.add('press-release-listing__search-field--filled');\n }\n fetchData();\n }\n\n // ========================================================================\n // Utils\n // ========================================================================\n const scrollToTop = () => {\n if (firstLoad) {\n setUrlParam('page', `${page}`);\n document.getElementById('press-release-results-container').scrollIntoView();\n const ev = {\"target\":\"window\"};\n updateUrl(ev);\n }\n }\n\n const handleClearAllFilters = e => {\n e.preventDefault();\n e.stopPropagation();\n\n setUrlParam('Type', []);\n setUrlParam('Year', []);\n setUrlParam('page', \"1\");\n updateUrl({target: \"target\"});\n }\n\n const handleClearFilter = (e) => {\n e.preventDefault();\n e.stopPropagation();\n\n const filter = e.target.getAttribute(\"data-filter\");\n setUrlParam(filter, []);\n setUrlParam('page', \"1\");\n updateUrl({target: \"target\"});\n }\n\n const hideFilterClear = e => {\n e.preventDefault();\n e.stopPropagation();\n\n const clearButton = e.target.parentNode.getElementsByClassName(\"press-release-listing__clear-filters\")[0]\n clearButton.style.display = \"none\";\n }\n\n const showFilterClear = e => {\n e.preventDefault();\n e.stopPropagation();\n\n const clearButton = e.target.parentNode.getElementsByClassName(\"press-release-listing__clear-filters\")[0]\n clearButton.style.display = \"inline-flex\";\n }\n\n const handleFacetContentToggle = () => {\n if(mainFacetPanelOpen === true) {\n setMainFacetPanelOpen(false);\n } else {\n setMainFacetPanelOpen(true);\n }\n }\n // ========================================================================\n\n // ========================================================================\n // URL Manipulation (getUrlParam, setUrlParam, updateUrl)\n // ========================================================================\n // eslint-disable-next-line arrow-body-style, no-unused-vars\n const getUrlParam = (param, uri) => {\n let result;\n if(uri) {\n result = uri.searchParams.get(param);\n } else {\n result = url.searchParams.get(param);\n }\n\n return result;\n }\n\n const setUrlParam = (param, value, uri) => {\n if (!uri && !value) return;\n\n if (uri) {\n if (value.length) {\n uri.searchParams.set(param, value);\n } else {\n uri.searchParams.delete(param);\n }\n return;\n }\n\n if (value && value.length) {\n url.searchParams.set(param, value);\n } else {\n url.searchParams.delete(param);\n }\n };\n\n const updateUrl = e => {\n window.history.replaceState(null, '', url.toString());\n if(e?.target){\n fetchData();\n }\n }\n // ========================================================================\n\n // ========================================================================\n // Facet Control ()\n // ========================================================================\n const handleFacetToggle = (event) => {\n const dataFilter = event.target.getAttribute('data-filter');\n const dataId = event.target.getAttribute('data-id');\n const updatedFilters = [...filters];\n const type = [];\n const year = [];\n\n if(event) {\n updatedFilters.forEach($filter => {\n if($filter.value === dataFilter) {\n $filter.items.forEach($item => {\n if($item.value === dataId) {\n if($item.checked === true) {\n $item.checked = false;\n } else {\n $item.checked = true;\n }\n }\n })\n }\n })\n\n updatedFilters.forEach($filter => {\n $filter.items.forEach($item => {\n if($item.checked === true){\n if($filter.value === \"Type\"){\n type.push(encodeURIComponent($item.value));\n }\n if($filter.value === \"Year\"){\n year.push(encodeURIComponent($item.value));\n }\n }\n })\n })\n\n setUrlParam('Type', type);\n setUrlParam('TypeState', getFilterPanelState('Type'))\n setUrlParam('Year', year);\n setUrlParam('YearState', getFilterPanelState('Year'))\n setUrlParam('page', '1');\n setPage(1);\n setFilters(updatedFilters);\n updateUrl(event);\n }\n }\n\n const checkActiveFilters = () => {\n let active = 0;\n\n filters.forEach($filter => {\n $filter.items.forEach($item => {\n if($item.checked === true) {\n active += 1;\n }\n })\n });\n\n setActiveFilters(active);\n };\n\n const handleFilterPanelToggle = (e) => {\n const control = e.target.getAttribute('aria-controls');\n\n const newFilters = [...filters];\n\n newFilters.forEach($filter => {\n if($filter.value === control){\n const {expanded} = $filter;\n if(expanded === true){\n $filter.expanded = false;\n hideFilterClear(e);\n } else {\n $filter.expanded = true;\n showFilterClear(e);\n }\n }\n });\n\n setFilters(newFilters);\n }\n\n const handleFilterLimitToggle = (e) => {\n e.preventDefault();\n e.target.blur();\n\n const control = e.target.getAttribute('aria-controls');\n const newFilters = [...filters];\n\n newFilters.forEach($filter => {\n if($filter.value === control){\n const {limited} = $filter;\n if(limited === true){\n $filter.limited = false;\n } else {\n $filter.limited = true;\n }\n }\n });\n\n setFilters(newFilters);\n }\n\n const getFilterPanelState = (filterName) => {\n const updatedFilters = [...filters];\n let state;\n\n updatedFilters.forEach($filter => {\n if($filter.value === filterName){\n state = $filter.expanded;\n }\n });\n\n if (state !== undefined){\n return state.toString();\n }\n }\n // ========================================================================\n\n // ========================================================================\n // Term Search Control\n // ========================================================================\n const handleTermClear = e => {\n e.preventDefault();\n\n setTerm('');\n setUrlParam('term', []);\n document.getElementById('press-release-listing__search-field').value = '';\n document.getElementById('press-release-listing__search-field').focus();\n document.getElementById('press-release-listing__search-field').classList.remove('press-release-listing__search-field--filled');\n updateUrl(e);\n }\n\n const handleTermKeyDown = e => {\n if (e.keyCode === 13) {\n e.preventDefault();\n handleTermSubmit(e);\n }\n }\n\n const handleTermKeyUp = e => {\n termLength = e.target.value.length;\n\n if(e.target.value.length > 0) {\n e.target.classList.add('press-release-listing__search-field--filled');\n } else {\n e.target.classList.remove('press-release-listing__search-field--filled');\n }\n }\n\n const handleTermSubmit = e => {\n e.preventDefault();\n const el = document.getElementById('press-release-listing__search-field');\n setTerm(el.value);\n setPage(1);\n setUrlParam('page', \"1\");\n setUrlParam('term', el.value);\n updateUrl(e);\n document.activeElement.blur()\n }\n\n const handleSortingChange = e => {\n setPage(1);\n setSorting(e.target.value);\n setUrlParam('page', \"1\");\n setUrlParam('sorting', e.target.value);\n updateUrl(e);\n }\n // ========================================================================\n\n // ========================================================================\n // Fetch Data and process data\n // ========================================================================\n const fetchData = () => {\n const endpoint = new URL(`${props.endpoint}`, window.location.origin);\n const currentUrl = new URL(window.location);\n let activeType = [];\n let activeYear = [];\n\n // Setting all the params to the endpoint url\n if(currentUrl.searchParams.get('sorting')) {\n endpoint.searchParams.set('sorting', currentUrl.searchParams.get('sorting'));\n }\n if(currentUrl.searchParams.get('term')) {\n endpoint.searchParams.set('term', currentUrl.searchParams.get('term'));\n }\n if(currentUrl.searchParams.get('Type')) {\n endpoint.searchParams.set('Type', currentUrl.searchParams.get('Type').split(','));\n activeType = decodeURIComponent((currentUrl.searchParams.get('Type')).split(','));\n }\n if(currentUrl.searchParams.get('Year')) {\n endpoint.searchParams.set('Year', currentUrl.searchParams.get('Year').split(','));\n activeYear = decodeURIComponent((currentUrl.searchParams.get('Year')).split(','));\n }\n if(currentUrl.searchParams.get('page')) {\n endpoint.searchParams.set('page', currentUrl.searchParams.get('page'));\n }\n\n\n setIsLoading(true);\n\n window.fetch(endpoint.toString(), {\n method: 'GET',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then(r => r.json())\n .then(data => {\n if (data.results) {\n processData(data, activeType, activeYear);\n } else {\n setError(true);\n }\n setIsLoading(false);\n if (!firstLoad) {\n setFirstLoad(true);\n }\n })\n .catch(() => {\n setError(true);\n setIsLoading(false);\n if (!firstLoad) {\n setFirstLoad(true);\n }\n });\n }\n\n const processData = (data, activeType, activeYear) => {\n data.filters.forEach($filter => {\n $filter.limited = true;\n $filter.hasLimiter = true;\n\n const paramName = `${$filter.value}State`;\n const state = url.searchParams.get(paramName);\n\n if (state) {\n $filter.expanded = (state === \"true\");\n }\n else if (window.innerWidth <= 1024){\n $filter.expanded = false;\n }\n else {\n $filter.expanded = true;\n }\n\n $filter.items.forEach($item => {\n if($filter.value === \"Type\") {\n if(activeType.indexOf($item.value) !== -1 ) {\n $item.checked = true;\n } else {\n $item.checked = false;\n }\n }\n\n if($filter.value === \"Year\") {\n if(activeYear.indexOf($item.value) !== -1 ) {\n $item.checked = true;\n } else {\n $item.checked = false;\n }\n }\n });\n })\n\n setFilters(data.filters);\n setTotalPages(data.totalPages);\n setSearchSummary(data.searchSummary);\n setItems(data.results);\n }\n // ========================================================================\n\n // ========================================================================\n // Setting up UseEffect\n // ========================================================================\n useEffect(init, []);\n // useEffect(updateUrl, []);\n useEffect(scrollToTop, [page]);\n useEffect(checkActiveFilters, [filters]);\n // useEffect(fetchData, [type, year, sorting, term]);\n // ========================================================================\n\n\n return {\n error,\n isLoading,\n firstLoad,\n items,\n filters,\n sorting,\n results: items,\n term,\n page,\n totalPages,\n searchSummary,\n activeFilters,\n mainFacetPanelOpen,\n facetLimit,\n setFacetLimit,\n handleClearAllFilters,\n handleClearFilter,\n handleSortingChange,\n handleTermKeyDown,\n handleTermKeyUp,\n handleTermSubmit,\n handleTermClear,\n handleFacetToggle,\n handleFilterPanelToggle,\n handleFacetContentToggle,\n handleFilterLimitToggle,\n setPage\n };\n}\n\nexport default usePressReleaseListing;\n","/* eslint-disable no-return-assign */\nimport React from 'react';\nimport usePressReleaseListing from './hooks/usePressReleaseListing';\nimport Pager from '../react-components/pager';\n\nfunction PressReleaseListing(props) {\n const { ...config } = usePressReleaseListing(props);\n // eslint-disable-next-line react/prop-types\n const dataLabels = JSON.parse(props.labels);\n // eslint-disable-next-line react/prop-types\n const noResultsMessage = props.noResultsRtf;\n // eslint-disable-next-line react/prop-types\n const errorMessage = props.errorMessageRtf;\n\n let facetItemsDisplayed = 0;\n\n const facets = (\n <>\n
\n
\n

Media Contact

\n
\n Press Inquiries:

\n press@amwell.com

\n

\n Head of External Communications:

\n Angela Vogen

\n press@amwell.com

\n
\n
\n
\n \n \n \n \n \n \n
\n \n {config.filters.length?\n
\n
\n {config.activeFilters?\n
\n \n
\n :
\n \n
\n }\n
\n
\n {config.activeFilters?\n
\n {config.filters?.map(filter => (\n filter?.items?.map(item => (\n item.checked?\n \n : \"\"))\n ))}\n
\n : \"\" }\n
    \n {config.filters?.map(filter => (\n
  • \n \n

    {dataLabels.narrowResults}

    \n \n
      \n {filter.items?.map(item => (\n facetItemsDisplayed < Number(config.facetLimit) ?\n
    • \n \n
    • \n :\n
    • \n \n
    • \n ))}\n
    \n {filter.hasLimiter && filter.expanded && filter?.items?.length > Number(config.facetLimit) ?\n \n {filter.limited ?\n 'View All' : 'View Less'\n }\n {filter.limited ?\n \n \n \n :\n \n \n \n }\n \n : ''}\n
  • \n ))}\n
\n
\n
\n : \"\"}\n
\n
\n
\n \"\"\n\n
\n

Need to use our logo?

\n
\n \n \n \n \n Download now\n \n
\n
\n \n );\n\n\n const summary = (\n <>\n
\n {config.searchSummary}\n
\n \n \n \n \n
\n
\n \n );\n\n\n const results = (\n <>\n \n \n )\n\n /* eslint-disable no-nested-ternary */\n return (\n <>\n
\n
\n {facets}\n
\n
\n {config.isLoading?\n
\n \n \n \n

Loading Results...

\n
\n :<>\n {config.error?\n
\n :config.results.length > 0?\n \n {summary}\n {results}\n \n \n :
\n }\n }\n
\n
\n \n );\n}\n\nexport default PressReleaseListing;\n","import Module from './PressReleaseListing';\n\nexport default Module;\n","const getPageSpread = (pages, current) => {\n const spreadPages = pages.map(page => ({\n page,\n isCurrent: current === page\n }));\n return spreadPages;\n};\n\nexport const getPages = (current, total) => {\n if (total <= 5) {\n const items = Array.from(new Array(total).keys()).map(n => n + 1);\n return getPageSpread(items, current);\n }\n if (current < 5) {\n\n if (current === 4) {\n return [\n ...getPageSpread([1], current),\n { isEllipses: true, page: current - 2 },\n ...getPageSpread([current - 1, current, current + 1], current),\n { isEllipses: true, page: current + 2 },\n ...getPageSpread([total], current)\n ];\n }\n\n const items = Array.from(new Array(4).keys()).map(n => n + 1);\n\n return [\n ...getPageSpread(items, current),\n { isEllipses: true, page: 5 },\n ...getPageSpread([total], current)\n ];\n }\n if (total > 5 && current >= total - 3) {\n\n if (current === total - 3) {\n return [\n ...getPageSpread([1], current),\n { isEllipses: true, page: current - 2 },\n ...getPageSpread([current - 1, current, current + 1], current),\n { isEllipses: true, page: current + 2 },\n ...getPageSpread([total], current)\n ];\n }\n\n return [\n ...getPageSpread([1], current),\n { isEllipses: true, page: total - 4 },\n ...getPageSpread([total - 3, total - 2, total - 1, total], current)\n ];\n }\n if (total > 6 && current > 4) {\n return [\n ...getPageSpread([1], current),\n { isEllipses: true, page: current - 2 },\n ...getPageSpread([current - 1, current, current + 1], current),\n { isEllipses: true, page: current + 2 },\n ...getPageSpread([total], current)\n ];\n }\n return [];\n};\n","/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { getPages } from './utils';\n\nconst pagerArrow = {\n nextArrowLabel: \"Next page\",\n pageLabel: \"Page\",\n prevArrowLabel: \"Previous page\"\n};\n\nconst Pager = props => {\n const { page, total, onChange } = props;\n const pages = getPages(page, total);\n\n if (pages.length <= 1) return null;\n\n const isPrevDisabled = page === 1;\n const isNextDisabled = page === total;\n\n const handleButtonClick = n => {\n onChange(n);\n }\n\n const previous = (\n
  • \n handleButtonClick(page - 1)}\n className=\"pager__button\"\n disabled={isPrevDisabled}\n aria-label={pagerArrow?.prevArrowLabel}\n aria-disabled={isPrevDisabled}\n >\n {props.labelPrev}\n Previous\n \n
  • \n );\n\n\n const next = (\n
  • \n handleButtonClick(page + 1)}\n className=\"pager__button\"\n disabled={isNextDisabled}\n aria-label={pagerArrow?.nextArrowLabel}\n aria-disabled={isNextDisabled}\n >\n {props.labelNext}\n Next\n \n
  • \n );\n\n return (\n
      \n {previous}\n {pages.map(p => (\n
    1. \n \n
    2. \n ))}\n {next}\n
    \n );\n};\n\nexport default Pager;\n"],"sourceRoot":""}