@mjhls/mjh-framework 1.0.691-beta.9 → 1.0.692

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 (154) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD.js +1 -1
  3. package/dist/cjs/AD300x250.js +3 -3
  4. package/dist/cjs/AD300x250x600.js +3 -3
  5. package/dist/cjs/AD728x90.js +4 -4
  6. package/dist/cjs/ADFloatingFooter.js +2 -2
  7. package/dist/cjs/ADGutter.js +5 -8
  8. package/dist/cjs/{ADInfeed-59543270.js → ADInfeed-3410ab3c.js} +3 -6
  9. package/dist/cjs/ADSkyscraper.js +5 -8
  10. package/dist/cjs/ADSponsoredResources.js +5 -8
  11. package/dist/cjs/ADWebcast.js +5 -8
  12. package/dist/cjs/ADWelcome.js +2 -2
  13. package/dist/cjs/{ADlgInfeed-0a1546ae.js → ADlgInfeed-845aac15.js} +3 -6
  14. package/dist/cjs/AccordionPanel.js +1 -1
  15. package/dist/cjs/AdSlot.js +4 -4
  16. package/dist/cjs/AdSlotsProvider.js +2 -23
  17. package/dist/cjs/ArticleCarousel.js +1 -1
  18. package/dist/cjs/ArticleSeriesListing.js +28 -7
  19. package/dist/cjs/Auth.js +306 -455
  20. package/dist/cjs/{BlockContent-80b15fac.js → BlockContent-88f69acd.js} +1 -1
  21. package/dist/cjs/BrowseVideosListing.js +1 -1
  22. package/dist/cjs/CMEDeck.js +5 -5
  23. package/dist/cjs/Column3.js +4 -4
  24. package/dist/cjs/ConferenceArticleCard.js +2 -2
  25. package/dist/cjs/DeckContent.js +8 -10
  26. package/dist/cjs/DeckQueue.js +6 -6
  27. package/dist/cjs/{Dfp-390337bf.js → Dfp-b2bc3b97.js} +1 -1
  28. package/dist/cjs/EventsDeck.js +4 -4
  29. package/dist/cjs/ExternalResources.js +9 -7
  30. package/dist/cjs/Feature.js +3 -3
  31. package/dist/cjs/ForbesHero.js +2 -2
  32. package/dist/cjs/GridContent.js +13 -17
  33. package/dist/cjs/GridHero.js +2 -2
  34. package/dist/cjs/GroupDeck.js +1 -1
  35. package/dist/cjs/HamMagazine.js +5 -5
  36. package/dist/cjs/Hero.js +1 -1
  37. package/dist/cjs/HorizontalHero.js +2 -2
  38. package/dist/cjs/IssueContentDeck.js +2 -2
  39. package/dist/cjs/IssueDeck.js +2 -2
  40. package/dist/cjs/IssueLanding.js +8 -8
  41. package/dist/cjs/LeftNav.js +2 -2
  42. package/dist/cjs/MasterDeck.js +10 -14
  43. package/dist/cjs/NavMagazine.js +5 -5
  44. package/dist/cjs/NavNative.js +4 -4
  45. package/dist/cjs/OncliveHero.js +2 -2
  46. package/dist/cjs/OncliveLargeHero.js +2 -2
  47. package/dist/cjs/PartnerDetailListing.js +12 -10
  48. package/dist/cjs/PublicationDeck.js +2 -2
  49. package/dist/cjs/QueueDeckExpanded.js +12 -16
  50. package/dist/cjs/RecentNews.js +2 -2
  51. package/dist/cjs/RelatedContent.js +2 -2
  52. package/dist/cjs/{SocialSearchComponent-56d49a1a.js → SocialSearchComponent-6b5e5b47.js} +5 -5
  53. package/dist/cjs/TaxonomyCard.js +2 -2
  54. package/dist/cjs/TemplateNormal.js +4 -4
  55. package/dist/cjs/ThumbnailCard.js +1 -1
  56. package/dist/cjs/Ustream.js +3 -3
  57. package/dist/cjs/VerticalHero.js +2 -2
  58. package/dist/cjs/VideoSeriesCard.js +2 -2
  59. package/dist/cjs/VideoSeriesListing.js +38 -7
  60. package/dist/cjs/View.js +21 -22
  61. package/dist/cjs/YahooHero.js +2 -2
  62. package/dist/cjs/YoutubeGroup.js +1 -1
  63. package/dist/cjs/getRelatedArticle.js +416 -5
  64. package/dist/cjs/getSerializers.js +8 -6
  65. package/dist/cjs/{index-099d45ae.js → index-2d0a4911.js} +4 -6
  66. package/dist/cjs/{index-bc377510.js → index-59436c13.js} +116 -75
  67. package/dist/cjs/{index-3294d3bc.js → index-5be2866f.js} +1 -1
  68. package/dist/cjs/{index-39beccb3.js → index-b5eb3ff8.js} +18 -18
  69. package/dist/cjs/index-bd6c9f56.js +211 -0
  70. package/dist/cjs/{index.es-9110add6.js → index.es-ab3f2690.js} +3 -1
  71. package/dist/cjs/{index.esm-876ca9ff.js → index.esm-90433435.js} +5 -0
  72. package/dist/cjs/index.js +16 -16
  73. package/dist/cjs/{lodash-7fd85bcf.js → lodash-fc2922d0.js} +22 -71
  74. package/dist/cjs/{main-03ffa84c.js → main-b6c96c8d.js} +67 -37
  75. package/dist/cjs/{moment-575fe24c.js → moment-66a6a284.js} +1 -1
  76. package/dist/cjs/timeDifferenceCalc.js +1 -1
  77. package/dist/cjs/urlFor.js +1 -1
  78. package/dist/esm/AD.js +1 -1
  79. package/dist/esm/AD300x250.js +3 -3
  80. package/dist/esm/AD300x250x600.js +3 -3
  81. package/dist/esm/AD728x90.js +4 -4
  82. package/dist/esm/ADFloatingFooter.js +2 -2
  83. package/dist/esm/ADGutter.js +5 -8
  84. package/dist/esm/{ADInfeed-a15fb981.js → ADInfeed-205cb7a9.js} +3 -6
  85. package/dist/esm/ADSkyscraper.js +5 -8
  86. package/dist/esm/ADSponsoredResources.js +5 -8
  87. package/dist/esm/ADWebcast.js +5 -8
  88. package/dist/esm/ADWelcome.js +2 -2
  89. package/dist/esm/{ADlgInfeed-33c8a066.js → ADlgInfeed-e538f17a.js} +3 -6
  90. package/dist/esm/AccordionPanel.js +1 -1
  91. package/dist/esm/AdSlot.js +4 -4
  92. package/dist/esm/AdSlotsProvider.js +3 -24
  93. package/dist/esm/ArticleCarousel.js +1 -1
  94. package/dist/esm/ArticleSeriesListing.js +28 -7
  95. package/dist/esm/Auth.js +301 -450
  96. package/dist/esm/{BlockContent-c409aca5.js → BlockContent-a614acdf.js} +1 -1
  97. package/dist/esm/BrowseVideosListing.js +1 -1
  98. package/dist/esm/CMEDeck.js +5 -5
  99. package/dist/esm/Column3.js +4 -4
  100. package/dist/esm/ConferenceArticleCard.js +2 -2
  101. package/dist/esm/DeckContent.js +8 -10
  102. package/dist/esm/DeckQueue.js +6 -6
  103. package/dist/esm/{Dfp-741c01be.js → Dfp-8a8fca18.js} +1 -1
  104. package/dist/esm/EventsDeck.js +4 -4
  105. package/dist/esm/ExternalResources.js +9 -7
  106. package/dist/esm/Feature.js +3 -3
  107. package/dist/esm/ForbesHero.js +2 -2
  108. package/dist/esm/GridContent.js +13 -17
  109. package/dist/esm/GridHero.js +2 -2
  110. package/dist/esm/GroupDeck.js +1 -1
  111. package/dist/esm/HamMagazine.js +5 -5
  112. package/dist/esm/Hero.js +1 -1
  113. package/dist/esm/HorizontalHero.js +2 -2
  114. package/dist/esm/IssueContentDeck.js +2 -2
  115. package/dist/esm/IssueDeck.js +2 -2
  116. package/dist/esm/IssueLanding.js +8 -8
  117. package/dist/esm/LeftNav.js +2 -2
  118. package/dist/esm/MasterDeck.js +10 -14
  119. package/dist/esm/NavMagazine.js +5 -5
  120. package/dist/esm/NavNative.js +4 -4
  121. package/dist/esm/OncliveHero.js +2 -2
  122. package/dist/esm/OncliveLargeHero.js +2 -2
  123. package/dist/esm/PartnerDetailListing.js +12 -10
  124. package/dist/esm/PublicationDeck.js +2 -2
  125. package/dist/esm/QueueDeckExpanded.js +12 -16
  126. package/dist/esm/RecentNews.js +2 -2
  127. package/dist/esm/RelatedContent.js +2 -2
  128. package/dist/esm/{SocialSearchComponent-677ed3bd.js → SocialSearchComponent-7f14e0f3.js} +5 -5
  129. package/dist/esm/TaxonomyCard.js +2 -2
  130. package/dist/esm/TemplateNormal.js +4 -4
  131. package/dist/esm/ThumbnailCard.js +1 -1
  132. package/dist/esm/Ustream.js +3 -3
  133. package/dist/esm/VerticalHero.js +2 -2
  134. package/dist/esm/VideoSeriesCard.js +2 -2
  135. package/dist/esm/VideoSeriesListing.js +38 -7
  136. package/dist/esm/View.js +21 -22
  137. package/dist/esm/YahooHero.js +2 -2
  138. package/dist/esm/YoutubeGroup.js +1 -1
  139. package/dist/esm/getRelatedArticle.js +416 -5
  140. package/dist/esm/getSerializers.js +8 -6
  141. package/dist/esm/{index-3849e3fe.js → index-51a80699.js} +18 -18
  142. package/dist/esm/{index-3f4dd6f2.js → index-93ec3c59.js} +4 -6
  143. package/dist/esm/{index-d1920c2d.js → index-a2e78632.js} +117 -76
  144. package/dist/esm/{index-ef6d5dcf.js → index-d2f90501.js} +1 -1
  145. package/dist/esm/index-db3bb315.js +207 -0
  146. package/dist/esm/{index.es-29c1cef5.js → index.es-938a3a58.js} +3 -1
  147. package/dist/esm/{index.esm-85cb09e6.js → index.esm-29e48d38.js} +5 -1
  148. package/dist/esm/index.js +15 -15
  149. package/dist/esm/{lodash-ec8c6b48.js → lodash-17fdfebb.js} +22 -71
  150. package/dist/esm/{main-35ff7b4f.js → main-0465b2a0.js} +65 -34
  151. package/dist/esm/{moment-e2f9b20c.js → moment-12415288.js} +1 -1
  152. package/dist/esm/timeDifferenceCalc.js +1 -1
  153. package/dist/esm/urlFor.js +1 -1
  154. package/package.json +3 -3
