@mjhls/mjh-framework 1.0.694-beta.2 → 1.0.694-beta.3

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 (89) hide show
  1. package/dist/cjs/AD.js +1 -1
  2. package/dist/cjs/AD300x250.js +2 -2
  3. package/dist/cjs/AD300x250x600.js +2 -2
  4. package/dist/cjs/AD728x90.js +2 -2
  5. package/dist/cjs/ADFloatingFooter.js +2 -2
  6. package/dist/cjs/ADGutter.js +2 -2
  7. package/dist/cjs/ADSkyscraper.js +2 -2
  8. package/dist/cjs/ADSponsoredResources.js +2 -2
  9. package/dist/cjs/ADWebcast.js +2 -2
  10. package/dist/cjs/ADWelcome.js +2 -2
  11. package/dist/cjs/AdSlot.js +2 -2
  12. package/dist/cjs/ArticleSeriesListing.js +2 -2
  13. package/dist/cjs/CMEDeck.js +2 -2
  14. package/dist/cjs/Column2.js +2 -2
  15. package/dist/cjs/Column3.js +3 -3
  16. package/dist/cjs/DeckContent.js +3 -3
  17. package/dist/cjs/DeckQueue.js +3 -3
  18. package/dist/cjs/{Dfp-1a9e2305.js → Dfp-f6a18ed2.js} +2 -2
  19. package/dist/cjs/ExternalResources.js +3 -3
  20. package/dist/cjs/GridContent.js +5 -5
  21. package/dist/cjs/IssueLanding.js +4 -4
  22. package/dist/cjs/LeftNav.js +2 -2
  23. package/dist/cjs/MasterDeck.js +4 -4
  24. package/dist/cjs/PartnerDetailListing.js +5 -5
  25. package/dist/cjs/QueueDeckExpanded.js +4 -4
  26. package/dist/cjs/SideFooter.js +2 -2
  27. package/dist/cjs/TemplateNormal.js +3 -3
  28. package/dist/cjs/VideoSeriesListing.js +2 -2
  29. package/dist/cjs/View.js +139 -178
  30. package/dist/cjs/{debounce-0106f44a.js → debounce-eb287781.js} +1 -1
  31. package/dist/cjs/{get-445b7179.js → get-68c52cb1.js} +1 -4
  32. package/dist/cjs/getQuery.js +2 -2
  33. package/dist/cjs/getRelatedArticle.js +75 -32
  34. package/dist/cjs/getSerializers.js +3 -3
  35. package/dist/cjs/index.js +13 -349
  36. package/dist/cjs/{isSymbol-488934a7.js → isSymbol-04666465.js} +0 -2
  37. package/dist/esm/AD.js +1 -1
  38. package/dist/esm/AD300x250.js +3 -3
  39. package/dist/esm/AD300x250x600.js +3 -3
  40. package/dist/esm/AD728x90.js +3 -3
  41. package/dist/esm/ADFloatingFooter.js +3 -3
  42. package/dist/esm/ADGutter.js +3 -3
  43. package/dist/esm/ADSkyscraper.js +3 -3
  44. package/dist/esm/ADSponsoredResources.js +3 -3
  45. package/dist/esm/ADWebcast.js +3 -3
  46. package/dist/esm/ADWelcome.js +3 -3
  47. package/dist/esm/AdSlot.js +3 -3
  48. package/dist/esm/ArticleSeriesListing.js +2 -2
  49. package/dist/esm/Auth.js +1 -1
  50. package/dist/esm/Beam.js +1 -1
  51. package/dist/esm/CMEDeck.js +3 -3
  52. package/dist/esm/Column2.js +3 -3
  53. package/dist/esm/Column3.js +4 -4
  54. package/dist/esm/DeckContent.js +4 -4
  55. package/dist/esm/DeckQueue.js +3 -3
  56. package/dist/esm/{Dfp-0fc96a5d.js → Dfp-96b49def.js} +2 -2
  57. package/dist/esm/ExternalResources.js +4 -4
  58. package/dist/esm/GridContent.js +6 -6
  59. package/dist/esm/HamMagazine.js +1 -1
  60. package/dist/esm/IssueLanding.js +5 -5
  61. package/dist/esm/LeftNav.js +3 -3
  62. package/dist/esm/MasterDeck.js +5 -5
  63. package/dist/esm/NavDvm.js +1 -1
  64. package/dist/esm/NavMagazine.js +1 -1
  65. package/dist/esm/NavNative.js +1 -1
  66. package/dist/esm/NavNormal.js +1 -1
  67. package/dist/esm/PartnerDetailListing.js +6 -6
  68. package/dist/esm/QueueDeckExpanded.js +5 -5
  69. package/dist/esm/Segment.js +1 -1
  70. package/dist/esm/SideFooter.js +3 -3
  71. package/dist/esm/TemplateNormal.js +4 -4
  72. package/dist/esm/VideoSeriesFilter.js +1 -1
  73. package/dist/esm/VideoSeriesListing.js +2 -2
  74. package/dist/esm/View.js +140 -179
  75. package/dist/esm/{asyncToGenerator-d0f08f8d.js → asyncToGenerator-7c654f36.js} +1 -1
  76. package/dist/esm/{debounce-3ab4e0ad.js → debounce-1a993acf.js} +1 -1
  77. package/dist/esm/{get-a36cf4c6.js → get-5ee14cda.js} +2 -2
  78. package/dist/esm/getQuery.js +2 -2
  79. package/dist/esm/getRelatedArticle.js +76 -33
  80. package/dist/esm/getSerializers.js +4 -4
  81. package/dist/esm/index.js +13 -349
  82. package/dist/esm/{isSymbol-5eb15258.js → isSymbol-807e927e.js} +1 -1
  83. package/package.json +1 -1
  84. /package/dist/cjs/{ADInfeed-4ef14853.js → ADInfeed-2fe7211c.js} +0 -0
  85. /package/dist/cjs/{ADlgInfeed-d42cc813.js → ADlgInfeed-14e17b43.js} +0 -0
  86. /package/dist/cjs/{index-26569dcc.js → index-a5919bab.js} +0 -0
  87. /package/dist/esm/{ADInfeed-ddbadcd3.js → ADInfeed-eae71d07.js} +0 -0
  88. /package/dist/esm/{ADlgInfeed-4d228100.js → ADlgInfeed-c619fe64.js} +0 -0
  89. /package/dist/esm/{index-42fd3adb.js → index-c376cd8e.js} +0 -0
