@mjhls/mjh-framework 1.0.939-nojs-pagination-v5 → 1.0.939-segment-test

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 (82) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AlgoliaSearch.js +15 -131
  3. package/dist/cjs/ArticleProgramLandingPage.js +1 -2
  4. package/dist/cjs/ArticleSeriesLandingPage.js +1 -2
  5. package/dist/cjs/AuthWrapper.js +1 -1
  6. package/dist/cjs/ConferenceArticleCard.js +15 -15
  7. package/dist/cjs/ContentCardPaginated.js +2 -1
  8. package/dist/cjs/DeckContent.js +17 -30
  9. package/dist/cjs/DeckQueuePaginated.js +2 -1
  10. package/dist/cjs/EventsDeck.js +17 -17
  11. package/dist/cjs/GridContent.js +11 -26
  12. package/dist/cjs/GridContentPaginated.js +2 -1
  13. package/dist/cjs/HamMagazine.js +9 -9
  14. package/dist/cjs/IssueLanding.js +29 -29
  15. package/dist/cjs/KMTracker.js +15 -15
  16. package/dist/cjs/MasterDeck.js +18 -17
  17. package/dist/cjs/MasterDeckPaginated.js +10 -9
  18. package/dist/cjs/{MediaSeriesCard-cc5aa886.js → MediaSeriesCard-659279e0.js} +1 -1
  19. package/dist/cjs/MediaSeriesLanding.js +7 -8
  20. package/dist/cjs/MediaSeriesLandingPaginated.js +9 -9
  21. package/dist/cjs/NavMagazine.js +10 -10
  22. package/dist/cjs/NavNative.js +9 -9
  23. package/dist/cjs/Pagination-885dcfbd.js +90 -0
  24. package/dist/cjs/PartnerDetailListingPaginated.js +2 -1
  25. package/dist/cjs/PublicationLanding.js +26 -26
  26. package/dist/cjs/QueueDeckExpanded.js +5 -3
  27. package/dist/cjs/QueueDeckExpandedPaginated.js +2 -1
  28. package/dist/cjs/RelatedContent.js +28 -28
  29. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  30. package/dist/cjs/SeriesListingDeck.js +1 -1
  31. package/dist/cjs/{SeriesSlider-de93a303.js → SeriesSlider-ba0c5d1a.js} +4 -4
  32. package/dist/cjs/SideFooter.js +2 -2
  33. package/dist/cjs/VideoProgramLandingPage.js +1 -2
  34. package/dist/cjs/VideoSeriesCard.js +1 -1
  35. package/dist/cjs/VideoSeriesListing.js +9 -17
  36. package/dist/cjs/View.js +63 -37
  37. package/dist/cjs/YoutubeGroup.js +4 -4
  38. package/dist/cjs/{getTargeting-dab97fe1.js → getTargeting-3c5754ac.js} +9 -9
  39. package/dist/cjs/getTargeting.js +1 -1
  40. package/dist/cjs/index.js +3 -2
  41. package/dist/esm/AlgoliaSearch.js +16 -132
  42. package/dist/esm/ArticleProgramLandingPage.js +1 -2
  43. package/dist/esm/ArticleSeriesLandingPage.js +1 -2
  44. package/dist/esm/AuthWrapper.js +1 -1
  45. package/dist/esm/ConferenceArticleCard.js +15 -15
  46. package/dist/esm/ContentCardPaginated.js +2 -1
  47. package/dist/esm/DeckContent.js +17 -30
  48. package/dist/esm/DeckQueuePaginated.js +2 -1
  49. package/dist/esm/EventsDeck.js +17 -17
  50. package/dist/esm/GridContent.js +11 -26
  51. package/dist/esm/GridContentPaginated.js +2 -1
  52. package/dist/esm/HamMagazine.js +9 -9
  53. package/dist/esm/IssueLanding.js +29 -29
  54. package/dist/esm/KMTracker.js +15 -15
  55. package/dist/esm/MasterDeck.js +18 -17
  56. package/dist/esm/MasterDeckPaginated.js +10 -9
  57. package/dist/esm/{MediaSeriesCard-2dc3c439.js → MediaSeriesCard-06c6251a.js} +1 -1
  58. package/dist/esm/MediaSeriesLanding.js +7 -8
  59. package/dist/esm/MediaSeriesLandingPaginated.js +9 -9
  60. package/dist/esm/NavMagazine.js +10 -10
  61. package/dist/esm/NavNative.js +9 -9
  62. package/dist/esm/Pagination-59436882.js +82 -0
  63. package/dist/esm/PartnerDetailListingPaginated.js +2 -1
  64. package/dist/esm/PublicationLanding.js +26 -26
  65. package/dist/esm/QueueDeckExpanded.js +5 -3
  66. package/dist/esm/QueueDeckExpandedPaginated.js +2 -1
  67. package/dist/esm/RelatedContent.js +28 -28
  68. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  69. package/dist/esm/SeriesListingDeck.js +1 -1
  70. package/dist/esm/{SeriesSlider-98ad6d97.js → SeriesSlider-45adb8dc.js} +4 -4
  71. package/dist/esm/SideFooter.js +2 -2
  72. package/dist/esm/VideoProgramLandingPage.js +1 -2
  73. package/dist/esm/VideoSeriesCard.js +1 -1
  74. package/dist/esm/VideoSeriesListing.js +9 -17
  75. package/dist/esm/View.js +62 -37
  76. package/dist/esm/YoutubeGroup.js +4 -4
  77. package/dist/esm/{getTargeting-04d979c9.js → getTargeting-42f9b439.js} +9 -9
  78. package/dist/esm/getTargeting.js +1 -1
  79. package/dist/esm/index.js +3 -2
  80. package/package.json +115 -115
  81. package/dist/cjs/Pagination-42f92f7c.js +0 -97
  82. package/dist/esm/Pagination-484b86c5.js +0 -90
@@ -376,32 +376,32 @@ module.exports = { "default": set$1, __esModule: true };
376
376
 
377
377
  var _Set = unwrapExports(set);