@@ -58,35 +58,35 @@ function parseSource(source) {
58
58
  if (typeof source === 'string' && isUrl(source)) {
59
59
  // Someone passed an existing image url?
60
60
  image = {
61
- asset: { _ref: urlToId(source) }
61
+ asset: { _ref: urlToId(source) },
62
62
  };
63
63
  }
64
64
  else if (typeof source === 'string') {
65
65
  // Just an asset id
66
66
  image = {
67
- asset: { _ref: source }
67
+ asset: { _ref: source },
68
68
  };
69
69
  }
70
70
  else if (isRef(source)) {
71
71
  // We just got passed an asset directly
72
72
  image = {
73
- asset: source
73
+ asset: source,
74
74
  };
75
75
  }
76
76
  else if (isAsset(source)) {
77
77
  // If we were passed an image asset document
78
78
  image = {
79
79
  asset: {
80
- _ref: source._id || ''
81
- }
80
+ _ref: source._id || '',
81
+ },
82
82
  };
83
83
  }
84
84
  else if (isAssetStub(source)) {
85
85
  // If we were passed a partial asset (`url`, but no `_id`)
86
86
  image = {
87
87
  asset: {
88
- _ref: urlToId(source.asset.url)
89
- }
88
+ _ref: urlToId(source.asset.url),
89
+ },
90
90
  };