package/dist/esm/View.js CHANGED
@@ -20,8 +20,8 @@ import 'react-bootstrap/Row';
20
20
  import 'react-bootstrap/Col';
21
21
  import { m as moment } from './moment-e2f9b20c.js';
22
22
  import { useRouter } from 'next/router';
23
- import './isSymbol-5eb15258.js';
24
- import './debounce-3ab4e0ad.js';
23
+ import './isSymbol-807e927e.js';
24
+ import './debounce-1a993acf.js';
25
25
  import { I as InfiniteScroll } from './index.es-29c1cef5.js';
26
26
  import 'react-dom';
27
27
  import './index-73819142.js';
@@ -30,7 +30,7 @@ import { m as main_36 } from './main-5d1e4bd3.js';
30
30
  import './entities-7cc3bf45.js';
31
31
  import { _ as _JSON$stringify } from './stringify-008c8802.js';
32
32
  import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-7021e5df.js';
33
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-d0f08f8d.js';
33
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
34
34
  import './_set-species-cede29f8.js';
35
35
  import './Segment.js';
36
36
  import './Beam.js';
@@ -42,9 +42,8 @@ import 'react-bootstrap';
42
42
  import './iconBase-602d52fe.js';
43
43
  import './index.esm-29e48d38.js';
44
44
  import Button from 'react-bootstrap/Button';
45
- import { _ as _defineProperty } from './defineProperty-b798470d.js';
46
45
  import Form from 'react-bootstrap/Form';
47
- import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-42fd3adb.js';
46
+ import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-c376cd8e.js';
48
47
  import './util-7700fc59.js';
49
48
  import './brightcove-react-player-loader.es-83f53e4e.js';