378
378
 
379
- /* usage & query
380
- const Publication = (props) => {
381
- const { cache, pub, year } = props
382
- const targeting = {
383
- content_placement: [`/journals/${pub.identifier.current}`],
384
- document_url: [`/journals/${pub.identifier.current}`],
385
- }
386
- return (
387
- <Shell title={pub.name} cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3'>
388
- <PublicationLanding publication={pub} year={year} href={'journals'} />
389
- </Shell>
390
- )
391
- }
392
- Publication.getInitialProps = async (ctx) => {
393
- const { query } = ctx
394
- const {
395
- query: { year },
396
- } = ctx
397
- const pub = await client.fetch(getQuery('publication'), query)
398
- **import urlFor from framework**
399
- pub.issues.map((issue) => {
400
- issue.thumbnail = urlFor({client, source: issue.thumbnail})
401
- })
402
- return { pub, year }
403
- }
404
- export default Publication
379
+ /* usage & query
380
+ const Publication = (props) => {
381
+ const { cache, pub, year } = props
382
+ const targeting = {
383
+ content_placement: [`/journals/${pub.identifier.current}`],
384
+ document_url: [`/journals/${pub.identifier.current}`],
385
+ }
386
+ return (
387
+ <Shell title={pub.name} cache={cache} settings={Settings} targeting={targeting} ads={Ads} layout='3'>
388
+ <PublicationLanding publication={pub} year={year} href={'journals'} />
389
+ </Shell>
390
+ )
391
+ }
392
+ Publication.getInitialProps = async (ctx) => {
393
+ const { query } = ctx
394
+ const {
395
+ query: { year },
396
+ } = ctx
397
+ const pub = await client.fetch(getQuery('publication'), query)
398
+ **import urlFor from framework**
399
+ pub.issues.map((issue) => {
400
+ issue.thumbnail = urlFor({client, source: issue.thumbnail})
401
+ })
402
+ return { pub, year }
403
+ }
404
+ export default Publication
405
405
  */
406
406
 
