@mjhls/mjh-framework 1.0.850-beta.3 → 1.0.850

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 (319) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AD.js +10 -9
  3. package/dist/cjs/AD300x250.js +31 -30
  4. package/dist/cjs/AD300x250x600.js +31 -30
  5. package/dist/cjs/AD728x90.js +34 -33
  6. package/dist/cjs/ADFloatingFooter.js +33 -32
  7. package/dist/cjs/ADFooter.js +15 -14
  8. package/dist/cjs/ADGutter.js +33 -32
  9. package/dist/cjs/{ADInfeed-98c71bcd.js → ADInfeed-fb136f1d.js} +15 -13
  10. package/dist/cjs/ADSkyscraper.js +33 -32
  11. package/dist/cjs/ADSponsoredResources.js +33 -32
  12. package/dist/cjs/ADWebcast.js +33 -32
  13. package/dist/cjs/ADWelcome.js +34 -33
  14. package/dist/cjs/{ADlgInfeed-9de32585.js → ADlgInfeed-d303d27e.js} +11 -10
  15. package/dist/cjs/AccordionPanel.js +31 -29
  16. package/dist/cjs/AdSlot.js +36 -35
  17. package/dist/cjs/AdSlotsProvider.js +21 -19
  18. package/dist/cjs/AlgoliaSearch.js +1087 -1068
  19. package/dist/cjs/AlphabeticList.js +26 -25
  20. package/dist/cjs/ArticleCarousel.js +24 -23
  21. package/dist/cjs/ArticleProgramLandingPage.js +60 -58
  22. package/dist/cjs/ArticleSeriesLandingPage.js +41 -40
  23. package/dist/cjs/ArticleSeriesListing.js +62 -61
  24. package/dist/cjs/Auth.js +3652 -0
  25. package/dist/cjs/AuthWrapper.js +311 -269
  26. package/dist/cjs/{AuthorComponent-bb831b74.js → AuthorComponent-c21aac7f.js} +14 -13
  27. package/dist/cjs/Beam.js +8 -8
  28. package/dist/cjs/{BlockContent-091a991f.js → BlockContent-36e54d77.js} +56 -55
  29. package/dist/cjs/Breadcrumbs.js +29 -27
  30. package/dist/cjs/CMEDeck.js +83 -83
  31. package/dist/cjs/Column1.js +14 -11
  32. package/dist/cjs/Column2.js +36 -33
  33. package/dist/cjs/Column3.js +62 -59
  34. package/dist/cjs/ConferenceArticleCard.js +38 -37
  35. package/dist/cjs/ConferenceBanner-6c9e718a.js +24 -0
  36. package/dist/cjs/DeckContent.js +107 -103
  37. package/dist/cjs/DeckQueue.js +92 -88
  38. package/dist/cjs/{Dfp-26baccf1.js → Dfp-93399f8c.js} +35 -34
  39. package/dist/cjs/EventsDeck.js +159 -152
  40. package/dist/cjs/ExternalResources.js +81 -79
  41. package/dist/cjs/Feature.js +26 -24
  42. package/dist/cjs/ForbesHero.js +43 -42
  43. package/dist/cjs/GridContent.js +238 -233
  44. package/dist/cjs/GridHero.js +45 -44
  45. package/dist/cjs/GroupDeck.js +60 -59
  46. package/dist/cjs/HamMagazine.js +145 -140
  47. package/dist/cjs/Header.js +14 -12
  48. package/dist/cjs/Hero.js +13 -12
  49. package/dist/cjs/HighlightenVideo.js +18 -17
  50. package/dist/cjs/HorizontalArticleListing.js +73 -71
  51. package/dist/cjs/HorizontalHero.js +25 -24
  52. package/dist/cjs/IssueContentDeck.js +78 -73
  53. package/dist/cjs/IssueDeck.js +77 -72
  54. package/dist/cjs/IssueLanding.js +96 -92
  55. package/dist/cjs/KMTracker.js +15 -15
  56. package/dist/cjs/LeftNav.js +41 -39
  57. package/dist/cjs/MasterDeck.js +81 -80
  58. package/dist/cjs/MediaSeriesLanding.js +1118 -1126
  59. package/dist/cjs/NavDvm.js +79 -74
  60. package/dist/cjs/{NavFooter-76c913e3.js → NavFooter-3dcd99a8.js} +15 -14
  61. package/dist/cjs/NavMagazine.js +152 -147
  62. package/dist/cjs/NavNative.js +147 -139
  63. package/dist/cjs/OncliveHero.js +19 -19
  64. package/dist/cjs/OncliveLargeHero.js +73 -72
  65. package/dist/cjs/PageFilter.js +15 -14
  66. package/dist/cjs/PartnerDetailListing.js +109 -105
  67. package/dist/cjs/PdfDownload.js +9 -8
  68. package/dist/cjs/PopUpModal.js +21 -19
  69. package/dist/cjs/PubSection.js +43 -40
  70. package/dist/cjs/PubToc.js +16 -15
  71. package/dist/cjs/PublicationDeck.js +67 -62
  72. package/dist/cjs/PublicationLanding.js +139 -135
  73. package/dist/cjs/QueueDeckExpanded.js +1174 -2074
  74. package/dist/cjs/RecentNews.js +22 -21
  75. package/dist/cjs/RelatedContent.js +55 -54
  76. package/dist/cjs/RelatedTopicsDropdown.js +32 -29
  77. package/dist/cjs/RolesDeck.js +32 -27
  78. package/dist/cjs/Search.js +22 -18
  79. package/dist/cjs/Segment.js +6 -6
  80. package/dist/cjs/SeriesListingDeck.js +38 -38
  81. package/dist/cjs/{SeriesSlider-8bbc989f.js → SeriesSlider-cbab9f0f.js} +40 -39
  82. package/dist/cjs/SetCookie.js +1 -1
  83. package/dist/cjs/SideFooter.js +39 -38
  84. package/dist/cjs/SocialIcons.js +10 -9
  85. package/dist/cjs/{SocialSearchComponent-cea213aa.js → SocialSearchComponent-ecb4f972.js} +40 -36
  86. package/dist/cjs/SocialShare.js +31 -29
  87. package/dist/cjs/TaxonomyCard.js +64 -59
  88. package/dist/cjs/TaxonomyDescription.js +56 -54
  89. package/dist/cjs/TemplateNormal.js +75 -74
  90. package/dist/cjs/ThumbnailCard.js +23 -21
  91. package/dist/cjs/Ustream.js +30 -29
  92. package/dist/cjs/VerticalHero.js +17 -16
  93. package/dist/cjs/VideoProgramLandingPage.js +78 -73
  94. package/dist/cjs/VideoSeriesCard.js +34 -33
  95. package/dist/cjs/VideoSeriesFilter.js +18 -18
  96. package/dist/cjs/VideoSeriesLandingPage.js +51 -50
  97. package/dist/cjs/VideoSeriesListing.js +79 -78
  98. package/dist/cjs/View.js +268 -263
  99. package/dist/cjs/YahooHero.js +42 -41
  100. package/dist/cjs/YoutubeGroup.js +67 -66
  101. package/dist/cjs/{_is-array-754e012d.js → _is-array-6128bd56.js} +6 -6
  102. package/dist/cjs/{_iter-detect-60b2f026.js → _iter-detect-55a5657a.js} +8 -8
  103. package/dist/cjs/{_object-pie-68c5bcbc.js → _object-pie-083f2dd6.js} +4 -4
  104. package/dist/cjs/{_object-sap-5e74ba08.js → _object-sap-a175b4a9.js} +1 -1
  105. package/dist/cjs/{_object-to-array-5762f850.js → _object-to-array-8fe5a54f.js} +2 -2
  106. package/dist/cjs/{_to-object-329a650b.js → _to-object-6de10e57.js} +8 -8
  107. package/dist/cjs/{asyncToGenerator-140e5f89.js → asyncToGenerator-58c289d9.js} +32 -32
  108. package/dist/cjs/{brightcove-react-player-loader.es-156bd4d6.js → brightcove-react-player-loader.es-a195642e.js} +11 -9
  109. package/dist/cjs/{core.get-iterator-method-f62321d4.js → core.get-iterator-method-f474eacc.js} +2 -2
  110. package/dist/cjs/{debounce-529c8d06.js → debounce-d4a2369b.js} +2 -2
  111. package/dist/cjs/{define-property-f4d12f4e.js → define-property-c88be878.js} +6 -6
  112. package/dist/cjs/{defineProperty-55548b25.js → defineProperty-0cb76d99.js} +1 -1
  113. package/dist/cjs/{entities-310b46ee.js → entities-3f9d0f2f.js} +1 -1
  114. package/dist/cjs/{eq-bb2843ed.js → eq-5fc26c07.js} +1 -1
  115. package/dist/cjs/{es6.string.iterator-cc0bbaa4.js → es6.string.iterator-c2573ffd.js} +6 -6
  116. package/dist/cjs/{extends-0a918631.js → extends-29bdbc6d.js} +7 -7
  117. package/dist/cjs/faundadb.js +10 -327
  118. package/dist/cjs/{get-adbb11e3.js → get-5839e5b5.js} +21 -21
  119. package/dist/cjs/getRelatedArticle.js +445 -28
  120. package/dist/cjs/getRootDocGroup.js +6 -6
  121. package/dist/cjs/getSerializers.js +45 -44
  122. package/dist/cjs/{getTargeting-f1821260.js → getTargeting-faf37284.js} +12 -12
  123. package/dist/cjs/getTargeting.js +8 -8
  124. package/dist/cjs/iconBase-68959171.js +0 -3
  125. package/dist/cjs/{index-e2e62963.js → index-8041a4eb.js} +11 -1
  126. package/dist/cjs/{index-4151deb3.js → index-a67ab93e.js} +1009 -1558
  127. package/dist/cjs/index-bd6c9f56.js +211 -0
  128. package/dist/cjs/{index-96b3db50.js → index-eadd5035.js} +17 -15
  129. package/dist/cjs/{index-be0c82be.js → index-efca863c.js} +36 -30
  130. package/dist/cjs/{index-3294d3bc.js → index-f86bb269.js} +44 -45
  131. package/dist/cjs/{index-98e01cb9.js → index-fc2f1ca2.js} +13 -12
  132. package/dist/cjs/{index.es-9110add6.js → index.es-f3e47207.js} +31 -12
  133. package/dist/cjs/{index.esm-ff47db6f.js → index.esm-05850a2f.js} +5 -12
  134. package/dist/cjs/{index.esm-e32d3e8e.js → index.esm-44f3e2d0.js} +3 -6
  135. package/dist/cjs/{index.esm-4d410430.js → index.esm-8123cf40.js} +20 -20
  136. package/dist/cjs/{index.esm-90433435.js → index.esm-974f47d9.js} +6 -15
  137. package/dist/cjs/index.js +169 -158
  138. package/dist/cjs/{inherits-9953db94.js → inherits-c2065b95.js} +22 -22
  139. package/dist/cjs/{isSymbol-04666465.js → isSymbol-03abbdf0.js} +15 -15
  140. package/dist/cjs/keys-7f2c2108.js +25 -0
  141. package/dist/cjs/{lodash-fc2922d0.js → lodash-f0783643.js} +128 -31
  142. package/dist/cjs/main-025fdc78.js +973 -0
  143. package/dist/cjs/md5-e1ca5797.js +323 -0
  144. package/dist/cjs/{moment-575fe24c.js → moment-aca40de1.js} +11 -9
  145. package/dist/cjs/{react-social-icons-f7f48f71.js → react-social-icons-af932527.js} +28 -27
  146. package/dist/cjs/{slicedToArray-8f385299.js → slicedToArray-5d1bc3b3.js} +14 -14
  147. package/dist/cjs/{smoothscroll-5054361f.js → smoothscroll-99df7f93.js} +1 -1
  148. package/dist/cjs/stringify-c9ac1214.js +17 -0
  149. package/dist/cjs/timeDifferenceCalc.js +1 -1
  150. package/dist/cjs/{toConsumableArray-9a3476fe.js → toConsumableArray-ddb70795.js} +9 -9
  151. package/dist/cjs/{toNumber-36d1e7e5.js → toNumber-5e1fac58.js} +40 -5
  152. package/dist/cjs/{typeof-725500bc.js → typeof-88a668c5.js} +36 -36
  153. package/dist/cjs/urlFor.js +3 -3
  154. package/dist/cjs/{ustream-api-d092dc31.js → ustream-api-b2b9092f.js} +4 -4
  155. package/dist/cjs/util-6f784d85.js +576 -0
  156. package/dist/cjs/{visibility-sensor-ad5e3116.js → visibility-sensor-eb2c5b69.js} +7 -5
  157. package/dist/cjs/{web.dom.iterable-a0e279c1.js → web.dom.iterable-46657b5c.js} +3 -3
  158. package/dist/esm/AD.js +7 -7
  159. package/dist/esm/AD300x250.js +27 -27
  160. package/dist/esm/AD300x250x600.js +27 -27
  161. package/dist/esm/AD728x90.js +30 -30
  162. package/dist/esm/ADFloatingFooter.js +29 -29
  163. package/dist/esm/ADFooter.js +11 -11
  164. package/dist/esm/ADGutter.js +29 -29
  165. package/dist/esm/{ADInfeed-bbdd5398.js → ADInfeed-df562a07.js} +11 -11
  166. package/dist/esm/ADSkyscraper.js +29 -29
  167. package/dist/esm/ADSponsoredResources.js +29 -29
  168. package/dist/esm/ADWebcast.js +29 -29
  169. package/dist/esm/ADWelcome.js +30 -30
  170. package/dist/esm/{ADlgInfeed-4473ee3b.js → ADlgInfeed-53992119.js} +8 -8
  171. package/dist/esm/AccordionPanel.js +24 -24
  172. package/dist/esm/AdSlot.js +27 -27
  173. package/dist/esm/AdSlotsProvider.js +14 -14
  174. package/dist/esm/AlgoliaSearch.js +736 -718
  175. package/dist/esm/AlphabeticList.js +22 -22
  176. package/dist/esm/ArticleCarousel.js +20 -20
  177. package/dist/esm/ArticleProgramLandingPage.js +56 -55
  178. package/dist/esm/ArticleSeriesLandingPage.js +37 -37
  179. package/dist/esm/ArticleSeriesListing.js +57 -57
  180. package/dist/esm/Auth.js +3632 -0
  181. package/dist/esm/AuthWrapper.js +308 -267
  182. package/dist/esm/{AuthorComponent-34b16174.js → AuthorComponent-5ae7409f.js} +11 -11
  183. package/dist/esm/Beam.js +8 -8
  184. package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-52cf21c5.js} +35 -35
  185. package/dist/esm/Breadcrumbs.js +17 -17
  186. package/dist/esm/CMEDeck.js +79 -79
  187. package/dist/esm/Column1.js +9 -9
  188. package/dist/esm/Column2.js +30 -30
  189. package/dist/esm/Column3.js +56 -56
  190. package/dist/esm/ConferenceArticleCard.js +35 -35
  191. package/dist/esm/{ConferenceBanner-8792ebd2.js → ConferenceBanner-9162d0ca.js} +4 -4
  192. package/dist/esm/DeckContent.js +98 -98
  193. package/dist/esm/DeckQueue.js +83 -83
  194. package/dist/esm/{Dfp-b7236041.js → Dfp-43f121ff.js} +22 -22
  195. package/dist/esm/EventsDeck.js +129 -129
  196. package/dist/esm/ExternalResources.js +74 -73
  197. package/dist/esm/Feature.js +18 -18
  198. package/dist/esm/ForbesHero.js +35 -35
  199. package/dist/esm/GridContent.js +201 -201
  200. package/dist/esm/GridHero.js +37 -37
  201. package/dist/esm/GroupDeck.js +47 -47
  202. package/dist/esm/HamMagazine.js +116 -116
  203. package/dist/esm/Header.js +8 -8
  204. package/dist/esm/Hero.js +10 -10
  205. package/dist/esm/HighlightenVideo.js +14 -14
  206. package/dist/esm/HorizontalArticleListing.js +69 -68
  207. package/dist/esm/HorizontalHero.js +22 -22
  208. package/dist/esm/IssueContentDeck.js +61 -61
  209. package/dist/esm/IssueDeck.js +65 -65
  210. package/dist/esm/IssueLanding.js +92 -89
  211. package/dist/esm/KMTracker.js +15 -15
  212. package/dist/esm/LeftNav.js +35 -35
  213. package/dist/esm/MasterDeck.js +77 -77
  214. package/dist/esm/MediaSeriesLanding.js +841 -852
  215. package/dist/esm/NavDvm.js +59 -59
  216. package/dist/esm/{NavFooter-e27bd93b.js → NavFooter-c29526b7.js} +12 -12
  217. package/dist/esm/NavMagazine.js +126 -126
  218. package/dist/esm/NavNative.js +116 -116
  219. package/dist/esm/OncliveHero.js +16 -17
  220. package/dist/esm/OncliveLargeHero.js +60 -60
  221. package/dist/esm/PageFilter.js +12 -12
  222. package/dist/esm/PartnerDetailListing.js +105 -102
  223. package/dist/esm/PdfDownload.js +6 -6
  224. package/dist/esm/PopUpModal.js +14 -14
  225. package/dist/esm/PubSection.js +39 -37
  226. package/dist/esm/PubToc.js +12 -12
  227. package/dist/esm/PublicationDeck.js +53 -53
  228. package/dist/esm/PublicationLanding.js +122 -122
  229. package/dist/esm/QueueDeckExpanded.js +1152 -2052
  230. package/dist/esm/RecentNews.js +19 -19
  231. package/dist/esm/RelatedContent.js +48 -48
  232. package/dist/esm/RelatedTopicsDropdown.js +21 -21
  233. package/dist/esm/RolesDeck.js +25 -25
  234. package/dist/esm/Search.js +13 -13
  235. package/dist/esm/Segment.js +6 -6
  236. package/dist/esm/SeriesListingDeck.js +32 -32
  237. package/dist/esm/{SeriesSlider-a866bb21.js → SeriesSlider-5c62a578.js} +31 -31
  238. package/dist/esm/SetCookie.js +1 -1
  239. package/dist/esm/SideFooter.js +34 -34
  240. package/dist/esm/SocialIcons.js +7 -7
  241. package/dist/esm/{SocialSearchComponent-03c3e869.js → SocialSearchComponent-cd38ae60.js} +30 -30
  242. package/dist/esm/SocialShare.js +25 -25
  243. package/dist/esm/TaxonomyCard.js +54 -54
  244. package/dist/esm/TaxonomyDescription.js +50 -49
  245. package/dist/esm/TemplateNormal.js +70 -70
  246. package/dist/esm/ThumbnailCard.js +14 -14
  247. package/dist/esm/Ustream.js +26 -26
  248. package/dist/esm/VerticalHero.js +14 -14
  249. package/dist/esm/VideoProgramLandingPage.js +67 -66
  250. package/dist/esm/VideoSeriesCard.js +26 -26
  251. package/dist/esm/VideoSeriesFilter.js +15 -15
  252. package/dist/esm/VideoSeriesLandingPage.js +42 -42
  253. package/dist/esm/VideoSeriesListing.js +74 -74
  254. package/dist/esm/View.js +248 -247
  255. package/dist/esm/YahooHero.js +35 -35
  256. package/dist/esm/YoutubeGroup.js +51 -51
  257. package/dist/esm/{_is-array-58e95429.js → _is-array-3e99e06e.js} +6 -6
  258. package/dist/esm/{_iter-detect-5d49a330.js → _iter-detect-7e5e5ce2.js} +8 -8
  259. package/dist/esm/{_object-pie-33c40e79.js → _object-pie-133f504a.js} +4 -4
  260. package/dist/esm/{_object-sap-964b6feb.js → _object-sap-f353c2a9.js} +1 -1
  261. package/dist/esm/{_object-to-array-7e804fce.js → _object-to-array-0f197f89.js} +2 -2
  262. package/dist/esm/{_to-object-a4107da3.js → _to-object-b50e61c3.js} +9 -9
  263. package/dist/esm/{asyncToGenerator-4877b617.js → asyncToGenerator-7f8f9219.js} +33 -33
  264. package/dist/esm/{brightcove-react-player-loader.es-83f53e4e.js → brightcove-react-player-loader.es-b43c695a.js} +7 -6
  265. package/dist/esm/{core.get-iterator-method-e1de7503.js → core.get-iterator-method-133dfacd.js} +2 -2
  266. package/dist/esm/{debounce-9207d8ee.js → debounce-533d9748.js} +2 -2
  267. package/dist/esm/{define-property-8af5f002.js → define-property-fe54dc9f.js} +6 -6
  268. package/dist/esm/{defineProperty-94fd8bfc.js → defineProperty-f5ff6f5a.js} +1 -1
  269. package/dist/esm/{entities-7cc3bf45.js → entities-932b50cf.js} +1 -1
  270. package/dist/esm/{eq-b470f743.js → eq-bdcbf886.js} +1 -1
  271. package/dist/esm/{es6.string.iterator-c990c18c.js → es6.string.iterator-bc33758b.js} +7 -7
  272. package/dist/esm/{extends-6f2fcc99.js → extends-60e0e1c6.js} +7 -7
  273. package/dist/esm/faundadb.js +8 -325
  274. package/dist/esm/{get-1e515072.js → get-3c308da4.js} +21 -21
  275. package/dist/esm/getRelatedArticle.js +445 -28
  276. package/dist/esm/getRootDocGroup.js +6 -6
  277. package/dist/esm/getSerializers.js +45 -44
  278. package/dist/esm/{getTargeting-bd800589.js → getTargeting-c3401fa7.js} +11 -11
  279. package/dist/esm/getTargeting.js +8 -8
  280. package/dist/esm/{index-73819142.js → index-0dbff1d1.js} +36 -30
  281. package/dist/esm/{index-41a678ea.js → index-2446af28.js} +6 -6
  282. package/dist/esm/{index-d6dc592a.js → index-27e2c06e.js} +963 -1519
  283. package/dist/esm/{index-5f7e79e7.js → index-35bdcc81.js} +10 -10
  284. package/dist/esm/{index-aaa2dae0.js → index-67e1773f.js} +11 -2
  285. package/dist/esm/{index-ef6d5dcf.js → index-79cfd25c.js} +44 -45
  286. package/dist/esm/index-db3bb315.js +207 -0
  287. package/dist/esm/{index.es-29c1cef5.js → index.es-c6222053.js} +28 -10
  288. package/dist/esm/{index.esm-29e48d38.js → index.esm-3fdda599.js} +6 -15
  289. package/dist/esm/{index.esm-fd746768.js → index.esm-8016b507.js} +17 -18
  290. package/dist/esm/{index.esm-cf08bf18.js → index.esm-a8ff922c.js} +5 -12
  291. package/dist/esm/{index.esm-f8aaeeeb.js → index.esm-c6715e80.js} +3 -6
  292. package/dist/esm/index.js +139 -132
  293. package/dist/esm/{inherits-cf8dde54.js → inherits-a41fe93f.js} +19 -19
  294. package/dist/esm/{isSymbol-1981418f.js → isSymbol-a7e9aafe.js} +15 -15
  295. package/dist/esm/{keys-8eda7a5c.js → keys-7a3adabf.js} +6 -6
  296. package/dist/esm/{lodash-17fdfebb.js → lodash-f97fd99a.js} +128 -31
  297. package/dist/esm/main-b5c5aac1.js +961 -0
  298. package/dist/esm/md5-4e42248e.js +321 -0
  299. package/dist/esm/{moment-e2f9b20c.js → moment-bc12cb97.js} +11 -9
  300. package/dist/esm/{react-social-icons-a7d5c5c7.js → react-social-icons-91f9716f.js} +20 -20
  301. package/dist/esm/{slicedToArray-641f241f.js → slicedToArray-be2f7a22.js} +14 -14
  302. package/dist/esm/{smoothscroll-0cd4c7a6.js → smoothscroll-fa4e3f8c.js} +1 -1
  303. package/dist/esm/stringify-59c8f690.js +15 -0
  304. package/dist/esm/timeDifferenceCalc.js +1 -1
  305. package/dist/esm/{toConsumableArray-43aa614d.js → toConsumableArray-6d9a4616.js} +9 -9
  306. package/dist/esm/{toNumber-2f7a84cd.js → toNumber-5aeba6e7.js} +40 -5
  307. package/dist/esm/{typeof-6435ba1c.js → typeof-a286cf0c.js} +36 -36
  308. package/dist/esm/urlFor.js +1 -1
  309. package/dist/esm/{ustream-api-9a50644d.js → ustream-api-33a866b6.js} +4 -4
  310. package/dist/esm/util-3ab476bf.js +574 -0
  311. package/dist/esm/{visibility-sensor-72fd8f8b.js → visibility-sensor-f40c2564.js} +2 -2
  312. package/dist/esm/{web.dom.iterable-4439f05a.js → web.dom.iterable-4109ff68.js} +3 -3
  313. package/package.json +110 -116
  314. package/dist/cjs/ConferenceBanner-4a16fddc.js +0 -23
  315. package/dist/cjs/keys-a586b7a0.js +0 -25
  316. package/dist/cjs/main-02daeefe.js +0 -862
  317. package/dist/cjs/stringify-7c5aff47.js +0 -17
  318. package/dist/esm/main-e4a934b2.js +0 -851
  319. package/dist/esm/stringify-4330ccdc.js +0 -15