50
49
  import 'react-bootstrap/Pagination';
@@ -248,7 +247,7 @@ var ISI = function ISI(props) {
248
247
  );
249
248
  };
250
249
 
251
- var css = ".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_mediaCard__3wQbn {\r\n width: 100%;\r\n }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n width: 100%;\r\n height: auto;\r\n\r\n max-height: 175px;\r\n object-fit: contain;\r\n margin-bottom: 1rem;\r\n }\r\n}\r\n";
250
+ var css = ".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";
252
251
  var styles = { "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" };
253
252
  styleInject(css);
254
253
 
@@ -484,65 +483,73 @@ var Article = function Article(props) {
484
483
  };
485
484
 
486
485
  var RelevantTopics = function RelevantTopics() {
487
- if (content_placement && content_placement.length > 0 || documentGroupMapping) {
488
- return React__default.createElement(
489
- 'div',
490
- { style: { color: '#262626' } },
491
- React__default.createElement(
492
- 'p',
493
- { className: 'mb-0' },
494
- React__default.createElement(
495
- 'b',
496
- null,
497
- 'Related Content:'
498
- )
499
- ),
500
- documentGroupMapping && documentGroupMapping.map(function (documentGroup) {
501
- if (!documentGroup.parent) {
502
- return null;
486
+ if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
487
+ var relatedLinks = [];
488
+ if (documentGroupMapping && documentGroupMapping.length > 0) {
489
+ documentGroupMapping.forEach(function (documentGroup) {
490
+ if (documentGroup.parent) {
491
+ relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path }]);
503
492
  }
504
-
505
- return React__default.createElement(
506
- React__default.Fragment,
507
- null,
508
- React__default.createElement(
509
- 'span',
510
- { className: '' },
511
- React__default.createElement(
512
- 'a',
513
- {
514
- className: 'related-links',
515
- style: { color: 'blue' },
516
- href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
517
- documentGroup.name
518
- )
519
- ),
520
- content_placement && content_placement.length ? ' | ' : null
521
- );
522
- }),
523
- content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
493
+ });
494
+ }
495
+ if (content_placement && content_placement.length > 0) {
496
+ content_placement.filter(function (item) {
497
+ return item.path !== 'news';
498
+ }).forEach(function (cp) {
524
499
  var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
525
500
  var href = '/' + cp_url;
526
- return React__default.createElement(
527
- React__default.Fragment,
528
- { key: index },
529
- React__default.createElement(
501
+ relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
502
+ });
503
+ }
504
+ if (relatedLinks && relatedLinks.length > 0) {
505
+ return React__default.createElement(
506
+ 'div',
507
+ null,
508
+ relatedLinks.map(function (relatedLink, index) {
509
+ return React__default.createElement(
530
510
  'span',
531
- null,
511
+ { key: index, className: 'related-link' },
532
512
  React__default.createElement(
533
513
  'a',
534
- { className: 'related-links', key: index, href: href, style: { color: 'blue' } },
535
- cp.name
514
+ { className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
515
+ relatedLink.label
516
+ ),
517
+ React__default.createElement(
518
+ 'style',
519
+ { jsx: 'true' },
520
+ '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
536
521
  )
537
- ),
538
- content_placement.length > index + 1 ? ' | ' : null
539
- );
540
- }) : null
541
- );
522
+ );
523
+ })
524
+ );
525
+ }
526
+ return null;
542
527
  }
543
528
  return null;
544
529
  };
545
530
 