91
91
  }
92
92
  else if (typeof source.asset === 'object') {
@@ -127,7 +127,7 @@ function applyDefaults(image) {
127
127
  left: 0,
128
128
  top: 0,
129
129
  bottom: 0,
130
- right: 0
130
+ right: 0,
131
131
  };
132
132
  }
133
133
  if (!result.hotspot) {
@@ -135,7 +135,7 @@ function applyDefaults(image) {
135
135
  x: 0.5,
136
136
  y: 0.5,
137
137
  height: 1.0,
138
- width: 1.0
138
+ width: 1.0,
139
139
  };
140
140
  }
141
141
  return result;
@@ -182,7 +182,7 @@ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
182
182
  ['crop', 'crop'],
183
183
  ['saturation', 'sat'],
184
184
  ['auto', 'auto'],
185
- ['dpr', 'dpr']
185
+ ['dpr', 'dpr'],
186
186
  ];
187
187
  function urlForImage(options) {
188
188
  var spec = __assign({}, (options || {}));
@@ -201,7 +201,7 @@ function urlForImage(options) {
201
201
  left: cropLeft,
202
202
  top: cropTop,
203
203
  width: Math.round(asset.width - image.crop.right * asset.width - cropLeft),
204
- height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop)
204
+ height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop),
205
205
  };
206
206
  // Compute hot spot rect in terms of pixel coordinates
207
207
  var hotSpotVerticalRadius = (image.hotspot.height * asset.height) / 2;