@@ -1,1138 +1,159 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
- import './_to-object-a4107da3.js';
3
- import './es6.string.iterator-c990c18c.js';
4
- import './_library-528f1934.js';
5
- import './_iter-detect-5d49a330.js';
6
- import { _ as _toConsumableArray } from './toConsumableArray-43aa614d.js';
7
- import './core.get-iterator-method-e1de7503.js';
8
- import './_object-pie-33c40e79.js';
9
- import { _ as _extends } from './extends-6f2fcc99.js';
10
- import './web.dom.iterable-4439f05a.js';
11
- import React__default, { useEffect, useLayoutEffect, createContext, useContext, useRef, useDebugValue, useState, useCallback, useMemo } from 'react';
1
+ import { _ as _slicedToArray } from './slicedToArray-be2f7a22.js';
2
+ import { _ as _toConsumableArray } from './toConsumableArray-6d9a4616.js';
3
+ import { _ as _extends } from './extends-60e0e1c6.js';
4
+ import React, { useEffect, useState, useRef } from 'react';
5
+ import { Container, Media } from 'react-bootstrap';
6
+ import urlFor from './urlFor.js';
7
+ import { I as InfiniteScroll } from './index.es-c6222053.js';
8
+ import { m as moment } from './moment-bc12cb97.js';
9
+ import { V as VisibilitySensor } from './visibility-sensor-f40c2564.js';
10
+ import { l as lib_3 } from './index-2446af28.js';
11
+ import { useRouter } from 'next/router';
12
+ import { L as LazyLoad } from './index-35bdcc81.js';
13
+ import { m as main_43 } from './main-b5c5aac1.js';
14
+ import { c as clean_html_1 } from './entities-932b50cf.js';
15
+ import { A as ADInfeed } from './ADInfeed-df562a07.js';
16
+ import { A as AuthorComponent } from './AuthorComponent-5ae7409f.js';
17
+ import { l as lodash } from './lodash-f97fd99a.js';
18
+ import { A as ADlgInfeed } from './ADlgInfeed-53992119.js';
19
+ import { g as getContentCategory } from './getContentCategory-15dcc413.js';
20
+ import timeDifferenceCalc from './timeDifferenceCalc.js';
21
+ import './_commonjsHelpers-0c4b6f40.js';
22
+ import './web.dom.iterable-4109ff68.js';
23
+ import './es6.string.iterator-bc33758b.js';
24
+ import './_to-object-b50e61c3.js';
25
+ import './core.get-iterator-method-133dfacd.js';
26
+ import './_iter-detect-7e5e5ce2.js';
27
+ import './_object-pie-133f504a.js';
28
+ import './index-0dbff1d1.js';
29
+ import 'react-dom';
12
30
  import './events-6c3a7a63.js';
13
- import { l as lib_3 } from './index-41a678ea.js';
14
31
  import 'prop-types';
15
32
  import 'react-bootstrap/Card';
16
- import { m as moment } from './moment-e2f9b20c.js';
17
- import { useRouter } from 'next/router';
18
- import './isSymbol-1981418f.js';
19
- import './debounce-9207d8ee.js';
20
- import './toNumber-2f7a84cd.js';
21
- import 'react-dom';
22
- import './index-73819142.js';
23
- import urlFor from './urlFor.js';
24
- import { L as LazyLoad } from './index-5f7e79e7.js';
25
- import { m as main_36 } from './main-e4a934b2.js';
26
- import { c as clean_html_1 } from './entities-7cc3bf45.js';
27
- import { _ as _slicedToArray } from './slicedToArray-641f241f.js';
28
- import './stringify-4330ccdc.js';
29
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-4877b617.js';
30
- import './Segment.js';
31
- import './Beam.js';
32
33
  import './AdSlot.js';
33
- import { A as ADInfeed } from './ADInfeed-bbdd5398.js';
34
- import { l as lodash } from './lodash-17fdfebb.js';
35
- import { A as ADlgInfeed } from './ADlgInfeed-4473ee3b.js';
36
- import { g as getContentCategory } from './getContentCategory-15dcc413.js';
37
- import { A as AuthorComponent } from './AuthorComponent-34b16174.js';
38
- import { Spinner, Container, Media } from 'react-bootstrap';
39
- import timeDifferenceCalc from './timeDifferenceCalc.js';
34
+ import './debounce-533d9748.js';
35
+ import './isSymbol-a7e9aafe.js';
36
+ import './toNumber-5aeba6e7.js';
37
+ import './Beam.js';
38
+ import './stringify-59c8f690.js';
39
+ import './asyncToGenerator-7f8f9219.js';
40
+ import './_library-528f1934.js';
41
+ import './Segment.js';
40
42
 
41
- var reactPaginate = createCommonjsModule(function (module, exports) {
42
- !function(e,a){module.exports=a(React__default);}(commonjsGlobal,(function(e){return function(e){var a={};function t(r){if(a[r])return a[r].exports;var n=a[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:r});},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var n in e)t.d(r,n,function(a){return e[a]}.bind(null,n));return r},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="",t(t.s=4)}([function(e,a,t){e.exports=t(2)();},function(a,t){a.exports=e;},function(e,a,t){var r=t(3);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,a,t,n,i,s){if(s!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function a(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:n};return t.PropTypes=t,t};},function(e,a,t){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";},function(e,a,t){t.r(a);var r=t(1),n=t.n(r),i=t(0),s=t.n(i);function l(){return (l=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var o=function(e){var a=e.pageClassName,t=e.pageLinkClassName,r=e.page,i=e.selected,s=e.activeClassName,o=e.activeLinkClassName,u=e.getEventListener,c=e.pageSelectedHandler,p=e.href,f=e.extraAriaContext,g=e.pageLabelBuilder,d=e.ariaLabel||"Page "+r+(f?" "+f:""),b=null;return i&&(b="page",d=e.ariaLabel||"Page "+r+" is your current page",a=void 0!==a?a+" "+s:s,void 0!==t?void 0!==o&&(t=t+" "+o):t=o),n.a.createElement("li",{className:a},n.a.createElement("a",l({role:"button",className:t,href:p,tabIndex:"0","aria-label":d,"aria-current":b,onKeyPress:c},u(c)),g(r)))};o.propTypes={pageSelectedHandler:s.a.func.isRequired,selected:s.a.bool.isRequired,pageClassName:s.a.string,pageLinkClassName:s.a.string,activeClassName:s.a.string,activeLinkClassName:s.a.string,extraAriaContext:s.a.string,href:s.a.string,ariaLabel:s.a.string,page:s.a.number.isRequired,getEventListener:s.a.func.isRequired,pageLabelBuilder:s.a.func.isRequired};var u=o;function c(){return (c=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var p=function(e){var a=e.breakLabel,t=e.breakClassName,r=e.breakLinkClassName,i=e.breakHandler,s=e.getEventListener,l=t||"break";return n.a.createElement("li",{className:l},n.a.createElement("a",c({className:r,role:"button",tabIndex:"0",onKeyPress:i},s(i)),a))};p.propTypes={breakLabel:s.a.oneOfType([s.a.string,s.a.node]),breakClassName:s.a.string,breakLinkClassName:s.a.string,breakHandler:s.a.func.isRequired,getEventListener:s.a.func.isRequired};var f=p;function g(e){return (g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(){return (d=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}function b(e,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function v(e,a){return (v=Object.setPrototypeOf||function(e,a){return e.__proto__=a,e})(e,a)}function m(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}();return function(){var t,r=C(e);if(a){var n=C(this).constructor;t=Reflect.construct(r,arguments,n);}else t=r.apply(this,arguments);return h(this,t)}}function h(e,a){return !a||"object"!==g(a)&&"function"!=typeof a?y(e):a}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return (C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var k=function(e){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&v(e,a);}(s,e);var a,t,i=m(s);function s(e){var a,t;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),P(y(a=i.call(this,e)),"handlePreviousPage",(function(e){var t=a.state.selected;e.preventDefault?e.preventDefault():e.returnValue=!1,t>0&&a.handlePageSelected(t-1,e);})),P(y(a),"handleNextPage",(function(e){var t=a.state.selected,r=a.props.pageCount;e.preventDefault?e.preventDefault():e.returnValue=!1,t<r-1&&a.handlePageSelected(t+1,e);})),P(y(a),"handlePageSelected",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1,a.state.selected!==e?(a.setState({selected:e}),a.callCallback(e)):a.callActiveCallback(e);})),P(y(a),"getEventListener",(function(e){return P({},a.props.eventListener,e)})),P(y(a),"handleBreakClick",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1;var r=a.state.selected;a.handlePageSelected(r<e?a.getForwardJump():a.getBackwardJump(),t);})),P(y(a),"callCallback",(function(e){void 0!==a.props.onPageChange&&"function"==typeof a.props.onPageChange&&a.props.onPageChange({selected:e});})),P(y(a),"callActiveCallback",(function(e){void 0!==a.props.onPageActive&&"function"==typeof a.props.onPageActive&&a.props.onPageActive({selected:e});})),P(y(a),"pagination",(function(){var e=[],t=a.props,r=t.pageRangeDisplayed,i=t.pageCount,s=t.marginPagesDisplayed,l=t.breakLabel,o=t.breakClassName,u=t.breakLinkClassName,c=a.state.selected;if(i<=r)for(var p=0;p<i;p++)e.push(a.getPageElement(p));else {var g,d,b,v=r/2,m=r-v;c>i-r/2?v=r-(m=i-c):c<r/2&&(m=r-(v=c));var h=function(e){return a.getPageElement(e)};for(g=0;g<i;g++)(d=g+1)<=s||d>i-s||g>=c-v&&g<=c+m?e.push(h(g)):l&&e[e.length-1]!==b&&(b=n.a.createElement(f,{key:g,breakLabel:l,breakClassName:o,breakLinkClassName:u,breakHandler:a.handleBreakClick.bind(null,g),getEventListener:a.getEventListener}),e.push(b));}return e})),t=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,a.state={selected:t},a}return a=s,(t=[{key:"componentDidMount",value:function(){var e=this.props,a=e.initialPage,t=e.disableInitialCallback,r=e.extraAriaContext;void 0===a||t||this.callCallback(a),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead.");}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&this.setState({selected:this.props.forcePage});}},{key:"getForwardJump",value:function(){var e=this.state.selected,a=this.props,t=a.pageCount,r=e+a.pageRangeDisplayed;return r>=t?t-1:r}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"hrefBuilder",value:function(e){var a=this.props,t=a.hrefBuilder,r=a.pageCount;if(t&&e!==this.state.selected&&e>=0&&e<r)return t(e+1)}},{key:"ariaLabelBuilder",value:function(e){var a=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var t=this.props.ariaLabelBuilder(e+1,a);return this.props.extraAriaContext&&!a&&(t=t+" "+this.props.extraAriaContext),t}}},{key:"getPageElement",value:function(e){var a=this.state.selected,t=this.props,r=t.pageClassName,i=t.pageLinkClassName,s=t.activeClassName,l=t.activeLinkClassName,o=t.extraAriaContext,c=t.pageLabelBuilder;return n.a.createElement(u,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:a===e,pageClassName:r,pageLinkClassName:i,activeClassName:s,activeLinkClassName:l,extraAriaContext:o,href:this.hrefBuilder(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:c,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props,a=e.disabledClassName,t=e.pageCount,r=e.containerClassName,i=e.previousLabel,s=e.previousClassName,l=e.previousLinkClassName,o=e.previousAriaLabel,u=e.prevRel,c=e.nextLabel,p=e.nextClassName,f=e.nextLinkClassName,g=e.nextAriaLabel,b=e.nextRel,v=this.state.selected,m=s+(0===v?" ".concat(a):""),h=p+(v===t-1?" ".concat(a):""),y=0===v?"true":"false",C=v===t-1?"true":"false";return n.a.createElement("ul",{className:r},n.a.createElement("li",{className:m},n.a.createElement("a",d({className:l,href:this.hrefBuilder(v-1),tabIndex:"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":y,"aria-label":o,rel:u},this.getEventListener(this.handlePreviousPage)),i)),this.pagination(),n.a.createElement("li",{className:h},n.a.createElement("a",d({className:f,href:this.hrefBuilder(v+1),tabIndex:"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":C,"aria-label":g,rel:b},this.getEventListener(this.handleNextPage)),c)))}}])&&b(a.prototype,t),s}(r.Component);P(k,"propTypes",{pageCount:s.a.number.isRequired,pageRangeDisplayed:s.a.number.isRequired,marginPagesDisplayed:s.a.number.isRequired,previousLabel:s.a.node,previousAriaLabel:s.a.string,prevRel:s.a.string,nextLabel:s.a.node,nextAriaLabel:s.a.string,nextRel:s.a.string,breakLabel:s.a.oneOfType([s.a.string,s.a.node]),hrefBuilder:s.a.func,onPageChange:s.a.func,onPageActive:s.a.func,initialPage:s.a.number,forcePage:s.a.number,disableInitialCallback:s.a.bool,containerClassName:s.a.string,pageClassName:s.a.string,pageLinkClassName:s.a.string,pageLabelBuilder:s.a.func,activeClassName:s.a.string,activeLinkClassName:s.a.string,previousClassName:s.a.string,nextClassName:s.a.string,previousLinkClassName:s.a.string,nextLinkClassName:s.a.string,disabledClassName:s.a.string,breakClassName:s.a.string,breakLinkClassName:s.a.string,extraAriaContext:s.a.string,ariaLabelBuilder:s.a.func,eventListener:s.a.string}),P(k,"defaultProps",{pageCount:10,pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick"});a.default=k;}])}));
43
+ var renderCardImage = function renderCardImage(row, client) {
44
+ var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
45
+ var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
46
+ var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
47
+ var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
43
48
 
44
- });
49
+ var url = urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
45
50
 
46
- var ReactPaginate = unwrapExports(reactPaginate);
47
- var reactPaginate_1 = reactPaginate.ReactPaginate;
51
+ return url;
52
+ };
48
53
 