531
+ var RelatedContent = function RelatedContent() {
532
+ return React__default.createElement(
533
+ 'section',
534
+ { id: 'related-content-section', className: 'my-1' },
535
+ React__default.createElement(
536
+ 'p',
537
+ { className: 'mb-0' },
538
+ React__default.createElement(
539
+ 'b',
540
+ null,
541
+ 'Related Content:'
542
+ )
543
+ ),
544
+ React__default.createElement(RelevantTopics, null),
545
+ React__default.createElement(
546
+ 'div',
547
+ { className: 'pt-2' },
548
+ React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
549
+ )
550
+ );
551
+ };
552
+
546
553
  var form = function form() {
547
554
  return React__default.createElement(
548
555
  React__default.Fragment,
@@ -1001,20 +1008,7 @@ var Article = function Article(props) {
1001
1008
  )
1002
1009
  ),
1003
1010
  React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
1004
- showRelatedArticles && !showIsi && React__default.createElement(
1005
- React__default.Fragment,
1006
- null,
1007
- React__default.createElement(
1008
- 'div',
1009
- null,
1010
- React__default.createElement(RelevantTopics, null)
1011
- ),
1012
- React__default.createElement(
1013
- 'div',
1014
- { className: 'pt-2' },
1015
- React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
1016
- )
1017
- )
1011
+ showRelatedArticles && !showIsi && React__default.createElement(RelatedContent, null)
1018
1012
  ),
1019
1013
  renderIsiContent(props.article)
1020
1014
  ),
@@ -1179,50 +1173,77 @@ var ArticleQueue = function ArticleQueue(props) {
1179
1173
  }, 1000);
1180
1174
  }, [queueData.length]);
1181
1175
 
1182
- var loadmore = function loadmore() {
1183
- var query = props.relatedArticleQuery;
1184
- var params = props.params;
1185
- if (queueData && queueData.length < maxListLength) {
1186
- params.index = queueData.length - 1;
1187
- props.client.fetch(query, params).then(function () {
1188
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(article) {
1189
- var startingIndex, endingIndex, targeting;
1190
- return regenerator.wrap(function _callee$(_context) {
1191
- while (1) {
1192
- switch (_context.prev = _context.next) {
1193
- case 0:
1194
- if (!(article && article._id)) {
1195
- _context.next = 9;
1196
- break;
1197
- }
1198
-
1199
- //query next 4 related article without repeating previous 4 related articles
1200
- startingIndex = queueData.length + 1;
1201
- endingIndex = startingIndex + 2;
1202
- _context.next = 5;
1203
- return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
1204
-
1205
- case 5:
1206
- article.relatedArticle = _context.sent;
1207
- targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1208
-
1209
- article.Ads = Ads.getRightItems(targeting);
1210
- setQueueData([].concat(_toConsumableArray(queueData), [article]));
1211
-
1212
- case 9:
1213
- case 'end':
1214
- return _context.stop();
1176
+ var loadmore = function () {
1177
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
1178
+ var index, article, startingIndex, endingIndex, targeting;
1179
+ return regenerator.wrap(function _callee$(_context) {
1180
+ while (1) {
1181
+ switch (_context.prev = _context.next) {
1182
+ case 0:
1183
+ if (!(queueData && queueData.length < maxListLength)) {
1184
+ _context.next = 27;
1185
+ break;
1215
1186
  }
1216
- }
1217
- }, _callee, _this);
1218
- }));
1219
1187
 
1220
- return function (_x) {
1221
- return _ref.apply(this, arguments);
1222
- };
1223
- }());
1224
- }
1225
- };
1188
+ index = queueData.length - 1;
1189
+ article = null;
1190
+ _context.prev = 3;
1191
+ _context.next = 6;
1192
+ return getRelatedArticle(null, props.client, props.article, prevUrl, index);
1193
+
1194
+ case 6:
1195
+ article = _context.sent;
1196
+ _context.next = 12;
1197
+ break;
1198
+
1199
+ case 9:
1200
+ _context.prev = 9;
1201
+ _context.t0 = _context['catch'](3);
1202
+
1203
+ console.error(_context.t0);
1204
+
1205
+ case 12:
1206
+ if (!(article && article._id)) {
1207
+ _context.next = 27;
1208
+ break;
1209
+ }
1210
+
1211
+ //query next 4 related article without repeating previous 4 related articles
1212
+ startingIndex = queueData.length + 1;
1213
+ endingIndex = startingIndex + 2;
1214
+ _context.prev = 15;
1215
+ _context.next = 18;
1216
+ return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
1217
+
1218
+ case 18:
1219
+ article.relatedArticle = _context.sent;
1220
+ _context.next = 24;
1221
+ break;
1222
+
1223
+ case 21:
1224
+ _context.prev = 21;
1225
+ _context.t1 = _context['catch'](15);
1226
+
1227
+ console.error(_context.t1);
1228
+
1229
+ case 24:
1230
+ targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1231
+
1232
+ article.Ads = Ads.getRightItems(targeting);
1233
+ setQueueData([].concat(_toConsumableArray(queueData), [article]));
1234
+
1235
+ case 27:
1236
+ case 'end':
1237
+ return _context.stop();
1238
+ }
1239
+ }
1240
+ }, _callee, _this, [[3, 9], [15, 21]]);
1241
+ }));
1242
+
1243
+ return function loadmore() {
1244
+ return _ref.apply(this, arguments);
1245
+ };
1246
+ }();
1226
1247
 