@@ -212,7 +212,7 @@ function urlForImage(options) {
212
212
  left: hotSpotCenterX - hotSpotHorizontalRadius,
213
213
  top: hotSpotCenterY - hotSpotVerticalRadius,
214
214
  right: hotSpotCenterX + hotSpotHorizontalRadius,
215
- bottom: hotSpotCenterY + hotSpotVerticalRadius
215
+ bottom: hotSpotCenterY + hotSpotVerticalRadius,
216
216
  };
217
217
  // If irrelevant, or if we are requested to: don't perform crop/fit based on
218
218
  // the crop/hotspot.
@@ -294,7 +294,7 @@ function fit(source, spec) {
294
294
  left: Math.round(left),
295
295
  top: Math.round(top_2),
296
296
  width: Math.round(width),
297
- height: Math.round(height)
297
+ height: Math.round(height),
298
298
  };
299
299
  }
300
300
  else {
@@ -316,13 +316,13 @@ function fit(source, spec) {
316
316
  left: Math.max(0, Math.floor(left)),
317
317
  top: Math.max(0, Math.floor(top_3)),
318
318
  width: Math.round(width),
319
- height: Math.round(height)
319
+ height: Math.round(height),
320
320
  };
321
321
  }
322
322
  return {
323
323
  width: imgWidth,
324
324
  height: imgHeight,
325
- rect: cropRect
325
+ rect: cropRect,
326
326
  };
327
327
  }
328
328
 
@@ -380,7 +380,7 @@ function urlBuilder(options) {
380
380
  return new ImageUrlBuilder(null, {
381
381
  baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
382
382
  projectId: projectId,
383
- dataset: dataset
383
+ dataset: dataset,
384
384
  });
385
385
  }
386
386
  // Or just accept the options as given