49
- var has = Object.prototype.hasOwnProperty;
54
+ var loadMore = function loadMore(values, setValues, itemsPerPage) {
55
+ console.log('Values:::', values);
56
+ setValues({
57
+ page: values.page + 1,
58
+ from: values.from + itemsPerPage,
59
+ to: values.to + itemsPerPage
60
+ });
61
+ };
50
62
 
51
- function dequal(foo, bar) {
52
- var ctor, len;
53
- if (foo === bar) return true;
63
+ var loadData = function loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray) {
64
+ params = _extends({}, params, {
65
+ from: values.from,
66
+ to: values.to
67
+ });
68
+ client.fetch(query, params).then(function (dataArr) {
69
+ if (pointer && pointerArray) {
70
+ dataArr = dataArr[pointerArray][pointer];
71
+ }
54
72
 
55
- if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
56
- if (ctor === Date) return foo.getTime() === bar.getTime();
57
- if (ctor === RegExp) return foo.toString() === bar.toString();
73
+ if (!dataArr) {
74
+ dataArr = [];
75
+ }
58
76
 
59
- if (ctor === Array) {
60
- if ((len=foo.length) === bar.length) {
61
- while (len-- && dequal(foo[len], bar[len]));
62
- }
63
- return len === -1;
64
- }
77
+ dataArr = dataArr.map(function (item) {
78
+ return _extends({}, item, {
79
+ pageNumber: values.page
80
+ });
81
+ });
65
82
 
66
- if (!ctor || typeof foo === 'object') {
67
- len = 0;
68
- for (ctor in foo) {
69
- if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
70
- if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
71
- }
72
- return Object.keys(bar).length === len;
73
- }
74
- }
83
+ if (dataArr.length > 0) {
84
+ setData(function (prevData) {
85
+ return [].concat(_toConsumableArray(prevData), _toConsumableArray(dataArr));
86
+ });
87
+ setLastDataSize(dataArr.length);
88
+ setScrolling(true);
89
+ } else {
90
+ setLastDataSize(0);
91
+ setScrolling(false);
92
+ }
93
+ });
94
+ };
75
95
 