407
407
  var generateContentPlacements = function generateContentPlacements(issues) {
@@ -1361,8 +1361,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1361
1361
  imageFit = props.imageFit,
1362
1362
  rightItems = props.rightItems,
1363
1363
  brandInsightAd = props.brandInsightAd,
1364
- _props$nextPagePostsC = props.nextPagePostsCount,
1365
- nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC,
1366
1364
  _props$showBI = props.showBI,
1367
1365
  showBI = _props$showBI === undefined ? false : _props$showBI,
1368
1366
  _props$heroContent = props.heroContent,
@@ -1416,6 +1414,10 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1416
1414
  var prevValues = usePrevious(values);
1417
1415
 
1418
1416
  var renderManualPagination = function renderManualPagination(currentPage) {
1417
+ if (lastDataSize < itemsPerPage) {
1418
+ return null;
1419
+ }
1420
+
1419
1421
  return React__default.createElement(
1420
1422
  'div',
1421
1423
  { className: 'd-flex justify-content-between' },
@@ -1424,7 +1426,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1424
1426
  { href: '?page=' + (currentPage - 1) },
1425
1427
  '<< Previous'
1426
1428
  ),
1427
- !(lastDataSize < itemsPerPage) && nextPagePostsCount > 0 && React__default.createElement(
1429
+ React__default.createElement(
1428
1430
  'a',
1429
1431
  { href: '?page=' + (currentPage + 1) },
1430
1432
  'Next >>'
@@ -17,7 +17,7 @@ import { A as ADlgInfeed } from './ADlgInfeed-ebcafb85.js';
17
17
  import { g as getContentCategory } from './getContentCategory-15dcc413.js';
18
18
  import timeDifferenceCalc from './timeDifferenceCalc.js';
19
19
  import urlFor from './urlFor.js';
20
- import { P as Pagination } from './Pagination-484b86c5.js';
20
+ import { P as Pagination } from './Pagination-59436882.js';
21
21
  import './_commonjsHelpers-0c4b6f40.js';
22
22
  import './core.get-iterator-method-ea258bb1.js';
23
23
  import './web.dom.iterable-ab4dea5c.js';
@@ -36,6 +36,7 @@ import './Beam.js';
36
36
  import './stringify-2b084bee.js';
37
37
  import './Segment.js';
38
38
  import './index-3f5c03b2.js';
39
+ import 'react-paginate';
39
40
  import 'react-bootstrap/Button';
40
41
  import './index.esm-1bd8a0a8.js';
41
42
  import './iconBase-ccc56b97.js';
@@ -11,34 +11,34 @@ import './index-3f5c03b2.js';
11
11
  import 'react-dom';
12
12
  import 'prop-types';
13
13
 
14
- /*
15
- Sample query
16
- let references = ''
17
- if(article.taxonomyMapping.length > 0){
18
- article.taxonomyMapping.forEach((ref, index) => {
19
- references = references + `references('${ref._ref}') `
20
- if(index+1 !== article.taxonomyMapping.length){
21
- references = references + ` && `
22
- }
23
- })
24
- }
25
-
26
- const relatedArticlesQuery = `*[!(_id in path("drafts.**")) && _type == "article" && title !='${article.title}' && defined(title) && is_visible == true && ( references('article.documentGroup._id') || ${references} ) && published <= '${today}'] | order(published desc) [0...4] {
27
- ...,
28
- title,
29
- summary,
30
- thumbnail,
31
- url,
32
- published,
33
- authorMapping[]->,
34
- contentCategory->
35
- }`
36
- const relatedArticles = await client.fetch(relatedArticlesQuery)
37
-
38
- Sample usage
39
- <RelatedContent dataRecord={props.relatedArticles} client={client} showAuthor showPublished reverse/>
40
-
41
-
14
+ /*
15
+ Sample query
16
+ let references = ''
17
+ if(article.taxonomyMapping.length > 0){
18
+ article.taxonomyMapping.forEach((ref, index) => {
19
+ references = references + `references('${ref._ref}') `
20
+ if(index+1 !== article.taxonomyMapping.length){
21
+ references = references + ` && `
22
+ }
23
+ })
24
+ }
25
+
26
+ const relatedArticlesQuery = `*[!(_id in path("drafts.**")) && _type == "article" && title !='${article.title}' && defined(title) && is_visible == true && ( references('article.documentGroup._id') || ${references} ) && published <= '${today}'] | order(published desc) [0...4] {
27
+ ...,
28
+ title,
29
+ summary,
30
+ thumbnail,
31
+ url,
32
+ published,
33
+ authorMapping[]->,
34
+ contentCategory->
35
+ }`
36
+ const relatedArticles = await client.fetch(relatedArticlesQuery)
37
+
38
+ Sample usage
39
+ <RelatedContent dataRecord={props.relatedArticles} client={client} showAuthor showPublished reverse/>
40
+
41
+
42
42
  */
43
43
  var RelatedContent = function RelatedContent(props) {
44
44
  var client = props.client,
@@ -14,16 +14,16 @@ var RelatedTopicsDropdown = function RelatedTopicsDropdown(_ref) {
14
14
  _ref$className = _ref.className,
15
15
  className = _ref$className === undefined ? '' : _ref$className;
16
16
 
17
- /*
18
- Props accepted - parentTaxonomy(required, object), subTaxonomy(required, array), page(optional), exclude(optional), variant(optional), className(optional)
19
- example:
20
- <RelatedTopicDropdown
21
- page='/clinical'
22
- exclude="clinical"
23
- className='mb-3'
24
- parentTaxonomy={props.parentTaxonomy}
25
- subTaxonomies={props.subTaxonomies}
26
- />
17
+ /*
18
+ Props accepted - parentTaxonomy(required, object), subTaxonomy(required, array), page(optional), exclude(optional), variant(optional), className(optional)
19
+ example:
20
+ <RelatedTopicDropdown
21
+ page='/clinical'
22
+ exclude="clinical"
23
+ className='mb-3'
24
+ parentTaxonomy={props.parentTaxonomy}
25
+ subTaxonomies={props.subTaxonomies}
26
+ />
27
27
  */
28
28
  if (subTaxonomies.length === 0 && parentTaxonomy) {
29
29
  if (parentTaxonomy.identifier == exclude) {
@@ -5,7 +5,7 @@ import React__default, { useState, useEffect, useRef } from 'react';
5
5
  import { useRouter } from 'next/router';
6
6
  import { l as lib_3 } from './index-f0fc23eb.js';
7
7
  import { I as InfiniteScroll } from './index.es-a6137319.js';
8
- import { S as SeriesSlider } from './SeriesSlider-98ad6d97.js';
8
+ import { S as SeriesSlider } from './SeriesSlider-45adb8dc.js';
9
9
  import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
10
10
  import './_commonjsHelpers-0c4b6f40.js';
11
11
  import './core.get-iterator-method-ea258bb1.js';
@@ -6,10 +6,10 @@ import { s as smoothscroll } from './smoothscroll-fa4e3f8c.js';
6
6
  import urlFor from './urlFor.js';
7
7
  import { m as main_43, a as main_49, b as main_42 } from './main-1894c974.js';
8
8
 
9
- /*
10
- GROQ query -
11
- accepts an array of title, URL
12
- `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
9
+ /*
10
+ GROQ query -
11
+ accepts an array of title, URL
12
+ `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
13
13
  */
14
14
 
15
15
  var SeriesSlider = function SeriesSlider(_ref) {
@@ -32,8 +32,8 @@ var renderLink = function renderLink(row) {
32
32
  };
33
33
 
34
34
  var SideFooter = function SideFooter(props) {
35
- /*
36
- useage example: <SideFooter cache={props.cache} logo='https://mjh-web.s3.amazonaws.com/_media/an_mjhls_brand_logo.png' />
35
+ /*
36
+ useage example: <SideFooter cache={props.cache} logo='https://mjh-web.s3.amazonaws.com/_media/an_mjhls_brand_logo.png' />
37
37
  */
38
38
  var _get = get_1(props, 'cache.siteSettingCache', {}),
39
39
  socialLinks = _get.socialLinks,
@@ -224,8 +224,7 @@ VideoProgramLandingPage.getInitialData = function () {
224
224
  params = {
225
225
  from: start,
226
226
  to: start + itemsPerPage,
227
- url: pathname,
228
- itemsPerPage: itemsPerPage
227
+ url: pathname
229
228
  };
230
229
 
231
230
  query = '*[\n _type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true\n && dateTime(published) <= dateTime(now())\n && references(\'' + taxonomyId + '\')\n ' + (topicId ? '&& references(\'' + topicId + '\')' : '') + '\n ] | order(published desc) [$from...$to]{\n \t\t...,\n \t\ttitle,\n \t\tsummary,\n \t\tpublished,\n \t\tthumbnail{ ..., asset->},\n \t\turl,\n \t\ttaxonomy,\n \t\tcontentCategory->,\n \t\tbody[_type == "youtubeGallery"]{\n ...,\n videos[]{\n ...,\n thumbnail{...,asset->}\n }\n },\n \t\t\'pageNumber\': ' + currentPage + '\n \t}';
@@ -15,7 +15,7 @@ import 'react-dom';
15
15
  import './slicedToArray-6ebcbfea.js';
16
16
  import './index-3f5c03b2.js';
17
17
 
18
- var css = ".VideoSeriesCard-module_article__Hlc3e {\r\n width: 100%;\r\n margin: 0 0 1rem 0;\r\n}\r\n.VideoSeriesCard-module_article__Hlc3e a {\r\n display: flex;\r\n width: 100%;\r\n color: #000000;\r\n}\r\n.VideoSeriesCard-module_thumb__3hGyJ {\r\n width: 25%;\r\n}\r\n.VideoSeriesCard-module_thumb__3hGyJ img {\r\n width: 100%;\r\n height: auto;\r\n}\r\n.VideoSeriesCard-module_info__2_i1N {\r\n width: 75%;\r\n font-size: 1rem;\r\n}\r\n.VideoSeriesCard-module_info__2_i1N h2 {\r\n font-weight: bold;\r\n font-size: 1.25rem;\r\n margin: 0;\r\n}\r\n.VideoSeriesCard-module_published__1fI0q {\r\n color: #6d6d6d;\r\n margin: 0;\r\n}\r\n.VideoSeriesCard-module_summary__3hWJT {\r\n margin: 0.5rem 0 0 0;\r\n}\r\n.VideoSeriesCard-module_author__aU35o {\r\n margin: 0;\r\n}\r\n.VideoSeriesCard-module_author__aU35o span {\r\n color: #6d6d6d;\r\n}\r\n@media only screen and (max-width: 568px) {\r\n .VideoSeriesCard-module_article__Hlc3e {\r\n margin: 1rem 0;\r\n box-shadow: 2px 4px 8px rgba(0,0,0,.2);\r\n }\r\n .VideoSeriesCard-module_article__Hlc3e a {\r\n flex-direction: column;\r\n align-items: center;\r\n }\r\n .VideoSeriesCard-module_thumb__3hGyJ {\r\n overflow: hidden;\r\n width: 100%;\r\n margin-bottom: 1rem;\r\n }\r\n .VideoSeriesCard-module_thumb__3hGyJ img{\r\n border-radius: 10px 10px 0 0; \r\n }\r\n .VideoSeriesCard-module_thumb__3hGyJ figure {\r\n margin: 0;\r\n }\r\n .VideoSeriesCard-module_info__2_i1N {\r\n width: 90%;\r\n padding: 1rem !important;\r\n }\r\n .VideoSeriesCard-module_info__2_i1N h2 {\r\n font-size: 1rem;\r\n }\r\n}\r\n";
18
+ var css = ".VideoSeriesCard-module_article__Hlc3e {\n width: 100%;\n margin: 0 0 1rem 0;\n}\n.VideoSeriesCard-module_article__Hlc3e a {\n display: flex;\n width: 100%;\n color: #000000;\n}\n.VideoSeriesCard-module_thumb__3hGyJ {\n width: 25%;\n}\n.VideoSeriesCard-module_thumb__3hGyJ img {\n width: 100%;\n height: auto;\n}\n.VideoSeriesCard-module_info__2_i1N {\n width: 75%;\n font-size: 1rem;\n}\n.VideoSeriesCard-module_info__2_i1N h2 {\n font-weight: bold;\n font-size: 1.25rem;\n margin: 0;\n}\n.VideoSeriesCard-module_published__1fI0q {\n color: #6d6d6d;\n margin: 0;\n}\n.VideoSeriesCard-module_summary__3hWJT {\n margin: 0.5rem 0 0 0;\n}\n.VideoSeriesCard-module_author__aU35o {\n margin: 0;\n}\n.VideoSeriesCard-module_author__aU35o span {\n color: #6d6d6d;\n}\n@media only screen and (max-width: 568px) {\n .VideoSeriesCard-module_article__Hlc3e {\n margin: 1rem 0;\n box-shadow: 2px 4px 8px rgba(0,0,0,.2);\n }\n .VideoSeriesCard-module_article__Hlc3e a {\n flex-direction: column;\n align-items: center;\n }\n .VideoSeriesCard-module_thumb__3hGyJ {\n overflow: hidden;\n width: 100%;\n margin-bottom: 1rem;\n }\n .VideoSeriesCard-module_thumb__3hGyJ img{\n border-radius: 10px 10px 0 0; \n }\n .VideoSeriesCard-module_thumb__3hGyJ figure {\n margin: 0;\n }\n .VideoSeriesCard-module_info__2_i1N {\n width: 90%;\n padding: 1rem !important;\n }\n .VideoSeriesCard-module_info__2_i1N h2 {\n font-size: 1rem;\n }\n}\n";
19
19
  var styles = { "article": "VideoSeriesCard-module_article__Hlc3e", "thumb": "VideoSeriesCard-module_thumb__3hGyJ", "info": "VideoSeriesCard-module_info__2_i1N", "published": "VideoSeriesCard-module_published__1fI0q", "summary": "VideoSeriesCard-module_summary__3hWJT", "author": "VideoSeriesCard-module_author__aU35o" };
20
20
  styleInject(css);
21
21
 
@@ -79,8 +79,7 @@ var VideoSeriesListing = function (_React$Component) {
79
79
  total_pages: null,
80
80
  scrolling: true,
81
81
  query: _this.query,
82
- currentPage: _this.props.currentPage || 1,
83
- lastDataSize: _this.data ? _this.data.length : 0
82
+ currentPage: _this.props.currentPage || 1
84
83
  }, _this.loadMore = debounce_1(function () {
85
84
  _this.setState(function (state) {
86
85
  var page = state.page,
@@ -124,13 +123,11 @@ var VideoSeriesListing = function (_React$Component) {
124
123
  newDataArr.push(dataArr);
125
124
  return {
126
125
  data: newDataArr,
127
- scrolling: true,
128
- lastDataSize: dataArr.length
126
+ scrolling: true
129
127
  };
130
128
  } else {
131
129
  return {
132
- scrolling: false,
133
- lastDataSize: 0
130
+ scrolling: false
134
131
  };
135
132
  }
136
133
  });
@@ -194,11 +191,9 @@ var VideoSeriesListing = function (_React$Component) {
194
191
  });
195
192
  }
196
193
  }
197
- }, _this.renderManualPagination = function (_ref2) {
198
- var nextPagePostsCount = _ref2.nextPagePostsCount;
194
+ }, _this.renderManualPagination = function () {
199
195
  var currentPage = _this.state.currentPage;
200
196
 
201
-
202
197
  return React__default.createElement(
203
198
  'div',
204
199
  { className: 'd-flex justify-content-between' },
@@ -207,7 +202,7 @@ var VideoSeriesListing = function (_React$Component) {
207
202
  { href: '?page=' + (currentPage - 1) },
208
203
  '<< Previous'
209
204
  ),
210
- !(_this.state.lastDataSize < _this.state.per) && nextPagePostsCount > 0 && React__default.createElement(
205
+ React__default.createElement(
211
206
  'a',
212
207
  { href: '?page=' + (currentPage + 1) },
213
208
  'Next >>'
@@ -266,11 +261,8 @@ var VideoSeriesListing = function (_React$Component) {
266
261
  value: function render() {
267
262
  var _this2 = this;
268
263
 
269
- var _props = this.props,
270
- _props$autoScroll = _props.autoScroll,
271
- autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll,
272
- _props$nextPagePostsC = _props.nextPagePostsCount,
273
- nextPagePostsCount = _props$nextPagePostsC === undefined ? 3 : _props$nextPagePostsC;
264
+ var _props$autoScroll = this.props.autoScroll,
265
+ autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll;
274
266
 
275
267
 
276
268
  if (autoScroll) {
@@ -309,7 +301,7 @@ var VideoSeriesListing = function (_React$Component) {
309
301
  React__default.createElement(
310
302
  'noscript',
311
303
  null,
312
- this.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
304
+ this.renderManualPagination()
313
305
  )
314
306
  )
315
307
  ) : React__default.createElement(
@@ -386,7 +378,7 @@ var VideoSeriesListing = function (_React$Component) {
386
378
  React__default.createElement(
387
379
  'noscript',
388
380
  null,
389
- _this2.renderManualPagination({ nextPagePostsCount: nextPagePostsCount })
381
+ _this2.renderManualPagination()
390
382
  )
391
383
  );
392
384
  })
package/dist/esm/View.js CHANGED
@@ -17,8 +17,8 @@ import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
17
17
  import SocialShare from './SocialShare.js';
18
18
  import { r as renderAuthor, g as getSerializers } from './index-6dc67bdb.js';
19
19
  import DFPAdSlot from './AdSlot.js';
20
- import { S as SeriesSlider } from './SeriesSlider-98ad6d97.js';
21
- import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-04d979c9.js';
20
+ import { S as SeriesSlider } from './SeriesSlider-45adb8dc.js';
21
+ import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-42f9b439.js';
22
22
  import getKeywords from './getKeywords.js';
23
23
  import urlFor from './urlFor.js';
24
24
  import { u as urlForFile } from './urlForFile-b69adffc.js';
@@ -28,13 +28,14 @@ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
28
28
  import './index-755f2cc2.js';
29
29
  import { DiscussionEmbed } from 'disqus-react';
30
30
  import Schema from './Schema.js';
31
- import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
31
+ import FileSaver from 'file-saver';
32
32
  import { _ as _Object$keys } from './keys-31dcdb31.js';
33
33
  import { I as InfiniteScroll } from './index.es-a6137319.js';
34
34
  import { l as lib_3 } from './index-f0fc23eb.js';
35
35
  import getRelatedArticle from './getRelatedArticle.js';
36
36
  import getQuery from './getQuery.js';
37
37
  import getSeriesDetail from './getSeriesDetail.js';
38
+ import './_commonjsHelpers-0c4b6f40.js';
38
39
  import './core.get-iterator-method-ea258bb1.js';
39
40
  import './web.dom.iterable-ab4dea5c.js';
40
41
  import './_library-528f1934.js';
@@ -339,7 +340,7 @@ var ISI = function ISI(props) {
339
340
  );
340
341
  };
341
342
 
342
- var css$1 = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.75rem;\r\n padding-bottom: 0.75rem;\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_cardTitle__3P-Ib {\r\n font-weight: bold;\r\n color: #252525;\r\n margin-bottom: 0.25rem;\r\n font-size: 15px;\r\n}\r\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\r\n color: #000;\r\n font-weight: bold;\r\n}\r\n.RelatedArticles-module_cardDate__1wOR5 {\r\n color: var(--dark);\r\n display: block;\r\n background: #fff !important;\r\n margin-bottom: 0;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: block;\r\n text-align: center;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n height: 135px;\r\n width: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RelatedArticles-module_mediaContainer__10h9k {\r\n flex-wrap: wrap;\r\n }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: none;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n width: 100%;\r\n margin-bottom: 0.5rem;\r\n padding: 0;\r\n }\r\n .RelatedArticles-module_cardTitle__3P-Ib {\r\n font-size: 0.75rem;\r\n margin-bottom: 0;\r\n }\r\n}\r\n";
343
+ var css$1 = ".RelatedArticles-module_mediaContainer__10h9k {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n margin: 0 -1rem;\n}\n.RelatedArticles-module_mediaCard__3wQbn {\n margin: 0 1rem 1rem;\n width: calc(33% - 1rem);\n display: column;\n flex-direction: row;\n margin-bottom: 0.75rem;\n padding-bottom: 0.75rem;\n border-bottom: none;\n}\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\n border-bottom: none;\n}\n.RelatedArticles-module_cardTitle__3P-Ib {\n font-weight: bold;\n color: #252525;\n margin-bottom: 0.25rem;\n font-size: 15px;\n}\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\n color: #000;\n font-weight: bold;\n}\n.RelatedArticles-module_cardDate__1wOR5 {\n color: var(--dark);\n display: block;\n background: #fff !important;\n margin-bottom: 0;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 {\n display: block;\n text-align: center;\n margin-bottom: 0.5rem;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\n height: 135px;\n width: 100%;\n object-fit: cover;\n object-position: center;\n}\n@media screen and (max-width: 1064px) {\n}\n@media screen and (max-width: 968px) {\n .RelatedArticles-module_mediaContainer__10h9k {\n flex-wrap: wrap;\n }\n .RelatedArticles-module_imgWrapper__5Jx_4 {\n display: none;\n }\n .RelatedArticles-module_mediaCard__3wQbn {\n width: 100%;\n margin-bottom: 0.5rem;\n padding: 0;\n }\n .RelatedArticles-module_cardTitle__3P-Ib {\n font-size: 0.75rem;\n margin-bottom: 0;\n }\n}\n";
343
344
  var styles$1 = { "mediaContainer": "RelatedArticles-module_mediaContainer__10h9k", "mediaCard": "RelatedArticles-module_mediaCard__3wQbn", "cardTitle": "RelatedArticles-module_cardTitle__3P-Ib", "authorListing": "RelatedArticles-module_authorListing__1EFg4", "text-muted": "RelatedArticles-module_text-muted__3b0zX", "cardDate": "RelatedArticles-module_cardDate__1wOR5", "imgWrapper": "RelatedArticles-module_imgWrapper__5Jx_4" };
344
345
  styleInject(css$1);
345
346
 
@@ -438,13 +439,7 @@ var getSocialShareDisableFlag = function getSocialShareDisableFlag(article) {
438
439
  return showSocialShare;
439
440
  };
440
441
 
441
- var FileSaver_min = createCommonjsModule(function (module, exports) {
442
- (function(a,b){b();})(commonjsGlobal,function(){function b(a,b){return "undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c);},d.onerror=function(){console.error("could not download file");},d.send();}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send();}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"));}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b);}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof commonjsGlobal&&commonjsGlobal.global===commonjsGlobal?commonjsGlobal:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href);},4E4),setTimeout(function(){e(j);},0));}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else {var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i);});}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null;},k.readAsDataURL(b);}else {var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m);},4E4);}});f.saveAs=g.saveAs=g,(module.exports=g);});
443
-
444
-
445
- });
446
-
447
- var css = ".RecommendedArticles-module_recommendTitle__2kUji {\r\n border-bottom: 2px solid var(--secondary-blue);\r\n font-size: 1.5rem;\r\n font-weight: bold;\r\n color: #0d335a;\r\n padding: 0.5rem;\r\n}\r\n.RecommendedArticles-module_recommendContainer__sZukI {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: wrap;\r\n margin: 0 -0.5rem;\r\n}\r\n.RecommendedArticles-module_recommendTop__1_yqw {\r\n margin: 0.5rem;\r\n width: 100%;\r\n flex-basis: 100%;\r\n display: flex;\r\n\r\n}\r\n.RecommendedArticles-module_recommendTopImg__1b9gu {\r\n min-width: 55%;\r\n width: 55%;\r\n height: 100%;\r\n}\r\n.RecommendedArticles-module_recommendTopImg__1b9gu img {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n}\r\n.RecommendedArticles-module_recommendTopBody__-13FI {\r\n margin-left: 1rem;\r\n line-height: 1.3;\r\n color: #121212;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n.RecommendedArticles-module_topTitle__2EafN {\r\n font-size: 25px;\r\n font-weight: bold;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RecommendedArticles-module_topBody__2_VNi {\r\n font-size: 19px;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RecommendedArticles-module_topLink__2RnXu {\r\n font-size: 19px;\r\n color: rgb(43, 43, 151);\r\n text-decoration: underline;\r\n margin-top: auto;\r\n}\r\n.RecommendedArticles-module_smContainer__4byBO {\r\n width: calc(25% - 1rem);\r\n margin: 0 0.5rem;\r\n}\r\n.RecommendedArticles-module_smImage__TYZGY img {\r\n width: 100%;\r\n}\r\n.RecommendedArticles-module_title__3q1ud {\r\n margin-top: 1rem;\r\n line-height: 1.2;\r\n color: #121212;\r\n}\r\n.RecommendedArticles-module_category__2jRto {\r\n text-transform: uppercase;\r\n font-size: 16px;\r\n letter-spacing: 2px;\r\n margin: 0.25rem 0;\r\n}\r\n\r\n/* media query */\r\n\r\n@media screen and (max-width: 1399px) {\r\n .RecommendedArticles-module_topTitle__2EafN {\r\n font-size: 21px;\r\n }\r\n .RecommendedArticles-module_topBody__2_VNi {\r\n font-size: 15px;\r\n }\r\n}\r\n@media screen and (max-width: 1191px) {\r\n .RecommendedArticles-module_topTitle__2EafN {\r\n font-size: 23px;\r\n }\r\n .RecommendedArticles-module_topBody__2_VNi,\r\n .RecommendedArticles-module_topLink__2RnXu {\r\n font-size: 17px;\r\n }\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RecommendedArticles-module_topTitle__2EafN {\r\n font-size: 18px;\r\n }\r\n .RecommendedArticles-module_topBody__2_VNi,\r\n .RecommendedArticles-module_topLink__2RnXu {\r\n font-size: 15px;\r\n }\r\n}\r\n@media screen and (max-width: 768px) {\r\n .RecommendedArticles-module_recommendTop__1_yqw {\r\n flex-direction: column;\r\n }\r\n .RecommendedArticles-module_recommendTopImg__1b9gu,\r\n .RecommendedArticles-module_recommendTopBody__-13FI {\r\n width: 100%;\r\n margin: 0;\r\n }\r\n .RecommendedArticles-module_recommendTopBody__-13FI {\r\n margin-bottom: 1rem;\r\n }\r\n .RecommendedArticles-module_smContainer__4byBO {\r\n width: calc(50% - 1rem);\r\n }\r\n}";
442
+ var css = ".RecommendedArticles-module_recommendTitle__2kUji {\n border-bottom: 2px solid var(--secondary-blue);\n font-size: 1.5rem;\n font-weight: bold;\n color: #0d335a;\n padding: 0.5rem;\n}\n.RecommendedArticles-module_recommendContainer__sZukI {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: 0 -0.5rem;\n}\n.RecommendedArticles-module_recommendTop__1_yqw {\n margin: 0.5rem;\n width: 100%;\n flex-basis: 100%;\n display: flex;\n\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu {\n min-width: 55%;\n width: 55%;\n height: 100%;\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.RecommendedArticles-module_recommendTopBody__-13FI {\n margin-left: 1rem;\n line-height: 1.3;\n color: #121212;\n display: flex;\n flex-direction: column;\n}\n.RecommendedArticles-module_topTitle__2EafN {\n font-size: 25px;\n font-weight: bold;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topBody__2_VNi {\n font-size: 19px;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topLink__2RnXu {\n font-size: 19px;\n color: rgb(43, 43, 151);\n text-decoration: underline;\n margin-top: auto;\n}\n.RecommendedArticles-module_smContainer__4byBO {\n width: calc(25% - 1rem);\n margin: 0 0.5rem;\n}\n.RecommendedArticles-module_smImage__TYZGY img {\n width: 100%;\n}\n.RecommendedArticles-module_title__3q1ud {\n margin-top: 1rem;\n line-height: 1.2;\n color: #121212;\n}\n.RecommendedArticles-module_category__2jRto {\n text-transform: uppercase;\n font-size: 16px;\n letter-spacing: 2px;\n margin: 0.25rem 0;\n}\n\n/* media query */\n\n@media screen and (max-width: 1399px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 21px;\n }\n .RecommendedArticles-module_topBody__2_VNi {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 1191px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 23px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 17px;\n }\n}\n@media screen and (max-width: 968px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 18px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 768px) {\n .RecommendedArticles-module_recommendTop__1_yqw {\n flex-direction: column;\n }\n .RecommendedArticles-module_recommendTopImg__1b9gu,\n .RecommendedArticles-module_recommendTopBody__-13FI {\n width: 100%;\n margin: 0;\n }\n .RecommendedArticles-module_recommendTopBody__-13FI {\n margin-bottom: 1rem;\n }\n .RecommendedArticles-module_smContainer__4byBO {\n width: calc(50% - 1rem);\n }\n}";
448
443
  var styles = { "recommendTitle": "RecommendedArticles-module_recommendTitle__2kUji", "recommendContainer": "RecommendedArticles-module_recommendContainer__sZukI", "recommendTop": "RecommendedArticles-module_recommendTop__1_yqw", "recommendTopImg": "RecommendedArticles-module_recommendTopImg__1b9gu", "recommendTopBody": "RecommendedArticles-module_recommendTopBody__-13FI", "topTitle": "RecommendedArticles-module_topTitle__2EafN", "topBody": "RecommendedArticles-module_topBody__2_VNi", "topLink": "RecommendedArticles-module_topLink__2RnXu", "smContainer": "RecommendedArticles-module_smContainer__4byBO", "smImage": "RecommendedArticles-module_smImage__TYZGY", "title": "RecommendedArticles-module_title__3q1ud", "category": "RecommendedArticles-module_category__2jRto" };
