@mjhls/mjh-framework 1.0.880-beta.0 → 1.0.881-beta.0

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 (105) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AlgoliaSearch.js +38 -37
  3. package/dist/cjs/ArticleCarousel.js +2 -1
  4. package/dist/cjs/ArticleProgramLandingPage.js +4 -3
  5. package/dist/cjs/ArticleSeriesLandingPage.js +8 -1
  6. package/dist/cjs/ArticleSeriesListing.js +2 -1
  7. package/dist/cjs/Auth.js +6 -6
  8. package/dist/cjs/{BlockContent-9c6b07ad.js → BlockContent-091a991f.js} +2 -2
  9. package/dist/cjs/ConferenceArticleCard.js +3 -2
  10. package/dist/cjs/DeckContent.js +5 -4
  11. package/dist/cjs/DeckQueue.js +285 -5
  12. package/dist/cjs/EventsDeck.js +11 -11
  13. package/dist/cjs/ExternalResources.js +7 -6
  14. package/dist/cjs/Feature.js +3 -2
  15. package/dist/cjs/ForbesHero.js +7 -6
  16. package/dist/cjs/GridContent.js +16 -15
  17. package/dist/cjs/GridHero.js +7 -6
  18. package/dist/cjs/GroupDeck.js +7 -6
  19. package/dist/cjs/Hero.js +3 -2
  20. package/dist/cjs/HorizontalArticleListing.js +4 -3
  21. package/dist/cjs/HorizontalHero.js +3 -2
  22. package/dist/cjs/IssueContentDeck.js +8 -7
  23. package/dist/cjs/IssueDeck.js +6 -5
  24. package/dist/cjs/IssueLanding.js +7 -4
  25. package/dist/cjs/MasterDeck.js +550 -35
  26. package/dist/cjs/MediaSeriesLanding.js +269 -266
  27. package/dist/cjs/OncliveHero.js +3 -2
  28. package/dist/cjs/OncliveLargeHero.js +10 -9
  29. package/dist/cjs/{Pagination-9cb60fba.js → Pagination-d6a59f99.js} +3 -2
  30. package/dist/cjs/PartnerDetailListing.js +10 -7
  31. package/dist/cjs/PubSection.js +5 -2
  32. package/dist/cjs/PublicationDeck.js +6 -5
  33. package/dist/cjs/PublicationLanding.js +3 -3
  34. package/dist/cjs/QueueDeckExpanded.js +1547 -43
  35. package/dist/cjs/RelatedContent.js +5 -4
  36. package/dist/cjs/SeriesListingDeck.js +3 -2
  37. package/dist/cjs/{SeriesSlider-ec146338.js → SeriesSlider-49b81b0b.js} +6 -6
  38. package/dist/cjs/TaxonomyCard.js +6 -5
  39. package/dist/cjs/TaxonomyDescription.js +4 -3
  40. package/dist/cjs/ThumbnailCard.js +5 -4
  41. package/dist/cjs/VerticalHero.js +3 -2
  42. package/dist/cjs/VideoProgramLandingPage.js +4 -3
  43. package/dist/cjs/VideoSeriesCard.js +5 -4
  44. package/dist/cjs/VideoSeriesLandingPage.js +9 -4
  45. package/dist/cjs/VideoSeriesListing.js +2 -1
  46. package/dist/cjs/View.js +12 -11
  47. package/dist/cjs/YahooHero.js +6 -5
  48. package/dist/cjs/YoutubeGroup.js +10 -9
  49. package/dist/cjs/getRelatedArticle.js +6 -6
  50. package/dist/cjs/getSerializers.js +4 -3
  51. package/dist/cjs/{urlFor-3a61226f.js → index-be0c82be.js} +1 -58
  52. package/dist/cjs/{index-17c6af5a.js → index-bf60a71c.js} +99 -72
  53. package/dist/cjs/index.js +11 -10
  54. package/dist/cjs/urlFor.js +57 -3
  55. package/dist/esm/AlgoliaSearch.js +2 -1
  56. package/dist/esm/ArticleCarousel.js +2 -1
  57. package/dist/esm/ArticleProgramLandingPage.js +4 -3
  58. package/dist/esm/ArticleSeriesLandingPage.js +8 -1
  59. package/dist/esm/ArticleSeriesListing.js +2 -1
  60. package/dist/esm/{BlockContent-f4515898.js → BlockContent-e9b4ddcf.js} +1 -1
  61. package/dist/esm/ConferenceArticleCard.js +2 -1
  62. package/dist/esm/DeckContent.js +2 -1
  63. package/dist/esm/DeckQueue.js +282 -2
  64. package/dist/esm/EventsDeck.js +1 -1
  65. package/dist/esm/ExternalResources.js +4 -3
  66. package/dist/esm/Feature.js +2 -1
  67. package/dist/esm/ForbesHero.js +2 -1
  68. package/dist/esm/GridContent.js +2 -1
  69. package/dist/esm/GridHero.js +2 -1
  70. package/dist/esm/GroupDeck.js +2 -1
  71. package/dist/esm/Hero.js +2 -1
  72. package/dist/esm/HorizontalArticleListing.js +4 -3
  73. package/dist/esm/HorizontalHero.js +2 -1
  74. package/dist/esm/IssueContentDeck.js +2 -1
  75. package/dist/esm/IssueDeck.js +2 -1
  76. package/dist/esm/IssueLanding.js +7 -4
  77. package/dist/esm/MasterDeck.js +550 -35
  78. package/dist/esm/MediaSeriesLanding.js +8 -5
  79. package/dist/esm/OncliveHero.js +2 -1
  80. package/dist/esm/OncliveLargeHero.js +2 -1
  81. package/dist/esm/{Pagination-256b60e5.js → Pagination-f7c4c5ae.js} +3 -2
  82. package/dist/esm/PartnerDetailListing.js +7 -4
  83. package/dist/esm/PubSection.js +5 -2
  84. package/dist/esm/PublicationDeck.js +2 -1
  85. package/dist/esm/QueueDeckExpanded.js +1533 -29
  86. package/dist/esm/RelatedContent.js +2 -1
  87. package/dist/esm/SeriesListingDeck.js +3 -2
  88. package/dist/esm/{SeriesSlider-d6561e33.js → SeriesSlider-ce19fa25.js} +1 -1
  89. package/dist/esm/TaxonomyCard.js +3 -2
  90. package/dist/esm/TaxonomyDescription.js +4 -3
  91. package/dist/esm/ThumbnailCard.js +2 -1
  92. package/dist/esm/VerticalHero.js +2 -1
  93. package/dist/esm/VideoProgramLandingPage.js +4 -3
  94. package/dist/esm/VideoSeriesCard.js +2 -1
  95. package/dist/esm/VideoSeriesLandingPage.js +8 -3
  96. package/dist/esm/VideoSeriesListing.js +2 -1
  97. package/dist/esm/View.js +5 -4
  98. package/dist/esm/YahooHero.js +2 -1
  99. package/dist/esm/YoutubeGroup.js +2 -1
  100. package/dist/esm/getSerializers.js +4 -3
  101. package/dist/esm/{urlFor-23b2244b.js → index-73819142.js} +1 -58
  102. package/dist/esm/{index-a35a5c39.js → index-e495ac6f.js} +40 -13
  103. package/dist/esm/index.js +8 -7
  104. package/dist/esm/urlFor.js +60 -2
  105. package/package.json +1 -1
@@ -16,9 +16,12 @@ import { useRouter } from 'next/router';
16
16
  import './isSymbol-1981418f.js';
17
17
  import './debounce-9207d8ee.js';
18
18
  import './toNumber-2f7a84cd.js';
19
+ import { I as InfiniteScroll } from './index.es-29c1cef5.js';
19
20
  import 'react-dom';
21
+ import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
20
22
  import { _ as _slicedToArray } from './slicedToArray-67a08c9c.js';