76
- return foo !== foo && bar !== bar;
77
- }
96
+ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) {
97
+ if (seoPaginate) {
98
+ var path = router.asPath;
99
+ var qrIndex = path.indexOf('?');
100
+ var pathname = router.pathname;
101
+ var queryString = '';
78
102
 
79
- // use WeakMap to store the object->key mapping
80
- // so the objects can be garbage collected.
81
- // WeakMap uses a hashtable under the hood, so the lookup
82
- // complexity is almost O(1).
83
- var table = new WeakMap();
84
- // counter of the key
85
- var counter = 0;
86
- // hashes an array of objects and returns a string
87
- function hash(args) {
88
- if (!args.length)
89
- return '';
90
- var key = 'arg';
91
- for (var i = 0; i < args.length; ++i) {
92
- if (args[i] === null) {
93
- key += '@null';
94
- continue;
95
- }
96
- var _hash = void 0;
97
- if (typeof args[i] !== 'object' && typeof args[i] !== 'function') {
98
- // need to consider the case that args[i] is a string:
99
- // args[i] _hash
100
- // "undefined" -> '"undefined"'
101
- // undefined -> 'undefined'
102
- // 123 -> '123'
103
- // "null" -> '"null"'
104
- if (typeof args[i] === 'string') {
105
- _hash = '"' + args[i] + '"';
106
- }
107
- else {
108
- _hash = String(args[i]);
109
- }
110
- }
111
- else {
112
- if (!table.has(args[i])) {
113
- _hash = counter;
114
- table.set(args[i], counter++);
115
- }
116
- else {
117
- _hash = table.get(args[i]);
118
- }
119
- }
120
- key += '@' + _hash;
121
- }
122
- return key;
123
- }
103
+ if (qrIndex > 0) {
104
+ path = path.substring(1, qrIndex);
124
105
 
125
- var Cache = /** @class */ (function () {
126
- function Cache(initialData) {
127
- if (initialData === void 0) { initialData = {}; }
128
- this.cache = new Map(Object.entries(initialData));
129
- this.subs = [];
130
- }
131
- Cache.prototype.get = function (key) {
132
- var _key = this.serializeKey(key)[0];
133
- return this.cache.get(_key);
134
- };
135
- Cache.prototype.set = function (key, value) {
136
- var _key = this.serializeKey(key)[0];
137
- this.cache.set(_key, value);
138
- this.notify();
139
- };
140
- Cache.prototype.keys = function () {
141
- return Array.from(this.cache.keys());
142
- };
143
- Cache.prototype.has = function (key) {
144
- var _key = this.serializeKey(key)[0];
145
- return this.cache.has(_key);
146
- };
147
- Cache.prototype.clear = function () {
148
- this.cache.clear();
149
- this.notify();
150
- };
151
- Cache.prototype.delete = function (key) {
152
- var _key = this.serializeKey(key)[0];
153
- this.cache.delete(_key);
154
- this.notify();
155
- };
156
- // TODO: introduce namespace for the cache
157
- Cache.prototype.serializeKey = function (key) {
158
- var args = null;
159
- if (typeof key === 'function') {
160
- try {
161
- key = key();
162
- }
163
- catch (err) {
164
- // dependencies not ready
165
- key = '';
166
- }
167
- }
168
- if (Array.isArray(key)) {
169
- // args array
170
- args = key;
171
- key = hash(key);
172
- }
173
- else {
174
- // convert null to ''
175
- key = String(key || '');
176
- }
177
- var errorKey = key ? 'err@' + key : '';
178
- var isValidatingKey = key ? 'validating@' + key : '';
179
- return [key, args, errorKey, isValidatingKey];
180
- };
181
- Cache.prototype.subscribe = function (listener) {
182
- var _this = this;
183
- if (typeof listener !== 'function') {
184
- throw new Error('Expected the listener to be a function.');
185
- }
186
- var isSubscribed = true;
187
- this.subs.push(listener);
188
- return function () {
189
- if (!isSubscribed)
190
- return;
191
- isSubscribed = false;
192
- var index = _this.subs.indexOf(listener);
193
- if (index > -1) {
194
- _this.subs[index] = _this.subs[_this.subs.length - 1];
195
- _this.subs.length--;
196
- }
197
- };
198
- };
199
- // Notify Cache subscribers about a change in the cache
200
- Cache.prototype.notify = function () {
201
- for (var _i = 0, _a = this.subs; _i < _a.length; _i++) {
202
- var listener = _a[_i];
203
- listener();
204
- }
205
- };
206
- return Cache;
207
- }());
106
+ var partialQS = router.asPath.substring(qrIndex + 1);
107
+ var partialQSArr = partialQS.split('&');
208
108
 
209
- /**
210
- * Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
211
- * it's not reliable to detect if the browser is currently online or offline
212
- * based on `navigator.onLine`.
213
- * As a work around, we always assume it's online on first load, and change
214
- * the status upon `online` or `offline` events.
215
- */
216
- var online = true;
217
- var isOnline = function () { return online; };
218
- var isDocumentVisible = function () {
219
- if (typeof document !== 'undefined' &&
220
- document.visibilityState !== undefined) {
221
- return document.visibilityState !== 'hidden';
222
- }
223
- // always assume it's visible
224
- return true;
225
- };
226
- var fetcher = function (url) { return fetch(url).then(function (res) { return res.json(); }); };
227
- var registerOnFocus = function (cb) {
228
- if (typeof window !== 'undefined' &&
229
- window.addEventListener !== undefined &&
230
- typeof document !== 'undefined' &&
231
- document.addEventListener !== undefined) {
232
- // focus revalidate
233
- document.addEventListener('visibilitychange', function () { return cb(); }, false);
234
- window.addEventListener('focus', function () { return cb(); }, false);
235
- }
236
- };
237
- var registerOnReconnect = function (cb) {
238
- if (typeof window !== 'undefined' && window.addEventListener !== undefined) {
239
- // reconnect revalidate
240
- window.addEventListener('online', function () {
241
- online = true;
242
- cb();
243
- }, false);
244
- // nothing to revalidate, just update the status
245
- window.addEventListener('offline', function () { return (online = false); }, false);
246
- }
247
- };
248
- var webPreset = {
249
- isOnline: isOnline,
250
- isDocumentVisible: isDocumentVisible,
251
- fetcher: fetcher,
252
- registerOnFocus: registerOnFocus,
253
- registerOnReconnect: registerOnReconnect
254
- };
109
+ // exclude page=xxx from query string
110
+ partialQSArr.map(function (item) {
111
+ var itemArr = item.split('=');
112
+ var key = itemArr[0];
113
+ var val = itemArr[1];
255
114
 
256
- var __assign = (undefined && undefined.__assign) || function () {
257
- __assign = Object.assign || function(t) {
258
- for (var s, i = 1, n = arguments.length; i < n; i++) {
259
- s = arguments[i];
260
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
261
- t[p] = s[p];
115
+ if (key !== 'page') {
116
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
262
117
  }
263
- return t;
264
- };
265
- return __assign.apply(this, arguments);
266
- };
267
- // cache
268
- var cache = new Cache();
269
- // error retry
270
- function onErrorRetry(_, __, config, revalidate, opts) {
271
- if (!config.isDocumentVisible()) {
272
- // if it's hidden, stop
273
- // it will auto revalidate when focus
274
- return;
118
+ });
275
119
  }
276
- if (typeof config.errorRetryCount === 'number' &&
277
- opts.retryCount > config.errorRetryCount) {
278
- return;
120
+
121
+ if (queryString.length > 0) {
122
+ path += '?' + queryString;
279
123
  }
280
- // exponential backoff
281
- var count = Math.min(opts.retryCount, 8);
282
- var timeout = ~~((Math.random() + 0.5) * (1 << count)) * config.errorRetryInterval;
283
- setTimeout(revalidate, timeout, opts);
284
- }
285
- // client side: need to adjust the config
286
- // based on the browser status
287
- // slow connection (<= 70Kbps)
288
- var slowConnection = typeof window !== 'undefined' &&
289
- // @ts-ignore
290
- navigator['connection'] &&
291
- // @ts-ignore
292
- ['slow-2g', '2g'].indexOf(navigator['connection'].effectiveType) !== -1;
293
- // config
294
- var defaultConfig = __assign({
295
- // events
296
- onLoadingSlow: function () { }, onSuccess: function () { }, onError: function () { }, onErrorRetry: onErrorRetry, errorRetryInterval: (slowConnection ? 10 : 5) * 1000, focusThrottleInterval: 5 * 1000, dedupingInterval: 2 * 1000, loadingTimeout: (slowConnection ? 5 : 3) * 1000, refreshInterval: 0, revalidateOnFocus: true, revalidateOnReconnect: true, refreshWhenHidden: false, refreshWhenOffline: false, shouldRetryOnError: true, suspense: false, compare: dequal, isPaused: function () { return false; } }, webPreset);
297
124
 
298
- var IS_SERVER = typeof window === 'undefined' ||
299
- // @ts-ignore
300
- !!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno);
301
- // polyfill for requestAnimationFrame
302
- var rAF = IS_SERVER
303
- ? null
304
- : window['requestAnimationFrame']
305
- ? function (f) { return window['requestAnimationFrame'](f); }
306
- : function (f) { return setTimeout(f, 1); };
307
- // React currently throws a warning when using useLayoutEffect on the server.
308
- // To get around it, we can conditionally useEffect on the server (no-op) and
309
- // useLayoutEffect in the browser.
310
- var useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
125
+ pageNumber = parseInt(pageNumber);
126
+ // const index = Number(itemIndex)
127
+ // const perPage = Number(itemsPerPage)
311
128
 
312
- var SWRConfigContext = createContext({});
313
- SWRConfigContext.displayName = 'SWRConfigContext';
129
+ // pageNumber = Math.ceil((index + 1) / perPage)
314
130
 
315
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
316
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
317
- return new (P || (P = Promise))(function (resolve, reject) {
318
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
319
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
320
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
321
- step((generator = generator.apply(thisArg, _arguments || [])).next());
322
- });
323
- };
324
- var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
325
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
326
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
327
- function verb(n) { return function (v) { return step([n, v]); }; }
328
- function step(op) {
329
- if (f) throw new TypeError("Generator is already executing.");
330
- while (_) try {
331
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
332
- if (y = 0, t) op = [op[0] & 2, t.value];
333
- switch (op[0]) {
334
- case 0: case 1: t = op; break;
335
- case 4: _.label++; return { value: op[1], done: false };
336
- case 5: _.label++; y = op[1]; op = [0]; continue;
337
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
338
- default:
339
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
340
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
341
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
342
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
343
- if (t[2]) _.ops.pop();
344
- _.trys.pop(); continue;
345
- }
346
- op = body.call(thisArg, _);
347
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
348
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
349
- }
350
- };
351
- // global state managers
352
- var CONCURRENT_PROMISES = {};
353
- var CONCURRENT_PROMISES_TS = {};
354
- var FOCUS_REVALIDATORS = {};
355
- var RECONNECT_REVALIDATORS = {};
356
- var CACHE_REVALIDATORS = {};
357
- var MUTATION_TS = {};
358
- var MUTATION_END_TS = {};
359
- // generate strictly increasing timestamps
360
- var now = (function () {
361
- var ts = 0;
362
- return function () { return ++ts; };
363
- })();
364
- // setup DOM events listeners for `focus` and `reconnect` actions
365
- if (!IS_SERVER) {
366
- var revalidate_1 = function (revalidators) {
367
- if (!defaultConfig.isDocumentVisible() || !defaultConfig.isOnline())
368
- return;
369
- for (var key in revalidators) {
370
- if (revalidators[key][0])
371
- revalidators[key][0]();
372
- }
373
- };
374
- if (typeof defaultConfig.registerOnFocus === 'function') {
375
- defaultConfig.registerOnFocus(function () { return revalidate_1(FOCUS_REVALIDATORS); });
376
- }
377
- if (typeof defaultConfig.registerOnReconnect === 'function') {
378
- defaultConfig.registerOnReconnect(function () { return revalidate_1(RECONNECT_REVALIDATORS); });
379
- }
380
- }
381
- var trigger = function (_key, shouldRevalidate) {
382
- if (shouldRevalidate === void 0) { shouldRevalidate = true; }
383
- // we are ignoring the second argument which correspond to the arguments
384
- // the fetcher will receive when key is an array
385
- var _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2], keyValidating = _a[3];
386
- if (!key)
387
- return Promise.resolve();
388
- var updaters = CACHE_REVALIDATORS[key];
389
- if (key && updaters) {
390
- var currentData = cache.get(key);
391
- var currentError = cache.get(keyErr);
392
- var currentIsValidating = cache.get(keyValidating);
393
- var promises = [];
394
- for (var i = 0; i < updaters.length; ++i) {
395
- promises.push(updaters[i](shouldRevalidate, currentData, currentError, currentIsValidating, i > 0));
396
- }
397
- // return new updated value
398
- return Promise.all(promises).then(function () { return cache.get(key); });
399
- }
400
- return Promise.resolve(cache.get(key));
401
- };
402
- var broadcastState = function (key, data, error, isValidating) {
403
- var updaters = CACHE_REVALIDATORS[key];
404
- if (key && updaters) {
405
- for (var i = 0; i < updaters.length; ++i) {
406
- updaters[i](false, data, error, isValidating);
407
- }
408
- }
409
- };
410
- var mutate = function (_key, _data, shouldRevalidate) {
411
- if (shouldRevalidate === void 0) { shouldRevalidate = true; }
412
- return __awaiter(void 0, void 0, void 0, function () {
413
- var _a, key, keyErr, beforeMutationTs, beforeConcurrentPromisesTs, data, error, isAsyncMutation, err_1, shouldAbort, updaters, promises, i;
414
- return __generator(this, function (_b) {
415
- switch (_b.label) {
416
- case 0:
417
- _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2];
418
- if (!key)
419
- return [2 /*return*/];
420
- // if there is no new data to update, let's just revalidate the key
421
- if (typeof _data === 'undefined')
422
- return [2 /*return*/, trigger(_key, shouldRevalidate)
423
- // update global timestamps
424
- ];
425
- // update global timestamps
426
- MUTATION_TS[key] = now() - 1;
427
- MUTATION_END_TS[key] = 0;
428
- beforeMutationTs = MUTATION_TS[key];
429
- beforeConcurrentPromisesTs = CONCURRENT_PROMISES_TS[key];
430
- isAsyncMutation = false;
431
- if (_data && typeof _data === 'function') {
432
- // `_data` is a function, call it passing current cache value
433
- try {
434
- _data = _data(cache.get(key));
435
- }
436
- catch (err) {
437
- // if `_data` function throws an error synchronously, it shouldn't be cached
438
- _data = undefined;
439
- error = err;
440
- }
441
- }
442
- if (!(_data && typeof _data.then === 'function')) return [3 /*break*/, 5];
443
- // `_data` is a promise
444
- isAsyncMutation = true;
445
- _b.label = 1;
446
- case 1:
447
- _b.trys.push([1, 3, , 4]);
448
- return [4 /*yield*/, _data];
449
- case 2:
450
- data = _b.sent();
451
- return [3 /*break*/, 4];
452
- case 3:
453
- err_1 = _b.sent();
454
- error = err_1;
455
- return [3 /*break*/, 4];
456
- case 4: return [3 /*break*/, 6];
457
- case 5:
458
- data = _data;
459
- _b.label = 6;
460
- case 6:
461
- shouldAbort = function () {
462
- // check if other mutations have occurred since we've started this mutation
463
- if (beforeMutationTs !== MUTATION_TS[key] ||
464
- beforeConcurrentPromisesTs !== CONCURRENT_PROMISES_TS[key]) {
465
- if (error)
466
- throw error;
467
- return true;
468
- }
469
- };
470
- // if there's a race we don't update cache or broadcast change, just return the data
471
- if (shouldAbort())
472
- return [2 /*return*/, data];
473
- if (typeof data !== 'undefined') {
474
- // update cached data
475
- cache.set(key, data);
476
- }
477
- // always update or reset the error
478
- cache.set(keyErr, error);
479
- // reset the timestamp to mark the mutation has ended
480
- MUTATION_END_TS[key] = now() - 1;
481
- if (!isAsyncMutation) {
482
- // we skip broadcasting if there's another mutation happened synchronously
483
- if (shouldAbort())
484
- return [2 /*return*/, data];
485
- }
486
- updaters = CACHE_REVALIDATORS[key];
487
- if (updaters) {
488
- promises = [];
489
- for (i = 0; i < updaters.length; ++i) {
490
- promises.push(updaters[i](!!shouldRevalidate, data, error, undefined, i > 0));
491
- }
492
- // return new updated value
493
- return [2 /*return*/, Promise.all(promises).then(function () {
494
- if (error)
495
- throw error;
496
- return cache.get(key);
497
- })];
498
- }
499
- // throw error or return data to be used by caller of mutate
500
- if (error)
501
- throw error;
502
- return [2 /*return*/, data];
503
- }
504
- });
505
- });
506
- };
507
- function useSWR() {
508
- var _this = this;
509
- var args = [];
510
- for (var _i = 0; _i < arguments.length; _i++) {
511
- args[_i] = arguments[_i];
512
- }
513
- var _key = args[0];
514
- var config = Object.assign({}, defaultConfig, useContext(SWRConfigContext), args.length > 2
515
- ? args[2]
516
- : args.length === 2 && typeof args[1] === 'object'
517
- ? args[1]
518
- : {});
519
- // in typescript args.length > 2 is not same as args.lenth === 3
520
- // we do a safe type assertion here
521
- // args.length === 3
522
- var fn = (args.length > 2
523
- ? args[1]
524
- : args.length === 2 && typeof args[1] === 'function'
525
- ? args[1]
526
- : /**
527
- pass fn as null will disable revalidate
528
- https://paco.sh/blog/shared-hook-state-with-swr
529
- */
530
- args[1] === null
531
- ? args[1]
532
- : config.fetcher);
533
- // we assume `key` as the identifier of the request
534
- // `key` can change but `fn` shouldn't
535
- // (because `revalidate` only depends on `key`)
536
- // `keyErr` is the cache key for error objects
537
- var _a = cache.serializeKey(_key), key = _a[0], fnArgs = _a[1], keyErr = _a[2], keyValidating = _a[3];
538
- var configRef = useRef(config);
539
- useIsomorphicLayoutEffect(function () {
540
- configRef.current = config;
541
- });
542
- var willRevalidateOnMount = function () {
543
- return (config.revalidateOnMount ||
544
- (!config.initialData && config.revalidateOnMount === undefined));
545
- };
546
- var resolveData = function () {
547
- var cachedData = cache.get(key);
548
- return typeof cachedData === 'undefined' ? config.initialData : cachedData;
549
- };
550
- var resolveIsValidating = function () {
551
- return !!cache.get(keyValidating) || (key && willRevalidateOnMount());
552
- };
553
- var initialData = resolveData();
554
- var initialError = cache.get(keyErr);
555
- var initialIsValidating = resolveIsValidating();
556
- // if a state is accessed (data, error or isValidating),
557
- // we add the state to dependencies so if the state is
558
- // updated in the future, we can trigger a rerender
559
- var stateDependencies = useRef({
560
- data: false,
561
- error: false,
562
- isValidating: false
563
- });
564
- var stateRef = useRef({
565
- data: initialData,
566
- error: initialError,
567
- isValidating: initialIsValidating
568
- });
569
- // display the data label in the React DevTools next to SWR hooks
570
- useDebugValue(stateRef.current.data);
571
- var rerender = useState({})[1];
572
- var dispatch = useCallback(function (payload) {
573
- var shouldUpdateState = false;
574
- for (var k in payload) {
575
- // @ts-ignore
576
- if (stateRef.current[k] === payload[k]) {
577
- continue;
578
- }
579
- // @ts-ignore
580
- stateRef.current[k] = payload[k];
581
- // @ts-ignore
582
- if (stateDependencies.current[k]) {
583
- shouldUpdateState = true;
584
- }
585
- }
586
- if (shouldUpdateState) {
587
- // if component is unmounted, should skip rerender
588
- // if component is not mounted, should skip rerender
589
- if (unmountedRef.current || !initialMountedRef.current)
590
- return;
591
- rerender({});
592
- }
593
- },
594
- // config.suspense isn't allowed to change during the lifecycle
595
- // eslint-disable-next-line react-hooks/exhaustive-deps
596
- []);
597
- // error ref inside revalidate (is last request errored?)
598
- var unmountedRef = useRef(false);
599
- var keyRef = useRef(key);
600
- // check if component is mounted in suspense mode
601
- var initialMountedRef = useRef(false);
602
- // do unmount check for callbacks
603
- var eventsCallback = useCallback(function (event) {
604
- var _a;
605
- var params = [];
606
- for (var _i = 1; _i < arguments.length; _i++) {
607
- params[_i - 1] = arguments[_i];
608
- }
609
- if (unmountedRef.current)
610
- return;
611
- if (!initialMountedRef.current)
612
- return;
613
- if (key !== keyRef.current)
614
- return;
615
- // @ts-ignore
616
- (_a = configRef.current)[event].apply(_a, params);
617
- }, [key]);
618
- var boundMutate = useCallback(function (data, shouldRevalidate) {
619
- return mutate(keyRef.current, data, shouldRevalidate);
620
- }, []);
621
- var addRevalidator = function (revalidators, callback) {
622
- if (!revalidators[key]) {
623
- revalidators[key] = [callback];
624
- }
625
- else {
626
- revalidators[key].push(callback);
627
- }
628
- return function () {
629
- var keyedRevalidators = revalidators[key];
630
- var index = keyedRevalidators.indexOf(callback);
631
- if (index >= 0) {
632
- // O(1): faster than splice
633
- keyedRevalidators[index] =
634
- keyedRevalidators[keyedRevalidators.length - 1];
635
- keyedRevalidators.pop();
636
- }
637
- };
638
- };
639
- // start a revalidation
640
- var revalidate = useCallback(function (revalidateOpts) {
641
- if (revalidateOpts === void 0) { revalidateOpts = {}; }
642
- return __awaiter(_this, void 0, void 0, function () {
643
- var _a, retryCount, _b, dedupe, loading, shouldDeduping, newData, startAt, newState, err_2;
644
- return __generator(this, function (_c) {
645
- switch (_c.label) {
646
- case 0:
647
- if (!key || !fn)
648
- return [2 /*return*/, false];
649
- if (unmountedRef.current)
650
- return [2 /*return*/, false];
651
- if (configRef.current.isPaused())
652
- return [2 /*return*/, false];
653
- _a = revalidateOpts.retryCount, retryCount = _a === void 0 ? 0 : _a, _b = revalidateOpts.dedupe, dedupe = _b === void 0 ? false : _b;
654
- loading = true;
655
- shouldDeduping = typeof CONCURRENT_PROMISES[key] !== 'undefined' && dedupe;
656
- _c.label = 1;
657
- case 1:
658
- _c.trys.push([1, 6, , 7]);
659
- dispatch({
660
- isValidating: true
661
- });
662
- cache.set(keyValidating, true);
663
- if (!shouldDeduping) {
664
- // also update other hooks
665
- broadcastState(key, stateRef.current.data, stateRef.current.error, true);
666
- }
667
- newData = void 0;
668
- startAt = void 0;
669
- if (!shouldDeduping) return [3 /*break*/, 3];
670
- // there's already an ongoing request,
671
- // this one needs to be deduplicated.
672
- startAt = CONCURRENT_PROMISES_TS[key];
673
- return [4 /*yield*/, CONCURRENT_PROMISES[key]];
674
- case 2:
675
- newData = _c.sent();
676
- return [3 /*break*/, 5];
677
- case 3:
678
- // if no cache being rendered currently (it shows a blank page),
679
- // we trigger the loading slow event.
680
- if (config.loadingTimeout && !cache.get(key)) {
681
- setTimeout(function () {
682
- if (loading)
683
- eventsCallback('onLoadingSlow', key, config);
684
- }, config.loadingTimeout);
685
- }
686
- if (fnArgs !== null) {
687
- CONCURRENT_PROMISES[key] = fn.apply(void 0, fnArgs);
688
- }
689
- else {
690
- CONCURRENT_PROMISES[key] = fn(key);
691
- }
692
- CONCURRENT_PROMISES_TS[key] = startAt = now();
693
- return [4 /*yield*/, CONCURRENT_PROMISES[key]];
694
- case 4:
695
- newData = _c.sent();
696
- setTimeout(function () {
697
- delete CONCURRENT_PROMISES[key];
698
- delete CONCURRENT_PROMISES_TS[key];
699
- }, config.dedupingInterval);
700
- // trigger the success event,
701
- // only do this for the original request.
702
- eventsCallback('onSuccess', newData, key, config);
703
- _c.label = 5;
704
- case 5:
705
- // if there're other ongoing request(s), started after the current one,
706
- // we need to ignore the current one to avoid possible race conditions:
707
- // req1------------------>res1 (current one)
708
- // req2---------------->res2
709
- // the request that fired later will always be kept.
710
- if (CONCURRENT_PROMISES_TS[key] > startAt) {
711
- return [2 /*return*/, false];
712
- }
713
- // if there're other mutations(s), overlapped with the current revalidation:
714
- // case 1:
715
- // req------------------>res
716
- // mutate------>end
717
- // case 2:
718
- // req------------>res
719
- // mutate------>end
720
- // case 3:
721
- // req------------------>res
722
- // mutate-------...---------->
723
- // we have to ignore the revalidation result (res) because it's no longer fresh.
724
- // meanwhile, a new revalidation should be triggered when the mutation ends.
725
- if (MUTATION_TS[key] &&
726
- // case 1
727
- (startAt <= MUTATION_TS[key] ||
728
- // case 2
729
- startAt <= MUTATION_END_TS[key] ||
730
- // case 3
731
- MUTATION_END_TS[key] === 0)) {
732
- dispatch({ isValidating: false });
733
- return [2 /*return*/, false];
734
- }
735
- cache.set(keyErr, undefined);
736
- cache.set(keyValidating, false);
737
- newState = {
738
- isValidating: false
739
- };
740
- if (typeof stateRef.current.error !== 'undefined') {
741
- // we don't have an error
742
- newState.error = undefined;
743
- }
744
- if (!config.compare(stateRef.current.data, newData)) {
745
- // deep compare to avoid extra re-render
746
- // data changed
747
- newState.data = newData;
748
- }
749
- if (!config.compare(cache.get(key), newData)) {
750
- cache.set(key, newData);
751
- }
752
- // merge the new state
753
- dispatch(newState);
754
- if (!shouldDeduping) {
755
- // also update other hooks
756
- broadcastState(key, newData, newState.error, false);
757
- }
758
- return [3 /*break*/, 7];
759
- case 6:
760
- err_2 = _c.sent();
761
- delete CONCURRENT_PROMISES[key];
762
- delete CONCURRENT_PROMISES_TS[key];
763
- if (configRef.current.isPaused()) {
764
- dispatch({
765
- isValidating: false
766
- });
767
- return [2 /*return*/, false];
768
- }
769
- cache.set(keyErr, err_2);
770
- // get a new error
771
- // don't use deep equal for errors
772
- if (stateRef.current.error !== err_2) {
773
- // we keep the stale data
774
- dispatch({
775
- isValidating: false,
776
- error: err_2
777
- });
778
- if (!shouldDeduping) {
779
- // also broadcast to update other hooks
780
- broadcastState(key, undefined, err_2, false);
781
- }
782
- }
783
- // events and retry
784
- eventsCallback('onError', err_2, key, config);
785
- if (config.shouldRetryOnError) {
786
- // when retrying, we always enable deduping
787
- eventsCallback('onErrorRetry', err_2, key, config, revalidate, {
788
- retryCount: retryCount + 1,
789
- dedupe: true
790
- });
791
- }
792
- return [3 /*break*/, 7];
793
- case 7:
794
- loading = false;
795
- return [2 /*return*/, true];
796
- }
797
- });
798
- });
799
- },
800
- // dispatch is immutable, and `eventsCallback`, `fnArgs`, `keyErr`, and `keyValidating` are based on `key`,
801
- // so we can them from the deps array.
802
- //
803
- // FIXME:
804
- // `fn` and `config` might be changed during the lifecycle,
805
- // but they might be changed every render like this.
806
- // useSWR('key', () => fetch('/api/'), { suspense: true })
807
- // So we omit the values from the deps array
808
- // even though it might cause unexpected behaviors.
809
- // eslint-disable-next-line react-hooks/exhaustive-deps
810
- [key]);
811
- // mounted (client side rendering)
812
- useIsomorphicLayoutEffect(function () {
813
- if (!key)
814
- return undefined;
815
- // after `key` updates, we need to mark it as mounted
816
- unmountedRef.current = false;
817
- var isUpdating = initialMountedRef.current;
818
- initialMountedRef.current = true;
819
- // after the component is mounted (hydrated),
820
- // we need to update the data from the cache
821
- // and trigger a revalidation
822
- var currentHookData = stateRef.current.data;
823
- var latestKeyedData = resolveData();
824
- // update the state if the key changed (not the inital render) or cache updated
825
- keyRef.current = key;
826
- if (!config.compare(currentHookData, latestKeyedData)) {
827
- dispatch({ data: latestKeyedData });
828
- }
829
- // revalidate with deduping
830
- var softRevalidate = function () { return revalidate({ dedupe: true }); };
831
- // trigger a revalidation
832
- if (isUpdating || willRevalidateOnMount()) {
833
- if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
834
- // delay revalidate if there's cache
835
- // to not block the rendering
836
- // @ts-ignore it's safe to use requestAnimationFrame in browser
837
- rAF(softRevalidate);
838
- }
839
- else {
840
- softRevalidate();
841
- }
842
- }
843
- var pending = false;
844
- var onFocus = function () {
845
- if (pending || !configRef.current.revalidateOnFocus)
846
- return;
847
- pending = true;
848
- softRevalidate();
849
- setTimeout(function () { return (pending = false); }, configRef.current.focusThrottleInterval);
850
- };
851
- var onReconnect = function () {
852
- if (configRef.current.revalidateOnReconnect) {
853
- softRevalidate();
854
- }
855
- };
856
- // register global cache update listener
857
- var onUpdate = function (shouldRevalidate, updatedData, updatedError, updatedIsValidating, dedupe) {
858
- if (shouldRevalidate === void 0) { shouldRevalidate = true; }
859
- if (dedupe === void 0) { dedupe = true; }
860
- // update hook state
861
- var newState = {};
862
- var needUpdate = false;
863
- if (typeof updatedData !== 'undefined' &&
864
- !config.compare(stateRef.current.data, updatedData)) {
865
- newState.data = updatedData;
866
- needUpdate = true;
867
- }
868
- // always update error
869
- // because it can be `undefined`
870
- if (stateRef.current.error !== updatedError) {
871
- newState.error = updatedError;
872
- needUpdate = true;
873
- }
874
- if (typeof updatedIsValidating !== 'undefined' &&
875
- stateRef.current.isValidating !== updatedIsValidating) {
876
- newState.isValidating = updatedIsValidating;
877
- needUpdate = true;
878
- }
879
- if (needUpdate) {
880
- dispatch(newState);
881
- }
882
- if (shouldRevalidate) {
883
- if (dedupe) {
884
- return softRevalidate();
885
- }
886
- else {
887
- return revalidate();
888
- }
889
- }
890
- return false;
891
- };
892
- var unsubFocus = addRevalidator(FOCUS_REVALIDATORS, onFocus);
893
- var unsubReconnect = addRevalidator(RECONNECT_REVALIDATORS, onReconnect);
894
- var unsubUpdate = addRevalidator(CACHE_REVALIDATORS, onUpdate);
895
- return function () {
896
- // cleanup
897
- dispatch = function () { return null; };
898
- // mark it as unmounted
899
- unmountedRef.current = true;
900
- unsubFocus();
901
- unsubReconnect();
902
- unsubUpdate();
903
- };
904
- }, [key, revalidate]);
905
- useIsomorphicLayoutEffect(function () {
906
- var timer = null;
907
- var tick = function () { return __awaiter(_this, void 0, void 0, function () {
908
- return __generator(this, function (_a) {
909
- switch (_a.label) {
910
- case 0:
911
- if (!(!stateRef.current.error &&
912
- (configRef.current.refreshWhenHidden ||
913
- configRef.current.isDocumentVisible()) &&
914
- (configRef.current.refreshWhenOffline || configRef.current.isOnline()))) return [3 /*break*/, 2];
915
- // only revalidate when the page is visible
916
- // if API request errored, we stop polling in this round
917
- // and let the error retry function handle it
918
- return [4 /*yield*/, revalidate({ dedupe: true })];
919
- case 1:
920
- // only revalidate when the page is visible
921
- // if API request errored, we stop polling in this round
922
- // and let the error retry function handle it
923
- _a.sent();
924
- _a.label = 2;
925
- case 2:
926
- // Read the latest refreshInterval
927
- if (configRef.current.refreshInterval && timer) {
928
- timer = setTimeout(tick, configRef.current.refreshInterval);
929
- }
930
- return [2 /*return*/];
931
- }
932
- });
933
- }); };
934
- if (configRef.current.refreshInterval) {
935
- timer = setTimeout(tick, configRef.current.refreshInterval);
936
- }
937
- return function () {
938
- if (timer) {
939
- clearTimeout(timer);
940
- timer = null;
941
- }
942
- };
943
- }, [
944
- config.refreshInterval,
945
- config.refreshWhenHidden,
946
- config.refreshWhenOffline,
947
- revalidate
948
- ]);
949
- // suspense
950
- var latestData;
951
- var latestError;
952
- if (config.suspense) {
953
- // in suspense mode, we can't return empty state
954
- // (it should be suspended)
955
- // try to get data and error from cache
956
- latestData = cache.get(key);
957
- latestError = cache.get(keyErr);
958
- if (typeof latestData === 'undefined') {
959
- latestData = initialData;
960
- }
961
- if (typeof latestError === 'undefined') {
962
- latestError = initialError;
963
- }
964
- if (typeof latestData === 'undefined' &&
965
- typeof latestError === 'undefined') {
966
- // need to start the request if it hasn't
967
- if (!CONCURRENT_PROMISES[key]) {
968
- // trigger revalidate immediately
969
- // to get the promise
970
- // in this revalidate, should not rerender
971
- revalidate();
972
- }
973
- if (CONCURRENT_PROMISES[key] &&
974
- typeof CONCURRENT_PROMISES[key].then === 'function') {
975
- // if it is a promise
976
- throw CONCURRENT_PROMISES[key];
977
- }
978
- // it's a value, return it directly (override)
979
- latestData = CONCURRENT_PROMISES[key];
980
- }
981
- if (typeof latestData === 'undefined' && latestError) {
982
- // in suspense mode, throw error if there's no content
983
- throw latestError;
984
- }
985
- }
986
- // define returned state
987
- // can be memorized since the state is a ref
988
- var memoizedState = useMemo(function () {
989
- // revalidate will be deprecated in the 1.x release
990
- // because mutate() covers the same use case of revalidate().
991
- // This remains only for backward compatibility
992
- var state = { revalidate: revalidate, mutate: boundMutate };
993
- Object.defineProperties(state, {
994
- error: {
995
- // `key` might be changed in the upcoming hook re-render,
996
- // but the previous state will stay
997
- // so we need to match the latest key and data (fallback to `initialData`)
998
- get: function () {
999
- stateDependencies.current.error = true;
1000
- if (config.suspense) {
1001
- return latestError;
1002
- }
1003
- return keyRef.current === key ? stateRef.current.error : initialError;
1004
- },
1005
- enumerable: true
1006
- },
1007
- data: {
1008
- get: function () {
1009
- stateDependencies.current.data = true;
1010
- if (config.suspense) {
1011
- return latestData;
1012
- }
1013
- return keyRef.current === key ? stateRef.current.data : initialData;
1014
- },
1015
- enumerable: true
1016
- },
1017
- isValidating: {
1018
- get: function () {
1019
- stateDependencies.current.isValidating = true;
1020
- return key ? stateRef.current.isValidating : false;
1021
- },
1022
- enumerable: true
1023
- }
1024
- });
1025
- return state;
1026
- // `config.suspense` isn't allowed to change during the lifecycle.
1027
- // `boundMutate` is immutable, and the immutability of `revalidate` depends on `key`
1028
- // so we can omit them from the deps array,
1029
- // but we put it to enable react-hooks/exhaustive-deps rule.
1030
- // `initialData` and `initialError` are not initial values
1031
- // because they are changed during the lifecycle
1032
- // so we should add them in the deps array.
1033
- }, [
1034
- revalidate,
1035
- initialData,
1036
- initialError,
1037
- boundMutate,
1038
- key,
1039
- config.suspense,
1040
- latestError,
1041
- latestData
1042
- ]);
1043
- return memoizedState;
1044
- }
1045
- Object.defineProperty(SWRConfigContext.Provider, 'default', {
1046
- value: defaultConfig
1047
- });
1048
- var SWRConfig = SWRConfigContext.Provider;
131
+ if (currentPage !== pageNumber) {
132
+ lib_3.refresh();
1049
133
 
1050
- var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1051
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1052
- return new (P || (P = Promise))(function (resolve, reject) {
1053
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1054
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1055
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1056
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1057
- });
1058
- };
1059
- var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
1060
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1061
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1062
- function verb(n) { return function (v) { return step([n, v]); }; }
1063
- function step(op) {
1064
- if (f) throw new TypeError("Generator is already executing.");
1065
- while (_) try {
1066
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1067
- if (y = 0, t) op = [op[0] & 2, t.value];
1068
- switch (op[0]) {
1069
- case 0: case 1: t = op; break;
1070
- case 4: _.label++; return { value: op[1], done: false };
1071
- case 5: _.label++; y = op[1]; op = [0]; continue;
1072
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
1073
- default:
1074
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1075
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1076
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1077
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1078
- if (t[2]) _.ops.pop();
1079
- _.trys.pop(); continue;
1080
- }
1081
- op = body.call(thisArg, _);
1082
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1083
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1084
- }
1085
- };
1086
- var __rest = (undefined && undefined.__rest) || function (s, e) {
1087
- var t = {};
1088
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1089
- t[p] = s[p];
1090
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1091
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1092
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1093
- t[p[i]] = s[p[i]];
1094
- }
1095
- return t;
1096
- };
134
+ setCurrentPage(pageNumber);
135
+ if (path[0] !== '/') {
136
+ path = '/' + path;
137
+ }
1097
138
 