1227
1248
  var changeMeta = function changeMeta(meta) {
1228
1249
  document.title = meta.shareTitle;
@@ -1294,74 +1315,6 @@ var ArticleQueue = function ArticleQueue(props) {
1294
1315
  );
1295
1316
  };
1296
1317
 
1297
- var Articles = function Articles(props) {
1298
- var _extends2;
1299
-
1300
- var videoAccountIDs = props.videoAccountIDs,
1301
- Ads = props.Ads,
1302
- cpModificationRequired = props.cpModificationRequired,
1303
- Settings = props.Settings,
1304
- ISIContent = props.ISIContent,
1305
- prevUrl = props.prevUrl,
1306
- setActiveArticle = props.setActiveArticle,
1307
- article = props.article,
1308
- client = props.client,
1309
- relatedArticleQuery = props.relatedArticleQuery,
1310
- Website = props.Website,
1311
- pageview = props.pageview,
1312
- shareOptions = props.shareOptions,
1313
- WAds = props.WAds,
1314
- regionalPages = props.regionalPages,
1315
- nationalPage = props.nationalPage,
1316
- canonicalTag = props.canonicalTag;
1317
- var taxonomyMapping = article.taxonomyMapping,
1318
- _article$url = article.url;
1319
- _article$url = _article$url === undefined ? {
1320
- current: null
1321
- } : _article$url;
1322
- var url = _article$url.current,
1323
- content_placement = article.content_placement;
1324
-
1325
-
1326
- var taxonomy = [];
1327
- content_placement.forEach(function (_ref2) {
1328
- var path = _ref2.path,
1329
- _id = _ref2._id;
1330
-
1331
- var prev_url_to_check = prevUrl;
1332
- if (prev_url_to_check.includes('?')) {
1333
- prev_url_to_check = prev_url_to_check.split('?')[0];
1334
- }
1335
- if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
1336
- });
1337
-
1338
- if (taxonomy.length === 0) {
1339
- taxonomy = taxonomyMapping.map(function (_ref3) {
1340
- var _ref = _ref3._ref;
1341
- return _ref;
1342
- });
1343
- }
1344
-
1345
- var params = {
1346
- url: url,
1347
- taxonomy: taxonomy,
1348
- index: 0
1349
- };
1350
-
1351
- return React__default.createElement(ArticleQueue, _extends((_extends2 = {
1352
- client: client,
1353
- params: params,
1354
- relatedArticleQuery: relatedArticleQuery,
1355
- website: Website,
1356
- checkSponsered: true,
1357
- pageview: pageview,
1358
- shareOptions: shareOptions,
1359
- Ads: WAds,
1360
- regionalPages: regionalPages,
1361
- nationalPage: nationalPage
1362
- }, _defineProperty(_extends2, 'pageview', pageview), _defineProperty(_extends2, 'onVote', function onVote() {}), _defineProperty(_extends2, 'ISIContent', ISIContent), _defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), _defineProperty(_extends2, 'sponsoredTaxonomies', []), _defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), _defineProperty(_extends2, 'Settings', Settings), _defineProperty(_extends2, 'canonicalTag', canonicalTag), _extends2), props));
1363
- };
1364
-
1365
1318
  var _this$1 = undefined;
1366
1319
 
1367
1320
  var View = function View(props) {
@@ -1540,7 +1493,15 @@ var View = function View(props) {
1540
1493
  props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
1541
1494
  )
1542
1495
  ),