21
- import { u as urlFor } from './urlFor-23b2244b.js';
23
+ import './index-73819142.js';
24
+ import urlFor from './urlFor.js';
22
25
  import { L as LazyLoad } from './index-5f7e79e7.js';
23
26
  import { m as main_36 } from './main-c0612122.js';
24
27
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
@@ -32,9 +35,9 @@ import { l as lodash } from './lodash-17fdfebb.js';
32
35
  import { A as ADlgInfeed } from './ADlgInfeed-e4e2031a.js';
33
36
  import { g as getContentCategory } from './getContentCategory-15dcc413.js';
34
37
  import { A as AuthorComponent } from './AuthorComponent-e6f95c2f.js';
38
+ import { P as Pagination } from './Pagination-f7c4c5ae.js';
35
39
  import { Spinner, Container, Media } from 'react-bootstrap';
36
40
  import timeDifferenceCalc from './timeDifferenceCalc.js';
37
- import { P as Pagination } from './Pagination-256b60e5.js';
38
41
 
39
42
  var _this = undefined;
40
43
 
@@ -1210,10 +1213,15 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1210
1213
  data = _useState4[0],
1211
1214
  setData = _useState4[1];
1212
1215
 
1213
- var _useState5 = useState(initialCurrentPage || 1),
1216
+ var _useState5 = useState(false),
1214
1217
  _useState6 = _slicedToArray(_useState5, 2),
1215
- currentPage = _useState6[0],
1216
- setCurrentPage = _useState6[1];
1218
+ isDataLoading = _useState6[0],
1219
+ setIsDataLoading = _useState6[1];
1220
+
1221
+ var _useState7 = useState(initialCurrentPage || 1),
1222
+ _useState8 = _slicedToArray(_useState7, 2),
1223
+ currentPage = _useState8[0],
1224
+ setCurrentPage = _useState8[1];
1217
1225
 
1218
1226
  var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : params && params.from && params.to ? params.to - params.from : 10;
1219
1227
 
@@ -1261,7 +1269,10 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1261
1269
  while (1) {
1262
1270
  switch (_context.prev = _context.next) {
1263
1271
  case 0:
1264
- setData(null);
1272
+ setIsDataLoading(true);
1273
+ setCurrentPage(selectedPage);
1274
+ seoPaginate && seoPagination(selectedPage);
1275
+ lib_3.refresh();
1265
1276
  document.body.scrollTop = 0;
1266
1277
  document.documentElement.scrollTop = 0;
1267
1278
  start = (selectedPage - 1) * itemsPerPage;
@@ -1269,35 +1280,33 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1269
1280
  from: start,
1270
1281
  to: start + itemsPerPage
1271
1282
  });
1272
- _context.prev = 5;
1273
- _context.next = 8;
1283
+ _context.prev = 8;
1284
+ _context.next = 11;
1274
1285
  return client.fetch(query, newParams);
1275
1286
 
1276
- case 8:
1287
+ case 11:
1277
1288
  newData = _context.sent;
1278
1289
 
1279
1290
  if (pointer && pointerArray) newData = newData[pointerArray][pointer];
1280
1291
  if (newData && newData.length > 0) {
1292
+ setIsDataLoading(false);
1281
1293
  setData(newData);
1282
- seoPaginate && seoPagination(selectedPage);
1283
- setCurrentPage(selectedPage);
1284
- lib_3.refresh();
1285
1294
  }
1286
- _context.next = 16;
1295
+ _context.next = 19;
1287
1296
  break;
1288
1297
 
1289
- case 13:
1290
- _context.prev = 13;
1291
- _context.t0 = _context['catch'](5);
1298
+ case 16:
1299
+ _context.prev = 16;
1300
+ _context.t0 = _context['catch'](8);
1292
1301
 
1293
1302
  console.error(_context.t0);
1294
1303
 
1295
- case 16:
1304
+ case 19:
1296
1305
  case 'end':
1297
1306
  return _context.stop();
1298
1307
  }
1299
1308
  }
1300
- }, _callee, _this, [[5, 13]]);
1309
+ }, _callee, _this, [[8, 16]]);
1301
1310
  }));
1302
1311
 