@@ -393,7 +393,7 @@ var ImageUrlBuilder = /** @class */ (function () {
393
393
  ? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
394
394
  }
395
395
  ImageUrlBuilder.prototype.withOptions = function (options) {
396
- var baseUrl = options.baseUrl || '';
396
+ var baseUrl = options.baseUrl || this.options.baseUrl;
397
397
  var newOptions = { baseUrl: baseUrl };
398
398
  for (var key in options) {
399
399
  if (options.hasOwnProperty(key)) {
@@ -521,7 +521,7 @@ var ImageUrlBuilder = /** @class */ (function () {
521
521
  ImageUrlBuilder.prototype.url = function () {
522
522
  return urlForImage_1$1.default(this.options);
523
523
  };
524
- // Synonym for url()
524
+ // Alias for url()
525
525
  ImageUrlBuilder.prototype.toString = function () {
526
526
  return this.url();
527
527
  };
@@ -821,15 +821,13 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
821
821
  });
822
822
 
823
823
  if (_this5.lazyLoadIsEnabled()) {
824
- var args = [];
825
-
826
824
  var config = _this5.getLazyLoadConfig();
827
825
 
828
- if (config !== null) {
829
- args.push(config);
826
+ if (config) {
827
+ pubadsService.enableLazyLoad(config);
828
+ } else {
829
+ pubadsService.enableLazyLoad();
830
830
  }
831
-
832
- pubadsService.enableLazyLoad.call(args);
833
831
  }
834
832
 
835
833
  if (_this5.singleRequestIsEnabled()) {
@@ -3,25 +3,26 @@ import { a as _Array$from, _ as _toConsumableArray } from './toConsumableArray-7
3
3
  import { _ as _extends } from './extends-cc5da797.js';
4
4
  import { _ as _inherits$1, a as _classCallCheck$1, b as _possibleConstructorReturn$1, c as _Object$getPrototypeOf, d as _createClass$1 } from './inherits-7ee3e0c1.js';
5
5
  import { _ as _typeof$1 } from './typeof-08f2c380.js';
6
- import React__default, { useState, useEffect, useRef, useCallback } from 'react';
7
- import { l as lib_3 } from './index-3f4dd6f2.js';
6
+ import React__default, { useState, useEffect, useRef, useLayoutEffect, useCallback } from 'react';
7
+ import { l as lib_3 } from './index-93ec3c59.js';
8
8
  import PropTypes from 'prop-types';
9
9
  import Row from 'react-bootstrap/Row';
10
10
  import Col from 'react-bootstrap/Col';
11
- import { m as moment } from './moment-e2f9b20c.js';
11
+ import { m as moment } from './moment-12415288.js';
12
12
  import Router, { useRouter } from 'next/router';
13
- import { i as imageUrlBuilder } from './index-3849e3fe.js';
13
+ import { i as imageUrlBuilder } from './index-51a80699.js';
14
14
  import { L as LazyLoad } from './index-5f9f807a.js';
15
- import { b as main_16, d as main_35, m as main_36 } from './main-35ff7b4f.js';
15
+ import { b as main_16, c as main_38, m as main_39 } from './main-0465b2a0.js';
16
16
  import { h as html_decode_1 } from './entities-7cc3bf45.js';
17
17
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
18
18
  import Segment from './Segment.js';
19
19
  import Beam from './Beam.js';
20
20
  import DFPAdSlot from './AdSlot.js';
21
- import { B as BlockContent } from './BlockContent-c409aca5.js';
21
+ import { B as BlockContent } from './BlockContent-a614acdf.js';
22
22
  import { g as getYoutubeId } from './smoothscroll-4b699764.js';
23
23
  import GroupDeck from './GroupDeck.js';
24
24
  import { Carousel, Table, Figure as Figure$1, Button, ProgressBar, Card, Row as Row$1, Col as Col$1 } from 'react-bootstrap';
25
+ import { d as IoIosArrowDropupCircle } from './index.esm-29e48d38.js';
25
26
  import Button$1 from 'react-bootstrap/Button';
26
27
  import { u as util } from './util-7700fc59.js';
27
28
  import { R as ReactPlayerLoader } from './brightcove-react-player-loader.es-83f53e4e.js';
@@ -7498,7 +7499,7 @@ var Poll = function Poll(_ref) {
7498
7499
  );
7499
7500
  };
7500
7501
 
7501
- var numberOfPaginations = main_35 ? 4 : 10;
7502
+ var numberOfPaginations = main_38 ? 4 : 10;
7502
7503
 
7503
7504
  var Quiz = function Quiz(_ref) {
7504
7505
  var quizzes = _ref.quizzes,
@@ -7611,7 +7612,7 @@ var Quiz = function Quiz(_ref) {
7611
7612
  var renderPagination = function renderPagination() {
7612
7613
  return React__default.createElement(
7613
7614
  Pagination,
7614
- { className: 'p-0 m-0', size: main_35 && 'sm' },
7615
+ { className: 'p-0 m-0', size: main_38 && 'sm' },
7615
7616
  React__default.createElement(Pagination.First, { onClick: function onClick() {
7616
7617
  return changePage('first');
7617
7618
  }, disabled: currentPage === 1 }),
@@ -8019,6 +8020,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8019
8020
  return null;
8020
8021
  }
8021
8022
  nodes.seriesTitle = !nodes.seriesTitle ? 'Learning Objectives' : nodes.seriesTitle;
8023
+ var today = moment().utc().format();
8022
8024
 
8023
8025
  var authorPrefix = 'authors';
8024
8026
  var builder = imageUrlBuilder(client);
@@ -8029,28 +8031,38 @@ var ArticleSeries = function ArticleSeries(_ref) {
8029
8031
 
8030
8032
  var refArray = useRef([]);
8031
8033
  var adRefArray = useRef([]);
8034
+ var articleContainerRef = useRef(null);
8035
+ var arrowRef = useRef(null);
8032
8036
 
8033
- var _ref2 = main_36 ? useState(100) : useState(-25),
8034
- _ref3 = _slicedToArray(_ref2, 2),
8035
- NavoffsetTop = _ref3[0],
8036
- setNavoffsetTop = _ref3[1];
8037
+ var _useState = useState(0),
8038
+ _useState2 = _slicedToArray(_useState, 2),
8039
+ contentWidth = _useState2[0],
8040
+ setContentWidth = _useState2[1];
8041
+
8042
+ var upArrowClicked = false;
8043
+
8044
+ var Articles = nodes.articles.filter(function (article) {
8045
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && today >= article.published) {
8046
+ return article;
8047
+ }
8048
+ });
8037
8049
 
8038
8050
  var PrevNextCards = function PrevNextCards(show, articleNum) {
8039
8051
  var articles = [];
8040
8052
  if (articleNum >= 0) {
8041
8053
  if (articleNum == 0) {
8042
- articles.push(nodes.articles[1]);
8043
- } else if (articleNum == nodes.articles.length - 1) {
8044
- articles.push(nodes.articles[articleNum - 1]);
8054
+ articles.push(Articles[1]);
8055
+ } else if (articleNum == Articles.length - 1) {
8056
+ articles.push(Articles[articleNum - 1]);
8045
8057
  } else {
8046
- articles.push(nodes.articles[articleNum - 1]);
8047
- articles.push(nodes.articles[articleNum + 1]);
8058
+ articles.push(Articles[articleNum - 1]);
8059
+ articles.push(Articles[articleNum + 1]);
8048
8060
  }
8049
8061
  } else {
8050
- articles = [].concat(_toConsumableArray(nodes.articles));
8062
+ articles = [].concat(_toConsumableArray(Articles));
8051
8063
  }
8052
8064
  return articles.map(function (article, index) {
8053
- if (!article) return null;
8065
+ if (!article || !article.is_visible && article.hasOwnProperty('is_visible') || today < article.published) return null;
8054
8066
  var showReading = show ? 'showReading' : '';
8055
8067
  var articleLabel = articles.length == 1 && articleNum != 0 || articles.length > 1 && index == 0 ? 'Previous' : 'Next';
8056
8068
  return React__default.createElement(
@@ -8090,35 +8102,35 @@ var ArticleSeries = function ArticleSeries(_ref) {
8090
8102
  });
8091
8103
  };
8092
8104
 
8093
- var _ref4 = router && router.asPath && router.asPath.split('?')[1] ? useState(router.asPath.split('=')[1]) : useState(null),
8094
- _ref5 = _slicedToArray(_ref4, 2),
8095
- selectedArticle = _ref5[0],
8096
- setSelectedArticle = _ref5[1];
8097
-
8098
- var _useState = useState(false),
8099
- _useState2 = _slicedToArray(_useState, 2),
8100
- firstLoad = _useState2[0],
8101
- setFirstLoad = _useState2[1];
8105
+ var _ref2 = router && router.asPath && router.asPath.split('?')[1] ? useState(router.asPath.split('=')[1]) : useState(null),
8106
+ _ref3 = _slicedToArray(_ref2, 2),
8107
+ selectedArticle = _ref3[0],
8108
+ setSelectedArticle = _ref3[1];
8102
8109
 
8103
- var _useState3 = useState(null),
8110
+ var _useState3 = useState(false),
8104
8111
  _useState4 = _slicedToArray(_useState3, 2),
8105
- currentURL = _useState4[0],
8106
- setCurrentURL = _useState4[1];
8112
+ firstLoad = _useState4[0],
8113
+ setFirstLoad = _useState4[1];
8107
8114
 
8108
8115
  var _useState5 = useState(null),
8109
8116
  _useState6 = _slicedToArray(_useState5, 2),
8110
- currentTitle = _useState6[0],
8111
- setCurrentTitle = _useState6[1];
8117
+ currentURL = _useState6[0],
8118
+ setCurrentURL = _useState6[1];
8112
8119
 
8113
8120
  var _useState7 = useState(null),
8114
8121
  _useState8 = _slicedToArray(_useState7, 2),
8115
- currentSummary = _useState8[0],
8116
- setCurrentSummary = _useState8[1];
8122
+ currentTitle = _useState8[0],
8123
+ setCurrentTitle = _useState8[1];
8117
8124
 
8118
8125
  var _useState9 = useState(null),
8119
8126
  _useState10 = _slicedToArray(_useState9, 2),
8120
- currentThumbnail = _useState10[0],
8121
- setCurrentThumbnail = _useState10[1];
8127
+ currentSummary = _useState10[0],
8128
+ setCurrentSummary = _useState10[1];
8129
+
8130
+ var _useState11 = useState(null),
8131
+ _useState12 = _slicedToArray(_useState11, 2),
8132
+ currentThumbnail = _useState12[0],
8133
+ setCurrentThumbnail = _useState12[1];
8122
8134
 
8123
8135
  var articleCardClickHandler = function articleCardClickHandler(e) {
8124
8136
  e.preventDefault();
@@ -8126,15 +8138,6 @@ var ArticleSeries = function ArticleSeries(_ref) {
8126
8138
  setSelectedArticle(articleClicked);
8127
8139
  scrollToArticle(articleClicked);
8128
8140
  };
8129
-
8130
- useEffect(function () {
8131
- try {
8132
- if (main_36) {
8133
- setNavoffsetTop(document.getElementById('navbar-ham').offsetHeight - 15);
8134
- }
8135
- } catch (e) {}
8136
- }, []);
8137
-
8138
8141
  var scrollToArticle = function scrollToArticle(id) {
8139
8142
  var localArticleID = id ? id : selectedArticle;
8140
8143
  var findArticle = function findArticle(ref) {
@@ -8146,8 +8149,12 @@ var ArticleSeries = function ArticleSeries(_ref) {
8146
8149
  var indexOfRef = refArray.current.findIndex(findArticle);
8147
8150
 
8148
8151
  if (indexOfRef >= 0) {
8149
- //refArray.current[indexOfRef].wraperRef.current.scrollIntoView({ behavior: 'smooth' })
8150
- window.scrollTo({ top: refArray.current[indexOfRef].wraperRef.current.offsetTop - NavoffsetTop, behavior: 'smooth' });
8152
+ var newOffsetTop = !firstLoad ? refArray.current[indexOfRef].wraperRef.current.offsetTop : refArray.current[indexOfRef].wraperRef.current.offsetTop + document.getElementsByTagName('header')[0].clientHeight;
8153
+ console.dir(refArray.current[indexOfRef].wraperRef.current);
8154
+ console.log(document.getElementsByTagName('header')[0].clientHeight);
8155
+ console.log(refArray.current[indexOfRef].wraperRef.current.offsetTop);
8156
+ window.scrollTo({ top: newOffsetTop, behavior: 'smooth' });
8157
+ //refArray.current[indexOfRef].wraperRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' })
8151
8158
  }
8152
8159
  setFirstLoad(true);
8153
8160
  };
@@ -8195,13 +8202,24 @@ var ArticleSeries = function ArticleSeries(_ref) {
8195
8202
 
8196
8203
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
8197
8204
  var window = e.currentTarget;
8198
-
8199
8205
  if (preVscroll > window.scrollY) {
8200
8206
  isScrollDown = false;
8201
- } else if (preVscroll < window.scrollY) {
8207
+ if (window.scrollY > articleContainerRef.current.offsetTop) {
8208
+ arrowRef.current.classList.add('showArrow');
8209
+ arrowRef.current.classList.remove('hideArrow');
8210
+ }
8211
+ } else if (preVscroll > window.scrollY) {
8202
8212
  isScrollDown = true;
8203
8213
  }
8204
8214
  preVscroll = window.scrollY;
8215
+ setContentWidth(articleContainerRef.current.offsetWidth);
8216
+ if (preVscroll <= articleContainerRef.current.offsetTop) {
8217
+ arrowRef.current.classList.remove('showArrow');
8218
+ arrowRef.current.classList.add('hideArrow');
8219
+ }
8220
+ if (window.scrollY === 0 && upArrowClicked === true) {
8221
+ upArrowClicked = false;
8222
+ }
8205
8223
  };
8206
8224
 
8207
8225
  useEffect(function () {
@@ -8211,18 +8229,18 @@ var ArticleSeries = function ArticleSeries(_ref) {
8211
8229
  };
8212
8230
  });
8213
8231
 
8214
- useEffect(function () {
8232
+ useLayoutEffect(function () {
8233
+ console.log('useLayoutEffect');
8215
8234
  if (!firstLoad) {
8216
- if (main_36) {
8235
+ if (main_39) {
8217
8236
  grabLoadedAds();
8218
8237
  } else {
8219
8238
  scrollToArticle();
8220
8239
  }
8221
8240
  }
8222
- }, []);
8241
+ });
8223
8242
 
8224
8243
  var grabLoadedAds = function grabLoadedAds() {
8225
- console.dir(lib_3);
8226
8244
  lib_3.getGoogletag().then(function (googletag) {
8227
8245
  var checkIfReady = window.setInterval(function () {
8228
8246
  if (window.googletag && googletag.pubadsReady) {
@@ -8237,7 +8255,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8237
8255
  //const activeArticle = path
8238
8256
  //let targeting = getTargeting({ article: activeArticle, cpModificationRequired, position: props.position, prevUrl })
8239
8257
 
8240
- if (!main_36) {
8258
+ if (!main_39) {
8241
8259
  lib_3.getGoogletag().then(function (googletag) {
8242
8260
  if (window.googletag && googletag.pubadsReady) {
8243
8261
  lib_3.refresh();
@@ -8245,7 +8263,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8245
8263
  });
8246
8264
  }
8247
8265
  //Refresh leaderboard ad on mobile
8248
- if (main_36) {
8266
+ if (main_39) {
8249
8267
  var leaderboardSlotId = '';
8250
8268
  lib_3.getGoogletag().then(function (googletag) {
8251
8269
  if (window.googletag && googletag.pubadsReady) {
@@ -8255,9 +8273,26 @@ var ArticleSeries = function ArticleSeries(_ref) {
8255
8273
  }
8256
8274
  };
8257
8275
 
8276
+ var handleArrowClick = function handleArrowClick() {
8277
+ isScrollDown = true;
8278
+ upArrowClicked = true;
8279
+ arrowRef.current.classList.add('hideArrow');
8280
+ arrowRef.current.classList.remove('showArrow');
8281
+ window.scrollTo({ top: 0, behavior: 'smooth' });
8282
+ window.history.pushState({}, '', router.asPath.split('?')[0]);
8283
+ document.title = nodes.seriesTitle;
8284
+ };
8285
+
8258
8286
  return React__default.createElement(
8259
8287
  React__default.Fragment,
8260
8288
  null,
8289
+ React__default.createElement(
8290
+ 'div',
8291
+ { ref: arrowRef, className: 'scrollToTopArrow hideArrow', onClick: function onClick() {
8292
+ return handleArrowClick();
8293
+ } },
8294
+ React__default.createElement(IoIosArrowDropupCircle, null)
8295
+ ),
8261
8296
  React__default.createElement('hr', { className: 'article-seperater my-4' }),
8262
8297
  React__default.createElement(
8263
8298
  'div',
@@ -8277,7 +8312,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8277
8312
  React__default.createElement(
8278
8313
  'div',
8279
8314
  { className: 'ad-box', style: { textAlign: 'center' } },
8280
- main_36 && Ads.map(function (ad, index) {
8315
+ main_39 && Ads.map(function (ad, index) {
8281
8316
  if (index === 0) {
8282
8317
  return React__default.createElement(
8283
8318
  'div',
@@ -8301,8 +8336,8 @@ var ArticleSeries = function ArticleSeries(_ref) {
8301
8336
  ),
8302
8337
  React__default.createElement(
8303
8338
  'div',
8304
- { className: 'article-container', style: { marginBottom: '2rem' } },
8305
- nodes.articles.map(function (article, index) {
8339
+ { ref: articleContainerRef, className: 'article-container', style: { marginBottom: '2rem' } },
8340
+ Articles.map(function (article, index) {
8306
8341
  return React__default.createElement(
8307
8342
  'div',
8308
8343
  { key: article.title },
@@ -8317,8 +8352,10 @@ var ArticleSeries = function ArticleSeries(_ref) {
8317
8352
  return refArray.current[index] = ele;
8318
8353
  },
8319
8354
  onChange: function onChange(visible) {
8320
- if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
8321
- onChangeArticle(article.param.current, visible, article.title, article.summary, urlFor(article.thumbnail.asset).url());
8355
+ if (!upArrowClicked) {
8356
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
8357
+ onChangeArticle(article.param.current, visible, article.title, article.summary, urlFor(article.thumbnail.asset).url());
8358
+ }
8322
8359
  }
8323
8360
  } },
8324
8361
  React__default.createElement(
@@ -8373,26 +8410,30 @@ var ArticleSeries = function ArticleSeries(_ref) {
8373
8410
  }, client.config())),
8374
8411
  React__default.createElement('hr', { className: 'article-seperater my-4' })
8375
8412
  ),
8376
- React__default.createElement(
8377
- 'div',
8378
- { className: 'objective-prevNext-Wrapper' },
8379
- React__default.createElement(
8380
- 'h5',
8381
- { className: 'objective-title' },
8382
- nodes.seriesTitle
8383
- ),
8413
+ Articles.length > 1 && React__default.createElement(
8414
+ React__default.Fragment,
8415
+ null,
8384
8416
  React__default.createElement(
8385
8417
  'div',
8386
- { className: 'prevNextWrapper' },
8387
- PrevNextCards(true, index)
8388
- )
8389
- ),
8390
- React__default.createElement('hr', { className: 'article-seperater' })
8418
+ { className: 'objective-prevNext-Wrapper' },
8419
+ React__default.createElement(
8420
+ 'h5',
8421
+ { className: 'objective-title' },
8422
+ nodes.seriesTitle
8423
+ ),
8424
+ React__default.createElement(
8425
+ 'div',
8426
+ { className: 'prevNextWrapper' },
8427
+ PrevNextCards(true, index)
8428
+ )
8429
+ ),
8430
+ React__default.createElement('hr', { className: 'article-seperater' })
8431
+ )
8391
8432
  ),
8392
8433
  React__default.createElement(
8393
8434
  'div',
8394
8435
  { className: 'ad-box', style: { textAlign: 'center' } },
8395
- main_36 && nodes.articles.length - 1 !== index && Ads.map(function (ad, innerIndex) {
8436
+ main_39 && Articles.length - 1 !== index && Ads.map(function (ad, innerIndex) {
8396
8437
  if (innerIndex === 0) {
8397
8438
  return React__default.createElement(
8398
8439
  'div',
@@ -8420,7 +8461,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8420
8461
  React__default.createElement(
8421
8462
  'style',
8422
8463
  { jsx: 'true' },
8423
- '\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8464
+ '\n .scrollToTopArrow {\n position: fixed;\n top: 150px;\n display: flex;\n justify-content: center;\n width: ' + contentWidth + 'px;\n opacity: 0;\n z-index: 99999999999;\n cursor: pointer;\n }\n .showArrow {\n opacity: 1;\n }\n .hideArrow {\n opacity: 0;\n }\n .scrollToTopArrow > svg {\n min-height: 50px;\n min-width: 50px;\n max-height: 50px;\n max-width: 50px;\n }\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8424
8465
  )
8425
8466
  )
8426
8467
  );
@@ -1,5 +1,5 @@
1
1
  import { c as createCommonjsModule, a as commonjsGlobal, g as getCjsExportFromNamespace } from './_commonjsHelpers-0c4b6f40.js';
2
- import { m as moment } from './moment-e2f9b20c.js';
2
+ import { m as moment } from './moment-12415288.js';
3
3
 
4
4
  var momentTimezone = createCommonjsModule(function (module) {
5
5
  //! moment-timezone.js