1098
- var _this = undefined;
139
+ var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
1099
140
 
1100
- var renderCardImage = function renderCardImage(row, client) {
1101
- var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1102
- var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1103
- var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1104
- var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
141
+ // if (pageview) {
142
+ // pageview(newPath)
143
+ // }
1105
144
 
1106
- return urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
145
+ router.push(pathname, newPath, {
146
+ shallow: true
147
+ });
148
+ }
149
+ }
1107
150
  };
1108
151
 
1109
152
  var checkExternalUrl = function checkExternalUrl(url) {
1110
153
  return new RegExp(['http', 'https'].join('|')).test(url);
1111
154
  };
1112
155
 
1113
- var CardLoader = function CardLoader(_ref) {
1114
- var data = _ref.data,
1115
- client = _ref.client,
1116
- mapping = _ref.mapping,
1117
- showPublished = _ref.showPublished,
1118
- defaultImage = _ref.defaultImage,
1119
- showAuthor = _ref.showAuthor,
1120
- showCategory = _ref.showCategory,
1121
- imageHeight = _ref.imageHeight,
1122
- imageWidth = _ref.imageWidth,
1123
- imageMaxHeight = _ref.imageMaxHeight,
1124
- imageFit = _ref.imageFit,
1125
- rightItems = _ref.rightItems,
1126
- brandInsightAd = _ref.brandInsightAd,
1127
- showBI = _ref.showBI,
1128
- heroContent = _ref.heroContent,
1129
- lgInfeedAd = _ref.lgInfeedAd,
1130
- showPubInfo = _ref.showPubInfo,
1131
- contentCategoryMapping = _ref.contentCategoryMapping,
1132
- showTimeDiff = _ref.showTimeDiff,
1133
- showTaxonomies = _ref.showTaxonomies,
1134
- showIntro = _ref.showIntro;
1135
-
156
+ 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) {
1136
157
  var numberOfItemsBeforeAd = 6;
1137
158
  var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
1138
159
  return [].concat(_toConsumableArray(arr.slice(0, index)), [newElement], _toConsumableArray(arr.slice(index)));
@@ -1214,842 +235,425 @@ var CardLoader = function CardLoader(_ref) {
1214
235
  }
1215
236
  }
1216
237
 
238
+ // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
239
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
240
+ // 'articleCount' will be the indexes of only the articles in the deck.
241
+ var articleCount = -1;
242
+ data = data.map(function (ele, i) {
243
+ if (ele._type === 'lg-infeed') {
244
+ // Setting pos as top2 for the first occurence of large infeed ad
245
+ // const pos = data.indexOf(data.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
246
+ return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: 'lg-infeed' }) });
247
+ } else if (ele._type === 'article') {
248
+ // incrementing 'articleCount' for each article.
249
+ ++articleCount;
250
+ return _extends({}, ele, { articleCount: articleCount });
251
+ } else {
252
+ return ele;
253
+ }
254
+ });
255
+
1217
256
  var featureCount = 0;