1543
- !needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles, canonicalTag: canonicalTag }, props))
1496
+ !needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(ArticleQueue, _extends({
1497
+ infiniteScroll: true,
1498
+ showRelatedArticles: showRelatedArticles,
1499
+ canonicalTag: canonicalTag,
1500
+ checkSponsered: true,
1501
+ Ads: props.WAds,
1502
+ onVote: function onVote() {},
1503
+ sponsoredTaxonomies: []
1504
+ }, props))
1544
1505
  );
1545
1506
  };
1546
1507
 
@@ -1342,4 +1342,4 @@ exports.default = function (fn) {
1342
1342
 
1343
1343
  var _asyncToGenerator = unwrapExports(asyncToGenerator);
1344
1344
 
1345
- export { _asyncToGenerator as _, _Promise as a, regenerator as r };
1345
+ export { _Promise as _, _asyncToGenerator as a, regenerator as r };
@@ -1,4 +1,4 @@
1
- import { _ as _root, d as isSymbol_1, e as isObject_1 } from './isSymbol-5eb15258.js';
1
+ import { _ as _root, i as isSymbol_1, a as isObject_1 } from './isSymbol-807e927e.js';
2
2
 
3
3
  /**
4
4
  * Gets the timestamp of the number of milliseconds that have elapsed since
@@ -1,4 +1,4 @@
1
- import { d as isSymbol_1, e as isObject_1, b as _baseGetTag, _ as _root, a as _Symbol } from './isSymbol-5eb15258.js';
1
+ import { i as isSymbol_1, a as isObject_1, b as _baseGetTag, _ as _root, c as _Symbol } from './isSymbol-807e927e.js';
2
2
 
3
3
  /**
4
4
  * Checks if `value` is classified as an `Array` object.
@@ -987,4 +987,4 @@ function get(object, path, defaultValue) {
987
987
 
988
988
  var get_1 = get;
989
989
 
990
- export { _getNative as _, _toSource as a, _Map as b, get_1 as g };
990
+ export { get_1 as g };
@@ -8,9 +8,9 @@ var getQuery = function getQuery(type) {
8
8
 
9
9
  switch (type) {
10
10
  case 'related':
11
- return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
11
+ return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n ' + conditions + '\n && !defined(body[].videos)\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
12
12
  case 'article':
13
- return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
13
+ return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
14
14
  case 'publication':
15
15
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
16
16
  case 'issue':
@@ -5,7 +5,7 @@ import './_library-528f1934.js';
5
5
  import './_iter-detect-59409a32.js';
6
6
  import './core.get-iterator-method-54d2e411.js';
7
7
  import './web.dom.iterable-8956f9a5.js';
8
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-d0f08f8d.js';
8
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
9
9
  import './_set-species-cede29f8.js';
10
10
  import { c as cookie } from './index-db3bb315.js';
11
11
  import getQuery from './getQuery.js';
@@ -362,28 +362,33 @@ var dist_3 = dist.parseCookies;
362
362
  var _this = undefined;
363
363
 
364
364
  var getRelatedArticle = function () {
365
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
365
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
366
366
  var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
367
367
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
368
368
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
369
369
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
370
370
  var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
371
371
 
372
- var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
372
+ var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, articles, filters, cookies, prevSlugs, referenceFilter, query;
373
373
 
374
374
  return regenerator.wrap(function _callee$(_context) {
375
375
  while (1) {
376
376
  switch (_context.prev = _context.next) {
377
377
  case 0:
378
- taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
378
+ _article$url = article.url;
379
379
  _article$url = _article$url === undefined ? {
380
380
  current: null
381
381
  } : _article$url;
382
- url = _article$url.current, content_placement = article.content_placement;
383
- taxonomy = [];
384
- //404 articles were throwing server error
382
+ url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
383
+ content_placement = article.content_placement;
384
+ references = [];
385
385
 
386
- if (content_placement) {
386
+
387
+ content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
388
+ var identifier = _ref2.identifier;
389
+ return identifier !== 'news';
390
+ });
391
+ if (content_placement && content_placement.length > 0) {
387
392
  content_placement.forEach(function (_ref3) {
388
393
  var path = _ref3.path,
389
394
  _id = _ref3._id;
@@ -395,27 +400,38 @@ var getRelatedArticle = function () {
395
400
  if (prev_url_to_check.includes('?')) {
396
401
  prev_url_to_check = prev_url_to_check.split('?')[0];
397
402
  }
398
- if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
403
+ if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
399
404
  });
405
+ if (references.length === 0) {
406
+ content_placement.forEach(function (_ref4) {
407
+ var _id = _ref4._id;
408
+
409
+ if (_id) references.push(_id);
410
+ });
411
+ }
400
412
  }
401
413
 
402
- //404 articles were throwing server error
403
- if (taxonomy.length === 0 && taxonomyMapping) {
404
- taxonomyMapping.forEach(function (_ref4) {
405
- var _ref = _ref4._ref;
414
+ if (documentGroupMapping && documentGroupMapping.length > 0) {
415
+ documentGroupMapping.forEach(function (_ref5) {
416
+ var _id = _ref5._id;
406
417
 
407
- if (_ref) {
408
- taxonomy.push(_ref);
409
- }
418
+ if (_id) references.push(_id);
410
419
  });
411
420
  }
412
421
 
413
- params = {
414
- url: url,
415
- taxonomy: taxonomy,
416
- index: articleCount
417
- };
418
- conditions = '';
422
+ if (issueGroup && issueGroup._ref) {
423
+ references.push(issueGroup._ref);
424
+ }
425
+
426
+ params = { url: url, index: articleCount };
427
+ articles = null;
428
+
429
+ if (!(references && references.length > 0)) {
430
+ _context.next = 26;
431
+ break;
432
+ }
433
+
434
+ filters = '';
419
435
 
420
436
  if (ctx && url) {
421
437
  cookies = dist_3(ctx);
@@ -423,27 +439,54 @@ var getRelatedArticle = function () {
423
439
 
424
440
  if (!!prevSlugs) {
425
441
  dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
426
- conditions = '&& !(url.current in [' + prevSlugs + '])';
442
+ filters = '&& !(url.current in [' + prevSlugs + '])';
427
443
  } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
428
444
  }
429
- relatedArticleQuery = getQuery('related', conditions, '', articleCount);
430
- _context.next = 12;
431
- return client.fetch(relatedArticleQuery, params);
432
-
433
- case 12:
434
- relatedArticle = _context.sent;
435
- return _context.abrupt('return', relatedArticle);
436
445
 
437
- case 14:
446
+ referenceFilter = references.reduce(function (acc, item, index, array) {
447
+ if (array.length === 1) {
448
+ acc = acc + ' references("' + item + '") ';
449
+ } else if (index === 0) {
450
+ acc = acc + ' (references("' + item + '") ||';
451
+ } else if (index + 1 === array.length) {
452
+ acc = acc + ' references("' + item + '")) ';
453
+ } else {
454
+ acc = acc + ' references("' + item + '") ||';
455
+ }
456
+ return acc;
457
+ }, '&&');
458
+
459
+
460
+ filters = filters + referenceFilter;
461
+ query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
462
+ _context.prev = 17;
463
+ _context.next = 20;
464
+ return client.fetch(query, params);
465
+
466
+ case 20:
467
+ articles = _context.sent;
468
+ _context.next = 26;
469
+ break;
470
+
471
+ case 23:
472
+ _context.prev = 23;
473
+ _context.t0 = _context['catch'](17);
474
+
475
+ console.error(_context.t0);
476
+
477
+ case 26:
478
+ return _context.abrupt('return', articles);
479
+
480
+ case 27:
438
481
  case 'end':
439
482
  return _context.stop();
440
483
  }
441
484
  }
442
- }, _callee, _this);
485
+ }, _callee, _this, [[17, 23]]);
443
486
  }));
444
487
 
445
488
  return function getRelatedArticle() {
446
- return _ref2.apply(this, arguments);
489
+ return _ref.apply(this, arguments);
447
490
  };
448
491
  }();
449
492