1303
1312
  return function handlePageChange(_x5) {
@@ -1308,7 +1317,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1308
1317
  return React__default.createElement(
1309
1318
  'div',
1310
1319
  { className: 'queuedeck-expanded' },
1311
- !data ? React__default.createElement(
1320
+ isDataLoading ? React__default.createElement(
1312
1321
  'div',
1313
1322
  { className: 'd-flex justify-content-center', style: { marginTop: '100px' } },
1314
1323
  React__default.createElement(
@@ -1345,19 +1354,1514 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1345
1354
  showTimeDif: showTimeDiff,
1346
1355
  showTaxonomies: showTaxonomies,
1347
1356
  showIntro: showIntro
1348
- })
1349
- ),
1350
- React__default.createElement(
1351
- 'div',
1352
- { className: 'pagination-wrapper ' + (!data ? 'd-none' : 'd-block') },
1353
- React__default.createElement(Pagination, { pageCount: Math.ceil(totalDataCount / itemsPerPage), pageRangeDisplayed: main_36 ? 3 : 9, initialPage: currentPage, onPageChange: handlePageChange }),
1357
+ }),
1354
1358
  React__default.createElement(
1355
- 'style',
1356
- { jsx: 'true' },
1357
- '\n .pagination-wrapper {\n margin: 3rem 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-wrapper {\n margin-bottom: 6rem;\n }\n }\n '
1359
+ 'div',
1360
+ { className: 'pagination-wrapper' },
1361
+ React__default.createElement(Pagination, { pageCount: Math.ceil(totalDataCount / itemsPerPage), pageRangeDisplayed: main_36 ? 3 : 9, currentPage: currentPage, onPageChange: handlePageChange }),
1362
+ React__default.createElement(
1363
+ 'style',
1364
+ { jsx: 'true' },
1365
+ '\n .pagination-wrapper {\n margin: 3rem 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-wrapper {\n margin-bottom: 6rem;\n }\n }\n '
1366
+ )
1367
+ )
1368
+ )
1369
+ );
1370
+ };
1371
+
1372
+ var renderCardImage$1 = function renderCardImage(row, client) {
1373
+ var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1374
+ var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1375
+ var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1376
+ var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
1377
+
1378
+ var url = urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
1379
+
1380
+ return url;
1381
+ };
1382
+
1383
+ var loadMore = function loadMore(values, setValues, itemsPerPage) {
1384
+ console.log('Values:::', values);
1385
+ setValues({
1386
+ page: values.page + 1,
1387
+ from: values.from + itemsPerPage,
1388
+ to: values.to + itemsPerPage
1389
+ });
1390
+ };
1391
+
1392
+ var loadData = function loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray) {
1393
+ params = _extends({}, params, {
1394
+ from: values.from,
1395
+ to: values.to
1396
+ });
1397
+ client.fetch(query, params).then(function (dataArr) {
1398
+ if (pointer && pointerArray) {
1399
+ dataArr = dataArr[pointerArray][pointer];
1400
+ }
1401
+
1402
+ if (!dataArr) {
1403
+ dataArr = [];
1404
+ }
1405
+
1406
+ dataArr = dataArr.map(function (item) {
1407
+ return _extends({}, item, {
1408
+ pageNumber: values.page
1409
+ });
1410
+ });
1411
+
1412
+ if (dataArr.length > 0) {
1413
+ setData(function (prevData) {
1414
+ return [].concat(_toConsumableArray(prevData), _toConsumableArray(dataArr));
1415
+ });
1416
+ setLastDataSize(dataArr.length);
1417
+ setScrolling(true);
1418
+ } else {
1419
+ setLastDataSize(0);
1420
+ setScrolling(false);
1421
+ }
1422
+ });
1423
+ };
1424
+
1425
+ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) {
1426
+ if (seoPaginate) {
1427
+ var path = router.asPath;
1428
+ var qrIndex = path.indexOf('?');
1429
+ var pathname = router.pathname;
1430
+ var queryString = '';
1431
+
1432
+ if (qrIndex > 0) {
1433
+ path = path.substring(1, qrIndex);
1434
+
1435
+ var partialQS = router.asPath.substring(qrIndex + 1);
1436
+ var partialQSArr = partialQS.split('&');
1437
+
1438
+ // exclude page=xxx from query string
1439
+ partialQSArr.map(function (item) {
1440
+ var itemArr = item.split('=');
1441
+ var key = itemArr[0];
1442
+ var val = itemArr[1];
1443
+
1444
+ if (key !== 'page') {
1445
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
1446
+ }
1447
+ });
1448
+ }
1449
+
1450
+ if (queryString.length > 0) {
1451
+ path += '?' + queryString;
1452
+ }
1453
+
1454
+ pageNumber = parseInt(pageNumber);
1455
+ // const index = Number(itemIndex)
1456
+ // const perPage = Number(itemsPerPage)
1457
+
1458
+ // pageNumber = Math.ceil((index + 1) / perPage)
1459
+
1460
+ if (currentPage !== pageNumber) {
1461
+ lib_3.refresh();
1462
+
1463
+ setCurrentPage(pageNumber);
1464
+ if (path[0] !== '/') {
1465
+ path = '/' + path;
1466
+ }
1467
+
1468
+ var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
1469
+
1470
+ // if (pageview) {
1471
+ // pageview(newPath)
1472
+ // }
1473
+
1474
+ router.push(pathname, newPath, {
1475
+ shallow: true
1476
+ });
1477
+ }
1478
+ }
1479
+ };
1480
+
1481
+ var checkExternalUrl$1 = function checkExternalUrl(url) {
1482
+ return new RegExp(['http', 'https'].join('|')).test(url);
1483
+ };
1484
+
1485
+ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro) {
1486
+ var numberOfItemsBeforeAd = data.length < 6 ? data.length : 6;
1487
+ var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
1488
+ return [].concat(_toConsumableArray(arr.slice(0, index)), [newElement], _toConsumableArray(arr.slice(index)));
1489
+ };
1490
+
1491
+ var _useState = useState(!showBI || !brandInsightAd ? true : false),
1492
+ _useState2 = _slicedToArray(_useState, 2),
1493
+ dataRemapped = _useState2[0],
1494
+ setDataRemapped = _useState2[1];
1495
+ // Need to pass flag "lgInfeedAd={true}" along with brandInsightAd from site level for large infeed-ad to render
1496
+ // Checking window and lgInfeedAd flag in desktop view ( window >= 1400px ).
1497
+
1498
+
1499
+ if (lgInfeedAd && brandInsightAd && typeof window !== 'undefined' && window.innerWidth >= 1400) {
1500
+ var lgInfeed = {
1501
+ _type: 'lg-infeed',
1502
+ adUnit: brandInsightAd.adUnit,
1503
+ className: 'lg-infeed',
1504
+ networkID: brandInsightAd.networkID,
1505
+ sizes: [728, 90],
1506
+ // Adding sizeMapping for showing ad above 1400px
1507
+ sizeMapping: [{
1508
+ viewport: [1400, 0],
1509
+ sizes: [[728, 90]]
1510
+ }, { viewport: [0, 0], sizes: [] }],
1511
+ targeting: {
1512
+ content_placement: brandInsightAd.targeting.content_placement,
1513
+ document_url: brandInsightAd.targeting.document_url,
1514
+ rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
1515
+ },
1516
+ /* Passing refresh flag */
1517
+ refreshFlag: brandInsightAd.refreshFlag ? brandInsightAd.refreshFlag : false
1518
+ };
1519
+
1520
+ var chunks = lodash.chunk(data, 6).map(function (chunk) {
1521
+ var set = lodash.chunk(chunk, 2);
1522
+ for (var i = 0; i < set.length; i++) {
1523
+ if (i !== set.length - 1) {
1524
+ set[i].push(lgInfeed);
1525
+ }
1526
+ }
1527
+ return lodash.flattenDeep(set);
1528
+ });
1529
+ data = lodash.flatten(chunks);
1530
+ !dataRemapped && setDataRemapped(true); // To detect if appending of insights ads are completed
1531
+ }
1532
+
1533
+ // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
1534
+ useEffect(function () {
1535
+ if (typeof window !== 'undefined' && (!lgInfeedAd || !brandInsightAd || window.innerWidth < 1400) && !dataRemapped) {
1536
+ setDataRemapped(true);
1537
+ }
1538
+ }, []);
1539
+
1540
+ if (showBI && brandInsightAd) {
1541
+ // Checking window and lgInfeedAd flag in desktop view ( window >= 1400px ).
1542
+ if (lgInfeedAd && typeof window !== 'undefined' && window.innerWidth >= 1400) brandInsightAd.interval = 8;
1543
+ var pos = 0;
1544
+ for (var i = 1; pos < data.length; i++) {
1545
+ var inFeedAd = {
1546
+ adUnit: brandInsightAd.adUnit,
1547
+ className: brandInsightAd.className,
1548
+ networkID: brandInsightAd.networkID,
1549
+ sizes: brandInsightAd.sizes,
1550
+ slotId: brandInsightAd.slotId + '_' + i,
1551
+ targeting: {
1552
+ pos: 'infeed',
1553
+ content_placement: brandInsightAd.targeting.content_placement,
1554
+ document_url: brandInsightAd.targeting.document_url,
1555
+ rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
1556
+ },
1557
+ _type: 'brandInsightAd',
1558
+ /* Passing refresh flag */
1559
+ refreshFlag: brandInsightAd.refreshFlag ? brandInsightAd.refreshFlag : false
1560
+ };
1561
+
1562
+ data = insertBrandInsightAd(data, pos, inFeedAd);
1563
+ pos += brandInsightAd.interval + 1;
1564
+ }
1565
+ }
1566
+
1567
+ // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
1568
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
1569
+ // 'articleCount' will be the indexes of only the articles in the deck.
1570
+ var articleCount = -1;
1571
+ data = data.map(function (ele, i) {
1572
+ if (ele._type === 'lg-infeed') {
1573
+ // Setting pos as top2 for the first occurence of large infeed ad
1574
+ // const pos = data.indexOf(data.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
1575
+ return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: 'lg-infeed' }) });
1576
+ } else if (ele._type === 'article') {
1577
+ // incrementing 'articleCount' for each article.
1578
+ ++articleCount;
1579
+ return _extends({}, ele, { articleCount: articleCount });
1580
+ } else {
1581
+ return ele;
1582
+ }
1583
+ });
1584
+
1585
+ var featureCount = 0;
1586
+ return React__default.createElement(
1587
+ 'div',
1588
+ null,
1589
+ data && data.length > 0 ? dataRemapped ? // For Javascript Enabled Cases
1590
+ data.map(function (article, index) {
1591
+ var pageNumber = article.pageNumber || values.page;
1592
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
1593
+
1594
+ if (article._type === 'feature') {
1595
+ featureCount++;
1596
+ if (article.blank || checkExternalUrl$1(article.url.current)) {
1597
+ return React__default.createElement(
1598
+ VisibilitySensor,
1599
+ {
1600
+ key: article._id ? article._id : index,
1601
+ partialVisibility: true,
1602
+ onChange: function onChange(isVisible) {
1603
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
1604
+ } },
1605
+ React__default.createElement(
1606
+ React__default.Fragment,
1607
+ null,
1608
+ React__default.createElement(
1609
+ Media,
1610
+ {
1611
+ key: article._id ? article._id : index,
1612
+ className: 'feature-media',
1613
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1614
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1615
+ 'a',
1616
+ { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
1617
+ React__default.createElement(
1618
+ LazyLoad,
1619
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
1620
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1621
+ ),
1622
+ article.source && React__default.createElement(
1623
+ 'div',
1624
+ { className: 'content-category-label' },
1625
+ React__default.createElement(
1626
+ 'div',
1627
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1628
+ article.source
1629
+ )
1630
+ )
1631
+ ),
1632
+ React__default.createElement(
1633
+ Media.Body,
1634
+ null,
1635
+ React__default.createElement(
1636
+ 'a',
1637
+ { rel: 'noopener', href: article.url.current, target: '_blank' },
1638
+ article.title && React__default.createElement(
1639
+ 'h4',
1640
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1641
+ article.title
1642
+ )
1643
+ ),
1644
+ showPublished && !showTimeDiff && article.published && React__default.createElement(
1645
+ 'p',
1646
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1647
+ moment(article.published).format('MMMM DD, YYYY')
1648
+ ),
1649
+ showTimeDiff && article.published && React__default.createElement(
1650
+ 'p',
1651
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1652
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1653
+ if (index > 3) {
1654
+ return null;
1655
+ }
1656
+ if (index === 3) {
1657
+ return React__default.createElement(
1658
+ React__default.Fragment,
1659
+ null,
1660
+ React__default.createElement(
1661
+ 'em',
1662
+ { style: { marginRight: '.5rem' } },
1663
+ '...'
1664
+ )
1665
+ );
1666
+ }
1667
+ return React__default.createElement(
1668
+ React__default.Fragment,
1669
+ null,
1670
+ React__default.createElement(
1671
+ 'em',
1672
+ null,
1673
+ taxonomy.name
1674
+ ),
1675
+ ' |',
1676
+ ' '
1677
+ );
1678
+ }),
1679
+ ' ',
1680
+ React__default.createElement(
1681
+ 'span',
1682
+ { style: { display: 'inline-block' } },
1683
+ timeDifferenceCalc(article.published)
1684
+ )
1685
+ ),
1686
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1687
+ LazyLoad,
1688
+ { height: 50 },
1689
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1690
+ ),
1691
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1692
+ 'div',
1693
+ { className: 'content-category-label' },
1694
+ React__default.createElement(
1695
+ 'div',
1696
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1697
+ article.source
1698
+ )
1699
+ ),
1700
+ React__default.createElement(
1701
+ 'div',
1702
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1703
+ showCategory && article.contentCategory && React__default.createElement(
1704
+ 'p',
1705
+ {
1706
+ className: 'article-category',
1707
+ style: {
1708
+ background: '#3FB618',
1709
+ color: '#ffffff',
1710
+ marginBottom: '.25rem',
1711
+ display: 'inline-block',
1712
+ padding: '0 .25rem',
1713
+ fontSize: '.8rem'
1714
+ } },
1715
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
1716
+ ),
1717
+ article.issueSection && article.issueSection.name && React__default.createElement(
1718
+ 'p',
1719
+ {
1720
+ className: 'issueSection',
1721
+ style: {
1722
+ background: '#000000',
1723
+ color: '#ffffff',
1724
+ marginBottom: '.25rem',
1725
+ marginLeft: '.25rem',
1726
+ display: 'inline-block',
1727
+ padding: '0 .25rem',
1728
+ fontSize: '.8rem'
1729
+ } },
1730
+ article.issueSection.name
1731
+ )
1732
+ ),
1733
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
1734
+ 'div',
1735
+ { className: 'pubInfo' },
1736
+ article.volume && React__default.createElement(
1737
+ 'p',
1738
+ { className: 'qdeVolume' },
1739
+ article.volume
1740
+ ),
1741
+ article.issue && React__default.createElement(
1742
+ 'p',
1743
+ { className: 'qdeIssue' },
1744
+ article.issue
1745
+ )
1746
+ ),
1747
+ showIntro && article.summary && React__default.createElement(
1748
+ 'p',
1749
+ { className: 'pt-2 card-text' },
1750
+ clean_html_1(article.summary)
1751
+ )
1752
+ )
1753
+ )
1754
+ )
1755
+ );
1756
+ } else {
1757
+ return React__default.createElement(
1758
+ VisibilitySensor,
1759
+ {
1760
+ key: article._id ? article._id : index,
1761
+ partialVisibility: true,
1762
+ onChange: function onChange(isVisible) {
1763
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
1764
+ } },
1765
+ React__default.createElement(
1766
+ React__default.Fragment,
1767
+ null,
1768
+ React__default.createElement(
1769
+ Media,
1770
+ {
1771
+ key: article._id ? article._id : index,
1772
+ className: 'feature-media',
1773
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1774
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1775
+ 'a',
1776
+ { href: article.url.current, className: 'feature-wrapper' },
1777
+ React__default.createElement(
1778
+ LazyLoad,
1779
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
1780
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1781
+ ),
1782
+ article.source && React__default.createElement(
1783
+ 'div',
1784
+ { className: 'content-category-label' },
1785
+ React__default.createElement(
1786
+ 'div',
1787
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1788
+ article.source
1789
+ )
1790
+ )
1791
+ ),
1792
+ React__default.createElement(
1793
+ Media.Body,
1794
+ null,
1795
+ React__default.createElement(
1796
+ 'a',
1797
+ { href: article.url.current },
1798
+ article.title && React__default.createElement(
1799
+ 'h4',
1800
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1801
+ article.title
1802
+ )
1803
+ ),
1804
+ showPublished && !showTimeDiff && article.published && React__default.createElement(
1805
+ 'p',
1806
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1807
+ moment(article.published).format('MMMM DD, YYYY')
1808
+ ),
1809
+ showTimeDiff && article.published && React__default.createElement(
1810
+ 'p',
1811
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1812
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1813
+ if (index > 3) {
1814
+ return null;
1815
+ }
1816
+ if (index === 3) {
1817
+ return React__default.createElement(
1818
+ React__default.Fragment,
1819
+ null,
1820
+ React__default.createElement(
1821
+ 'em',
1822
+ { style: { marginRight: '.5rem' } },
1823
+ '...'
1824
+ )
1825
+ );
1826
+ }
1827
+ if (index === 3) {
1828
+ return React__default.createElement(
1829
+ React__default.Fragment,
1830
+ null,
1831
+ React__default.createElement(
1832
+ 'em',
1833
+ { style: { marginRight: '.5rem' } },
1834
+ '...'
1835
+ )
1836
+ );
1837
+ }
1838
+ return React__default.createElement(
1839
+ React__default.Fragment,
1840
+ null,
1841
+ React__default.createElement(
1842
+ 'em',
1843
+ null,
1844
+ taxonomy.name
1845
+ ),
1846
+ ' |',
1847
+ ' '
1848
+ );
1849
+ }),
1850
+ ' ',
1851
+ React__default.createElement(
1852
+ 'span',
1853
+ { style: { display: 'inline-block' } },
1854
+ timeDifferenceCalc(article.published)
1855
+ )
1856
+ ),
1857
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1858
+ LazyLoad,
1859
+ { height: 50 },
1860
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1861
+ ),
1862
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1863
+ 'div',
1864
+ { className: 'content-category-label' },
1865
+ React__default.createElement(
1866
+ 'div',
1867
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1868
+ article.source
1869
+ )
1870
+ ),
1871
+ React__default.createElement(
1872
+ 'div',
1873
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1874
+ showCategory && article.contentCategory && React__default.createElement(
1875
+ 'p',
1876
+ {
1877
+ className: 'article-category',
1878
+ style: {
1879
+ background: '#3FB618',
1880
+ color: '#ffffff',
1881
+ marginBottom: '.25rem',
1882
+ display: 'inline-block',
1883
+ padding: '0 .25rem',
1884
+ fontSize: '.8rem'
1885
+ } },
1886
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
1887
+ ),
1888
+ article.issueSection && article.issueSection.name && React__default.createElement(
1889
+ 'p',
1890
+ {
1891
+ className: 'issueSection',
1892
+ style: {
1893
+ background: '#000000',
1894
+ color: '#ffffff',
1895
+ marginBottom: '.25rem',
1896
+ marginLeft: '.25rem',
1897
+ display: 'inline-block',
1898
+ padding: '0 .25rem',
1899
+ fontSize: '.8rem'
1900
+ } },
1901
+ article.issueSection.name
1902
+ )
1903
+ ),
1904
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
1905
+ 'div',
1906
+ { className: 'pubInfo' },
1907
+ article.volume && React__default.createElement(
1908
+ 'p',
1909
+ { className: 'qdeVolume' },
1910
+ article.volume
1911
+ ),
1912
+ article.issue && React__default.createElement(
1913
+ 'p',
1914
+ { className: 'qdeIssue' },
1915
+ article.issue
1916
+ )
1917
+ ),
1918
+ showIntro && article.summary && React__default.createElement(
1919
+ 'p',
1920
+ { className: 'pt-2 card-text' },
1921
+ clean_html_1(article.summary)
1922
+ )
1923
+ )
1924
+ )
1925
+ )
1926
+ );
1927
+ }
1928
+ } else if (article._type === 'lg-infeed' && article.adUnit) {
1929
+ return React__default.createElement(ADlgInfeed, _extends({ index: index }, article));
1930
+ } else if (article._type === 'brandInsightAd' && article.adUnit) {
1931
+ return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
1932
+ }
1933
+ if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
1934
+ return React__default.createElement(
1935
+ VisibilitySensor,
1936
+ {
1937
+ key: article._id ? article._id : index,
1938
+ onChange: function onChange(isVisible) {
1939
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
1940
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index);
1941
+ } },
1942
+ React__default.createElement(
1943
+ React__default.Fragment,
1944
+ null,
1945
+ React__default.createElement(
1946
+ Media,
1947
+ {
1948
+ key: article._id ? article._id : index,
1949
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1950
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1951
+ 'a',
1952
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
1953
+ React__default.createElement(
1954
+ LazyLoad,
1955
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
1956
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1957
+ ),
1958
+ article.source && React__default.createElement(
1959
+ 'div',
1960
+ { className: 'content-category-label' },
1961
+ React__default.createElement(
1962
+ 'div',
1963
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1964
+ article.source
1965
+ )
1966
+ )
1967
+ ),
1968
+ React__default.createElement(
1969
+ Media.Body,
1970
+ null,
1971
+ React__default.createElement(
1972
+ 'a',
1973
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
1974
+ article.title && React__default.createElement(
1975
+ 'h4',
1976
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1977
+ article.title
1978
+ )
1979
+ ),
1980
+ showPublished && !showTimeDiff && article.published && React__default.createElement(
1981
+ 'p',
1982
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1983
+ moment(article.published).format('MMMM DD, YYYY')
1984
+ ),
1985
+ showTimeDiff && article.published && React__default.createElement(
1986
+ 'p',
1987
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1988
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1989
+ if (index > 3) {
1990
+ return null;
1991
+ }
1992
+ if (index === 3) {
1993
+ return React__default.createElement(
1994
+ React__default.Fragment,
1995
+ null,
1996
+ React__default.createElement(
1997
+ 'em',
1998
+ { style: { marginRight: '.5rem' } },
1999
+ '...'
2000
+ )
2001
+ );
2002
+ }
2003
+ return React__default.createElement(
2004
+ React__default.Fragment,
2005
+ null,
2006
+ React__default.createElement(
2007
+ 'em',
2008
+ null,
2009
+ taxonomy.name
2010
+ ),
2011
+ ' |',
2012
+ ' '
2013
+ );
2014
+ }),
2015
+ ' ',
2016
+ React__default.createElement(
2017
+ 'span',
2018
+ { style: { display: 'inline-block' } },
2019
+ timeDifferenceCalc(article.published)
2020
+ )
2021
+ ),
2022
+ React__default.createElement(
2023
+ 'div',
2024
+ { className: 'author-sec', style: { lineHeight: 1.5 } },
2025
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2026
+ LazyLoad,
2027
+ { height: 50 },
2028
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2029
+ )
2030
+ ),
2031
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2032
+ 'div',
2033
+ { className: 'content-category-label' },
2034
+ React__default.createElement(
2035
+ 'div',
2036
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2037
+ article.source
2038
+ )
2039
+ ),
2040
+ React__default.createElement(
2041
+ 'div',
2042
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2043
+ showCategory && article.contentCategory && React__default.createElement(
2044
+ 'p',
2045
+ {
2046
+ className: 'article-category',
2047
+ style: {
2048
+ background: '#3FB618',
2049
+ color: '#ffffff',
2050
+ marginBottom: '.25rem',
2051
+ display: 'inline-block',
2052
+ padding: '0 .25rem',
2053
+ fontSize: '.8rem'
2054
+ } },
2055
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
2056
+ ),
2057
+ article.issueSection && article.issueSection.name && React__default.createElement(
2058
+ 'p',
2059
+ {
2060
+ className: 'issueSection',
2061
+ style: {
2062
+ background: '#000000',
2063
+ color: '#ffffff',
2064
+ marginBottom: '.25rem',
2065
+ marginLeft: '.25rem',
2066
+ display: 'inline-block',
2067
+ padding: '0 .25rem',
2068
+ fontSize: '.8rem'
2069
+ } },
2070
+ article.issueSection.name
2071
+ )
2072
+ ),
2073
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2074
+ 'div',
2075
+ { className: 'pubInfo' },
2076
+ article.volume && React__default.createElement(
2077
+ 'p',
2078
+ { className: 'qdeVolume' },
2079
+ article.volume
2080
+ ),
2081
+ article.issue && React__default.createElement(
2082
+ 'p',
2083
+ { className: 'qdeIssue' },
2084
+ article.issue
2085
+ )
2086
+ ),
2087
+ showIntro && article.summary && React__default.createElement(
2088
+ 'p',
2089
+ { className: 'pt-2 card-text' },
2090
+ clean_html_1(article.summary)
2091
+ )
2092
+ )
2093
+ ),
2094
+ React__default.createElement(
2095
+ 'div',
2096
+ null,
2097
+ main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd$1(index, numberOfItemsBeforeAd, rightItems)
2098
+ )
2099
+ )
2100
+ );
2101
+ } else return null;
2102
+ }) :
2103
+ // For Javascript Disabled Cases
2104
+ React__default.createElement(
2105
+ 'noscript',
2106
+ null,
2107
+ data.map(function (article, index) {
2108
+ var pageNumber = article.pageNumber || values.page;
2109
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
2110
+
2111
+ if (article._type === 'feature') {
2112
+ featureCount++;
2113
+ if (article.blank || checkExternalUrl$1(article.url.current)) {
2114
+ return React__default.createElement(
2115
+ VisibilitySensor,
2116
+ {
2117
+ key: article._id ? article._id : index,
2118
+ partialVisibility: true,
2119
+ onChange: function onChange(isVisible) {
2120
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
2121
+ } },
2122
+ React__default.createElement(
2123
+ React__default.Fragment,
2124
+ null,
2125
+ React__default.createElement(
2126
+ Media,
2127
+ {
2128
+ key: article._id ? article._id : index,
2129
+ className: 'feature-media',
2130
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2131
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
2132
+ 'a',
2133
+ { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
2134
+ React__default.createElement(
2135
+ LazyLoad,
2136
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
2137
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2138
+ ),
2139
+ article.source && React__default.createElement(
2140
+ 'div',
2141
+ { className: 'content-category-label' },
2142
+ React__default.createElement(
2143
+ 'div',
2144
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2145
+ article.source
2146
+ )
2147
+ )
2148
+ ),
2149
+ React__default.createElement(
2150
+ Media.Body,
2151
+ null,
2152
+ React__default.createElement(
2153
+ 'a',
2154
+ { rel: 'noopener', href: article.url.current, target: '_blank' },
2155
+ article.title && React__default.createElement(
2156
+ 'h4',
2157
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2158
+ article.title
2159
+ )
2160
+ ),
2161
+ showPublished && article.published && React__default.createElement(
2162
+ 'p',
2163
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
2164
+ moment(article.published).format('MMMM DD, YYYY')
2165
+ ),
2166
+ showTimeDiff && article.published && React__default.createElement(
2167
+ 'p',
2168
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2169
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
2170
+ if (index > 3) {
2171
+ return null;
2172
+ }
2173
+ if (index === 3) {
2174
+ return React__default.createElement(
2175
+ React__default.Fragment,
2176
+ null,
2177
+ React__default.createElement(
2178
+ 'em',
2179
+ { style: { marginRight: '.5rem' } },
2180
+ '...'
2181
+ )
2182
+ );
2183
+ }
2184
+ return React__default.createElement(
2185
+ React__default.Fragment,
2186
+ null,
2187
+ React__default.createElement(
2188
+ 'em',
2189
+ null,
2190
+ taxonomy.name
2191
+ ),
2192
+ ' |',
2193
+ ' '
2194
+ );
2195
+ }),
2196
+ ' ',
2197
+ React__default.createElement(
2198
+ 'span',
2199
+ { style: { display: 'inline-block' } },
2200
+ timeDifferenceCalc(article.published)
2201
+ )
2202
+ ),
2203
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2204
+ LazyLoad,
2205
+ { height: 50 },
2206
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2207
+ ),
2208
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2209
+ 'div',
2210
+ { className: 'content-category-label' },
2211
+ React__default.createElement(
2212
+ 'div',
2213
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2214
+ article.source
2215
+ )
2216
+ ),
2217
+ React__default.createElement(
2218
+ 'div',
2219
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2220
+ showCategory && article.contentCategory && React__default.createElement(
2221
+ 'p',
2222
+ {
2223
+ className: 'article-category',
2224
+ style: {
2225
+ background: '#3FB618',
2226
+ color: '#ffffff',
2227
+ marginBottom: '.25rem',
2228
+ display: 'inline-block',
2229
+ padding: '0 .25rem',
2230
+ fontSize: '.8rem'
2231
+ } },
2232
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
2233
+ ),
2234
+ article.issueSection && article.issueSection.name && React__default.createElement(
2235
+ 'p',
2236
+ {
2237
+ className: 'issueSection',
2238
+ style: {
2239
+ background: '#000000',
2240
+ color: '#ffffff',
2241
+ marginBottom: '.25rem',
2242
+ marginLeft: '.25rem',
2243
+ display: 'inline-block',
2244
+ padding: '0 .25rem',
2245
+ fontSize: '.8rem'
2246
+ } },
2247
+ article.issueSection.name
2248
+ )
2249
+ ),
2250
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2251
+ 'div',
2252
+ { className: 'pubInfo' },
2253
+ article.volume && React__default.createElement(
2254
+ 'p',
2255
+ { className: 'qdeVolume' },
2256
+ article.volume
2257
+ ),
2258
+ article.issue && React__default.createElement(
2259
+ 'p',
2260
+ { className: 'qdeIssue' },
2261
+ article.issue
2262
+ )
2263
+ ),
2264
+ showIntro && article.summary && React__default.createElement(
2265
+ 'p',
2266
+ { className: 'pt-2 card-text' },
2267
+ clean_html_1(article.summary)
2268
+ )
2269
+ )
2270
+ )
2271
+ )
2272
+ );
2273
+ } else {
2274
+ return React__default.createElement(
2275
+ VisibilitySensor,
2276
+ {
2277
+ key: article._id ? article._id : index,
2278
+ partialVisibility: true,
2279
+ onChange: function onChange(isVisible) {
2280
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
2281
+ } },
2282
+ React__default.createElement(
2283
+ React__default.Fragment,
2284
+ null,
2285
+ React__default.createElement(
2286
+ Media,
2287
+ {
2288
+ key: article._id ? article._id : index,
2289
+ className: 'feature-media',
2290
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2291
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
2292
+ 'a',
2293
+ { href: article.url.current, className: 'feature-wrapper' },
2294
+ React__default.createElement(
2295
+ LazyLoad,
2296
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
2297
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2298
+ ),
2299
+ article.source && React__default.createElement(
2300
+ 'div',
2301
+ { className: 'content-category-label' },
2302
+ React__default.createElement(
2303
+ 'div',
2304
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2305
+ article.source
2306
+ )
2307
+ )
2308
+ ),
2309
+ React__default.createElement(
2310
+ Media.Body,
2311
+ null,
2312
+ React__default.createElement(
2313
+ 'a',
2314
+ { href: article.url.current },
2315
+ article.title && React__default.createElement(
2316
+ 'h4',
2317
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2318
+ article.title
2319
+ )
2320
+ ),
2321
+ showPublished && article.published && React__default.createElement(
2322
+ 'p',
2323
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
2324
+ moment(article.published).format('MMMM DD, YYYY')
2325
+ ),
2326
+ showTimeDiff && article.published && React__default.createElement(
2327
+ 'p',
2328
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2329
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
2330
+ if (index > 3) {
2331
+ return null;
2332
+ }
2333
+ if (index === 3) {
2334
+ return React__default.createElement(
2335
+ React__default.Fragment,
2336
+ null,
2337
+ React__default.createElement(
2338
+ 'em',
2339
+ { style: { marginRight: '.5rem' } },
2340
+ '...'
2341
+ )
2342
+ );
2343
+ }
2344
+ return React__default.createElement(
2345
+ React__default.Fragment,
2346
+ null,
2347
+ React__default.createElement(
2348
+ 'em',
2349
+ null,
2350
+ taxonomy.name
2351
+ ),
2352
+ ' |',
2353
+ ' '
2354
+ );
2355
+ }),
2356
+ ' ',
2357
+ React__default.createElement(
2358
+ 'span',
2359
+ { style: { display: 'inline-block' } },
2360
+ timeDifferenceCalc(article.published)
2361
+ )
2362
+ ),
2363
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2364
+ LazyLoad,
2365
+ { height: 50 },
2366
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2367
+ ),
2368
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2369
+ 'div',
2370
+ { className: 'content-category-label' },
2371
+ React__default.createElement(
2372
+ 'div',
2373
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2374
+ article.source
2375
+ )
2376
+ ),
2377
+ React__default.createElement(
2378
+ 'div',
2379
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2380
+ showCategory && article.contentCategory && React__default.createElement(
2381
+ 'p',
2382
+ {
2383
+ className: 'article-category',
2384
+ style: {
2385
+ background: '#3FB618',
2386
+ color: '#ffffff',
2387
+ marginBottom: '.25rem',
2388
+ display: 'inline-block',
2389
+ padding: '0 .25rem',
2390
+ fontSize: '.8rem'
2391
+ } },
2392
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
2393
+ ),
2394
+ article.issueSection && article.issueSection.name && React__default.createElement(
2395
+ 'p',
2396
+ {
2397
+ className: 'issueSection',
2398
+ style: {
2399
+ background: '#000000',
2400
+ color: '#ffffff',
2401
+ marginBottom: '.25rem',
2402
+ marginLeft: '.25rem',
2403
+ display: 'inline-block',
2404
+ padding: '0 .25rem',
2405
+ fontSize: '.8rem'
2406
+ } },
2407
+ article.issueSection.name
2408
+ )
2409
+ ),
2410
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2411
+ 'div',
2412
+ { className: 'pubInfo' },
2413
+ article.volume && React__default.createElement(
2414
+ 'p',
2415
+ { className: 'qdeVolume' },
2416
+ article.volume
2417
+ ),
2418
+ article.issue && React__default.createElement(
2419
+ 'p',
2420
+ { className: 'qdeIssue' },
2421
+ article.issue
2422
+ )
2423
+ ),
2424
+ showIntro && article.summary && React__default.createElement(
2425
+ 'p',
2426
+ { className: 'pt-2 card-text' },
2427
+ clean_html_1(article.summary)
2428
+ )
2429
+ )
2430
+ )
2431
+ )
2432
+ );
2433
+ }
2434
+ } else if (article._type === 'lg-infeed' && article.adUnit) {
2435
+ return React__default.createElement(ADlgInfeed, _extends({ index: index }, article));
2436
+ } else if (article._type === 'brandInsightAd' && article.adUnit) {
2437
+ return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
2438
+ }
2439
+ if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
2440
+ return React__default.createElement(
2441
+ VisibilitySensor,
2442
+ {
2443
+ key: article._id ? article._id : index,
2444
+ onChange: function onChange(isVisible) {
2445
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
2446
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index);
2447
+ } },
2448
+ React__default.createElement(
2449
+ React__default.Fragment,
2450
+ null,
2451
+ React__default.createElement(
2452
+ Media,
2453
+ {
2454
+ key: article._id ? article._id : index,
2455
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2456
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
2457
+ 'a',
2458
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
2459
+ React__default.createElement(
2460
+ LazyLoad,
2461
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
2462
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2463
+ ),
2464
+ article.source && React__default.createElement(
2465
+ 'div',
2466
+ { className: 'content-category-label' },
2467
+ React__default.createElement(
2468
+ 'div',
2469
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2470
+ article.source
2471
+ )
2472
+ )
2473
+ ),
2474
+ React__default.createElement(
2475
+ Media.Body,
2476
+ null,
2477
+ React__default.createElement(
2478
+ 'a',
2479
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
2480
+ article.title && React__default.createElement(
2481
+ 'h4',
2482
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2483
+ article.title
2484
+ )
2485
+ ),
2486
+ showPublished && article.published && React__default.createElement(
2487
+ 'p',
2488
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
2489
+ moment(article.published).format('MMMM DD, YYYY')
2490
+ ),
2491
+ showTimeDiff && article.published && React__default.createElement(
2492
+ 'p',
2493
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2494
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
2495
+ if (index > 3) {
2496
+ return null;
2497
+ }
2498
+ if (index === 3) {
2499
+ return React__default.createElement(
2500
+ React__default.Fragment,
2501
+ null,
2502
+ React__default.createElement(
2503
+ 'em',
2504
+ { style: { marginRight: '.5rem' } },
2505
+ '...'
2506
+ )
2507
+ );
2508
+ }
2509
+ return React__default.createElement(
2510
+ React__default.Fragment,
2511
+ null,
2512
+ React__default.createElement(
2513
+ 'em',
2514
+ null,
2515
+ taxonomy.name
2516
+ ),
2517
+ ' |',
2518
+ ' '
2519
+ );
2520
+ }),
2521
+ ' ',
2522
+ React__default.createElement(
2523
+ 'span',
2524
+ { style: { display: 'inline-block' } },
2525
+ timeDifferenceCalc(article.published)
2526
+ )
2527
+ ),
2528
+ React__default.createElement(
2529
+ 'div',
2530
+ { className: 'author-sec', style: { lineHeight: 1.5 } },
2531
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2532
+ LazyLoad,
2533
+ { height: 50 },
2534
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2535
+ )
2536
+ ),
2537
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2538
+ 'div',
2539
+ { className: 'content-category-label' },
2540
+ React__default.createElement(
2541
+ 'div',
2542
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2543
+ article.source
2544
+ )
2545
+ ),
2546
+ React__default.createElement(
2547
+ 'div',
2548
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2549
+ showCategory && article.contentCategory && React__default.createElement(
2550
+ 'p',
2551
+ {
2552
+ className: 'article-category',
2553
+ style: {
2554
+ background: '#3FB618',
2555
+ color: '#ffffff',
2556
+ marginBottom: '.25rem',
2557
+ display: 'inline-block',
2558
+ padding: '0 .25rem',
2559
+ fontSize: '.8rem'
2560
+ } },
2561
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
2562
+ ),
2563
+ article.issueSection && article.issueSection.name && React__default.createElement(
2564
+ 'p',
2565
+ {
2566
+ className: 'issueSection',
2567
+ style: {
2568
+ background: '#000000',
2569
+ color: '#ffffff',
2570
+ marginBottom: '.25rem',
2571
+ marginLeft: '.25rem',
2572
+ display: 'inline-block',
2573
+ padding: '0 .25rem',
2574
+ fontSize: '.8rem'
2575
+ } },
2576
+ article.issueSection.name
2577
+ )
2578
+ ),
2579
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2580
+ 'div',
2581
+ { className: 'pubInfo' },
2582
+ article.volume && React__default.createElement(
2583
+ 'p',
2584
+ { className: 'qdeVolume' },
2585
+ article.volume
2586
+ ),
2587
+ article.issue && React__default.createElement(
2588
+ 'p',
2589
+ { className: 'qdeIssue' },
2590
+ article.issue
2591
+ )
2592
+ ),
2593
+ showIntro && article.summary && React__default.createElement(
2594
+ 'p',
2595
+ { className: 'pt-2 card-text' },
2596
+ clean_html_1(article.summary)
2597
+ )
2598
+ )
2599
+ ),
2600
+ React__default.createElement(
2601
+ 'div',
2602
+ null,
2603
+ main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd$1(index, numberOfItemsBeforeAd, rightItems)
2604
+ )
2605
+ )
2606
+ );
2607
+ } else return null;
2608
+ })
2609
+ ) : React__default.createElement(
2610
+ 'div',
2611
+ null,
2612
+ React__default.createElement(
2613
+ 'h5',
2614
+ null,
2615
+ React__default.createElement(
2616
+ 'em',
2617
+ null,
2618
+ 'New content coming soon, please check back later.'
2619
+ )
2620
+ )
2621
+ ),
2622
+ React__default.createElement(
2623
+ 'style',
2624
+ { jsx: 'true' },
2625
+ '\n .displayLabelThumb {\n margin: 0 auto;\n margin-top: -1.25rem;\n background-color: white;\n position: relative;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n width: fit-content;\n width: -moz-fit-content;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .feature-media > .media-body {\n -webkit-box-flex: none;\n -ms-flex: none;\n flex: none;\n }\n .img-wrapper img {\n max-height: 240px;\n height: auto;\n width: 100%;\n object-fit: contain;\n }\n .feature-wrapper {\n height: 100%;\n width: 100%;\n }\n .feature-wrapper img {\n width: 100%;\n margin-bottom: 1em;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .sanityDisplayLabel {\n max-width: 100%;\n }\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column !important;\n }\n }\n '
2626
+ )
2627
+ );
2628
+ };
2629
+
2630
+ var ImagePlaceholder$1 = function ImagePlaceholder() {
2631
+ return React__default.createElement(
2632
+ React__default.Fragment,
2633
+ null,
2634
+ React__default.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
2635
+ React__default.createElement(
2636
+ 'style',
2637
+ { jsx: 'true' },
2638
+ '\n .queuedeck-exp-image-placeholder {\n width: 240px;\n height: 0;\n padding-top: calc(240px * 9 / 16);\n margin: 0 1rem 0 0;\n }\n @media only screen and (max-width: 767px) {\n .queuedeck-exp-image-placeholder {\n width: 100%;\n height: 0;\n padding-top: calc(100% * 9 / 16);\n margin: 0 0 1rem 0;\n }\n }\n '
2639
+ )
2640
+ );
2641
+ };
2642
+
2643
+ var renderMobileAd$1 = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
2644
+ var i = numberOfItemsBeforeAd < 6 ? 0 : ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
2645
+ return React__default.createElement(
2646
+ 'div',
2647
+ { style: { display: 'flex', flex: '1 0 auto' } },
2648
+ rightItems[i].component
2649
+ );
2650
+ };
2651
+
2652
+ var usePrevious$1 = function usePrevious(value) {
2653
+ var ref = useRef();
2654
+ useEffect(function () {
2655
+ ref.current = value;
2656
+ });
2657
+ return ref.current;
2658
+ };
2659
+
2660
+ var QueueDeckExpanded$1 = function QueueDeckExpanded$1(props) {
2661
+ if (props.totalDataCount) return React__default.createElement(QueueDeckExpanded, props);
2662
+ var router = useRouter();
2663
+
2664
+ // Logging GA Pageview on path change
2665
+ var prevPath = usePrevious$1(lodash.get(router, 'asPath', undefined));
2666
+ useEffect(function () {
2667
+ var pageview = props.pageview;
2668
+
2669
+ var currentPath = router.asPath;
2670
+ if (prevPath && prevPath !== currentPath && pageview) {
2671
+ pageview(router.asPath);
2672
+ }
2673
+ }, [router]);
2674
+
2675
+ var initialData = props.dataRecord,
2676
+ client = props.client,
2677
+ params = props.params,
2678
+ query = props.query,
2679
+ autoScroll = props.autoScroll,
2680
+ pointer = props.pointer,
2681
+ pointerArray = props.pointerArray,
2682
+ mapping = props.mapping,
2683
+ seoPaginate = props.seoPaginate,
2684
+ pageview = props.pageview,
2685
+ defaultImage = props.defaultImage,
2686
+ showAuthor = props.showAuthor,
2687
+ showCategory = props.showCategory,
2688
+ imageHeight = props.imageHeight,
2689
+ imageWidth = props.imageWidth,
2690
+ imageMaxHeight = props.imageMaxHeight,
2691
+ imageFit = props.imageFit,
2692
+ rightItems = props.rightItems,
2693
+ brandInsightAd = props.brandInsightAd,
2694
+ _props$showBI = props.showBI,
2695
+ showBI = _props$showBI === undefined ? false : _props$showBI,
2696
+ _props$heroContent = props.heroContent,
2697
+ heroContent = _props$heroContent === undefined ? 0 : _props$heroContent,
2698
+ _props$lgInfeedAd = props.lgInfeedAd,
2699
+ lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd,
2700
+ _props$showPubInfo = props.showPubInfo,
2701
+ showPubInfo = _props$showPubInfo === undefined ? false : _props$showPubInfo,
2702
+ _props$showTimeDiff = props.showTimeDiff,
2703
+ showTimeDiff = _props$showTimeDiff === undefined ? false : _props$showTimeDiff,
2704
+ _props$showTaxonomies = props.showTaxonomies,
2705
+ showTaxonomies = _props$showTaxonomies === undefined ? false : _props$showTaxonomies,
2706
+ _props$showIntro = props.showIntro,
2707
+ showIntro = _props$showIntro === undefined ? true : _props$showIntro,
2708
+ _props$contentCategor = props.contentCategoryMapping,
2709
+ contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor;
2710
+ var initialCurrentPage = props.currentPage,
2711
+ showPublished = props.showPublished;
2712
+
2713
+ var _useState3 = useState(initialData),
2714
+ _useState4 = _slicedToArray(_useState3, 2),
2715
+ data = _useState4[0],
2716
+ setData = _useState4[1];
2717
+
2718
+ var _useState5 = useState(true),
2719
+ _useState6 = _slicedToArray(_useState5, 2),
2720
+ scrolling = _useState6[0],
2721
+ setScrolling = _useState6[1];
2722
+
2723
+ var _useState7 = useState(initialCurrentPage || 1),
2724
+ _useState8 = _slicedToArray(_useState7, 2),
2725
+ currentPage = _useState8[0],
2726
+ setCurrentPage = _useState8[1];
2727
+
2728
+ var _useState9 = useState(initialData ? initialData.length : 0),
2729
+ _useState10 = _slicedToArray(_useState9, 2),
2730
+ lastDataSize = _useState10[0],
2731
+ setLastDataSize = _useState10[1];
2732
+
2733
+ var _useState11 = useState({
2734
+ from: params ? params.from : 0,
2735
+ to: params ? params.to : 0,
2736
+ page: initialCurrentPage ? initialCurrentPage : 1
2737
+ }),
2738
+ _useState12 = _slicedToArray(_useState11, 2),
2739
+ values = _useState12[0],
2740
+ setValues = _useState12[1];
2741
+
2742
+ var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : 10;
2743
+
2744
+ var prevValues = usePrevious$1(values);
2745
+
2746
+ var renderManualPagination = function renderManualPagination(currentPage) {
2747
+ if (lastDataSize < itemsPerPage) {
2748
+ return null;
2749
+ }
2750
+
2751
+ return React__default.createElement(
2752
+ 'div',
2753
+ { className: 'd-flex justify-content-between' },
2754
+ currentPage && currentPage > 1 && React__default.createElement(
2755
+ 'a',
2756
+ { href: '?page=' + (currentPage - 1) },
2757
+ '<< Previous'
2758
+ ),
2759
+ React__default.createElement(
2760
+ 'a',
2761
+ { href: '?page=' + (currentPage + 1) },
2762
+ 'Next >>'
2763
+ )
2764
+ );
2765
+ };
2766
+
2767
+ // check for change in filter parameters from client side and refresh the page
2768
+ useEffect(function () {
2769
+ if (initialData && data !== initialData && initialData.length >= 0) {
2770
+ setData(initialData);
2771
+ setCurrentPage(initialCurrentPage ? initialCurrentPage : 1);
2772
+ setValues({
2773
+ from: params ? params.from : 0,
2774
+ to: params ? params.to : 0,
2775
+ page: initialCurrentPage ? initialCurrentPage : 1
2776
+ });
2777
+ if (initialData.length > 0) {
2778
+ setScrolling(true);
2779
+ }
2780
+ }
2781
+ }, [initialData]);
2782
+
2783
+ useEffect(function () {
2784
+ if (prevValues) {
2785
+ if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.to) {
2786
+ loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray);
2787
+ }
2788
+ }
2789
+ }, [values, prevValues, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray]);
2790
+
2791
+ // useEffect(() => {
2792
+ // document.addEventListener('scroll', trackScrolling)
2793
+ // return () => {
2794
+ // document.removeEventListener('scroll', trackScrolling)
2795
+ // }
2796
+ // }, [currentPage])
2797
+
2798
+ // const trackScrolling = (current) => {
2799
+ // if (window.pageYOffset === 0) {
2800
+ // if (currentPage > 1) {
2801
+ // changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, 1)
2802
+ // }
2803
+ // }
2804
+ // }
2805
+
2806
+ return React__default.createElement(
2807
+ 'div',
2808
+ null,
2809
+ autoScroll ? React__default.createElement(
2810
+ React__default.Fragment,
2811
+ null,
2812
+ React__default.createElement(
2813
+ InfiniteScroll,
2814
+ { dataLength: data && data.length, next: function next() {
2815
+ return loadMore(values, setValues, itemsPerPage);
2816
+ }, hasMore: scrolling, scrollThreshold: 0.9 },
2817
+ React__default.createElement(
2818
+ Container,
2819
+ null,
2820
+ cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
2821
+ )
2822
+ ),
2823
+ React__default.createElement(
2824
+ 'noscript',
2825
+ null,
2826
+ renderManualPagination(currentPage)
2827
+ )
2828
+ ) : React__default.createElement(
2829
+ React__default.Fragment,
2830
+ null,
2831
+ React__default.createElement(
2832
+ Container,
2833
+ null,
2834
+ cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
2835
+ ),
2836
+ React__default.createElement(
2837
+ 'div',
2838
+ { style: { padding: '0px 10px' } },
2839
+ scrolling ? React__default.createElement(
2840
+ 'button',
2841
+ {
2842
+ className: 'load-more-btn',
2843
+ style: { margin: 'auto', width: '100%' },
2844
+ onClick: function onClick(e) {
2845
+ loadMore(values, setValues, itemsPerPage);
2846
+ } },
2847
+ 'Load More'
2848
+ ) : React__default.createElement(
2849
+ 'p',
2850
+ { style: { textAlign: 'center' } },
2851
+ React__default.createElement(
2852
+ 'b',
2853
+ null,
2854
+ 'End of data'
2855
+ )
2856
+ )
2857
+ ),
2858
+ React__default.createElement(
2859
+ 'noscript',
2860
+ null,
2861
+ renderManualPagination(currentPage)
1358
2862
  )
1359
2863
  )
1360
2864
  );
1361
2865
  };
1362
2866
 
1363
- export default QueueDeckExpanded;
2867
+ export default QueueDeckExpanded$1;