449
444
  styleInject(css);
450
445
 
@@ -455,7 +450,9 @@ var Recommended = function Recommended(props) {
455
450
  client = props.client,
456
451
  _props$index = props.index,
457
452
  index = _props$index === undefined ? 0 : _props$index,
458
- cpModificationRequired = props.cpModificationRequired;
453
+ cpModificationRequired = props.cpModificationRequired,
454
+ segmentData = props.segmentData,
455
+ setSegmentData = props.setSegmentData;
459
456
 
460
457
  var _useState = useState(false),
461
458
  _useState2 = _slicedToArray(_useState, 2),
@@ -467,10 +464,11 @@ var Recommended = function Recommended(props) {
467
464
  articles = _useState4[0],
468
465
  setArticles = _useState4[1];
469
466
 
470
- var _useState5 = useState(false),
467
+ var _useState5 = useState('loading'),
471
468
  _useState6 = _slicedToArray(_useState5, 2),
472
469
  loaded = _useState6[0],
473
- setLoaded = _useState6[1];
470
+ setLoaded = _useState6[1]; //loading, loaded, failed
471
+
474
472
 
475
473
  var starting = index * 5;
476
474
  var contentMapping = {
@@ -496,32 +494,48 @@ var Recommended = function Recommended(props) {
496
494
  categories: _JSON$stringify(mainCategories)
497
495
  });
498
496
  }
499
- var anonymousId = analytics.user().anonymousId();
497
+
500
498
  // get users traits
501
499
  var getSegmentProfile = function () {
502
500
  var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
503
- var response, data, addTaxonomyName, favoriteCategories, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts;
501
+ var data, anonymousId, response, addTaxonomyName, favoriteCategories, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts;
504
502
 
505
503
  return regenerator.wrap(function _callee$(_context) {
506
504
  while (1) {
507
505
  switch (_context.prev = _context.next) {
508
506
  case 0:
509
- _context.next = 2;
507
+ data = void 0;
508
+
509
+ if (segmentData) {
510
+ _context.next = 12;
511
+ break;
512
+ }
513
+
514
+ anonymousId = analytics.user().anonymousId();
515
+ _context.next = 5;
510
516
  return fetch('/api/getSegmentProfile', {
511
517
  method: 'POST',
512
518
  body: _JSON$stringify({ anonymousId: anonymousId })
513
519
  });
514
520
 
515
- case 2:
521
+ case 5:
516
522
  response = _context.sent;
517
- _context.next = 5;
523
+ _context.next = 8;
518
524
  return response.json();
519
525
 
520
- case 5:
526
+ case 8:
521
527
  data = _context.sent;
522
528
 
529
+ setSegmentData(data);
530
+ _context.next = 13;
531
+ break;
532
+
533
+ case 12:
534
+ data = segmentData;
535
+
536
+ case 13:
523
537
  if (!(data && data.traits && data.traits.favorite_article_category)) {
524
- _context.next = 21;
538
+ _context.next = 28;
525
539
  break;
526
540
  }
527
541
 
@@ -540,8 +554,6 @@ var Recommended = function Recommended(props) {
540
554
 
541
555
  query = query + ' )';
542
556
 
543
- console.log(query);
544
-
545
557
  return query;
546
558
  };
547
559
 
@@ -554,10 +566,10 @@ var Recommended = function Recommended(props) {
554
566
  params = {
555
567
  id: article._id
556
568
  };
557
- _context.next = 15;
569
+ _context.next = 22;
558
570
  return _Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params)]);
559
571
 
560
- case 15:
572
+ case 22:
561
573
  _ref2 = _context.sent;
562
574
  _ref3 = _slicedToArray(_ref2, 3);
563
575
  _articles = _ref3[0];
@@ -577,7 +589,7 @@ var Recommended = function Recommended(props) {
577
589
  setArticles(_articles);
578
590
  }
579
591
 
580
- case 21:
592
+ case 28:
581
593
  case 'end':
582
594
  return _context.stop();
583
595
  }
@@ -598,7 +610,7 @@ var Recommended = function Recommended(props) {
598
610
 
599
611
  useEffect(function () {
600
612
  if (articles && articles.length > 0) {
601
- setLoaded(true);
613
+ setLoaded('loaded');
602
614
  }
603
615
  }, [articles]);
604
616
 
@@ -606,18 +618,19 @@ var Recommended = function Recommended(props) {
606
618
  try {
607
619
  analytics.ready(function () {
608
620
  setSegmentLoaded(function () {
609
- return true;
621
+ return 'loaded';
610
622
  });
611
623
  });
612
624
  } catch (err) {
613
625
  console.log(err);
626
+ setLoaded('failed');
614
627
  }
615
628
  }, []);
616
629
 
617
630
  return React__default.createElement(
618
631
  'div',
619
632
  { id: 'recommended' },
620
- loaded ? React__default.createElement(
633
+ loaded === 'loaded' && React__default.createElement(
621
634
  React__default.Fragment,
622
635
  null,
623
636
  React__default.createElement(
@@ -638,7 +651,7 @@ var Recommended = function Recommended(props) {
638
651
  { className: styles.recommendTopImg },
639
652
  React__default.createElement(
640
653
  'a',
641
- { href: '/view/' + article.url.current },
654
+ { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
642
655
  React__default.createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 306, imageWidth: 544 }) })
643
656
  )
644
657
  ),
@@ -657,7 +670,7 @@ var Recommended = function Recommended(props) {
657
670
  ),
658
671
  React__default.createElement(
659
672
  'a',
660
- { href: '/view/' + article.url.current, className: styles.topLink },
673
+ { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit', className: styles.topLink },
661
674
  '>> ',
662
675
  'Read Article'
663
676
  )
@@ -674,7 +687,7 @@ var Recommended = function Recommended(props) {
674
687
  ),
675
688
  React__default.createElement(
676
689
  'a',
677
- { href: '/view/' + article.url.current },
690
+ { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
678
691
  React__default.createElement(
679
692
  'div',
680
693
  { className: styles.smImage },
@@ -690,7 +703,8 @@ var Recommended = function Recommended(props) {
690
703
  }
691
704
  })
692
705
  )
693
- ) : React__default.createElement(
706
+ ),
707
+ loaded === 'failed' && React__default.createElement(
694
708
  'section',
695
709
  { id: 'related-content-section', className: 'my-1' },
696
710
  (article.relatedArticle || RelevantTopics({ article: article })) && React__default.createElement(
@@ -901,7 +915,11 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
901
915
  _props$downloadCitati = props.downloadCitation,
902
916
  downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati,
903
917
  _props$useSegmentReco = props.useSegmentRecommendedArticles,
904
- useSegmentRecommendedArticles = _props$useSegmentReco === undefined ? false : _props$useSegmentReco;
918
+ useSegmentRecommendedArticles = _props$useSegmentReco === undefined ? false : _props$useSegmentReco,
919
+ _props$segmentData = props.segmentData,
920
+ segmentData = _props$segmentData === undefined ? null : _props$segmentData,
921
+ _props$setSegmentData = props.setSegmentData,
922
+ setSegmentData = _props$setSegmentData === undefined ? function () {} : _props$setSegmentData;
905
923
  var sliderData = props.sliderData;
906
924
 
907
925
 
@@ -1066,7 +1084,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1066
1084
  var downloadRIS = function downloadRIS() {
1067
1085
  var fileContent = generateRIS();
1068
1086
  var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
1069
- FileSaver_min.saveAs(file, 'citation-' + url + '.ris');
1087
+ FileSaver.saveAs(file, 'citation-' + url + '.ris');
1070
1088
  };
1071
1089
 
1072
1090
  var RelevantTopics = function RelevantTopics() {
@@ -1136,7 +1154,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1136
1154
  return React__default.createElement(
1137
1155
  'div',
1138
1156
  null,
1139
- useSegmentRecommendedArticles ? React__default.createElement(Recommended, { client: client, article: article, index: props.index, Settings: props.Settings, showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage, cpModificationRequired: cpModificationRequired }) : React__default.createElement(
1157
+ useSegmentRecommendedArticles ? React__default.createElement(Recommended, { segmentData: segmentData, setSegmentData: setSegmentData, client: client, article: article, index: props.index, Settings: props.Settings, showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage, cpModificationRequired: cpModificationRequired }) : React__default.createElement(
1140
1158
  'section',
1141
1159
  { id: 'related-content-section', className: 'my-1' },
1142
1160
  (article.relatedArticle || RelevantTopics()) && React__default.createElement(
@@ -1835,6 +1853,11 @@ var ArticleQueue = function ArticleQueue(props) {
1835
1853
  active = _useState6[0],
1836
1854
  setActive = _useState6[1];
1837
1855
 
1856
+ var _useState7 = useState(null),
1857
+ _useState8 = _slicedToArray(_useState7, 2),
1858
+ segmentData = _useState8[0],
1859
+ setSegmentData = _useState8[1];
1860
+
1838
1861
  var refreshAD = function refreshAD(path) {
1839
1862
  var activeArticle = queueData.find(function (item) {
1840
1863
  return item.url.current === path;
@@ -2056,7 +2079,9 @@ var ArticleQueue = function ArticleQueue(props) {
2056
2079
  // Passing queueData to check for single article
2057
2080
  , queueData: queueData,
2058
2081
  showRelatedArticles: showRelatedArticles,
2059
- index: index
2082
+ index: index,
2083
+ segmentData: segmentData,
2084
+ setSegmentData: setSegmentData
2060
2085
  }))
2061
2086
  );
2062
2087
  })