1218
- return React__default.createElement(
257
+ return React.createElement(
1219
258
  'div',
1220
259
  null,
1221
260
  data && data.length > 0 ? dataRemapped ? // For Javascript Enabled Cases
1222
261
  data.map(function (article, index) {
262
+ var pageNumber = article.pageNumber || values.page;
1223
263
  var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
1224
264
 
1225
265
  if (article._type === 'feature') {
1226
266
  featureCount++;
1227
267
  if (article.blank || checkExternalUrl(article.url.current)) {
1228
- return React__default.createElement(
1229
- Media,
1230
- {
1231
- key: article._id ? article._id : index,
1232
- className: 'feature-media',
1233
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1234
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1235
- 'a',
1236
- { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
1237
- React__default.createElement(
1238
- LazyLoad,
1239
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
1240
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(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 })
1241
- ),
1242
- article.source && React__default.createElement(
1243
- 'div',
1244
- { className: 'content-category-label' },
1245
- React__default.createElement(
1246
- 'div',
1247
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1248
- article.source
1249
- )
1250
- )
1251
- ),
1252
- React__default.createElement(
1253
- Media.Body,
1254
- null,
1255
- React__default.createElement(
1256
- 'a',
1257
- { rel: 'noopener', href: article.url.current, target: '_blank' },
1258
- article.title && React__default.createElement(
1259
- 'h4',
1260
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1261
- article.title
1262
- )
1263
- ),
1264
- showPublished && !showTimeDiff && article.published && React__default.createElement(
1265
- 'p',
1266
- { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1267
- moment(article.published).format('MMMM DD, YYYY')
1268
- ),
1269
- showTimeDiff && article.published && React__default.createElement(
1270
- 'p',
1271
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1272
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1273
- if (index > 3) {
1274
- return null;
1275
- }
1276
- if (index === 3) {
1277
- return React__default.createElement(
1278
- React__default.Fragment,
1279
- null,
1280
- React__default.createElement(
1281
- 'em',
1282
- { style: { marginRight: '.5rem' } },
1283
- '...'
1284
- )
1285
- );
1286
- }
1287
- return React__default.createElement(
1288
- React__default.Fragment,
1289
- null,
1290
- React__default.createElement(
1291
- 'em',
1292
- null,
1293
- taxonomy.name
1294
- ),
1295
- ' |',
1296
- ' '
1297
- );
1298
- }),
1299
- ' ',
1300
- React__default.createElement(
1301
- 'span',
1302
- { style: { display: 'inline-block' } },
1303
- timeDifferenceCalc(article.published)
1304
- )
1305
- ),
1306
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1307
- LazyLoad,
1308
- { height: 50 },
1309
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1310
- ),
1311
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1312
- 'div',
1313
- { className: 'content-category-label' },
1314
- React__default.createElement(
1315
- 'div',
1316
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1317
- article.source
1318
- )
1319
- ),
1320
- React__default.createElement(
1321
- 'div',
1322
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1323
- showCategory && article.contentCategory && React__default.createElement(
1324
- 'p',
1325
- {
1326
- className: 'article-category',
1327
- style: {
1328
- background: '#3FB618',
1329
- color: '#ffffff',
1330
- marginBottom: '.25rem',
1331
- display: 'inline-block',
1332
- padding: '0 .25rem',
1333
- fontSize: '.8rem'
1334
- } },
1335
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
1336
- ),
1337
- article.issueSection && article.issueSection.name && React__default.createElement(
1338
- 'p',
1339
- {
1340
- className: 'issueSection',
1341
- style: {
1342
- background: '#000000',
1343
- color: '#ffffff',
1344
- marginBottom: '.25rem',
1345
- marginLeft: '.25rem',
1346
- display: 'inline-block',
1347
- padding: '0 .25rem',
1348
- fontSize: '.8rem'
1349
- } },
1350
- article.issueSection.name
1351
- )
1352
- ),
1353
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
1354
- 'div',
1355
- { className: 'pubInfo' },
1356
- article.volume && React__default.createElement(
1357
- 'p',
1358
- { className: 'qdeVolume' },
1359
- article.volume
1360
- ),
1361
- article.issue && React__default.createElement(
1362
- 'p',
1363
- { className: 'qdeIssue' },
1364
- article.issue
1365
- )
1366
- ),
1367
- showIntro && article.summary && React__default.createElement(
1368
- 'p',
1369
- { className: 'pt-2 card-text' },
1370
- clean_html_1(article.summary)
1371
- )
1372
- )
1373
- );
1374
- } else {
1375
- return React__default.createElement(
1376
- Media,
1377
- {
1378
- key: article._id ? article._id : index,
1379
- className: 'feature-media',
1380
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1381
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1382
- 'a',
1383
- { href: article.url.current, className: 'feature-wrapper' },
1384
- React__default.createElement(
1385
- LazyLoad,
1386
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
1387
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(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 })
1388
- ),
1389
- article.source && React__default.createElement(
1390
- 'div',
1391
- { className: 'content-category-label' },
1392
- React__default.createElement(
1393
- 'div',
1394
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1395
- article.source
1396
- )
1397
- )
1398
- ),
1399
- React__default.createElement(
1400
- Media.Body,
1401
- null,
1402
- React__default.createElement(
1403
- 'a',
1404
- { href: article.url.current },
1405
- article.title && React__default.createElement(
1406
- 'h4',
1407
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1408
- article.title
1409
- )
1410
- ),
1411
- showPublished && !showTimeDiff && article.published && React__default.createElement(
1412
- 'p',
1413
- { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1414
- moment(article.published).format('MMMM DD, YYYY')
1415
- ),
1416
- showTimeDiff && article.published && React__default.createElement(
1417
- 'p',
1418
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1419
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1420
- if (index > 3) {
1421
- return null;
1422
- }
1423
- if (index === 3) {
1424
- return React__default.createElement(
1425
- React__default.Fragment,
1426
- null,
1427
- React__default.createElement(
1428
- 'em',
1429
- { style: { marginRight: '.5rem' } },
1430
- '...'
1431
- )
1432
- );
1433
- }
1434
- if (index === 3) {
1435
- return React__default.createElement(
1436
- React__default.Fragment,
1437
- null,
1438
- React__default.createElement(
1439
- 'em',
1440
- { style: { marginRight: '.5rem' } },
1441
- '...'
1442
- )
1443
- );
1444
- }
1445
- return React__default.createElement(
1446
- React__default.Fragment,
1447
- null,
1448
- React__default.createElement(
1449
- 'em',
1450
- null,
1451
- taxonomy.name
1452
- ),
1453
- ' |',
1454
- ' '
1455
- );
1456
- }),
1457
- ' ',
1458
- React__default.createElement(
1459
- 'span',
1460
- { style: { display: 'inline-block' } },
1461
- timeDifferenceCalc(article.published)
1462
- )
1463
- ),
1464
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1465
- LazyLoad,
1466
- { height: 50 },
1467
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1468
- ),
1469
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1470
- 'div',
1471
- { className: 'content-category-label' },
1472
- React__default.createElement(
1473
- 'div',
1474
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1475
- article.source
1476
- )
1477
- ),
1478
- React__default.createElement(
1479
- 'div',
1480
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1481
- showCategory && article.contentCategory && React__default.createElement(
1482
- 'p',
1483
- {
1484
- className: 'article-category',
1485
- style: {
1486
- background: '#3FB618',
1487
- color: '#ffffff',
1488
- marginBottom: '.25rem',
1489
- display: 'inline-block',
1490
- padding: '0 .25rem',
1491
- fontSize: '.8rem'
1492
- } },
1493
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
1494
- ),
1495
- article.issueSection && article.issueSection.name && React__default.createElement(
1496
- 'p',
1497
- {
1498
- className: 'issueSection',
1499
- style: {
1500
- background: '#000000',
1501
- color: '#ffffff',
1502
- marginBottom: '.25rem',
1503
- marginLeft: '.25rem',
1504
- display: 'inline-block',
1505
- padding: '0 .25rem',
1506
- fontSize: '.8rem'
1507
- } },
1508
- article.issueSection.name
1509
- )
1510
- ),
1511
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
1512
- 'div',
1513
- { className: 'pubInfo' },
1514
- article.volume && React__default.createElement(
1515
- 'p',
1516
- { className: 'qdeVolume' },
1517
- article.volume
1518
- ),
1519
- article.issue && React__default.createElement(
1520
- 'p',
1521
- { className: 'qdeIssue' },
1522
- article.issue
1523
- )
1524
- ),
1525
- showIntro && article.summary && React__default.createElement(
1526
- 'p',
1527
- { className: 'pt-2 card-text' },
1528
- clean_html_1(article.summary)
1529
- )
1530
- )
1531
- );
1532
- }
1533
- } else if (article._type === 'lg-infeed' && article.adUnit) {
1534
- return React__default.createElement(ADlgInfeed, _extends({ index: index }, article));
1535
- } else if (article._type === 'brandInsightAd' && article.adUnit) {
1536
- return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
1537
- }
1538
- if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
1539
- return React__default.createElement(
1540
- React__default.Fragment,
1541
- { key: article._id ? article._id : index },
1542
- React__default.createElement(
1543
- Media,
268
+ return React.createElement(
269
+ VisibilitySensor,
1544
270
  {
1545
271
  key: article._id ? article._id : index,
1546
- style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1547
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1548
- 'a',
1549
- { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
1550
- React__default.createElement(
1551
- LazyLoad,
1552
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
1553
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(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 })
1554
- ),
1555
- article.source && React__default.createElement(
1556
- 'div',
1557
- { className: 'content-category-label' },
1558
- React__default.createElement(
1559
- 'div',
1560
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1561
- article.source
1562
- )
1563
- )
1564
- ),
1565
- React__default.createElement(
1566
- Media.Body,
272
+ partialVisibility: true,
273
+ onChange: function onChange(isVisible) {
274
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
275
+ } },
276
+ React.createElement(
277
+ React.Fragment,
1567
278
  null,
1568
- React__default.createElement(
1569
- 'a',
1570
- { href: mapping[contentCategoryName] + '/' + article.url.current },
1571
- article.title && React__default.createElement(
1572
- 'h4',
1573
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1574
- article.title
1575
- )
1576
- ),
1577
- showPublished && !showTimeDiff && article.published && React__default.createElement(
1578
- 'p',
1579
- { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1580
- moment(article.published).format('MMMM DD, YYYY')
1581
- ),
1582
- showTimeDiff && article.published && React__default.createElement(
1583
- 'p',
1584
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1585
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1586
- if (index > 3) {
1587
- return null;
1588
- }
1589
- if (index === 3) {
1590
- return React__default.createElement(
1591
- React__default.Fragment,
1592
- null,
1593
- React__default.createElement(
1594
- 'em',
1595
- { style: { marginRight: '.5rem' } },
1596
- '...'
1597
- )
1598
- );
1599
- }
1600
- return React__default.createElement(
1601
- React__default.Fragment,
1602
- null,
1603
- React__default.createElement(
1604
- 'em',
1605
- null,
1606
- taxonomy.name
1607
- ),
1608
- ' |',
1609
- ' '
1610
- );
1611
- }),
1612
- ' ',
1613
- React__default.createElement(
1614
- 'span',
1615
- { style: { display: 'inline-block' } },
1616
- timeDifferenceCalc(article.published)
1617
- )
1618
- ),
1619
- React__default.createElement(
1620
- 'div',
1621
- { className: 'author-sec', style: { lineHeight: 1.5 } },
1622
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1623
- LazyLoad,
1624
- { height: 50 },
1625
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1626
- )
1627
- ),
1628
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1629
- 'div',
1630
- { className: 'content-category-label' },
1631
- React__default.createElement(
1632
- 'div',
1633
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1634
- article.source
1635
- )
1636
- ),
1637
- React__default.createElement(
1638
- 'div',
1639
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1640
- showCategory && article.contentCategory && React__default.createElement(
1641
- 'p',
1642
- {
1643
- className: 'article-category',
1644
- style: {
1645
- background: '#3FB618',
1646
- color: '#ffffff',
1647
- marginBottom: '.25rem',
1648
- display: 'inline-block',
1649
- padding: '0 .25rem',
1650
- fontSize: '.8rem'
1651
- } },
1652
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
1653
- ),
1654
- article.issueSection && article.issueSection.name && React__default.createElement(
1655
- 'p',
1656
- {
1657
- className: 'issueSection',
1658
- style: {
1659
- background: '#000000',
1660
- color: '#ffffff',
1661
- marginBottom: '.25rem',
1662
- marginLeft: '.25rem',
1663
- display: 'inline-block',
1664
- padding: '0 .25rem',
1665
- fontSize: '.8rem'
1666
- } },
1667
- article.issueSection.name
1668
- )
1669
- ),
1670
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
1671
- 'div',
1672
- { className: 'pubInfo' },
1673
- article.volume && React__default.createElement(
1674
- 'p',
1675
- { className: 'qdeVolume' },
1676
- article.volume
1677
- ),
1678
- article.issue && React__default.createElement(
1679
- 'p',
1680
- { className: 'qdeIssue' },
1681
- article.issue
1682
- )
1683
- ),
1684
- showIntro && article.summary && React__default.createElement(
1685
- 'p',
1686
- { className: 'pt-2 card-text' },
1687
- clean_html_1(article.summary)
1688
- )
1689
- )
1690
- ),
1691
- React__default.createElement(
1692
- 'div',
1693
- null,
1694
- main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
1695
- )
1696
- );
1697
- } else return null;
1698
- }) :
1699
- // For Javascript Disabled Cases
1700
- React__default.createElement(
1701
- 'noscript',
1702
- null,
1703
- data.map(function (article, index) {
1704
- var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
1705
-
1706
- if (article._type === 'feature') {
1707
- featureCount++;
1708
- if (article.blank || checkExternalUrl(article.url.current)) {
1709
- return React__default.createElement(
1710
- Media,
1711
- {
1712
- key: article._id ? article._id : index,
1713
- className: 'feature-media',
1714
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1715
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1716
- 'a',
1717
- { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
1718
- React__default.createElement(
1719
- LazyLoad,
1720
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
1721
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(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 })
1722
- ),
1723
- article.source && React__default.createElement(
1724
- 'div',
1725
- { className: 'content-category-label' },
1726
- React__default.createElement(
1727
- 'div',
1728
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1729
- article.source
1730
- )
1731
- )
1732
- ),
1733
- React__default.createElement(
1734
- Media.Body,
1735
- null,
1736
- React__default.createElement(
279
+ React.createElement(
280
+ Media,
281
+ {
282
+ key: article._id ? article._id : index,
283
+ className: 'feature-media',
284
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
285
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React.createElement(
1737
286
  'a',
1738
- { rel: 'noopener', href: article.url.current, target: '_blank' },
1739
- article.title && React__default.createElement(
1740
- 'h4',
1741
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1742
- article.title
1743
- )
1744
- ),
1745
- showPublished && article.published && React__default.createElement(
1746
- 'p',
1747
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
1748
- moment(article.published).format('MMMM DD, YYYY')
1749
- ),
1750
- showTimeDiff && article.published && React__default.createElement(
1751
- 'p',
1752
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1753
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1754
- if (index > 3) {
1755
- return null;
1756
- }
1757
- if (index === 3) {
1758
- return React__default.createElement(
1759
- React__default.Fragment,
1760
- null,
1761
- React__default.createElement(
1762
- 'em',
1763
- { style: { marginRight: '.5rem' } },
1764
- '...'
1765
- )
1766
- );
1767
- }
1768
- return React__default.createElement(
1769
- React__default.Fragment,
1770
- null,
1771
- React__default.createElement(
1772
- 'em',
1773
- null,
1774
- taxonomy.name
1775
- ),
1776
- ' |',
1777
- ' '
1778
- );
1779
- }),
1780
- ' ',
1781
- React__default.createElement(
1782
- 'span',
1783
- { style: { display: 'inline-block' } },
1784
- timeDifferenceCalc(article.published)
1785
- )
1786
- ),
1787
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1788
- LazyLoad,
1789
- { height: 50 },
1790
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1791
- ),
1792
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1793
- 'div',
1794
- { className: 'content-category-label' },
1795
- React__default.createElement(
287
+ { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
288
+ React.createElement(
289
+ LazyLoad,
290
+ { height: imageHeight, placeholder: React.createElement(ImagePlaceholder, null) },
291
+ article.thumbnail && article.thumbnail.asset ? React.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
292
+ ),
293
+ article.source && React.createElement(
1796
294
  'div',
1797
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1798
- article.source
295
+ { className: 'content-category-label' },
296
+ React.createElement(
297
+ 'div',
298
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
299
+ article.source
300
+ )
1799
301
  )
1800
302
  ),
1801
- React__default.createElement(
1802
- 'div',
1803
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1804
- showCategory && article.contentCategory && React__default.createElement(
1805
- 'p',
1806
- {
1807
- className: 'article-category',
1808
- style: {
1809
- background: '#3FB618',
1810
- color: '#ffffff',
1811
- marginBottom: '.25rem',
1812
- display: 'inline-block',
1813
- padding: '0 .25rem',
1814
- fontSize: '.8rem'
1815
- } },
1816
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
303
+ React.createElement(
304
+ Media.Body,
305
+ null,
306
+ React.createElement(
307
+ 'a',
308
+ { rel: 'noopener', href: article.url.current, target: '_blank' },
309
+ article.title && React.createElement(
310
+ 'h4',
311
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
312
+ article.title
313
+ )
1817
314
  ),
1818
- article.issueSection && article.issueSection.name && React__default.createElement(
315
+ showPublished && !showTimeDiff && article.published && React.createElement(
1819
316
  'p',
1820
- {
1821
- className: 'issueSection',
1822
- style: {
1823
- background: '#000000',
1824
- color: '#ffffff',
1825
- marginBottom: '.25rem',
1826
- marginLeft: '.25rem',
1827
- display: 'inline-block',
1828
- padding: '0 .25rem',
1829
- fontSize: '.8rem'
1830
- } },
1831
- article.issueSection.name
1832
- )
1833
- ),
1834
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
1835
- 'div',
1836
- { className: 'pubInfo' },
1837
- article.volume && React__default.createElement(
1838
- 'p',
1839
- { className: 'qdeVolume' },
1840
- article.volume
317
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
318
+ moment(article.published).format('MMMM DD, YYYY')
1841
319
  ),
1842
- article.issue && React__default.createElement(
320
+ showTimeDiff && article.published && React.createElement(
1843
321
  'p',
1844
- { className: 'qdeIssue' },
1845
- article.issue
1846
- )
1847
- ),
1848
- showIntro && article.summary && React__default.createElement(
1849
- 'p',
1850
- { className: 'pt-2 card-text' },
1851
- clean_html_1(article.summary)
1852
- )
1853
- )
1854
- );
1855
- } else {
1856
- return React__default.createElement(
1857
- Media,
1858
- {
1859
- key: article._id ? article._id : index,
1860
- className: 'feature-media',
1861
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1862
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1863
- 'a',
1864
- { href: article.url.current, className: 'feature-wrapper' },
1865
- React__default.createElement(
1866
- LazyLoad,
1867
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
1868
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(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 })
1869
- ),
1870
- article.source && React__default.createElement(
1871
- 'div',
1872
- { className: 'content-category-label' },
1873
- React__default.createElement(
1874
- 'div',
1875
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1876
- article.source
1877
- )
1878
- )
1879
- ),
1880
- React__default.createElement(
1881
- Media.Body,
1882
- null,
1883
- React__default.createElement(
1884
- 'a',
1885
- { href: article.url.current },
1886
- article.title && React__default.createElement(
1887
- 'h4',
1888
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1889
- article.title
1890
- )
1891
- ),
1892
- showPublished && article.published && React__default.createElement(
1893
- 'p',
1894
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
1895
- moment(article.published).format('MMMM DD, YYYY')
1896
- ),
1897
- showTimeDiff && article.published && React__default.createElement(
1898
- 'p',
1899
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1900
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1901
- if (index > 3) {
1902
- return null;
1903
- }
1904
- if (index === 3) {
1905
- return React__default.createElement(
1906
- React__default.Fragment,
322
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
323
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
324
+ if (index > 3) {
325
+ return null;
326
+ }
327
+ if (index === 3) {
328
+ return React.createElement(
329
+ React.Fragment,
330
+ null,
331
+ React.createElement(
332
+ 'em',
333
+ { style: { marginRight: '.5rem' } },
334
+ '...'
335
+ )
336
+ );
337
+ }
338
+ return React.createElement(
339
+ React.Fragment,
1907
340
  null,
1908
- React__default.createElement(
341
+ React.createElement(
1909
342
  'em',
1910
- { style: { marginRight: '.5rem' } },
1911
- '...'
1912
- )
343
+ null,
344
+ taxonomy.name
345
+ ),
346
+ ' |',
347
+ ' '
1913
348
  );
1914
- }
1915
- return React__default.createElement(
1916
- React__default.Fragment,
1917
- null,
1918
- React__default.createElement(
1919
- 'em',
1920
- null,
1921
- taxonomy.name
1922
- ),
1923
- ' |',
1924
- ' '
1925
- );
1926
- }),
1927
- ' ',
1928
- React__default.createElement(
1929
- 'span',
1930
- { style: { display: 'inline-block' } },
1931
- timeDifferenceCalc(article.published)
349
+ }),
350
+ ' ',
351
+ React.createElement(
352
+ 'span',
353
+ { style: { display: 'inline-block' } },
354
+ timeDifferenceCalc(article.published)
355
+ )
356
+ ),
357
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React.createElement(
358
+ LazyLoad,
359
+ { height: 50 },
360
+ React.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
361
+ ),
362
+ !article.thumbnail && !defaultImage && article.source && React.createElement(
363
+ 'div',
364
+ { className: 'content-category-label' },
365
+ React.createElement(
366
+ 'div',
367
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
368
+ article.source
369
+ )
370
+ ),
371
+ React.createElement(
372
+ 'div',
373
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
374
+ showCategory && article.contentCategory && React.createElement(
375
+ 'p',
376
+ {
377
+ className: 'article-category',
378
+ style: {
379
+ background: '#3FB618',
380
+ color: '#ffffff',
381
+ marginBottom: '.25rem',
382
+ display: 'inline-block',
383
+ padding: '0 .25rem',
384
+ fontSize: '.8rem'
385
+ } },
386
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
387
+ ),
388
+ article.issueSection && article.issueSection.name && React.createElement(
389
+ 'p',
390
+ {
391
+ className: 'issueSection',
392
+ style: {
393
+ background: '#000000',
394
+ color: '#ffffff',
395
+ marginBottom: '.25rem',
396
+ marginLeft: '.25rem',
397
+ display: 'inline-block',
398
+ padding: '0 .25rem',
399
+ fontSize: '.8rem'
400
+ } },
401
+ article.issueSection.name
402
+ )
403
+ ),
404
+ showPubInfo && (article.issue || article.volume) && React.createElement(
405
+ 'div',
406
+ { className: 'pubInfo' },
407
+ article.volume && React.createElement(
408
+ 'p',
409
+ { className: 'qdeVolume' },
410
+ article.volume
411
+ ),
412
+ article.issue && React.createElement(
413
+ 'p',
414
+ { className: 'qdeIssue' },
415
+ article.issue
416
+ )
417
+ ),
418
+ showIntro && article.summary && React.createElement(
419
+ 'p',
420
+ { className: 'pt-2 card-text' },
421
+ clean_html_1(article.summary)
1932
422
  )
1933
- ),
1934
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1935
- LazyLoad,
1936
- { height: 50 },
1937
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1938
- ),
1939
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1940
- 'div',
1941
- { className: 'content-category-label' },
1942
- React__default.createElement(
423
+ )
424
+ )
425
+ )
426
+ );
427
+ } else {
428
+ return React.createElement(
429
+ VisibilitySensor,
430
+ {
431
+ key: article._id ? article._id : index,
432
+ partialVisibility: true,
433
+ onChange: function onChange(isVisible) {
434
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
435
+ } },
436
+ React.createElement(
437
+ React.Fragment,
438
+ null,
439
+ React.createElement(
440
+ Media,
441
+ {
442
+ key: article._id ? article._id : index,
443
+ className: 'feature-media',
444
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
445
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React.createElement(
446
+ 'a',
447
+ { href: article.url.current, className: 'feature-wrapper' },
448
+ React.createElement(
449
+ LazyLoad,
450
+ { height: imageHeight, placeholder: React.createElement(ImagePlaceholder, null) },
451
+ article.thumbnail && article.thumbnail.asset ? React.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
452
+ ),
453
+ article.source && React.createElement(
1943
454
  'div',
1944
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1945
- article.source
455
+ { className: 'content-category-label' },
456
+ React.createElement(
457
+ 'div',
458
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
459
+ article.source
460
+ )
1946
461
  )
1947
462
  ),
1948
- React__default.createElement(
1949
- 'div',
1950
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1951
- showCategory && article.contentCategory && React__default.createElement(
1952
- 'p',
1953
- {
1954
- className: 'article-category',
1955
- style: {
1956
- background: '#3FB618',
1957
- color: '#ffffff',
1958
- marginBottom: '.25rem',
1959
- display: 'inline-block',
1960
- padding: '0 .25rem',
1961
- fontSize: '.8rem'
1962
- } },
1963
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
463
+ React.createElement(
464
+ Media.Body,
465
+ null,
466
+ React.createElement(
467
+ 'a',
468
+ { href: article.url.current },
469
+ article.title && React.createElement(
470
+ 'h4',
471
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
472
+ article.title
473
+ )
1964
474
  ),
1965
- article.issueSection && article.issueSection.name && React__default.createElement(
475
+ showPublished && !showTimeDiff && article.published && React.createElement(
1966
476
  'p',
1967
- {
1968
- className: 'issueSection',
1969
- style: {
1970
- background: '#000000',
1971
- color: '#ffffff',
1972
- marginBottom: '.25rem',
1973
- marginLeft: '.25rem',
1974
- display: 'inline-block',
1975
- padding: '0 .25rem',
1976
- fontSize: '.8rem'
1977
- } },
1978
- article.issueSection.name
1979
- )
1980
- ),
1981
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
1982
- 'div',
1983
- { className: 'pubInfo' },
1984
- article.volume && React__default.createElement(
477
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
478
+ moment(article.published).format('MMMM DD, YYYY')
479
+ ),
480
+ showTimeDiff && article.published && React.createElement(
1985
481
  'p',
1986
- { className: 'qdeVolume' },
1987
- article.volume
482
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
483
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
484
+ if (index > 3) {
485
+ return null;
486
+ }
487
+ if (index === 3) {
488
+ return React.createElement(
489
+ React.Fragment,
490
+ null,
491
+ React.createElement(
492
+ 'em',
493
+ { style: { marginRight: '.5rem' } },
494
+ '...'
495
+ )
496
+ );
497
+ }
498
+ if (index === 3) {
499
+ return React.createElement(
500
+ React.Fragment,
501
+ null,
502
+ React.createElement(
503
+ 'em',
504
+ { style: { marginRight: '.5rem' } },
505
+ '...'
506
+ )
507
+ );
508
+ }
509
+ return React.createElement(
510
+ React.Fragment,
511
+ null,
512
+ React.createElement(
513
+ 'em',
514
+ null,
515
+ taxonomy.name
516
+ ),
517
+ ' |',
518
+ ' '
519
+ );
520
+ }),
521
+ ' ',
522
+ React.createElement(
523
+ 'span',
524
+ { style: { display: 'inline-block' } },
525
+ timeDifferenceCalc(article.published)
526
+ )
527
+ ),
528
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React.createElement(
529
+ LazyLoad,
530
+ { height: 50 },
531
+ React.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
532
+ ),
533
+ !article.thumbnail && !defaultImage && article.source && React.createElement(
534
+ 'div',
535
+ { className: 'content-category-label' },
536
+ React.createElement(
537
+ 'div',
538
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
539
+ article.source
540
+ )
541
+ ),
542
+ React.createElement(
543
+ 'div',
544
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
545
+ showCategory && article.contentCategory && React.createElement(
546
+ 'p',
547
+ {
548
+ className: 'article-category',
549
+ style: {
550
+ background: '#3FB618',
551
+ color: '#ffffff',
552
+ marginBottom: '.25rem',
553
+ display: 'inline-block',
554
+ padding: '0 .25rem',
555
+ fontSize: '.8rem'
556
+ } },
557
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
558
+ ),
559
+ article.issueSection && article.issueSection.name && React.createElement(
560
+ 'p',
561
+ {
562
+ className: 'issueSection',
563
+ style: {
564
+ background: '#000000',
565
+ color: '#ffffff',
566
+ marginBottom: '.25rem',
567
+ marginLeft: '.25rem',
568
+ display: 'inline-block',
569
+ padding: '0 .25rem',
570
+ fontSize: '.8rem'
571
+ } },
572
+ article.issueSection.name
573
+ )
574
+ ),
575
+ showPubInfo && (article.issue || article.volume) && React.createElement(
576
+ 'div',
577
+ { className: 'pubInfo' },
578
+ article.volume && React.createElement(
579
+ 'p',
580
+ { className: 'qdeVolume' },
581
+ article.volume
582
+ ),
583
+ article.issue && React.createElement(
584
+ 'p',
585
+ { className: 'qdeIssue' },
586
+ article.issue
587
+ )
1988
588
  ),
1989
- article.issue && React__default.createElement(
589
+ showIntro && article.summary && React.createElement(
1990
590
  'p',
1991
- { className: 'qdeIssue' },
1992
- article.issue
591
+ { className: 'pt-2 card-text' },
592
+ clean_html_1(article.summary)
1993
593
  )
1994
- ),
1995
- showIntro && article.summary && React__default.createElement(
1996
- 'p',
1997
- { className: 'pt-2 card-text' },
1998
- clean_html_1(article.summary)
1999
594
  )
2000
595
  )
2001
- );
2002
- }
2003
- } else if (article._type === 'lg-infeed' && article.adUnit) {
2004
- return React__default.createElement(ADlgInfeed, _extends({ index: index }, article));
2005
- } else if (article._type === 'brandInsightAd' && article.adUnit) {
2006
- return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
596
+ )
597
+ );
2007
598
  }
2008
- if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
2009
- return React__default.createElement(
2010
- React__default.Fragment,
2011
- { key: article._id ? article._id : index },
2012
- React__default.createElement(
599
+ } else if (article._type === 'lg-infeed' && article.adUnit) {
600
+ return React.createElement(ADlgInfeed, _extends({ index: index }, article));
601
+ } else if (article._type === 'brandInsightAd' && article.adUnit) {
602
+ return React.createElement(ADInfeed, { index: index, infeedAd: article });
603
+ }
604
+ if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
605
+ return React.createElement(
606
+ VisibilitySensor,
607
+ {
608
+ key: article._id ? article._id : index,
609
+ onChange: function onChange(isVisible) {
610
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
611
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index);
612
+ } },
613
+ React.createElement(
614
+ React.Fragment,
615
+ null,
616
+ React.createElement(
2013
617
  Media,
2014
618
  {
2015
619
  key: article._id ? article._id : index,
2016
620
  style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2017
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
621
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React.createElement(
2018
622
  'a',
2019
623
  { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
2020
- React__default.createElement(
624
+ React.createElement(
2021
625
  LazyLoad,
2022
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
2023
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(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 })
626
+ { height: imageHeight, placeholder: React.createElement(ImagePlaceholder, null) },
627
+ article.thumbnail && article.thumbnail.asset ? React.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2024
628
  ),
2025
- article.source && React__default.createElement(
629
+ article.source && React.createElement(
2026
630
  'div',
2027
631
  { className: 'content-category-label' },
2028
- React__default.createElement(
632
+ React.createElement(
2029
633
  'div',
2030
634
  { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2031
635
  article.source
2032
636
  )
2033
637
  )
2034
638
  ),
2035
- React__default.createElement(
639
+ React.createElement(
2036
640
  Media.Body,
2037
641
  null,
2038
- React__default.createElement(
642
+ React.createElement(
2039
643
  'a',
2040
644
  { href: mapping[contentCategoryName] + '/' + article.url.current },
2041
- article.title && React__default.createElement(
645
+ article.title && React.createElement(
2042
646
  'h4',
2043
647
  { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2044
648
  article.title
2045
649
  )
2046
650
  ),
2047
- showPublished && article.published && React__default.createElement(
651
+ showPublished && !showTimeDiff && article.published && React.createElement(
2048
652
  'p',
2049
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
653
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
2050
654
  moment(article.published).format('MMMM DD, YYYY')
2051
655
  ),
2052
- showTimeDiff && article.published && React__default.createElement(
656
+ showTimeDiff && article.published && React.createElement(
2053
657
  'p',
2054
658
  { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2055
659
  showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
@@ -2057,20 +661,20 @@ var CardLoader = function CardLoader(_ref) {
2057
661
  return null;
2058
662
  }
2059
663
  if (index === 3) {
2060
- return React__default.createElement(
2061
- React__default.Fragment,
664
+ return React.createElement(
665
+ React.Fragment,
2062
666
  null,
2063
- React__default.createElement(
667
+ React.createElement(
2064
668
  'em',
2065
669
  { style: { marginRight: '.5rem' } },
2066
670
  '...'
2067
671
  )
2068
672
  );
2069
673
  }
2070
- return React__default.createElement(
2071
- React__default.Fragment,
674
+ return React.createElement(
675
+ React.Fragment,
2072
676
  null,
2073
- React__default.createElement(
677
+ React.createElement(
2074
678
  'em',
2075
679
  null,
2076
680
  taxonomy.name
@@ -2080,34 +684,34 @@ var CardLoader = function CardLoader(_ref) {
2080
684
  );
2081
685
  }),
2082
686
  ' ',
2083
- React__default.createElement(
687
+ React.createElement(
2084
688
  'span',
2085
689
  { style: { display: 'inline-block' } },
2086
690
  timeDifferenceCalc(article.published)
2087
691
  )
2088
692
  ),
2089
- React__default.createElement(
693
+ React.createElement(
2090
694
  'div',
2091
695
  { className: 'author-sec', style: { lineHeight: 1.5 } },
2092
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
696
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React.createElement(
2093
697
  LazyLoad,
2094
698
  { height: 50 },
2095
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
699
+ React.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2096
700
  )
2097
701
  ),
2098
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
702
+ !article.thumbnail && !defaultImage && article.source && React.createElement(
2099
703
  'div',
2100
704
  { className: 'content-category-label' },
2101
- React__default.createElement(
705
+ React.createElement(
2102
706
  'div',
2103
707
  { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2104
708
  article.source
2105
709
  )
2106
710
  ),
2107
- React__default.createElement(
711
+ React.createElement(
2108
712
  'div',
2109
713
  { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2110
- showCategory && article.contentCategory && React__default.createElement(
714
+ showCategory && article.contentCategory && React.createElement(
2111
715
  'p',
2112
716
  {
2113
717
  className: 'article-category',
@@ -2121,7 +725,7 @@ var CardLoader = function CardLoader(_ref) {
2121
725
  } },
2122
726
  getContentCategory(article.contentCategory.name, contentCategoryMapping)
2123
727
  ),
2124
- article.issueSection && article.issueSection.name && React__default.createElement(
728
+ article.issueSection && article.issueSection.name && React.createElement(
2125
729
  'p',
2126
730
  {
2127
731
  className: 'issueSection',
@@ -2137,49 +741,556 @@ var CardLoader = function CardLoader(_ref) {
2137
741
  article.issueSection.name
2138
742
  )
2139
743
  ),
2140
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
744
+ showPubInfo && (article.issue || article.volume) && React.createElement(
2141
745
  'div',
2142
746
  { className: 'pubInfo' },
2143
- article.volume && React__default.createElement(
747
+ article.volume && React.createElement(
2144
748
  'p',
2145
749
  { className: 'qdeVolume' },
2146
750
  article.volume
2147
751
  ),
2148
- article.issue && React__default.createElement(
752
+ article.issue && React.createElement(
2149
753
  'p',
2150
754
  { className: 'qdeIssue' },
2151
755
  article.issue
2152
756
  )
2153
757
  ),
2154
- showIntro && article.summary && React__default.createElement(
758
+ showIntro && article.summary && React.createElement(
2155
759
  'p',
2156
760
  { className: 'pt-2 card-text' },
2157
761
  clean_html_1(article.summary)
2158
762
  )
2159
763
  )
2160
764
  ),
2161
- React__default.createElement(
765
+ React.createElement(
2162
766
  'div',
2163
767
  null,
2164
- main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
768
+ main_43 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
769
+ )
770
+ )
771
+ );
772
+ } else return null;
773
+ }) :
774
+ // For Javascript Disabled Cases
775
+ React.createElement(
776
+ 'noscript',
777
+ null,
778
+ data.map(function (article, index) {
779
+ var pageNumber = article.pageNumber || values.page;
780
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
781
+
782
+ if (article._type === 'feature') {
783
+ featureCount++;
784
+ if (article.blank || checkExternalUrl(article.url.current)) {
785
+ return React.createElement(
786
+ VisibilitySensor,
787
+ {
788
+ key: article._id ? article._id : index,
789
+ partialVisibility: true,
790
+ onChange: function onChange(isVisible) {
791
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
792
+ } },
793
+ React.createElement(
794
+ React.Fragment,
795
+ null,
796
+ React.createElement(
797
+ Media,
798
+ {
799
+ key: article._id ? article._id : index,
800
+ className: 'feature-media',
801
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
802
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React.createElement(
803
+ 'a',
804
+ { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
805
+ React.createElement(
806
+ LazyLoad,
807
+ { height: imageHeight, placeholder: React.createElement(ImagePlaceholder, null) },
808
+ article.thumbnail && article.thumbnail.asset ? React.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
809
+ ),
810
+ article.source && React.createElement(
811
+ 'div',
812
+ { className: 'content-category-label' },
813
+ React.createElement(
814
+ 'div',
815
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
816
+ article.source
817
+ )
818
+ )
819
+ ),
820
+ React.createElement(
821
+ Media.Body,
822
+ null,
823
+ React.createElement(
824
+ 'a',
825
+ { rel: 'noopener', href: article.url.current, target: '_blank' },
826
+ article.title && React.createElement(
827
+ 'h4',
828
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
829
+ article.title
830
+ )
831
+ ),
832
+ showPublished && article.published && React.createElement(
833
+ 'p',
834
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
835
+ moment(article.published).format('MMMM DD, YYYY')
836
+ ),
837
+ showTimeDiff && article.published && React.createElement(
838
+ 'p',
839
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
840
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
841
+ if (index > 3) {
842
+ return null;
843
+ }
844
+ if (index === 3) {
845
+ return React.createElement(
846
+ React.Fragment,
847
+ null,
848
+ React.createElement(
849
+ 'em',
850
+ { style: { marginRight: '.5rem' } },
851
+ '...'
852
+ )
853
+ );
854
+ }
855
+ return React.createElement(
856
+ React.Fragment,
857
+ null,
858
+ React.createElement(
859
+ 'em',
860
+ null,
861
+ taxonomy.name
862
+ ),
863
+ ' |',
864
+ ' '
865
+ );
866
+ }),
867
+ ' ',
868
+ React.createElement(
869
+ 'span',
870
+ { style: { display: 'inline-block' } },
871
+ timeDifferenceCalc(article.published)
872
+ )
873
+ ),
874
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React.createElement(
875
+ LazyLoad,
876
+ { height: 50 },
877
+ React.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
878
+ ),
879
+ !article.thumbnail && !defaultImage && article.source && React.createElement(
880
+ 'div',
881
+ { className: 'content-category-label' },
882
+ React.createElement(
883
+ 'div',
884
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
885
+ article.source
886
+ )
887
+ ),
888
+ React.createElement(
889
+ 'div',
890
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
891
+ showCategory && article.contentCategory && React.createElement(
892
+ 'p',
893
+ {
894
+ className: 'article-category',
895
+ style: {
896
+ background: '#3FB618',
897
+ color: '#ffffff',
898
+ marginBottom: '.25rem',
899
+ display: 'inline-block',
900
+ padding: '0 .25rem',
901
+ fontSize: '.8rem'
902
+ } },
903
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
904
+ ),
905
+ article.issueSection && article.issueSection.name && React.createElement(
906
+ 'p',
907
+ {
908
+ className: 'issueSection',
909
+ style: {
910
+ background: '#000000',
911
+ color: '#ffffff',
912
+ marginBottom: '.25rem',
913
+ marginLeft: '.25rem',
914
+ display: 'inline-block',
915
+ padding: '0 .25rem',
916
+ fontSize: '.8rem'
917
+ } },
918
+ article.issueSection.name
919
+ )
920
+ ),
921
+ showPubInfo && (article.issue || article.volume) && React.createElement(
922
+ 'div',
923
+ { className: 'pubInfo' },
924
+ article.volume && React.createElement(
925
+ 'p',
926
+ { className: 'qdeVolume' },
927
+ article.volume
928
+ ),
929
+ article.issue && React.createElement(
930
+ 'p',
931
+ { className: 'qdeIssue' },
932
+ article.issue
933
+ )
934
+ ),
935
+ showIntro && article.summary && React.createElement(
936
+ 'p',
937
+ { className: 'pt-2 card-text' },
938
+ clean_html_1(article.summary)
939
+ )
940
+ )
941
+ )
942
+ )
943
+ );
944
+ } else {
945
+ return React.createElement(
946
+ VisibilitySensor,
947
+ {
948
+ key: article._id ? article._id : index,
949
+ partialVisibility: true,
950
+ onChange: function onChange(isVisible) {
951
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
952
+ } },
953
+ React.createElement(
954
+ React.Fragment,
955
+ null,
956
+ React.createElement(
957
+ Media,
958
+ {
959
+ key: article._id ? article._id : index,
960
+ className: 'feature-media',
961
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
962
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React.createElement(
963
+ 'a',
964
+ { href: article.url.current, className: 'feature-wrapper' },
965
+ React.createElement(
966
+ LazyLoad,
967
+ { height: imageHeight, placeholder: React.createElement(ImagePlaceholder, null) },
968
+ article.thumbnail && article.thumbnail.asset ? React.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
969
+ ),
970
+ article.source && React.createElement(
971
+ 'div',
972
+ { className: 'content-category-label' },
973
+ React.createElement(
974
+ 'div',
975
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
976
+ article.source
977
+ )
978
+ )
979
+ ),
980
+ React.createElement(
981
+ Media.Body,
982
+ null,
983
+ React.createElement(
984
+ 'a',
985
+ { href: article.url.current },
986
+ article.title && React.createElement(
987
+ 'h4',
988
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
989
+ article.title
990
+ )
991
+ ),
992
+ showPublished && article.published && React.createElement(
993
+ 'p',
994
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
995
+ moment(article.published).format('MMMM DD, YYYY')
996
+ ),
997
+ showTimeDiff && article.published && React.createElement(
998
+ 'p',
999
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1000
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1001
+ if (index > 3) {
1002
+ return null;
1003
+ }
1004
+ if (index === 3) {
1005
+ return React.createElement(
1006
+ React.Fragment,
1007
+ null,
1008
+ React.createElement(
1009
+ 'em',
1010
+ { style: { marginRight: '.5rem' } },
1011
+ '...'
1012
+ )
1013
+ );
1014
+ }
1015
+ return React.createElement(
1016
+ React.Fragment,
1017
+ null,
1018
+ React.createElement(
1019
+ 'em',
1020
+ null,
1021
+ taxonomy.name
1022
+ ),
1023
+ ' |',
1024
+ ' '
1025
+ );
1026
+ }),
1027
+ ' ',
1028
+ React.createElement(
1029
+ 'span',
1030
+ { style: { display: 'inline-block' } },
1031
+ timeDifferenceCalc(article.published)
1032
+ )
1033
+ ),
1034
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React.createElement(
1035
+ LazyLoad,
1036
+ { height: 50 },
1037
+ React.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1038
+ ),
1039
+ !article.thumbnail && !defaultImage && article.source && React.createElement(
1040
+ 'div',
1041
+ { className: 'content-category-label' },
1042
+ React.createElement(
1043
+ 'div',
1044
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1045
+ article.source
1046
+ )
1047
+ ),
1048
+ React.createElement(
1049
+ 'div',
1050
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1051
+ showCategory && article.contentCategory && React.createElement(
1052
+ 'p',
1053
+ {
1054
+ className: 'article-category',
1055
+ style: {
1056
+ background: '#3FB618',
1057
+ color: '#ffffff',
1058
+ marginBottom: '.25rem',
1059
+ display: 'inline-block',
1060
+ padding: '0 .25rem',
1061
+ fontSize: '.8rem'
1062
+ } },
1063
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
1064
+ ),
1065
+ article.issueSection && article.issueSection.name && React.createElement(
1066
+ 'p',
1067
+ {
1068
+ className: 'issueSection',
1069
+ style: {
1070
+ background: '#000000',
1071
+ color: '#ffffff',
1072
+ marginBottom: '.25rem',
1073
+ marginLeft: '.25rem',
1074
+ display: 'inline-block',
1075
+ padding: '0 .25rem',
1076
+ fontSize: '.8rem'
1077
+ } },
1078
+ article.issueSection.name
1079
+ )
1080
+ ),
1081
+ showPubInfo && (article.issue || article.volume) && React.createElement(
1082
+ 'div',
1083
+ { className: 'pubInfo' },
1084
+ article.volume && React.createElement(
1085
+ 'p',
1086
+ { className: 'qdeVolume' },
1087
+ article.volume
1088
+ ),
1089
+ article.issue && React.createElement(
1090
+ 'p',
1091
+ { className: 'qdeIssue' },
1092
+ article.issue
1093
+ )
1094
+ ),
1095
+ showIntro && article.summary && React.createElement(
1096
+ 'p',
1097
+ { className: 'pt-2 card-text' },
1098
+ clean_html_1(article.summary)
1099
+ )
1100
+ )
1101
+ )
1102
+ )
1103
+ );
1104
+ }
1105
+ } else if (article._type === 'lg-infeed' && article.adUnit) {
1106
+ return React.createElement(ADlgInfeed, _extends({ index: index }, article));
1107
+ } else if (article._type === 'brandInsightAd' && article.adUnit) {
1108
+ return React.createElement(ADInfeed, { index: index, infeedAd: article });
1109
+ }
1110
+ if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
1111
+ return React.createElement(
1112
+ VisibilitySensor,
1113
+ {
1114
+ key: article._id ? article._id : index,
1115
+ onChange: function onChange(isVisible) {
1116
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
1117
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index);
1118
+ } },
1119
+ React.createElement(
1120
+ React.Fragment,
1121
+ null,
1122
+ React.createElement(
1123
+ Media,
1124
+ {
1125
+ key: article._id ? article._id : index,
1126
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1127
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React.createElement(
1128
+ 'a',
1129
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
1130
+ React.createElement(
1131
+ LazyLoad,
1132
+ { height: imageHeight, placeholder: React.createElement(ImagePlaceholder, null) },
1133
+ article.thumbnail && article.thumbnail.asset ? React.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1134
+ ),
1135
+ article.source && React.createElement(
1136
+ 'div',
1137
+ { className: 'content-category-label' },
1138
+ React.createElement(
1139
+ 'div',
1140
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1141
+ article.source
1142
+ )
1143
+ )
1144
+ ),
1145
+ React.createElement(
1146
+ Media.Body,
1147
+ null,
1148
+ React.createElement(
1149
+ 'a',
1150
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
1151
+ article.title && React.createElement(
1152
+ 'h4',
1153
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1154
+ article.title
1155
+ )
1156
+ ),
1157
+ showPublished && article.published && React.createElement(
1158
+ 'p',
1159
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
1160
+ moment(article.published).format('MMMM DD, YYYY')
1161
+ ),
1162
+ showTimeDiff && article.published && React.createElement(
1163
+ 'p',
1164
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1165
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1166
+ if (index > 3) {
1167
+ return null;
1168
+ }
1169
+ if (index === 3) {
1170
+ return React.createElement(
1171
+ React.Fragment,
1172
+ null,
1173
+ React.createElement(
1174
+ 'em',
1175
+ { style: { marginRight: '.5rem' } },
1176
+ '...'
1177
+ )
1178
+ );
1179
+ }
1180
+ return React.createElement(
1181
+ React.Fragment,
1182
+ null,
1183
+ React.createElement(
1184
+ 'em',
1185
+ null,
1186
+ taxonomy.name
1187
+ ),
1188
+ ' |',
1189
+ ' '
1190
+ );
1191
+ }),
1192
+ ' ',
1193
+ React.createElement(
1194
+ 'span',
1195
+ { style: { display: 'inline-block' } },
1196
+ timeDifferenceCalc(article.published)
1197
+ )
1198
+ ),
1199
+ React.createElement(
1200
+ 'div',
1201
+ { className: 'author-sec', style: { lineHeight: 1.5 } },
1202
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React.createElement(
1203
+ LazyLoad,
1204
+ { height: 50 },
1205
+ React.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1206
+ )
1207
+ ),
1208
+ !article.thumbnail && !defaultImage && article.source && React.createElement(
1209
+ 'div',
1210
+ { className: 'content-category-label' },
1211
+ React.createElement(
1212
+ 'div',
1213
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1214
+ article.source
1215
+ )
1216
+ ),
1217
+ React.createElement(
1218
+ 'div',
1219
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1220
+ showCategory && article.contentCategory && React.createElement(
1221
+ 'p',
1222
+ {
1223
+ className: 'article-category',
1224
+ style: {
1225
+ background: '#3FB618',
1226
+ color: '#ffffff',
1227
+ marginBottom: '.25rem',
1228
+ display: 'inline-block',
1229
+ padding: '0 .25rem',
1230
+ fontSize: '.8rem'
1231
+ } },
1232
+ getContentCategory(article.contentCategory.name, contentCategoryMapping)
1233
+ ),
1234
+ article.issueSection && article.issueSection.name && React.createElement(
1235
+ 'p',
1236
+ {
1237
+ className: 'issueSection',
1238
+ style: {
1239
+ background: '#000000',
1240
+ color: '#ffffff',
1241
+ marginBottom: '.25rem',
1242
+ marginLeft: '.25rem',
1243
+ display: 'inline-block',
1244
+ padding: '0 .25rem',
1245
+ fontSize: '.8rem'
1246
+ } },
1247
+ article.issueSection.name
1248
+ )
1249
+ ),
1250
+ showPubInfo && (article.issue || article.volume) && React.createElement(
1251
+ 'div',
1252
+ { className: 'pubInfo' },
1253
+ article.volume && React.createElement(
1254
+ 'p',
1255
+ { className: 'qdeVolume' },
1256
+ article.volume
1257
+ ),
1258
+ article.issue && React.createElement(
1259
+ 'p',
1260
+ { className: 'qdeIssue' },
1261
+ article.issue
1262
+ )
1263
+ ),
1264
+ showIntro && article.summary && React.createElement(
1265
+ 'p',
1266
+ { className: 'pt-2 card-text' },
1267
+ clean_html_1(article.summary)
1268
+ )
1269
+ )
1270
+ ),
1271
+ React.createElement(
1272
+ 'div',
1273
+ null,
1274
+ main_43 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
1275
+ )
2165
1276
  )
2166
1277
  );
2167
1278
  } else return null;
2168
1279
  })
2169
- ) : React__default.createElement(
1280
+ ) : React.createElement(
2170
1281
  'div',
2171
1282
  null,
2172
- React__default.createElement(
1283
+ React.createElement(
2173
1284
  'h5',
2174
1285
  null,
2175
- React__default.createElement(
1286
+ React.createElement(
2176
1287
  'em',
2177
1288
  null,
2178
1289
  'New content coming soon, please check back later.'
2179
1290
  )
2180
1291
  )
2181
1292
  ),
2182
- React__default.createElement(
1293
+ React.createElement(
2183
1294
  'style',
2184
1295
  { jsx: 'true' },
2185
1296
  '\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 '
@@ -2188,11 +1299,11 @@ var CardLoader = function CardLoader(_ref) {
2188
1299
  };
2189
1300
 
2190
1301
  var ImagePlaceholder = function ImagePlaceholder() {
2191
- return React__default.createElement(
2192
- React__default.Fragment,
1302
+ return React.createElement(
1303
+ React.Fragment,
2193
1304
  null,
2194
- React__default.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
2195
- React__default.createElement(
1305
+ React.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
1306
+ React.createElement(
2196
1307
  'style',
2197
1308
  { jsx: 'true' },
2198
1309
  '\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 '
@@ -2202,7 +1313,7 @@ var ImagePlaceholder = function ImagePlaceholder() {
2202
1313
 
2203
1314
  var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
2204
1315
  var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
2205
- return React__default.createElement(
1316
+ return React.createElement(
2206
1317
  'div',
2207
1318
  { style: { display: 'flex', flex: '1 0 auto' } },
2208
1319
  rightItems[i].component
@@ -2217,46 +1328,6 @@ var usePrevious = function usePrevious(value) {
2217
1328
  return ref.current;
2218
1329
  };
2219
1330
 
2220
- var Pagination = function Pagination(_ref2) {
2221
- var totalPostsCount = _ref2.totalPostsCount,
2222
- itemsPerPage = _ref2.itemsPerPage,
2223
- currentPage = _ref2.currentPage,
2224
- handlePageChange = _ref2.handlePageChange,
2225
- data = _ref2.data;
2226
-
2227
- var pageCount = Math.ceil(totalPostsCount / itemsPerPage);
2228
- return React__default.createElement(
2229
- 'div',
2230
- { className: '' + (!data ? 'd-none' : 'd-block') },
2231
- React__default.createElement(ReactPaginate, {
2232
- pageCount: pageCount,
2233
- marginPagesDisplayed: 1,
2234
- pageRangeDisplayed: main_36 ? 3 : 9,
2235
- initialPage: currentPage - 1,
2236
- disableInitialCallback: true,
2237
- onPageChange: function onPageChange(_ref3) {
2238
- var selected = _ref3.selected;
2239
- return handlePageChange(selected + 1);
2240
- },
2241
- hrefBuilder: function hrefBuilder(page) {
2242
- return page === 1 ? '/' : '?page=' + page;
2243
- },
2244
- previousLabel: '<',
2245
- nextLabel: '>',
2246
- containerClassName: 'pagination-container',
2247
- previousLinkClassName: 'previous',
2248
- nextLinkClassName: 'next',
2249
- disabledClassName: 'disbaled',
2250
- activeClassName: 'active'
2251
- }),
2252
- React__default.createElement(
2253
- 'style',
2254
- { jsx: 'true' },
2255
- '\n .pagination-container {\n list-style: none;\n display: flex;\n justify-content: center;\n margin: 3rem 0 3rem 0;\n padding-left: 0;\n }\n .pagination-container a {\n padding: 10px;\n border: 1px solid #dee2e6;\n }\n .pagination-container a:hover {\n text-decoration: none;\n background-color: #e9ecef;\n border-color: #dee2e6;\n }\n .pagination-container .active a {\n color: #fff;\n background-color: var(--primary);\n border-color: #007bff;\n }\n .pagination-container .previous a {\n border-radius: 5px 0 0 5px;\n }\n .pagination-container .next a {\n border-radius: 0 5px 5px 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-container {\n margin-bottom: 6rem;\n }\n }\n '
2256
- )
2257
- );
2258
- };
2259
-
2260
1331
  var QueueDeckExpanded = function QueueDeckExpanded(props) {
2261
1332
  var router = useRouter();
2262
1333
 
@@ -2272,12 +1343,15 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
2272
1343
  }, [router]);
2273
1344
 
2274
1345
  var initialData = props.dataRecord,
2275
- initialCurrentPage = props.currentPage,
2276
1346
  client = props.client,
2277
1347
  params = props.params,
2278
1348
  query = props.query,
1349
+ autoScroll = props.autoScroll,
1350
+ pointer = props.pointer,
1351
+ pointerArray = props.pointerArray,
2279
1352
  mapping = props.mapping,
2280
1353
  seoPaginate = props.seoPaginate,
1354
+ pageview = props.pageview,
2281
1355
  defaultImage = props.defaultImage,
2282
1356
  showAuthor = props.showAuthor,
2283
1357
  showCategory = props.showCategory,
@@ -2302,135 +1376,161 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
2302
1376
  _props$showIntro = props.showIntro,
2303
1377
  showIntro = _props$showIntro === undefined ? true : _props$showIntro,
2304
1378
  _props$contentCategor = props.contentCategoryMapping,
2305
- contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor,
1379
+ contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor;
1380
+ var initialCurrentPage = props.currentPage,
2306
1381
  showPublished = props.showPublished;
2307
1382
 
2308
- var _useState3 = useState(initialCurrentPage || 1),
1383
+ var _useState3 = useState(initialData),
2309
1384
  _useState4 = _slicedToArray(_useState3, 2),
2310
- currentPage = _useState4[0],
2311
- setCurrentPage = _useState4[1];
1385
+ data = _useState4[0],
1386
+ setData = _useState4[1];
2312
1387
 
2313
- var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : params && params.from && params.to ? params.to - params.from : 10;
1388
+ var _useState5 = useState(true),
1389
+ _useState6 = _slicedToArray(_useState5, 2),
1390
+ scrolling = _useState6[0],
1391
+ setScrolling = _useState6[1];
2314
1392
 
2315
- var fetcher = function () {
2316
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(currentPage) {
2317
- var start;
2318
- return regenerator.wrap(function _callee$(_context) {
2319
- while (1) {
2320
- switch (_context.prev = _context.next) {
2321
- case 0:
2322
- start = (currentPage - 1) * itemsPerPage;
2323
- _context.next = 3;
2324
- return client.fetch(query, _extends({}, params, {
2325
- from: start,
2326
- to: start + itemsPerPage
2327
- }));
1393
+ var _useState7 = useState(initialCurrentPage || 1),
1394
+ _useState8 = _slicedToArray(_useState7, 2),
1395
+ currentPage = _useState8[0],
1396
+ setCurrentPage = _useState8[1];
2328
1397
 
2329
- case 3:
2330
- return _context.abrupt('return', _context.sent);
1398
+ var _useState9 = useState(initialData ? initialData.length : 0),
1399
+ _useState10 = _slicedToArray(_useState9, 2),
1400
+ lastDataSize = _useState10[0],
1401
+ setLastDataSize = _useState10[1];
2331
1402
 
2332
- case 4:
2333
- case 'end':
2334
- return _context.stop();
2335
- }
2336
- }
2337
- }, _callee, _this);
2338
- }));
1403
+ var _useState11 = useState({
1404
+ from: params ? params.from : 0,
1405
+ to: params ? params.to : 0,
1406
+ page: initialCurrentPage ? initialCurrentPage : 1
1407
+ }),
1408
+ _useState12 = _slicedToArray(_useState11, 2),
1409
+ values = _useState12[0],
1410
+ setValues = _useState12[1];
2339
1411
 
2340
- return function fetcher(_x5) {
2341
- return _ref4.apply(this, arguments);
2342
- };
2343
- }();
1412
+ var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : 10;
2344
1413
 
2345
- var onLoadDataSuccess = function onLoadDataSuccess() {
2346
- seoPaginate && seoPagination(currentPage);
2347
- lib_3.refresh();
2348
- };
1414
+ var prevValues = usePrevious(values);
2349
1415
 
2350
- var _useSWR = useSWR([currentPage], fetcher, { initialData: currentPage === initialCurrentPage ? initialData : undefined, onSuccess: onLoadDataSuccess }),
2351
- data = _useSWR.data;
1416
+ var renderManualPagination = function renderManualPagination(currentPage) {
1417
+ if (lastDataSize < itemsPerPage) {
1418
+ return null;
1419
+ }
2352
1420
 
2353
- var handlePageChange = function handlePageChange(selectedPage) {
2354
- setCurrentPage(selectedPage);
2355
- document.body.scrollTop = 0;
2356
- document.documentElement.scrollTop = 0;
1421
+ return React.createElement(
1422
+ 'div',
1423
+ { className: 'd-flex justify-content-between' },
1424
+ currentPage && currentPage > 1 && React.createElement(
1425
+ 'a',
1426
+ { href: '?page=' + (currentPage - 1) },
1427
+ '<< Previous'
1428
+ ),
1429
+ React.createElement(
1430
+ 'a',
1431
+ { href: '?page=' + (currentPage + 1) },
1432
+ 'Next >>'
1433
+ )
1434
+ );
2357
1435
  };
2358
1436
 
2359
- var seoPagination = function seoPagination(pageNumber) {
2360
- var path = router.asPath;
2361
- var qrIndex = path.indexOf('?');
2362
- var pathname = router.pathname;
2363
- var queryString = '';
2364
- if (qrIndex > 0) {
2365
- path = path.substring(1, qrIndex);
2366
- var partialQS = router.asPath.substring(qrIndex + 1);
2367
- var partialQSArr = partialQS.split('&');
2368
- // exclude page=xxx from query string
2369
- partialQSArr.map(function (item) {
2370
- var itemArr = item.split('=');
2371
- var key = itemArr[0];
2372
- var val = itemArr[1];
2373
- if (key !== 'page') queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
1437
+ // check for change in filter parameters from client side and refresh the page
1438
+ useEffect(function () {
1439
+ if (initialData && data !== initialData && initialData.length >= 0) {
1440
+ setData(initialData);
1441
+ setCurrentPage(initialCurrentPage ? initialCurrentPage : 1);
1442
+ setValues({
1443
+ from: params ? params.from : 0,
1444
+ to: params ? params.to : 0,
1445
+ page: initialCurrentPage ? initialCurrentPage : 1
2374
1446
  });
1447
+ if (initialData.length > 0) {
1448
+ setScrolling(true);
1449
+ }
2375
1450
  }
2376
- if (queryString.length > 0) path += '?' + queryString;
2377
- pageNumber = parseInt(pageNumber);
2378
- if (path[0] !== '/') path = '/' + path;
2379
- var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
2380
- router.push(pathname, newPath, {
2381
- shallow: true
2382
- });
2383
- };
1451
+ }, [initialData]);
1452
+
1453
+ useEffect(function () {
1454
+ if (prevValues) {
1455
+ if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.to) {
1456
+ loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray);
1457
+ }
1458
+ }
1459
+ }, [values, prevValues, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray]);
1460
+
1461
+ // useEffect(() => {
1462
+ // document.addEventListener('scroll', trackScrolling)
1463
+ // return () => {
1464
+ // document.removeEventListener('scroll', trackScrolling)
1465
+ // }
1466
+ // }, [currentPage])
2384
1467
 
2385
- return React__default.createElement(
1468
+ // const trackScrolling = (current) => {
1469
+ // if (window.pageYOffset === 0) {
1470
+ // if (currentPage > 1) {
1471
+ // changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, 1)
1472
+ // }
1473
+ // }
1474
+ // }
1475
+
1476
+ return React.createElement(
2386
1477
  'div',
2387
1478
  null,
2388
- !data ? React__default.createElement(
2389
- 'div',
2390
- { className: 'd-flex justify-content-center', style: { marginTop: '100px' } },
2391
- React__default.createElement(
2392
- Spinner,
2393
- { animation: 'border', role: 'status' },
2394
- React__default.createElement(
2395
- 'span',
2396
- { className: 'sr-only' },
2397
- 'Loading...'
1479
+ autoScroll ? React.createElement(
1480
+ React.Fragment,
1481
+ null,
1482
+ React.createElement(
1483
+ InfiniteScroll,
1484
+ { dataLength: data && data.length, next: function next() {
1485
+ return loadMore(values, setValues, itemsPerPage);
1486
+ }, hasMore: scrolling, scrollThreshold: 0.9 },
1487
+ React.createElement(
1488
+ Container,
1489
+ null,
1490
+ 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)
2398
1491
  )
1492
+ ),
1493
+ React.createElement(
1494
+ 'noscript',
1495
+ null,
1496
+ renderManualPagination(currentPage)
2399
1497
  )
2400
- ) : React__default.createElement(
2401
- Container,
1498
+ ) : React.createElement(
1499
+ React.Fragment,
2402
1500
  null,
2403
- React__default.createElement(CardLoader, {
2404
- data: data,
2405
- client: client,
2406
- mapping: mapping,
2407
- showPublished: showPublished,
2408
- defaultImage: defaultImage,
2409
- showAuthor: showAuthor,
2410
- showCategory: showCategory,
2411
- imageHeight: imageHeight,
2412
- imageWidth: imageWidth,
2413
- imageMaxHeight: imageMaxHeight,
2414
- imageFit: imageFit,
2415
- rightItems: rightItems,
2416
- brandInsightAd: brandInsightAd,
2417
- showBI: showBI,
2418
- heroContent: heroContent,
2419
- lgInfeedAd: lgInfeedAd,
2420
- showPubInfo: showPubInfo,
2421
- contentCategoryMapping: contentCategoryMapping,
2422
- showTimeDif: showTimeDiff,
2423
- showTaxonomies: showTaxonomies,
2424
- showIntro: showIntro
2425
- })
2426
- ),
2427
- React__default.createElement(Pagination, {
2428
- totalPostsCount: props.totalPostsCount,
2429
- itemsPerPage: props.params.itemsPerPage,
2430
- currentPage: props.currentPage,
2431
- handlePageChange: handlePageChange,
2432
- data: data
2433
- })
1501
+ React.createElement(
1502
+ Container,
1503
+ null,
1504
+ 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)
1505
+ ),
1506
+ React.createElement(
1507
+ 'div',
1508
+ { style: { padding: '0px 10px' } },
1509
+ scrolling ? React.createElement(
1510
+ 'button',
1511
+ {
1512
+ className: 'load-more-btn',
1513
+ style: { margin: 'auto', width: '100%' },
1514
+ onClick: function onClick(e) {
1515
+ loadMore(values, setValues, itemsPerPage);
1516
+ } },
1517
+ 'Load More'
1518
+ ) : React.createElement(
1519
+ 'p',
1520
+ { style: { textAlign: 'center' } },
1521
+ React.createElement(
1522
+ 'b',
1523
+ null,
1524
+ 'End of data'
1525
+ )
1526
+ )
1527
+ ),
1528
+ React.createElement(
1529
+ 'noscript',
1530
+ null,
1531
+ renderManualPagination(currentPage)
1532
+ )
1533
+ )
2434
1534
  );
2435
1535
  };
2436
1536