@mjhls/mjh-framework 1.0.109-8.rlTest → 1.0.109

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 (370) hide show
  1. package/README.md +5 -1
  2. package/dist/index.es.js +20606 -0
  3. package/dist/index.es.js.map +1 -0
  4. package/dist/index.js +20644 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +26 -55
  7. package/dist/cjs/AD.js +0 -32
  8. package/dist/cjs/AD300x250.js +0 -95
  9. package/dist/cjs/AD300x250x600.js +0 -112
  10. package/dist/cjs/AD728x90.js +0 -109
  11. package/dist/cjs/ADFloatingFooter.js +0 -151
  12. package/dist/cjs/ADFooter.js +0 -53
  13. package/dist/cjs/ADGutter.js +0 -123
  14. package/dist/cjs/ADInfeed-7c075eda.js +0 -75
  15. package/dist/cjs/ADSkyscraper.js +0 -125
  16. package/dist/cjs/ADSponsoredResources.js +0 -122
  17. package/dist/cjs/ADWebcast.js +0 -127
  18. package/dist/cjs/ADWelcome.js +0 -166
  19. package/dist/cjs/ADlgInfeed-d4f556bd.js +0 -69
  20. package/dist/cjs/AccordionPanel.js +0 -94
  21. package/dist/cjs/AdSlot.js +0 -283
  22. package/dist/cjs/AdSlotsProvider.js +0 -184
  23. package/dist/cjs/AlgoliaSearch.js +0 -15221
  24. package/dist/cjs/AlphabeticList.js +0 -134
  25. package/dist/cjs/ArticleCarousel.js +0 -45
  26. package/dist/cjs/ArticleProgramLandingPage.js +0 -186
  27. package/dist/cjs/ArticleSeriesLandingPage.js +0 -162
  28. package/dist/cjs/ArticleSeriesListing.js +0 -314
  29. package/dist/cjs/AuthWrapper.js +0 -1526
  30. package/dist/cjs/AuthorComponent-7d00f6d5.js +0 -96
  31. package/dist/cjs/Beam.js +0 -405
  32. package/dist/cjs/BlockContent-96b44364.js +0 -916
  33. package/dist/cjs/Breadcrumbs.js +0 -107
  34. package/dist/cjs/CEDeckSupabase.js +0 -444
  35. package/dist/cjs/CMEDeck.js +0 -444
  36. package/dist/cjs/Column1.js +0 -36
  37. package/dist/cjs/Column2.js +0 -73
  38. package/dist/cjs/Column3.js +0 -140
  39. package/dist/cjs/ConferenceArticleCard.js +0 -94
  40. package/dist/cjs/ConferenceBanner-213003ce.js +0 -24
  41. package/dist/cjs/ContentCardPaginated.js +0 -416
  42. package/dist/cjs/DeckContent.js +0 -507
  43. package/dist/cjs/DeckQueue.js +0 -402
  44. package/dist/cjs/DeckQueuePaginated.js +0 -347
  45. package/dist/cjs/Dfp-67646058.js +0 -103
  46. package/dist/cjs/EventsDeck.js +0 -856
  47. package/dist/cjs/ExternalResources.js +0 -220
  48. package/dist/cjs/Feature.js +0 -132
  49. package/dist/cjs/ForbesHero.js +0 -138
  50. package/dist/cjs/GridContent.js +0 -828
  51. package/dist/cjs/GridContentPaginated.js +0 -703
  52. package/dist/cjs/GridHero.js +0 -148
  53. package/dist/cjs/GroupDeck.js +0 -314
  54. package/dist/cjs/HamMagazine.js +0 -664
  55. package/dist/cjs/Header.js +0 -65
  56. package/dist/cjs/HealthCareProfessionalModal.js +0 -78
  57. package/dist/cjs/Hero.js +0 -49
  58. package/dist/cjs/HighlightenVideo.js +0 -69
  59. package/dist/cjs/HorizontalArticleListing.js +0 -167
  60. package/dist/cjs/HorizontalHero.js +0 -112
  61. package/dist/cjs/ImageSlider-7c995858.js +0 -2808
  62. package/dist/cjs/IssueContentDeck.js +0 -242
  63. package/dist/cjs/IssueDeck.js +0 -267
  64. package/dist/cjs/IssueLanding.js +0 -176
  65. package/dist/cjs/KMTracker.js +0 -27
  66. package/dist/cjs/LeftNav.js +0 -153
  67. package/dist/cjs/MasterDeck.js +0 -555
  68. package/dist/cjs/MasterDeckPaginated.js +0 -468
  69. package/dist/cjs/MediaSeriesCard.js +0 -134
  70. package/dist/cjs/MediaSeriesLanding.js +0 -507
  71. package/dist/cjs/MediaSeriesLandingPaginated.js +0 -532
  72. package/dist/cjs/NavDvm.js +0 -278
  73. package/dist/cjs/NavFooter-b7b16d48.js +0 -72
  74. package/dist/cjs/NavMagazine.js +0 -615
  75. package/dist/cjs/NavNative.js +0 -880
  76. package/dist/cjs/OncliveHero.js +0 -80
  77. package/dist/cjs/OncliveLargeHero.js +0 -242
  78. package/dist/cjs/PageFilter.js +0 -72
  79. package/dist/cjs/Pagination-6359861a.js +0 -97
  80. package/dist/cjs/PartnerDetailListing.js +0 -374
  81. package/dist/cjs/PartnerDetailListingPaginated.js +0 -365
  82. package/dist/cjs/PdfDownload.js +0 -28
  83. package/dist/cjs/PixelTracking.js +0 -191
  84. package/dist/cjs/PodcastsLanding.js +0 -234
  85. package/dist/cjs/PopUpModal.js +0 -58
  86. package/dist/cjs/PtceDeck.js +0 -150
  87. package/dist/cjs/PubSection.js +0 -120
  88. package/dist/cjs/PubToc.js +0 -88
  89. package/dist/cjs/PublicationDeck.js +0 -184
  90. package/dist/cjs/PublicationFeature-4b68e0db.js +0 -130
  91. package/dist/cjs/PublicationLanding.js +0 -826
  92. package/dist/cjs/QueueDeckExpanded.js +0 -1540
  93. package/dist/cjs/QueueDeckExpandedPaginated.js +0 -1387
  94. package/dist/cjs/RecentNews.js +0 -91
  95. package/dist/cjs/RelatedContent.js +0 -115
  96. package/dist/cjs/RelatedTopicsDropdown.js +0 -90
  97. package/dist/cjs/RolesDeck.js +0 -94
  98. package/dist/cjs/Schema.js +0 -102
  99. package/dist/cjs/Search.js +0 -66
  100. package/dist/cjs/Segment.js +0 -458
  101. package/dist/cjs/SeriesListingDeck.js +0 -247
  102. package/dist/cjs/SeriesSlider-086a8319.js +0 -332
  103. package/dist/cjs/SetCookie.js +0 -10
  104. package/dist/cjs/SideFooter.js +0 -152
  105. package/dist/cjs/SocialIcons.js +0 -103
  106. package/dist/cjs/SocialSearchComponent-d7e5d3a6.js +0 -213
  107. package/dist/cjs/SocialShare.js +0 -74
  108. package/dist/cjs/TaxonomyCard.js +0 -256
  109. package/dist/cjs/TaxonomyDescription.js +0 -208
  110. package/dist/cjs/TemplateNormal.js +0 -204
  111. package/dist/cjs/ThumbnailCard.js +0 -60
  112. package/dist/cjs/Tooltip-b8516cbf.js +0 -9541
  113. package/dist/cjs/Ustream.js +0 -157
  114. package/dist/cjs/VerticalHero.js +0 -75
  115. package/dist/cjs/VideoProgramLandingPage.js +0 -262
  116. package/dist/cjs/VideoSeriesCard.js +0 -88
  117. package/dist/cjs/VideoSeriesFilter.js +0 -129
  118. package/dist/cjs/VideoSeriesLandingPage.js +0 -178
  119. package/dist/cjs/VideoSeriesListing.js +0 -421
  120. package/dist/cjs/View.js +0 -2835
  121. package/dist/cjs/YahooHero.js +0 -127
  122. package/dist/cjs/YoutubeGroup.js +0 -372
  123. package/dist/cjs/_commonjsHelpers-06173234.js +0 -25
  124. package/dist/cjs/_is-array-54228b29.js +0 -74
  125. package/dist/cjs/_iter-detect-b1df62f0.js +0 -52
  126. package/dist/cjs/_library-dd23b178.js +0 -5
  127. package/dist/cjs/_object-sap-d1978572.js +0 -16
  128. package/dist/cjs/_object-to-array-9337ba83.js +0 -25
  129. package/dist/cjs/_set-species-0c7864a2.js +0 -55
  130. package/dist/cjs/asyncToGenerator-65df6bf8.js +0 -1347
  131. package/dist/cjs/brightcove-react-player-loader.es-35faab67.js +0 -2232
  132. package/dist/cjs/checkSisterSite-c3a4ac98.js +0 -19
  133. package/dist/cjs/core.get-iterator-method-5643aa10.js +0 -584
  134. package/dist/cjs/debounce-d4a2369b.js +0 -216
  135. package/dist/cjs/define-property-e8404b64.js +0 -20
  136. package/dist/cjs/defineProperty-19580e93.js +0 -71
  137. package/dist/cjs/defineProperty-9673846a.js +0 -34
  138. package/dist/cjs/entities-df1aed86.js +0 -510
  139. package/dist/cjs/eq-5fc26c07.js +0 -79
  140. package/dist/cjs/extends-be0d85bc.js +0 -100
  141. package/dist/cjs/faundadb.js +0 -765
  142. package/dist/cjs/get-5839e5b5.js +0 -920
  143. package/dist/cjs/getContentCategory-f38a4c00.js +0 -11
  144. package/dist/cjs/getKeywords.js +0 -46
  145. package/dist/cjs/getPtceActivities.js +0 -90
  146. package/dist/cjs/getQuery.js +0 -27
  147. package/dist/cjs/getRelatedArticle.js +0 -766
  148. package/dist/cjs/getRootDocGroup.js +0 -63
  149. package/dist/cjs/getSerializers.js +0 -66
  150. package/dist/cjs/getSeriesDetail.js +0 -40
  151. package/dist/cjs/getTIData.js +0 -93
  152. package/dist/cjs/getTargeting-7ce7037b.js +0 -166
  153. package/dist/cjs/getTargeting.js +0 -12
  154. package/dist/cjs/iconBase-be4097c0.js +0 -104
  155. package/dist/cjs/index-187c967e.js +0 -54
  156. package/dist/cjs/index-3177f564.js +0 -1573
  157. package/dist/cjs/index-65621b6c.js +0 -613
  158. package/dist/cjs/index-7435b964.js +0 -1683
  159. package/dist/cjs/index-a26637a3.js +0 -11764
  160. package/dist/cjs/index-d48b231c.js +0 -556
  161. package/dist/cjs/index-ff83a88b.js +0 -104
  162. package/dist/cjs/index.es-1ab8dda7.js +0 -445
  163. package/dist/cjs/index.esm-2ea9e9ff.js +0 -98
  164. package/dist/cjs/index.esm-c1e16606.js +0 -13
  165. package/dist/cjs/index.esm-d51c9ac6.js +0 -25
  166. package/dist/cjs/index.esm-d81454e7.js +0 -19
  167. package/dist/cjs/index.js +0 -638
  168. package/dist/cjs/inherits-e47b5342.js +0 -188
  169. package/dist/cjs/isSymbol-03abbdf0.js +0 -209
  170. package/dist/cjs/js.cookie-a511c430.js +0 -160
  171. package/dist/cjs/keys-e982b3fa.js +0 -25
  172. package/dist/cjs/lodash-f0783643.js +0 -17195
  173. package/dist/cjs/main-ae8472f3.js +0 -969
  174. package/dist/cjs/moment-f730814d.js +0 -5684
  175. package/dist/cjs/react-social-icons-2c5c389a.js +0 -616
  176. package/dist/cjs/slicedToArray-067dd3bc.js +0 -95
  177. package/dist/cjs/smoothscroll-99df7f93.js +0 -438
  178. package/dist/cjs/stringify-f7a37a8d.js +0 -17
  179. package/dist/cjs/style-inject.es-dcee06b6.js +0 -30
  180. package/dist/cjs/timeDifferenceCalc.js +0 -39
  181. package/dist/cjs/toConsumableArray-d7797c2b.js +0 -74
  182. package/dist/cjs/toNumber-5e1fac58.js +0 -104
  183. package/dist/cjs/typeof-220bbf73.js +0 -382
  184. package/dist/cjs/urlFor.js +0 -66
  185. package/dist/cjs/urlForFile-5084fc48.js +0 -29
  186. package/dist/cjs/ustream-api-3819e4aa.js +0 -106
  187. package/dist/cjs/visibility-sensor-56020df6.js +0 -597
  188. package/dist/cjs/web.dom.iterable-d98303e0.js +0 -50
  189. package/dist/esm/AD.js +0 -26
  190. package/dist/esm/AD300x250.js +0 -89
  191. package/dist/esm/AD300x250x600.js +0 -106
  192. package/dist/esm/AD728x90.js +0 -103
  193. package/dist/esm/ADFloatingFooter.js +0 -145
  194. package/dist/esm/ADFooter.js +0 -47
  195. package/dist/esm/ADGutter.js +0 -117
  196. package/dist/esm/ADInfeed-3442c999.js +0 -68
  197. package/dist/esm/ADSkyscraper.js +0 -119
  198. package/dist/esm/ADSponsoredResources.js +0 -116
  199. package/dist/esm/ADWebcast.js +0 -121
  200. package/dist/esm/ADWelcome.js +0 -160
  201. package/dist/esm/ADlgInfeed-30649360.js +0 -63
  202. package/dist/esm/AccordionPanel.js +0 -87
  203. package/dist/esm/AdSlot.js +0 -276
  204. package/dist/esm/AdSlotsProvider.js +0 -177
  205. package/dist/esm/AlgoliaSearch.js +0 -15214
  206. package/dist/esm/AlphabeticList.js +0 -128
  207. package/dist/esm/ArticleCarousel.js +0 -39
  208. package/dist/esm/ArticleProgramLandingPage.js +0 -180
  209. package/dist/esm/ArticleSeriesLandingPage.js +0 -156
  210. package/dist/esm/ArticleSeriesListing.js +0 -307
  211. package/dist/esm/AuthWrapper.js +0 -1520
  212. package/dist/esm/AuthorComponent-d9653ae5.js +0 -90
  213. package/dist/esm/Beam.js +0 -403
  214. package/dist/esm/BlockContent-1e73bd2c.js +0 -909
  215. package/dist/esm/Breadcrumbs.js +0 -100
  216. package/dist/esm/CEDeckSupabase.js +0 -438
  217. package/dist/esm/CMEDeck.js +0 -438
  218. package/dist/esm/Column1.js +0 -28
  219. package/dist/esm/Column2.js +0 -65
  220. package/dist/esm/Column3.js +0 -132
  221. package/dist/esm/ConferenceArticleCard.js +0 -88
  222. package/dist/esm/ConferenceBanner-8792ebd2.js +0 -18
  223. package/dist/esm/ContentCardPaginated.js +0 -405
  224. package/dist/esm/DeckContent.js +0 -497
  225. package/dist/esm/DeckQueue.js +0 -392
  226. package/dist/esm/DeckQueuePaginated.js +0 -336
  227. package/dist/esm/Dfp-3b6eb620.js +0 -96
  228. package/dist/esm/EventsDeck.js +0 -843
  229. package/dist/esm/ExternalResources.js +0 -213
  230. package/dist/esm/Feature.js +0 -125
  231. package/dist/esm/ForbesHero.js +0 -132
  232. package/dist/esm/GridContent.js +0 -818
  233. package/dist/esm/GridContentPaginated.js +0 -692
  234. package/dist/esm/GridHero.js +0 -142
  235. package/dist/esm/GroupDeck.js +0 -308
  236. package/dist/esm/HamMagazine.js +0 -651
  237. package/dist/esm/Header.js +0 -54
  238. package/dist/esm/HealthCareProfessionalModal.js +0 -70
  239. package/dist/esm/Hero.js +0 -43
  240. package/dist/esm/HighlightenVideo.js +0 -63
  241. package/dist/esm/HorizontalArticleListing.js +0 -161
  242. package/dist/esm/HorizontalHero.js +0 -106
  243. package/dist/esm/ImageSlider-75f7b81a.js +0 -2799
  244. package/dist/esm/IssueContentDeck.js +0 -232
  245. package/dist/esm/IssueDeck.js +0 -257
  246. package/dist/esm/IssueLanding.js +0 -170
  247. package/dist/esm/KMTracker.js +0 -25
  248. package/dist/esm/LeftNav.js +0 -143
  249. package/dist/esm/MasterDeck.js +0 -548
  250. package/dist/esm/MasterDeckPaginated.js +0 -460
  251. package/dist/esm/MediaSeriesCard.js +0 -128
  252. package/dist/esm/MediaSeriesLanding.js +0 -500
  253. package/dist/esm/MediaSeriesLandingPaginated.js +0 -525
  254. package/dist/esm/NavDvm.js +0 -265
  255. package/dist/esm/NavFooter-4bcffccb.js +0 -66
  256. package/dist/esm/NavMagazine.js +0 -602
  257. package/dist/esm/NavNative.js +0 -864
  258. package/dist/esm/OncliveHero.js +0 -74
  259. package/dist/esm/OncliveLargeHero.js +0 -236
  260. package/dist/esm/PageFilter.js +0 -66
  261. package/dist/esm/Pagination-9fe9f61d.js +0 -90
  262. package/dist/esm/PartnerDetailListing.js +0 -368
  263. package/dist/esm/PartnerDetailListingPaginated.js +0 -359
  264. package/dist/esm/PdfDownload.js +0 -22
  265. package/dist/esm/PixelTracking.js +0 -182
  266. package/dist/esm/PodcastsLanding.js +0 -227
  267. package/dist/esm/PopUpModal.js +0 -51
  268. package/dist/esm/PtceDeck.js +0 -144
  269. package/dist/esm/PubSection.js +0 -114
  270. package/dist/esm/PubToc.js +0 -82
  271. package/dist/esm/PublicationDeck.js +0 -174
  272. package/dist/esm/PublicationFeature-6c334891.js +0 -121
  273. package/dist/esm/PublicationLanding.js +0 -816
  274. package/dist/esm/QueueDeckExpanded.js +0 -1534
  275. package/dist/esm/QueueDeckExpandedPaginated.js +0 -1381
  276. package/dist/esm/RecentNews.js +0 -85
  277. package/dist/esm/RelatedContent.js +0 -109
  278. package/dist/esm/RelatedTopicsDropdown.js +0 -82
  279. package/dist/esm/RolesDeck.js +0 -84
  280. package/dist/esm/Schema.js +0 -96
  281. package/dist/esm/Search.js +0 -57
  282. package/dist/esm/Segment.js +0 -456
  283. package/dist/esm/SeriesListingDeck.js +0 -241
  284. package/dist/esm/SeriesSlider-acbdf4c9.js +0 -326
  285. package/dist/esm/SetCookie.js +0 -8
  286. package/dist/esm/SideFooter.js +0 -146
  287. package/dist/esm/SocialIcons.js +0 -97
  288. package/dist/esm/SocialSearchComponent-9e65c8d6.js +0 -204
  289. package/dist/esm/SocialShare.js +0 -67
  290. package/dist/esm/TaxonomyCard.js +0 -246
  291. package/dist/esm/TaxonomyDescription.js +0 -201
  292. package/dist/esm/TemplateNormal.js +0 -197
  293. package/dist/esm/ThumbnailCard.js +0 -53
  294. package/dist/esm/Tooltip-fe0ed92d.js +0 -9532
  295. package/dist/esm/Ustream.js +0 -151
  296. package/dist/esm/VerticalHero.js +0 -69
  297. package/dist/esm/VideoProgramLandingPage.js +0 -253
  298. package/dist/esm/VideoSeriesCard.js +0 -82
  299. package/dist/esm/VideoSeriesFilter.js +0 -123
  300. package/dist/esm/VideoSeriesLandingPage.js +0 -172
  301. package/dist/esm/VideoSeriesListing.js +0 -414
  302. package/dist/esm/View.js +0 -2825
  303. package/dist/esm/YahooHero.js +0 -121
  304. package/dist/esm/YoutubeGroup.js +0 -366
  305. package/dist/esm/_commonjsHelpers-0c4b6f40.js +0 -19
  306. package/dist/esm/_is-array-68c79b29.js +0 -71
  307. package/dist/esm/_iter-detect-2f89237f.js +0 -48
  308. package/dist/esm/_library-528f1934.js +0 -3
  309. package/dist/esm/_object-sap-14bd8e96.js +0 -14
  310. package/dist/esm/_object-to-array-9dfdfb29.js +0 -23
  311. package/dist/esm/_set-species-7d3317b7.js +0 -50
  312. package/dist/esm/asyncToGenerator-1ebeb135.js +0 -1343
  313. package/dist/esm/brightcove-react-player-loader.es-a2422c4b.js +0 -2226
  314. package/dist/esm/checkSisterSite-a7218fda.js +0 -17
  315. package/dist/esm/core.get-iterator-method-95db387d.js +0 -547
  316. package/dist/esm/debounce-533d9748.js +0 -214
  317. package/dist/esm/define-property-433c51d3.js +0 -18
  318. package/dist/esm/defineProperty-e5afb9eb.js +0 -32
  319. package/dist/esm/defineProperty-e8022d1e.js +0 -66
  320. package/dist/esm/entities-6d9154b4.js +0 -507
  321. package/dist/esm/eq-bdcbf886.js +0 -76
  322. package/dist/esm/extends-2f4448b8.js +0 -94
  323. package/dist/esm/faundadb.js +0 -754
  324. package/dist/esm/get-3c308da4.js +0 -918
  325. package/dist/esm/getContentCategory-15dcc413.js +0 -9
  326. package/dist/esm/getKeywords.js +0 -44
  327. package/dist/esm/getPtceActivities.js +0 -88
  328. package/dist/esm/getQuery.js +0 -25
  329. package/dist/esm/getRelatedArticle.js +0 -764
  330. package/dist/esm/getRootDocGroup.js +0 -61
  331. package/dist/esm/getSerializers.js +0 -60
  332. package/dist/esm/getSeriesDetail.js +0 -38
  333. package/dist/esm/getTIData.js +0 -91
  334. package/dist/esm/getTargeting-301942ae.js +0 -163
  335. package/dist/esm/getTargeting.js +0 -6
  336. package/dist/esm/iconBase-ccc56b97.js +0 -81
  337. package/dist/esm/index-3f5c03b2.js +0 -553
  338. package/dist/esm/index-4550ef23.js +0 -1571
  339. package/dist/esm/index-5cc7b406.js +0 -1674
  340. package/dist/esm/index-755f2cc2.js +0 -605
  341. package/dist/esm/index-a68bfe70.js +0 -11743
  342. package/dist/esm/index-c7e2ac95.js +0 -52
  343. package/dist/esm/index-c8d5e72b.js +0 -99
  344. package/dist/esm/index.es-a6137319.js +0 -439
  345. package/dist/esm/index.esm-1bd8a0a8.js +0 -18
  346. package/dist/esm/index.esm-9508070a.js +0 -91
  347. package/dist/esm/index.esm-9b042655.js +0 -10
  348. package/dist/esm/index.esm-eb1e8e80.js +0 -14
  349. package/dist/esm/index.js +0 -531
  350. package/dist/esm/inherits-96c84cbd.js +0 -179
  351. package/dist/esm/isSymbol-a7e9aafe.js +0 -203
  352. package/dist/esm/js.cookie-6874175c.js +0 -158
  353. package/dist/esm/keys-185288f4.js +0 -23
  354. package/dist/esm/lodash-f97fd99a.js +0 -17193
  355. package/dist/esm/main-754d4992.js +0 -956
  356. package/dist/esm/moment-48faeb9c.js +0 -5682
  357. package/dist/esm/react-social-icons-9be47857.js +0 -609
  358. package/dist/esm/slicedToArray-72ed566b.js +0 -92
  359. package/dist/esm/smoothscroll-fa4e3f8c.js +0 -436
  360. package/dist/esm/stringify-1e2a5946.js +0 -15
  361. package/dist/esm/style-inject.es-1f59c1d0.js +0 -28
  362. package/dist/esm/timeDifferenceCalc.js +0 -37
  363. package/dist/esm/toConsumableArray-e6f28e5c.js +0 -71
  364. package/dist/esm/toNumber-5aeba6e7.js +0 -102
  365. package/dist/esm/typeof-3ab7d3b6.js +0 -378
  366. package/dist/esm/urlFor.js +0 -64
  367. package/dist/esm/urlForFile-2e523b67.js +0 -27
  368. package/dist/esm/ustream-api-63a164b3.js +0 -104
  369. package/dist/esm/visibility-sensor-72fd8f8b.js +0 -590
  370. package/dist/esm/web.dom.iterable-3fffc027.js +0 -48
package/dist/cjs/View.js DELETED
@@ -1,2835 +0,0 @@
1
- 'use strict';
2
-
3
- var asyncToGenerator = require('./asyncToGenerator-65df6bf8.js');
4
- var _extends = require('./extends-be0d85bc.js');
5
- var slicedToArray = require('./slicedToArray-067dd3bc.js');
6
- var React = require('react');
7
- var Head = require('next/head');
8
- var Router = require('next/router');
9
- var stringify = require('./stringify-f7a37a8d.js');
10
- var toConsumableArray = require('./toConsumableArray-d7797c2b.js');
11
- var moment = require('./moment-f730814d.js');
12
- var BlockContent = require('./BlockContent-96b44364.js');
13
- var main = require('./main-ae8472f3.js');
14
- require('react-bootstrap/Dropdown');
15
- var Form = require('react-bootstrap/Form');
16
- var FormControl = require('react-bootstrap/FormControl');
17
- var Button = require('react-bootstrap/Button');
18
- var visibilitySensor = require('./visibility-sensor-56020df6.js');
19
- var SocialShare = require('./SocialShare.js');
20
- var getSerializers = require('./index-a26637a3.js');
21
- var AdSlot = require('./AdSlot.js');
22
- var SeriesSlider = require('./SeriesSlider-086a8319.js');
23
- var getTargeting = require('./getTargeting-7ce7037b.js');
24
- var getKeywords = require('./getKeywords.js');
25
- var urlFor = require('./urlFor.js');
26
- var urlForFile = require('./urlForFile-5084fc48.js');
27
- var _typeof = require('./typeof-220bbf73.js');
28
- var index_esm = require('./index.esm-d51c9ac6.js');
29
- var styleInject_es = require('./style-inject.es-dcee06b6.js');
30
- require('./index-65621b6c.js');
31
- var disqusReact = require('disqus-react');
32
- var Schema = require('./Schema.js');
33
- var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
34
- var PixelTracking = require('./PixelTracking.js');
35
- var keys = require('./keys-e982b3fa.js');
36
- var index_es = require('./index.es-1ab8dda7.js');
37
- var index = require('./index-7435b964.js');
38
- var getRelatedArticle = require('./getRelatedArticle.js');
39
- var getQuery = require('./getQuery.js');
40
- var getSeriesDetail = require('./getSeriesDetail.js');
41
- require('./core.get-iterator-method-5643aa10.js');
42
- require('./web.dom.iterable-d98303e0.js');
43
- require('./_library-dd23b178.js');
44
- require('./_set-species-0c7864a2.js');
45
- require('./_iter-detect-b1df62f0.js');
46
- require('prop-types');
47
- require('./index-d48b231c.js');
48
- require('react-dom');
49
- require('react-share');
50
- require('react-bootstrap');
51
- require('./index-187c967e.js');
52
- require('./Beam.js');
53
- require('./Segment.js');
54
- require('./brightcove-react-player-loader.es-35faab67.js');
55
- require('./_object-to-array-9337ba83.js');
56
- require('react-bootstrap/Modal');
57
- require('react-ga');
58
- require('./GroupDeck.js');
59
- require('./smoothscroll-99df7f93.js');
60
- require('./_is-array-54228b29.js');
61
- require('react-bootstrap/Pagination');
62
- require('./entities-df1aed86.js');
63
- require('react-bootstrap/Row');
64
- require('react-bootstrap/Col');
65
- require('./inherits-e47b5342.js');
66
- require('./_object-sap-d1978572.js');
67
- require('./define-property-e8404b64.js');
68
- require('./index.esm-d81454e7.js');
69
- require('./iconBase-be4097c0.js');
70
- require('react-bootstrap/Figure');
71
- require('react-bootstrap/OverlayTrigger');
72
- require('react-bootstrap/Tooltip');
73
- require('react-bootstrap/Popover');
74
- require('./checkSisterSite-c3a4ac98.js');
75
- require('./debounce-d4a2369b.js');
76
- require('./isSymbol-03abbdf0.js');
77
- require('./toNumber-5e1fac58.js');
78
-
79
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
80
-
81
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
82
- var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
83
- var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
84
- var FormControl__default = /*#__PURE__*/_interopDefaultLegacy(FormControl);
85
- var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
86
-
87
- var getArticleSummary = function getArticleSummary(article) {
88
- if (article.summary && article.summary.length > 0) {
89
- return article.summary;
90
- } else {
91
- return false;
92
- }
93
- };
94
-
95
- var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
96
- if (!docGroup) {
97
- return null;
98
- }
99
- var url = void 0;
100
- try {
101
- if (docGroup.path && docGroup.path.includes('/') && (!docGroup.parent || !docGroup.parent.parent)) {
102
- return '/' + docGroup.path;
103
- }
104
- } catch (e) {
105
- console.log(e.message);
106
- }
107
- // Checking if Parent has Parent
108
- try {
109
- if (docGroup.path && docGroup.path.includes('/') && docGroup.parent && docGroup.parent.parent) {
110
- if (docGroup.path.includes(docGroup.parent.identifier.current)) {
111
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.path;
112
- } else {
113
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
114
- }
115
- }
116
- } catch (e) {
117
- console.log(e.message);
118
- }
119
-
120
- try {
121
- if (docGroup.parent && docGroup.parent.identifier && docGroup.parent.parent && docGroup.parent.parent.identifier && docGroup.parent.identifier.current.includes('/') && docGroup.parent.identifier.current.split('/')[0] === docGroup.parent.parent.identifier.current) {
122
- return '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
123
- }
124
- } catch (e) {
125
- console.log(e.message);
126
- }
127
-
128
- if (docGroup.parent) {
129
- url = '/' + docGroup.parent.identifier.current;
130
- if (docGroup.parent.parent && docGroup.parent.parent.name) {
131
- url = '/' + docGroup.parent.parent.identifier.current + url;
132
- }
133
- }
134
-
135
- if (typeof url !== 'undefined') {
136
- url = url + '/' + docGroup.path;
137
- } else {
138
- // url = '/' + docGroup.path
139
- return null;
140
- }
141
-
142
- return url;
143
- };
144
-
145
- var getDocumentGroupName = function getDocumentGroupName(docGroup) {
146
- var name = void 0;
147
- if (!docGroup) {
148
- return null;
149
- }
150
-
151
- if (docGroup.parent) {
152
- name = docGroup.parent.name;
153
-
154
- if (docGroup.parent.parent && docGroup.parent.parent.name) {
155
- name = docGroup.parent.parent.name + ' | ' + name;
156
- }
157
- }
158
-
159
- if (typeof name !== 'undefined') {
160
- name = name + ' | <b>' + docGroup.name + '</b>';
161
- } else {
162
- // name = '<b>' + docGroup.name + '</b>'
163
- return null;
164
- }
165
-
166
- return name && typeof name != 'undefined' ? name : null;
167
- };
168
-
169
- var DocumentGroup = function DocumentGroup(_ref) {
170
- var article = _ref.article,
171
- client = _ref.client;
172
-
173
-
174
- var mediaSeriesGroup = null;
175
- var disableThumbnail = false;
176
-
177
- if (article.documentGroup && article.documentGroup.hideThumbnail === true) {
178
- disableThumbnail = true;
179
- }
180
-
181
- if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
182
- mediaSeriesGroup = article.documentGroup;
183
- }
184
- if (!article.documentGroup && article.documentGroupMapping) {
185
- for (var i = 0; i < article.documentGroupMapping.length; i++) {
186
- if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
187
- mediaSeriesGroup = article.documentGroupMapping[i];
188
- break;
189
- }
190
- }
191
- }
192
-
193
- if (!mediaSeriesGroup) {
194
- return null;
195
- }
196
-
197
- var name = getDocumentGroupName(mediaSeriesGroup);
198
- var url = getDocumentGroupUrl(mediaSeriesGroup);
199
- var thumbnailUrl = false;
200
-
201
- if (mediaSeriesGroup.thumbnail) {
202
- thumbnailUrl = urlFor({ client: client, source: mediaSeriesGroup.thumbnail });
203
- }
204
- var margin = article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'none' : '1rem';
205
- return React__default["default"].createElement(
206
- 'div',
207
- null,
208
- React__default["default"].createElement(
209
- 'p',
210
- { style: { textAlign: 'center', fontWeight: 600 } },
211
- article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
212
- ),
213
- url && name && React__default["default"].createElement(
214
- 'a',
215
- {
216
- href: url,
217
- className: 'doc-group',
218
- style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
219
- thumbnailUrl && !disableThumbnail && React__default["default"].createElement('img', { style: { maxWidth: '210px', maxHeight: '100px', marginTop: margin }, src: thumbnailUrl, alt: name }),
220
- (disableThumbnail || !thumbnailUrl) && React__default["default"].createElement('p', {
221
- style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main.main_43 ? 'left' : 'right', marginTop: '.25rem' },
222
- dangerouslySetInnerHTML: { __html: name } }),
223
- main.main_43 && !thumbnailUrl && React__default["default"].createElement(
224
- 'style',
225
- { jsx: 'true' },
226
- '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
227
- )
228
- )
229
- );
230
- };
231
-
232
- var findIndex = function findIndex(arr) {
233
- var indexes = [];
234
- if ((typeof arr === 'undefined' ? 'undefined' : _typeof._typeof(arr)) === 'object') {
235
- var _iteratorNormalCompletion = true;
236
- var _didIteratorError = false;
237
- var _iteratorError = undefined;
238
-
239
- try {
240
- for (var _iterator = slicedToArray._getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
241
- var ele = _step.value;
242
-
243
- if (ele['_type'] === 'block' && ele.children.some(function (child) {
244
- return child.text.trim().length > 0;
245
- }) && ele['listItem'] !== 'bullet' &&
246
- // To skip li tags when setting contextual native ads
247
- ele['listItem'] !== 'number' && ele['style'] === 'normal' || ele['_type'] === 'figure') {
248
- indexes.push(arr.indexOf(ele));
249
- }
250
- }
251
- } catch (err) {
252
- _didIteratorError = true;
253
- _iteratorError = err;
254
- } finally {
255
- try {
256
- if (!_iteratorNormalCompletion && _iterator.return) {
257
- _iterator.return();
258
- }
259
- } finally {
260
- if (_didIteratorError) {
261
- throw _iteratorError;
262
- }
263
- }
264
- }
265
- }
266
- return indexes;
267
- };
268
-
269
- var ISI = function ISI(props) {
270
- var children = props.children;
271
-
272
- var _useState = React.useState(false),
273
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
274
- active = _useState2[0],
275
- setActive = _useState2[1];
276
-
277
- var _useState3 = React.useState(false),
278
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
279
- bottomOfArticle = _useState4[0],
280
- setbottomOfArticle = _useState4[1];
281
-
282
- var isi = React.useRef();
283
-
284
- React.useEffect(function () {
285
- if (active) {
286
- var offset = '5rem';
287
- var nav = document.getElementsByTagName('header');
288
- if (nav && nav.length > 0) {
289
- offset = nav[0].offsetHeight + 'px';
290
- }
291
- isi.current.style.maxHeight = 'calc(100% - ' + offset + ')';
292
- isi.current.style.overflowY = 'scroll';
293
- } else {
294
- isi.current.style.maxHeight = '';
295
- isi.current.style.overflowY = '';
296
- }
297
- }, [active]);
298
- React.useEffect(function () {
299
- var detectBottomOfArticle = function detectBottomOfArticle() {
300
- var article_body = document.getElementById('article__block');
301
- var isi = document.getElementById('isi');
302
- var articleBottomPosition = article_body.getBoundingClientRect().bottom - window.innerHeight;
303
- // console.log(articleBottomPosition, bottomOfArticle)
304
- if (articleBottomPosition < 30 && !isi.classList.contains('in-view')) {
305
- setbottomOfArticle(true);
306
- }
307
- if (articleBottomPosition > 60 && isi.classList.contains('in-view')) {
308
- setbottomOfArticle(false);
309
- }
310
- };
311
- window.addEventListener('scroll', detectBottomOfArticle);
312
- return function () {
313
- return window.removeEventListener('scroll', detectBottomOfArticle);
314
- };
315
- }, []);
316
-
317
- React.useEffect(function () {
318
- var isi = document.getElementById('isi');
319
- if (bottomOfArticle) {
320
- toggleSticky(true);
321
- isi.classList.add('in-view');
322
- if (active) {
323
- setActive(false);
324
- }
325
- }
326
- if (!bottomOfArticle) {
327
- toggleSticky(false);
328
- isi.classList.remove('in-view');
329
- }
330
- }, [bottomOfArticle]);
331
-
332
- var toggleSticky = function toggleSticky(sticky) {
333
- var isiToggle = document.getElementById('isiToggle');
334
- var isiContent = document.getElementById('isiContent');
335
- var isi = document.getElementById('isi');
336
- if (sticky) {
337
- isi.style.bottom = '-200px';
338
- setTimeout(function () {
339
- isi.style.maxHeight = 'unset';
340
- isi.style.position = 'relative';
341
- isi.style.boxShadow = 'none';
342
- isi.style.zIndex = '1';
343
- isi.style.marginTop = '-25rem';
344
- isi.style.marginBottom = '15rem';
345
- isiToggle.style.display = 'none';
346
- isiContent.style.padding = '0';
347
- }, 300);
348
- } else if (!sticky) {
349
-
350
- isi.style.marginBottom = '0';
351
- isi.style.maxHeight = '12rem';
352
- isi.style.position = 'fixed';
353
- isi.style.boxShadow = '0 0 1rem 0 rgba(0, 0, 0, 0.5)';
354
- isi.style.zIndex = '99999';
355
-
356
- isiToggle.style.display = 'block';
357
- isiContent.style.padding = '1rem';
358
- setTimeout(function () {
359
- isi.style.bottom = '0';
360
- isi.style.marginTop = '0';
361
- }, 300);
362
- }
363
- };
364
- return React__default["default"].createElement(
365
- React__default["default"].Fragment,
366
- null,
367
- React__default["default"].createElement(
368
- 'div',
369
- { id: 'isi', ref: isi },
370
- React__default["default"].createElement(
371
- 'div',
372
- { id: 'isiContent' },
373
- React__default["default"].createElement(
374
- 'div',
375
- { onClick: function onClick() {
376
- return setActive(function (prev) {
377
- return !prev;
378
- });
379
- }, id: 'isiToggle' },
380
- active ? React__default["default"].createElement(
381
- 'p',
382
- null,
383
- 'Close ',
384
- React__default["default"].createElement(index_esm.FaMinus, null)
385
- ) : React__default["default"].createElement(
386
- 'p',
387
- null,
388
- 'See More ',
389
- React__default["default"].createElement(index_esm.FaPlus, null)
390
- )
391
- ),
392
- children
393
- )
394
- ),
395
- React__default["default"].createElement(
396
- 'style',
397
- { jsx: true },
398
- '\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 12rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n width: 100%;\n box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.5);\n transition: bottom .5s ease , margin-top .3s, max-height .2s;\n }\n #isiContent {\n width: 100%;\n max-width: 1000px;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n padding: 1rem;\n font-size: 1rem;\n }\n #isi::-webkit-scrollbar {\n display: none;\n }\n #isiToggle {\n position: absolute;\n top: 0;\n right: 0;\n padding: 1rem;\n font-weight: bold;\n cursor: pointer;\n font-size: 1rem;\n }\n #isiToggle p {\n margin: 0;\n }\n '
399
- )
400
- );
401
- };
402
-
403
- var css$1 = ".RelatedArticles-module_mediaContainer__10h9k {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n margin: 0 -1rem;\n}\n.RelatedArticles-module_mediaCard__3wQbn {\n margin: 0 1rem 1rem;\n width: calc(33% - 1rem);\n display: column;\n flex-direction: row;\n margin-bottom: 0.75rem;\n padding-bottom: 0.75rem;\n border-bottom: none;\n}\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\n border-bottom: none;\n}\n.RelatedArticles-module_cardTitle__3P-Ib {\n font-weight: bold;\n color: #252525;\n margin-bottom: 0.25rem;\n font-size: 15px;\n}\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\n color: #000;\n font-weight: bold;\n}\n.RelatedArticles-module_cardDate__1wOR5 {\n color: var(--dark);\n display: block;\n background: #fff !important;\n margin-bottom: 0;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 {\n display: block;\n text-align: center;\n margin-bottom: 0.5rem;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\n height: 135px;\n width: 100%;\n object-fit: cover;\n object-position: center;\n}\n@media screen and (max-width: 1064px) {\n}\n@media screen and (max-width: 968px) {\n .RelatedArticles-module_mediaContainer__10h9k {\n flex-wrap: wrap;\n }\n .RelatedArticles-module_imgWrapper__5Jx_4 {\n display: none;\n }\n .RelatedArticles-module_mediaCard__3wQbn {\n width: 100%;\n margin-bottom: 0.5rem;\n padding: 0;\n }\n .RelatedArticles-module_cardTitle__3P-Ib {\n font-size: 0.75rem;\n margin-bottom: 0;\n }\n}\n";
404
- var styles$1 = { "mediaContainer": "RelatedArticles-module_mediaContainer__10h9k", "mediaCard": "RelatedArticles-module_mediaCard__3wQbn", "cardTitle": "RelatedArticles-module_cardTitle__3P-Ib", "authorListing": "RelatedArticles-module_authorListing__1EFg4", "text-muted": "RelatedArticles-module_text-muted__3b0zX", "cardDate": "RelatedArticles-module_cardDate__1wOR5", "imgWrapper": "RelatedArticles-module_imgWrapper__5Jx_4" };
405
- styleInject_es.styleInject(css$1);
406
-
407
- var RelatedArticle = function RelatedArticle(_ref) {
408
- var articles = _ref.articles,
409
- client = _ref.client,
410
- fallbackImage = _ref.fallbackImage,
411
- _ref$showRelatedArtic = _ref.showRelatedArticleFallbackImage,
412
- showRelatedArticleFallbackImage = _ref$showRelatedArtic === undefined ? true : _ref$showRelatedArtic;
413
-
414
- if (!articles || articles.length == 0 || !articles[0]) {
415
- return null;
416
- }
417
- return React__default["default"].createElement(
418
- 'div',
419
- { className: styles$1.mediaContainer },
420
- articles.map(function (article, index) {
421
- if (article && article.url && article.url.current) {
422
- return React__default["default"].createElement(
423
- 'div',
424
- { id: 'related-card', key: index, className: styles$1.mediaCard },
425
- React__default["default"].createElement(
426
- 'a',
427
- { className: styles$1.imgWrapper, href: '/view/' + (article.url ? article.url.current : '') },
428
- article.thumbnail ? React__default["default"].createElement('img', {
429
- style: { objectFit: 'cover', objectPosition: 'center' },
430
- src: article.thumbnail && urlFor({ client: client, source: article.thumbnail.asset, imageWidth: 250 }),
431
- alt: article.title
432
- }) : React__default["default"].createElement(
433
- React__default["default"].Fragment,
434
- null,
435
- fallbackImage && showRelatedArticleFallbackImage && React__default["default"].createElement('img', { src: fallbackImage, alt: 'website logo', style: { objectFit: 'contain' } })
436
- )
437
- ),
438
- React__default["default"].createElement(
439
- 'div',
440
- { className: styles$1.mediaBody },
441
- React__default["default"].createElement(
442
- 'a',
443
- { href: '/view/' + (article.url ? article.url.current : '') },
444
- React__default["default"].createElement(
445
- 'div',
446
- { className: styles$1.cardTitle },
447
- article.title
448
- )
449
- )
450
- )
451
- );
452
- }
453
- })
454
- );
455
- };
456
-
457
- var getSocialShareDisableFlag = function getSocialShareDisableFlag(article) {
458
- //Need to check Taxonomy, DocumentGroup, and Authors for showSocialShare
459
- var showSocialShare = true;
460
- if (article.showSocialShare === true) {
461
- return showSocialShare;
462
- }
463
-
464
- if (article.showSocialShare === false) {
465
- showSocialShare = false;
466
- return showSocialShare;
467
- }
468
-
469
- if (article.content_placement && article.content_placement.length > 0) {
470
- //loop through each
471
- article.content_placement.forEach(function (category) {
472
- if (category.showSocialShare === false) {
473
- showSocialShare = false;
474
- }
475
- });
476
- }
477
- if (article.authorDetails && article.authorDetails.length > 0) {
478
- article.authorDetails.forEach(function (author) {
479
- if (author.showSocialShare === false) {
480
- showSocialShare = false;
481
- }
482
- });
483
- }
484
- if (article.documentGroup && article.documentGroup.length > 0) {
485
- article.documentGroup.forEach(function (docGroup) {
486
- if (docGroup.showSocialShare === false) {
487
- showSocialShare = false;
488
- }
489
- });
490
- }
491
- if (article.documentGroupMapping && article.documentGroupMapping.length > 0) {
492
- article.documentGroupMapping.forEach(function (docGroup) {
493
- if (docGroup.showSocialShare === false) {
494
- showSocialShare = false;
495
- }
496
- });
497
- }
498
-
499
- return showSocialShare;
500
- };
501
-
502
- var FileSaver_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
503
- (function(a,b){b();})(_commonjsHelpers.commonjsGlobal,function(){function b(a,b){return "undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c);},d.onerror=function(){console.error("could not download file");},d.send();}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send();}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"));}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b);}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof _commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.global===_commonjsHelpers.commonjsGlobal?_commonjsHelpers.commonjsGlobal:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href);},4E4),setTimeout(function(){e(j);},0));}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else {var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i);});}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null;},k.readAsDataURL(b);}else {var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m);},4E4);}});f.saveAs=g.saveAs=g,(module.exports=g);});
504
-
505
-
506
- });
507
-
508
- var css = ".RecommendedArticles-module_recommendTitle__2kUji {\n border-bottom: 2px solid var(--secondary-blue);\n font-size: 1.5rem;\n font-weight: bold;\n color: #0d335a;\n padding: 0.5rem;\n}\n.RecommendedArticles-module_recommendContainer__sZukI {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: 0 -0.5rem;\n}\n.RecommendedArticles-module_recommendTop__1_yqw {\n margin: 0.5rem;\n width: 100%;\n flex-basis: 100%;\n display: flex;\n\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu {\n min-width: 55%;\n width: 55%;\n height: 100%;\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.RecommendedArticles-module_recommendTopBody__-13FI {\n margin-left: 1rem;\n line-height: 1.3;\n color: #121212;\n display: flex;\n flex-direction: column;\n}\n.RecommendedArticles-module_topTitle__2EafN {\n font-size: 25px;\n font-weight: bold;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topBody__2_VNi {\n font-size: 19px;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topLink__2RnXu {\n font-size: 19px;\n color: rgb(43, 43, 151);\n text-decoration: underline;\n margin-top: auto;\n}\n.RecommendedArticles-module_smContainer__4byBO {\n width: calc(25% - 1rem);\n margin: 0 0.5rem;\n}\n.RecommendedArticles-module_smImage__TYZGY img {\n width: 100%;\n}\n.RecommendedArticles-module_title__3q1ud {\n margin-top: 1rem;\n line-height: 1.2;\n color: #121212;\n}\n.RecommendedArticles-module_category__2jRto {\n text-transform: uppercase;\n font-size: 16px;\n letter-spacing: 2px;\n margin: 0.25rem 0;\n}\n\n/* media query */\n\n@media screen and (max-width: 1399px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 21px;\n }\n .RecommendedArticles-module_topBody__2_VNi {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 1191px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 23px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 17px;\n }\n}\n@media screen and (max-width: 968px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 18px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 768px) {\n .RecommendedArticles-module_recommendTop__1_yqw {\n flex-direction: column;\n }\n .RecommendedArticles-module_recommendTopImg__1b9gu,\n .RecommendedArticles-module_recommendTopBody__-13FI {\n width: 100%;\n margin: 0;\n }\n .RecommendedArticles-module_recommendTopBody__-13FI {\n margin-bottom: 1rem;\n }\n .RecommendedArticles-module_smContainer__4byBO {\n width: calc(50% - 1rem);\n }\n}";
509
- var styles = { "recommendTitle": "RecommendedArticles-module_recommendTitle__2kUji", "recommendContainer": "RecommendedArticles-module_recommendContainer__sZukI", "recommendTop": "RecommendedArticles-module_recommendTop__1_yqw", "recommendTopImg": "RecommendedArticles-module_recommendTopImg__1b9gu", "recommendTopBody": "RecommendedArticles-module_recommendTopBody__-13FI", "topTitle": "RecommendedArticles-module_topTitle__2EafN", "topBody": "RecommendedArticles-module_topBody__2_VNi", "topLink": "RecommendedArticles-module_topLink__2RnXu", "smContainer": "RecommendedArticles-module_smContainer__4byBO", "smImage": "RecommendedArticles-module_smImage__TYZGY", "title": "RecommendedArticles-module_title__3q1ud", "category": "RecommendedArticles-module_category__2jRto" };
510
- styleInject_es.styleInject(css);
511
-
512
- var _this$2 = undefined;
513
-
514
- var Recommended = function Recommended(props) {
515
- var article = props.article,
516
- client = props.client,
517
- _props$index = props.index,
518
- index = _props$index === undefined ? 0 : _props$index,
519
- cpModificationRequired = props.cpModificationRequired,
520
- emailList = props.emailList,
521
- articleRecsQuery = props.articleRecsQuery;
522
-
523
- var _useState = React.useState(false),
524
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
525
- segmentLoaded = _useState2[0],
526
- setSegmentLoaded = _useState2[1];
527
-
528
- var _useState3 = React.useState([]),
529
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
530
- articles = _useState4[0],
531
- setArticles = _useState4[1];
532
-
533
- var _useState5 = React.useState('loading'),
534
- _useState6 = slicedToArray._slicedToArray(_useState5, 2),
535
- loaded = _useState6[0],
536
- setLoaded = _useState6[1]; // loading, loaded, failed
537
-
538
-
539
- var starting = index * 5;
540
- var emailTracked = React.useRef(false);
541
-
542
- var contentMapping = {
543
- videos: 'video',
544
- articles: 'article',
545
- podcasts: 'podcast'
546
- };
547
- var mainCategories = article.content_placement.filter(function (cp) {
548
- return cp.usedForRecommendations === true;
549
- }).map(function (cp) {
550
- return cp.name;
551
- }).sort();
552
-
553
- React.useEffect(function () {
554
- try {
555
- if (!segmentLoaded) {
556
- return;
557
- }
558
- if (mainCategories.length > 0) {
559
- analytics.track('Article Category Viewed', {
560
- 'categories.$': stringify._JSON$stringify(mainCategories)
561
- });
562
- }
563
- var getSegmentProfile = function () {
564
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
565
- var anonymousId, traits, i, response, data, addTaxonomyName, favoriteCategories, articlesCategory, videosCategory, podcastCategory, taxonomyCategories, taxonomies, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts, recs;
566
-
567
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
568
- while (1) {
569
- switch (_context.prev = _context.next) {
570
- case 0:
571
- anonymousId = analytics.user().anonymousId();
572
- traits = analytics.user().traits();
573
- // console.log('anonymousId', anonymousId)
574
-
575
- if (!(traits && traits.email)) {
576
- _context.next = 11;
577
- break;
578
- }
579
-
580
- i = 0;
581
-
582
- case 4:
583
- if (!(i < emailList.length)) {
584
- _context.next = 11;
585
- break;
586
- }
587
-
588
- if (!(traits.email === emailList[i].email)) {
589
- _context.next = 8;
590
- break;
591
- }
592
-
593
- emailTracked.current = true;
594
- return _context.abrupt('break', 11);
595
-
596
- case 8:
597
- i++;
598
- _context.next = 4;
599
- break;
600
-
601
- case 11:
602
- _context.next = 13;
603
- return fetch('/api/getSegmentProfile?anonymousId=' + anonymousId, {
604
- method: 'GET'
605
- });
606
-
607
- case 13:
608
- response = _context.sent;
609
- _context.next = 16;
610
- return response.json();
611
-
612
- case 16:
613
- data = _context.sent;
614
-
615
- if (!(emailTracked.current || data && data.traits)) {
616
- _context.next = 54;
617
- break;
618
- }
619
-
620
- // console.log('%csegment user profile', 'font-size:1.5rem;color:#000000;padding:1rem;background-color:yellow;', data.traits)
621
- addTaxonomyName = function addTaxonomyName(taxArr) {
622
- if (!taxArr) return '';
623
- var query = ' && ( ';
624
- taxArr.forEach(function (item, index) {
625
- if (index === 0) {
626
- query = query + ('name == \'' + item + '\'');
627
- } else {
628
- query = query + (' || name == \'' + item + '\'');
629
- }
630
- });
631
-
632
- query = query + ' )';
633
-
634
- return query;
635
- };
636
-
637
- favoriteCategories = data.traits.most_frequent_article_category ? JSON.parse(data.traits.most_frequent_article_category) : null;
638
-
639
- // grab contentCategory ID
640
-
641
- _context.next = 22;
642
- return client.fetch("*[_type == 'contentCategory' && name == 'Articles'][0]{_id}");
643
-
644
- case 22:
645
- articlesCategory = _context.sent;
646
- _context.next = 25;
647
- return client.fetch("*[_type == 'contentCategory' && name == 'Videos'][0]{_id}");
648
-
649
- case 25:
650
- videosCategory = _context.sent;
651
- _context.next = 28;
652
- return client.fetch("*[_type == 'contentCategory' && name == 'Podcasts'][0]{_id}");
653
-
654
- case 28:
655
- podcastCategory = _context.sent;
656
- _context.next = 31;
657
- return client.fetch('*[_type == \'taxonomy\' ' + addTaxonomyName(favoriteCategories) + ']');
658
-
659
- case 31:
660
- taxonomyCategories = _context.sent;
661
- taxonomies = '';
662
-
663
- taxonomyCategories.forEach(function (taxonomy, index) {
664
- if (index === 0) {
665
- taxonomies = taxonomies + (' && ( references(\'' + taxonomy._id + '\')');
666
- } else {
667
- taxonomies = taxonomies + (' || references(\'' + taxonomy._id + '\')');
668
- }
669
- });
670
- taxonomies = taxonomies + ' )';
671
- // grab 3 articles from sanity different from the one currently being read
672
- articlesQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + articlesCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 5) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
673
- videosQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + videosCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 1) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
674
- podcastQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + podcastCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 2) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
675
- params = {
676
- id: article._id
677
- };
678
- _context.next = 41;
679
- return asyncToGenerator._Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params), client.fetch(articleRecsQuery)]);
680
-
681
- case 41:
682
- _ref2 = _context.sent;
683
- _ref3 = slicedToArray._slicedToArray(_ref2, 4);
684
- _articles = _ref3[0];
685
- videos = _ref3[1];
686
- podcasts = _ref3[2];
687
- recs = _ref3[3];
688
-
689
- if (_articles.length === 0) setLoaded('failed');
690
-
691
- if (!(emailTracked.current && recs)) {
692
- _context.next = 51;
693
- break;
694
- }
695
-
696
- setArticles(recs);
697
- return _context.abrupt('return');
698
-
699
- case 51:
700
- if (_articles && !emailTracked.current) {
701
- if (videos[0] && _articles[2]) {
702
- _articles[2] = videos[0];
703
- }
704
- if (videos[1] && _articles[4]) {
705
- _articles[4] = videos[1];
706
- }
707
- if (podcasts[0] && _articles[3]) {
708
- _articles[3] = podcasts[0];
709
- }
710
- setArticles(_articles);
711
- }
712
- _context.next = 55;
713
- break;
714
-
715
- case 54:
716
- setLoaded('failed');
717
-
718
- case 55:
719
- case 'end':
720
- return _context.stop();
721
- }
722
- }
723
- }, _callee, _this$2);
724
- }));
725
-
726
- return function getSegmentProfile() {
727
- return _ref.apply(this, arguments);
728
- };
729
- }();
730
- getSegmentProfile();
731
- } catch (err) {
732
- console.log(err);
733
- setLoaded('failed');
734
- }
735
- }, [segmentLoaded]);
736
-
737
- React.useEffect(function () {
738
- if (articles && articles.length > 0) {
739
- setLoaded('loaded');
740
- }
741
- }, [articles]);
742
-
743
- React.useEffect(function () {
744
- try {
745
- analytics.ready(function () {
746
- setSegmentLoaded(function () {
747
- return 'loaded';
748
- });
749
- });
750
- } catch (err) {
751
- console.log(err);
752
- setLoaded('failed');
753
- }
754
- }, []);
755
-
756
- return React__default["default"].createElement(
757
- 'div',
758
- { id: 'recommended', style: { minHeight: '150px' } },
759
- loaded === 'loaded' && React__default["default"].createElement(
760
- React__default["default"].Fragment,
761
- null,
762
- React__default["default"].createElement(
763
- 'h4',
764
- { className: styles.recommendTitle },
765
- 'Recommended For You'
766
- ),
767
- React__default["default"].createElement(
768
- 'div',
769
- { className: styles.recommendContainer, id: 'recommendedContent' },
770
- articles.map(function (article, index) {
771
- if (index === 0) {
772
- return React__default["default"].createElement(
773
- 'div',
774
- { key: article._id + ('-' + index), className: styles.recommendTop },
775
- React__default["default"].createElement(
776
- 'div',
777
- { className: styles.recommendTopImg },
778
- React__default["default"].createElement(
779
- 'a',
780
- { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
781
- React__default["default"].createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 306, imageWidth: 544 }) })
782
- )
783
- ),
784
- React__default["default"].createElement(
785
- 'div',
786
- { className: styles.recommendTopBody },
787
- React__default["default"].createElement(
788
- 'div',
789
- { className: styles.topTitle },
790
- article.title
791
- ),
792
- React__default["default"].createElement(
793
- 'p',
794
- { className: styles.topBody },
795
- article.summary
796
- ),
797
- React__default["default"].createElement(
798
- 'a',
799
- { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit', className: styles.topLink },
800
- '>> ',
801
- 'Read Article'
802
- )
803
- )
804
- );
805
- } else {
806
- return React__default["default"].createElement(
807
- 'div',
808
- { key: article._id + ('-' + index), className: styles.smContainer },
809
- React__default["default"].createElement(
810
- 'div',
811
- { className: styles.category },
812
- contentMapping && contentMapping[article.contentCategory.name] && contentMapping[article.contentCategory.name.toLowerCase()] ? contentMapping[article.contentCategory.name.toLowerCase()] : article.contentCategory.name
813
- ),
814
- React__default["default"].createElement(
815
- 'a',
816
- { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
817
- React__default["default"].createElement(
818
- 'div',
819
- { className: styles.smImage },
820
- React__default["default"].createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 270, imageWidth: 480 }) })
821
- ),
822
- React__default["default"].createElement(
823
- 'div',
824
- { className: styles.title },
825
- article.title
826
- )
827
- )
828
- );
829
- }
830
- })
831
- )
832
- ),
833
- loaded === 'failed' && React__default["default"].createElement(
834
- 'section',
835
- { id: 'related-content-section', className: 'my-1' },
836
- (article.relatedArticle || RelevantTopics({ article: article })) && React__default["default"].createElement(
837
- 'p',
838
- { className: 'mb-0' },
839
- React__default["default"].createElement(
840
- 'b',
841
- null,
842
- 'Related Content:'
843
- )
844
- ),
845
- React__default["default"].createElement(RelevantTopics, { article: article, cpModificationRequired: cpModificationRequired, Settings: props.Settings }),
846
- React__default["default"].createElement(
847
- 'div',
848
- { className: 'pt-2' },
849
- React__default["default"].createElement(RelatedArticle, {
850
- articles: article.relatedArticle,
851
- client: client,
852
- fallbackImage: props.Settings.logo,
853
- showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage
854
- })
855
- )
856
- )
857
- );
858
- };
859
-
860
- var RelevantTopics = function RelevantTopics(props) {
861
- var article = props.article,
862
- cpModificationRequired = props.cpModificationRequired;
863
- var content_placement = article.content_placement,
864
- documentGroupMapping = article.documentGroupMapping,
865
- issueGroup = article.issueGroup;
866
-
867
- if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
868
- var relatedLinks = [];
869
- if (documentGroupMapping && documentGroupMapping.length > 0) {
870
- documentGroupMapping.forEach(function (documentGroup) {
871
- if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
872
- return null;
873
- }
874
- if (documentGroup.parent) {
875
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{
876
- label: documentGroup.name,
877
- href: cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path
878
- }]);
879
- }
880
- });
881
- }
882
- if (content_placement && content_placement.length > 0) {
883
- content_placement.filter(function (item) {
884
- return item.path !== 'news';
885
- }).forEach(function (cp) {
886
- if (cp.excludeRelatedContents) {
887
- return null;
888
- }
889
- var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
890
- var href = '/' + cp_url;
891
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
892
- });
893
- }
894
- if (issueGroup && issueGroup.name && issueGroup.identifier && issueGroup.identifier.current && issueGroup.parent && issueGroup.parent.identifier && issueGroup.parent.identifier.current) {
895
- var _props$Settings$issue = props.Settings.issueMapping,
896
- issueMapping = _props$Settings$issue === undefined ? '/publications' : _props$Settings$issue;
897
-
898
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: issueGroup.name, href: issueMapping + '/' + issueGroup.parent.identifier.current + '/' + issueGroup.identifier.current }]);
899
- }
900
- if (relatedLinks && relatedLinks.length > 0) {
901
- return React__default["default"].createElement(
902
- 'div',
903
- null,
904
- relatedLinks.map(function (relatedLink, index) {
905
- if (relatedLink && relatedLink.href && relatedLink.label) {
906
- return React__default["default"].createElement(
907
- 'span',
908
- { key: relatedLink.label, className: 'related-link' },
909
- React__default["default"].createElement(
910
- 'a',
911
- { className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
912
- relatedLink.label
913
- ),
914
- React__default["default"].createElement(
915
- 'style',
916
- { jsx: 'true' },
917
- '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
918
- )
919
- );
920
- }
921
- })
922
- );
923
- }
924
- return null;
925
- }
926
- return null;
927
- };
928
-
929
- var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
930
-
931
- for (var i = 0; i < docGroupArray.length; i++) {
932
- if (docGroupArray[i].isSeries) {
933
- return docGroupArray[i];
934
- }
935
- }
936
-
937
- return false;
938
- };
939
-
940
- var Article = React__default["default"].memo(React.forwardRef(function (props, ref) {
941
- var onVote = function () {
942
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
943
- var response, result;
944
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
945
- while (1) {
946
- switch (_context.prev = _context.next) {
947
- case 0:
948
- _context.next = 2;
949
- return fetch('/api/polls/vote', {
950
- method: 'POST',
951
- headers: { 'Content-Type': 'application/json' },
952
- body: stringify._JSON$stringify({ articleId: props.article._id, nodeKey: nodeKey, selectedChoice: selectedChoice, body: articleBody })
953
- });
954
-
955
- case 2:
956
- response = _context.sent;
957
-
958
- if (!response.ok) {
959
- _context.next = 11;
960
- break;
961
- }
962
-
963
- _context.next = 6;
964
- return response.json();
965
-
966
- case 6:
967
- result = _context.sent;
968
-
969
- setArticleBody(result.body);
970
-
971
- console.log('Voted successfully');
972
- _context.next = 12;
973
- break;
974
-
975
- case 11:
976
- console.log('Unable to vote!');
977
-
978
- case 12:
979
- case 'end':
980
- return _context.stop();
981
- }
982
- }
983
- }, _callee, this);
984
- }));
985
-
986
- return function onVote(_x, _x2) {
987
- return _ref.apply(this, arguments);
988
- };
989
- }();
990
-
991
- var article = props.article,
992
- Ads = props.Ads,
993
- showRelatedArticles = props.showRelatedArticles,
994
- _props$hideFBShare = props.hideFBShare,
995
- hideFBShare = _props$hideFBShare === undefined ? false : _props$hideFBShare,
996
- _props$hidePinterestS = props.hidePinterestShare,
997
- hidePinterestShare = _props$hidePinterestS === undefined ? false : _props$hidePinterestS,
998
- onChangeArticle = props.onChangeArticle,
999
- _props$showSocialShar = props.showSocialShare,
1000
- showSocialShare = _props$showSocialShar === undefined ? true : _props$showSocialShar;
1001
- var client = props.client,
1002
- pageview = props.pageview,
1003
- videoAccountIDs = props.videoAccountIDs,
1004
- drupalLeadSettings = props.drupalLeadSettings,
1005
- currentPage = props.currentPage,
1006
- _props$showAuthorDeta = props.showAuthorDetails,
1007
- showAuthorDetails = _props$showAuthorDeta === undefined ? false : _props$showAuthorDeta,
1008
- audioAutoplay = props.audioAutoplay,
1009
- _props$article = props.article,
1010
- title = _props$article.title,
1011
- _props$article$passwo = _props$article.passwordLock,
1012
- passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
1013
- authorDetails = _props$article.authorDetails,
1014
- pageNumber = _props$article.pageNumber,
1015
- published = _props$article.published,
1016
- _props$article$showPu = _props$article.showPublished,
1017
- showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
1018
- body = _props$article.body,
1019
- thumbnail = _props$article.thumbnail,
1020
- content_placement = _props$article.content_placement,
1021
- _props$article$url = _props$article.url;
1022
- _props$article$url = _props$article$url === undefined ? {
1023
- current: ''
1024
- } : _props$article$url;
1025
- var url = _props$article$url.current,
1026
- issue = _props$article.issue,
1027
- source = _props$article.source,
1028
- documentGroupMapping = _props$article.documentGroupMapping,
1029
- issueGroup = _props$article.issueGroup,
1030
- showIsi = _props$article.showIsi,
1031
- isi = _props$article.isi,
1032
- _props$article$displa = _props$article.display_summary,
1033
- display_summary = _props$article$displa === undefined ? true : _props$article$displa,
1034
- regionalPages = props.regionalPages,
1035
- nationalPage = props.nationalPage,
1036
- ISIContent = props.ISIContent,
1037
- shareOptions = props.shareOptions,
1038
- cpModificationRequired = props.cpModificationRequired,
1039
- authorPrefix = props.authorPrefix,
1040
- _props$lgContextAd = props.lgContextAd,
1041
- lgContextAd = _props$lgContextAd === undefined ? false : _props$lgContextAd,
1042
- queueData = props.queueData,
1043
- _props$sponsoredFlag = props.sponsoredFlag,
1044
- sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
1045
- _props$authorImgHeigh = props.authorImgHeight,
1046
- authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
1047
- props.active;
1048
- var _props$refreshFlag = props.refreshFlag,
1049
- refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
1050
- disqusConfig = props.disqusConfig,
1051
- showDisqus = props.showDisqus,
1052
- _props$downloadCitati = props.downloadCitation,
1053
- downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati,
1054
- _props$useSegmentReco = props.useSegmentRecommendedArticles,
1055
- useSegmentRecommendedArticles = _props$useSegmentReco === undefined ? false : _props$useSegmentReco,
1056
- showIssueNameOnly = props.showIssueNameOnly,
1057
- showPageNumber = props.showPageNumber,
1058
- emailList = props.emailList,
1059
- articleRecs = props.articleRecs;
1060
-
1061
-
1062
- var parentRisToggle = issueGroup && issueGroup.parent && issueGroup.parent.risMapping ? issueGroup.parent.risMapping.show_download_ris_button : null;
1063
- var issueGroupRisToggle = issueGroup && issueGroup.risMapping ? issueGroup.risMapping.show_download_ris_button : null;
1064
-
1065
- var sliderData = props.sliderData;
1066
-
1067
- var disableEpisodeNumber = false;
1068
- var articleRecsQuery = '*[_type == \'article\' && url.current in ';
1069
-
1070
- if (article && article.documentGroup && article.documentGroup.disableEpisodeNumber === true) {
1071
- disableEpisodeNumber = true;
1072
- }
1073
- var logicforDisplayingEpisodeNumber = !disableEpisodeNumber;
1074
- var targeting = getTargeting.getTargeting(props);
1075
- // remove slider data if toggled
1076
- if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
1077
- sliderData = null;
1078
- }
1079
- // build query string for article recs, pass down as props
1080
- if (articleRecs) {
1081
- articleRecs.forEach(function (rec, ind) {
1082
- ind === 0 ? articleRecsQuery = articleRecsQuery.concat('[\'' + rec + '\', ') : ind === articleRecs.length - 1 ? articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\']]') : articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\', ');
1083
- });
1084
- }
1085
- // next video url
1086
- if (sliderData) {
1087
- var nextArticle = void 0;
1088
- sliderData.forEach(function (data, index) {
1089
- if (data.url.current === props.article.url.current) {
1090
- nextArticle = index + 1;
1091
- }
1092
- });
1093
-
1094
- if (nextArticle && sliderData[nextArticle]) {
1095
- article.nextVideo = sliderData[nextArticle].url.current;
1096
- }
1097
- }
1098
-
1099
- // if showSocialShare is not disabled for entire site, check article taxonomy, docgroup, authors for showSocialShare === false
1100
- if (showSocialShare) {
1101
- showSocialShare = getSocialShareDisableFlag(props.article);
1102
- }
1103
-
1104
- // If sponsored flag, disable contextual ads
1105
- if (sponsoredFlag || article.disableNativeAds) {
1106
- article.contextualVideoAD = false;
1107
- article.contextualAD = false;
1108
- }
1109
-
1110
- if (article.disableRelatedContent || sponsoredFlag) {
1111
- showRelatedArticles = false;
1112
- }
1113
- // This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
1114
- if (!sponsoredFlag && Ads.getVideoContextualAD) {
1115
- article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting.getTargeting(props, 'in-context_video'));
1116
- }
1117
- if (!sponsoredFlag && Ads.getNativeContextualAD && !article.disableNativeAds) {
1118
- article.contextualAD = Ads.getNativeContextualAD(getTargeting.getTargeting(props, 'native-ad'));
1119
- }
1120
-
1121
- var _useState = React.useState(null),
1122
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
1123
- contextualADFlag = _useState2[0],
1124
- setContextualADFlag = _useState2[1];
1125
- // Setting new Flag 'visibleFlag' to know when the article is visible so that new contextual ad can be appended into DOM.
1126
-
1127
-
1128
- var _useState3 = React.useState(false),
1129
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
1130
- visibleFlag = _useState4[0],
1131
- setVisibleFlag = _useState4[1];
1132
-
1133
- var summary = getArticleSummary(props.article);
1134
-
1135
- var _useState5 = React.useState(1),
1136
- _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1137
- auth = _useState6[0],
1138
- setAuth = _useState6[1];
1139
-
1140
- var _useState7 = React.useState(''),
1141
- _useState8 = slicedToArray._slicedToArray(_useState7, 2),
1142
- passwordKey = _useState8[0],
1143
- setPasswordKey = _useState8[1];
1144
-
1145
- var _useState9 = React.useState(body),
1146
- _useState10 = slicedToArray._slicedToArray(_useState9, 2),
1147
- articleBody = _useState10[0],
1148
- setArticleBody = _useState10[1];
1149
-
1150
- var _useState11 = React.useState(0),
1151
- _useState12 = slicedToArray._slicedToArray(_useState11, 2),
1152
- containerHeight = _useState12[0],
1153
- setContainerHeight = _useState12[1];
1154
-
1155
- var _useState13 = React.useState(true),
1156
- _useState14 = slicedToArray._slicedToArray(_useState13, 2);
1157
- _useState14[0];
1158
- var setPreviewAd = _useState14[1];
1159
-
1160
- var _useState15 = React.useState(props.index === 0),
1161
- _useState16 = slicedToArray._slicedToArray(_useState15, 2),
1162
- isFirstArticle = _useState16[0],
1163
- setIsFirstArticle = _useState16[1];
1164
-
1165
- React.useEffect(function () {
1166
- var path = window && window.location && window.location.search;
1167
- // Setting flag for Ad-preview URLs
1168
- setPreviewAd(path.split('&').some(function (param) {
1169
- return param.includes('creativeId');
1170
- }));
1171
- setContainerHeight(window.innerHeight);
1172
- }, []);
1173
-
1174
- var isCutomPage = function isCutomPage(article) {
1175
- var url = article.url.current;
1176
-
1177
- if (regionalPages || nationalPage) {
1178
- return regionalPages.includes(url) || nationalPage === url;
1179
- } else {
1180
- return false;
1181
- }
1182
- };
1183
- var renderAuthorBiography = function renderAuthorBiography(biography) {
1184
- if (biography) {
1185
- return React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1186
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
1187
- blocks: [biography]
1188
- }, client.config()));
1189
- }
1190
- };
1191
-
1192
- var getAbstract = function getAbstract() {
1193
- return article.abstract && article.abstract.map(function (block) {
1194
- if (block.children) {
1195
- return block.children.map(function (child) {
1196
- if (child._type === 'span') return child.text;
1197
- });
1198
- }
1199
- }).join(' ');
1200
- };
1201
-
1202
- var renderIsiContent = function renderIsiContent(article) {
1203
- var url = article.url.current;
1204
-
1205
- if (regionalPages && ISIContent && regionalPages.includes(url)) {
1206
- return React__default["default"].createElement(ISIContent, null);
1207
- } else if (nationalPage === url && ISIContent) {
1208
- return React__default["default"].createElement(ISIContent, { national: true });
1209
- }
1210
- return null;
1211
- };
1212
- var generateRIS = function generateRIS() {
1213
- var fileContent = 'TY - JOUR\n';
1214
- if (issue) {
1215
- if (article.title) {
1216
- fileContent += 'TI - ' + article.title + '\n'; // Title - TI
1217
- fileContent += 'T1 - ' + article.title + '\n'; // Title - T1
1218
- }
1219
- if (authorDetails && authorDetails.length) {
1220
- authorDetails.map(function (authorDetail, index) {
1221
- return fileContent += 'AU - ' + (authorDetail.firstName && authorDetail.lastName ? authorDetail.lastName + ', ' + authorDetail.firstName : '' + authorDetail.displayName) + '\n';
1222
- } // Author
1223
- );
1224
- }
1225
- if (issue.publication && issue.publication.name) {
1226
- fileContent += 'T2 - ' + issue.publication.name + '\n'; // Secondary Title - T2
1227
- fileContent += 'JF - ' + issue.publication.name + '\n'; // Journal Name - JF
1228
- }
1229
- if (issue.name) {
1230
- fileContent += 'T3 - ' + issue.name + '\n'; // Issue Name - T3
1231
- }
1232
- if (issue.abbreviatedJournal) {
1233
- fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; // Journal Name - JO
1234
- }
1235
- if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; // Abstract - AB
1236
- if (article.abstract) fileContent += 'N2 - ' + getAbstract() + '\n'; // Abstract - N2
1237
- if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; // Issue Number - IS
1238
- fileContent += 'PB - MJH Life Sciences\n'; // Publisher - PB
1239
- if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; // Published Year - PY
1240
- if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; // Volume - VL
1241
- if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; // Link to PDF - L1
1242
- if (shareOptions && shareOptions.shareBaseUrl) {
1243
- fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Link to Full-text - L2
1244
- fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Doc URL - UR
1245
- }
1246
- if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; // Website Link - LK
1247
- if (issue.isbn_issn) {
1248
- fileContent += 'SN - ' + issue.isbn_issn + '\n'; // ISSN/ISBN - TI
1249
- }
1250
- if (pageNumber) {
1251
- if (pageNumber.includes('-')) {
1252
- fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; // Start Page - SP
1253
- fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; // End Page - EP
1254
- } else {
1255
- fileContent += 'SP - ' + pageNumber + '\n';
1256
- }
1257
- }
1258
- if (article.published) fileContent += 'Y1 - ' + moment.moment(published).format('DD-MMMM-YYYY') + '\n'; // Primary Date - Y1
1259
- fileContent += 'Y2 - ' + moment.moment().format('DD-MMMM-YYYY') + '\n'; // Access Date - Y2
1260
- }
1261
- fileContent += 'ER -\n'; // End of Record
1262
- return fileContent;
1263
- };
1264
- var getAuthorList = function getAuthorList() {
1265
- var authorList = '';
1266
- if (authorDetails && authorDetails.length > 0) {
1267
- authorDetails.map(function (author) {
1268
- if (author.lastName && author.firstName) authorList += author.lastName + ',' + author.firstName + ';';else if (author.displayName) authorList += author.displayName + ';';
1269
- });
1270
- }
1271
- return authorList;
1272
- };
1273
- var downloadRIS = function downloadRIS() {
1274
- var fileContent = generateRIS();
1275
- var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
1276
- FileSaver_min.saveAs(file, 'citation-' + url + '.ris');
1277
- };
1278
-
1279
- var RelevantTopics = function RelevantTopics() {
1280
- if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
1281
- var relatedLinks = [];
1282
- if (documentGroupMapping && documentGroupMapping.length > 0) {
1283
- documentGroupMapping.forEach(function (documentGroup) {
1284
- if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
1285
- return null;
1286
- }
1287
-
1288
- // let doc_url = cpModificationRequired
1289
- // ? getDocumentGroupUrl(documentGroup)
1290
- // : documentGroup.ancestor
1291
- // ? documentGroup.parent && !documentGroup.path.includes('/')
1292
- // ? `/${documentGroup.ancestor}/${documentGroup.parent.identifier.current}/${documentGroup.path}` : `/${documentGroup.ancestor}/${documentGroup.path}` : documentGroup.parent
1293
- // ? !documentGroup.path.includes('/')
1294
- // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}` : `/${documentGroup.path}` : `/${documentGroup.path}`
1295
-
1296
- var docUrl = '/' + documentGroup.path;
1297
-
1298
- if (cpModificationRequired) {
1299
- docUrl = getDocumentGroupUrl(documentGroup);
1300
- } else {
1301
- try {
1302
- if (documentGroup.ancestor) {
1303
- if (documentGroup.parent && documentGroup.path.findIndex('/') < 0) {
1304
- docUrl = '/' + documentGroup.ancestor + '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path;
1305
- } else {
1306
- docUrl = '/' + documentGroup.ancestor + '/' + documentGroup.path;
1307
- }
1308
- } else if (documentGroup.parent) {
1309
- if (documentGroup.path.findIndex('/') < 0) {
1310
- docUrl = '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path;
1311
- } else {
1312
- docUrl = '/' + documentGroup.path;
1313
- }
1314
- }
1315
- } catch (e) {
1316
- console.log(e.message);
1317
- }
1318
- }
1319
-
1320
- var href = '' + docUrl;
1321
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: href }]);
1322
- // if (documentGroup.parent) {
1323
- // relatedLinks = [
1324
- // ...relatedLinks,
1325
- // {
1326
- // label: documentGroup.name,
1327
- // href: cpModificationRequired
1328
- // ? getDocumentGroupUrl(documentGroup)
1329
- // : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/')
1330
- // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}`
1331
- // : `/${documentGroup.path}`
1332
- // }
1333
- // ]
1334
- // }
1335
- });
1336
- }
1337
- if (content_placement && content_placement.length > 0) {
1338
- content_placement.filter(function (item) {
1339
- return item.path !== 'news';
1340
- }).forEach(function (cp) {
1341
- if (cp.excludeRelatedContents) {
1342
- return null;
1343
- }
1344
- var cp_url = '' + cp.path;
1345
- try {
1346
- cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && cp.path.indexOf('/') < 0 ? cp.ancestor + '/' + cp.parent + '/' + cp.path : !cp.path.indexOf(cp.ancestor) < 0 ? cp.ancestor + '/' + cp.path : '' + cp.path : cp.parent ? !cp.path.indexOf('/') < 0 ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1347
- } catch (e) {
1348
- console.log(e.message);
1349
- }
1350
- var href = '/' + cp_url;
1351
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
1352
- });
1353
- }
1354
-
1355
- if (issueGroup && issueGroup.name && issueGroup.identifier && issueGroup.identifier.current && issueGroup.parent && issueGroup.parent.identifier && issueGroup.parent.identifier.current) {
1356
- var _props$Settings$issue = props.Settings.issueMapping,
1357
- issueMapping = _props$Settings$issue === undefined ? '/publications' : _props$Settings$issue;
1358
-
1359
- relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: issueGroup.name, href: issueMapping + '/' + issueGroup.parent.identifier.current + '/' + issueGroup.identifier.current }]);
1360
- }
1361
- if (relatedLinks && relatedLinks.length > 0) {
1362
- return React__default["default"].createElement(
1363
- 'div',
1364
- null,
1365
- relatedLinks.map(function (relatedLink, index) {
1366
- if (relatedLink && relatedLink.href && relatedLink.label) {
1367
- if (relatedLink.href === 'null') return;
1368
- return React__default["default"].createElement(
1369
- 'span',
1370
- { key: index, className: 'related-link' },
1371
- React__default["default"].createElement(
1372
- 'a',
1373
- { className: 'related-links article', style: { color: 'blue' }, href: relatedLink.href },
1374
- relatedLink.label
1375
- ),
1376
- React__default["default"].createElement(
1377
- 'style',
1378
- { jsx: 'true' },
1379
- '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
1380
- )
1381
- );
1382
- }
1383
- })
1384
- );
1385
- }
1386
- return null;
1387
- }
1388
- return null;
1389
- };
1390
-
1391
- var RelatedContent = React__default["default"].memo(function () {
1392
- return React__default["default"].createElement(
1393
- 'div',
1394
- null,
1395
- useSegmentRecommendedArticles ? React__default["default"].createElement(Recommended, {
1396
- client: client,
1397
- article: article,
1398
- index: props.index,
1399
- Settings: props.Settings,
1400
- showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage,
1401
- cpModificationRequired: cpModificationRequired,
1402
- emailList: emailList,
1403
- articleRecsQuery: articleRecsQuery
1404
- }) : React__default["default"].createElement(
1405
- 'section',
1406
- { id: 'related-content-section', className: 'my-1' },
1407
- (article.relatedArticle || RelevantTopics()) && React__default["default"].createElement(
1408
- 'p',
1409
- { className: 'mb-0' },
1410
- React__default["default"].createElement(
1411
- 'b',
1412
- null,
1413
- 'Related Content:'
1414
- )
1415
- ),
1416
- React__default["default"].createElement(RelevantTopics, null),
1417
- React__default["default"].createElement(
1418
- 'div',
1419
- { className: 'pt-2' },
1420
- React__default["default"].createElement(RelatedArticle, {
1421
- articles: article.relatedArticle,
1422
- client: client,
1423
- fallbackImage: props.Settings.logo,
1424
- showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage
1425
- })
1426
- )
1427
- )
1428
- );
1429
- });
1430
-
1431
- var form = function form() {
1432
- return React__default["default"].createElement(
1433
- React__default["default"].Fragment,
1434
- null,
1435
- React__default["default"].createElement(
1436
- Head__default["default"],
1437
- null,
1438
- React__default["default"].createElement('meta', { name: 'googlebot', content: 'noindex' })
1439
- ),
1440
- React__default["default"].createElement(
1441
- 'div',
1442
- { className: 'mt-5', style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
1443
- React__default["default"].createElement(
1444
- Form__default["default"],
1445
- {
1446
- inline: true,
1447
- onSubmit: function onSubmit(e) {
1448
- e.preventDefault();
1449
- } },
1450
- React__default["default"].createElement(FormControl__default["default"], { type: 'text', className: 'mr-sm-2', value: passwordKey, onChange: function onChange(e) {
1451
- return setPasswordKey(e.target.value);
1452
- }, placeholder: 'Password' }),
1453
- React__default["default"].createElement(
1454
- Button__default["default"],
1455
- {
1456
- variant: 'primary',
1457
- onClick: function onClick() {
1458
- if (passwordKey === props.article.password) {
1459
- setAuth(2);
1460
- } else {
1461
- alert('Incorrect Password');
1462
- }
1463
- } },
1464
- 'Submit'
1465
- )
1466
- )
1467
- )
1468
- );
1469
- };
1470
-
1471
- var renderBlockContent = function renderBlockContent(payload, meta, authorImgHeight) {
1472
- var _payload = payload,
1473
- body = _payload.body;
1474
-
1475
- var indexes = findIndex(body);
1476
- var seriesInfo = checkIfMediaSeriesHasVideo(article);
1477
- var isMediaSeries = false;
1478
- if (article.documentGroup && article.documentGroup.isSeries) {
1479
- isMediaSeries = true;
1480
- } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1481
- isMediaSeries = true;
1482
- }
1483
-
1484
- if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
1485
- payload = _extends._extends({}, payload, {
1486
- contextualAD: _extends._extends({}, payload.contextualAD, {
1487
- slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id
1488
- }),
1489
- contextualVideoAD: _extends._extends({}, payload.contextualVideoAD, {
1490
- slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
1491
- })
1492
- });
1493
- var selectedIndex = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1494
- if (seriesInfo.hasVideo) {
1495
- selectedIndex = seriesInfo.videoIndex;
1496
- }
1497
-
1498
- var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
1499
- if (!isFound) {
1500
- var parent = document.getElementById('contextual-video-ad-' + payload._id);
1501
- parent.style.height = '0%';
1502
- parent.style.width = '0%';
1503
- parent.style.display = 'none';
1504
- setContextualADFlag(false);
1505
- } else {
1506
- setContextualADFlag(true);
1507
- }
1508
- };
1509
- return React__default["default"].createElement(
1510
- React__default["default"].Fragment,
1511
- null,
1512
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1513
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1514
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, selectedIndex))),
1515
- imageOptions: { w: 320, h: 240, fit: 'max' }
1516
- }, client.config())),
1517
- React__default["default"].createElement('span', { className: 'clearfix' }),
1518
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1519
- React__default["default"].createElement(
1520
- 'div',
1521
- { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
1522
- React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
1523
- ),
1524
- React__default["default"].createElement(
1525
- 'style',
1526
- { jsx: 'true' },
1527
- '\n .contextual-native-ad {\n margin-bottom: 1rem;\n }\n '
1528
- ),
1529
- React__default["default"].createElement('span', { className: 'clearfix' }),
1530
- React__default["default"].createElement(
1531
- 'div',
1532
- { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
1533
- React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualVideoAD, { refreshFlag: refreshFlag, checkIsAdFound: checkIsVideoAdFound }))
1534
- ),
1535
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1536
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1537
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(selectedIndex))),
1538
- imageOptions: { w: 320, h: 240, fit: 'max' }
1539
- }, client.config()))
1540
- );
1541
- } else if (indexes.length >= 2 && body.length >= 3 && payload.contextualAD && !payload.contextualVideoAD) {
1542
- payload = _extends._extends({}, payload, {
1543
- contextualAD: _extends._extends({}, payload.contextualAD, {
1544
- slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id,
1545
- className: 'ADFluid',
1546
- // Fetching new contextual targeting based on the current active article.
1547
- targeting: getTargeting.getTargeting(props, 'native-ad'),
1548
- // Adding new ad size for large contextual ad for desktop screen width >= 1400
1549
- sizes: lgContextAd ? [[728, 90], 'fluid', [300, 100]] : ['fluid', [300, 100]],
1550
- sizeMapping: lgContextAd ? [{
1551
- viewport: [1400, 0],
1552
- sizes: [[728, 90], 'fluid', [300, 100]]
1553
- }, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : [{ viewport: [0, 0], sizes: ['fluid', [300, 100]] }]
1554
- })
1555
- });
1556
- var _selectedIndex = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1557
- if (seriesInfo.hasVideo) {
1558
- _selectedIndex = seriesInfo.videoIndex;
1559
- }
1560
- return React__default["default"].createElement(
1561
- React__default["default"].Fragment,
1562
- null,
1563
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1564
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1565
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex))),
1566
- imageOptions: { w: 320, h: 240, fit: 'max' }
1567
- }, client.config())),
1568
- contextualADFlag && React__default["default"].createElement('span', { className: 'clearfix' }),
1569
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1570
- (visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default["default"].createElement(
1571
- React__default["default"].Fragment,
1572
- null,
1573
- React__default["default"].createElement(
1574
- 'div',
1575
- { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
1576
- React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
1577
- ),
1578
- React__default["default"].createElement(
1579
- 'style',
1580
- { jsx: 'true' },
1581
- '\n .contextual-native-ad {\n margin-bottom: 1rem;\n }\n '
1582
- )
1583
- ),
1584
- contextualADFlag && React__default["default"].createElement('span', { className: 'clearfix' }),
1585
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1586
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1587
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex))),
1588
- imageOptions: { w: 320, h: 240, fit: 'max' }
1589
- }, client.config()))
1590
- );
1591
- } else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
1592
- payload = _extends._extends({}, payload, {
1593
- contextualVideoAD: _extends._extends({}, payload.contextualVideoAD, {
1594
- slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
1595
- })
1596
- });
1597
- var _selectedIndex2 = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1598
- if (seriesInfo.hasVideo) {
1599
- _selectedIndex2 = seriesInfo.videoIndex;
1600
- }
1601
- var checkIsAdFound = function checkIsAdFound(isFound) {
1602
- if (!isFound) {
1603
- var parent = document.getElementById('contextual-video-ad-' + payload._id);
1604
- parent.style.height = '0%';
1605
- parent.style.width = '0%';
1606
- parent.style.display = 'none';
1607
- setContextualADFlag(false);
1608
- } else {
1609
- if (body && body[1] && body[1]._type === 'figure') {
1610
- setContextualADFlag(true);
1611
- }
1612
- }
1613
- };
1614
-
1615
- return React__default["default"].createElement(
1616
- React__default["default"].Fragment,
1617
- null,
1618
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1619
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1620
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex2))),
1621
- imageOptions: { w: 320, h: 240, fit: 'max' }
1622
- }, client.config())),
1623
- React__default["default"].createElement('span', { className: 'clearfix' }),
1624
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1625
- React__default["default"].createElement(
1626
- 'div',
1627
- { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
1628
- React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualVideoAD, { refreshFlag: refreshFlag, checkIsAdFound: checkIsAdFound }))
1629
- ),
1630
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1631
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1632
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex2))),
1633
- imageOptions: { w: 320, h: 240, fit: 'max' }
1634
- }, client.config()))
1635
- );
1636
- } else {
1637
- var _selectedIndex3 = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1638
- if (seriesInfo.hasVideo) {
1639
- _selectedIndex3 = seriesInfo.videoIndex;
1640
- }
1641
-
1642
- return React__default["default"].createElement(
1643
- 'div',
1644
- null,
1645
- React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1646
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, false, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1647
- blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
1648
- imageOptions: { w: 320, h: 240, fit: 'max' }
1649
- }, client.config())),
1650
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1651
- article.documentGroup && article.documentGroup.isSeries && React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1652
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1653
- blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex3))),
1654
- imageOptions: { w: 320, h: 240, fit: 'max' }
1655
- }, client.config()))
1656
- );
1657
- }
1658
- };
1659
-
1660
- var checkIfVideoSeries = function checkIfVideoSeries(article) {
1661
- if (!article || !article.body) {
1662
- return false;
1663
- }
1664
-
1665
- for (var i = 0; i < article.body.length; i++) {
1666
- var block = article.body[i];
1667
- if (block._type === 'youtubeGallery') {
1668
- return true;
1669
- }
1670
- }
1671
-
1672
- return false;
1673
- };
1674
- var checkIfFormAssembly = function checkIfFormAssembly(article) {
1675
- if (!article || !article.body) {
1676
- return false;
1677
- }
1678
-
1679
- for (var i = 0; i < article.body.length; i++) {
1680
- var block = article.body[i];
1681
- if (block._type === 'formassembly') {
1682
- return true;
1683
- }
1684
- }
1685
- return false;
1686
- };
1687
- var checkIfMediaSeriesHasVideo = function checkIfMediaSeriesHasVideo(article) {
1688
- var seriesInfo = { hasVideo: false, videoIndex: 0 };
1689
- if (!article || !article.body) {
1690
- return false;
1691
- }
1692
-
1693
- for (var i = 0; i < article.body.length; i++) {
1694
- var block = article.body[i];
1695
- if (block._type == 'video' || block._type == 'youtube' || block._type == 'audio') {
1696
- seriesInfo.hasVideo = true;
1697
- seriesInfo.videoIndex = i + 1;
1698
- }
1699
- }
1700
-
1701
- return seriesInfo;
1702
- };
1703
-
1704
- var detail = function detail() {
1705
- var shareVia = shareOptions.shareVia,
1706
- shareSubject = shareOptions.shareSubject,
1707
- twitterSiteName = shareOptions.twitterSiteName,
1708
- shareImageDefault = shareOptions.shareImageDefault,
1709
- shareBaseUrl = shareOptions.shareBaseUrl;
1710
- shareOptions.shareSiteTitle;
1711
-
1712
- var shareUrl = shareBaseUrl + props.article.url.current;
1713
- var shareTitle = article.title;
1714
- var shareSummary = article.summary;
1715
- var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1716
- var siteName = props.Website && props.Website.title ? props.Website.title : '';
1717
- var shareKeywords = getKeywords(props.article).join(',');
1718
-
1719
- var meta = {
1720
- shareTitle: shareTitle,
1721
- shareSiteName: props.cache.siteSettingCache.name,
1722
- shareSummary: shareSummary,
1723
- shareUrl: shareUrl,
1724
- shareImage: shareImage,
1725
- shareVia: props.Settings.title,
1726
- shareKeywords: shareKeywords
1727
- };
1728
- if (!props.infiniteScroll) {
1729
- onChangeArticle = function onChangeArticle() {
1730
- return null;
1731
- };
1732
- }
1733
- var fetchCurrentEpisode = function fetchCurrentEpisode(sliderData, article) {
1734
- if (!sliderData) return null;
1735
- var episode = null;
1736
- sliderData.forEach(function (seriesArticle, index) {
1737
- if (seriesArticle.title === article.title) {
1738
- episode = index + 1;
1739
- }
1740
- });
1741
- return episode;
1742
- };
1743
- // pixels from bottom of window to change trigger visibility change
1744
- var triggerOffset = 20;
1745
- var isVideoSeries = checkIfVideoSeries(article);
1746
- var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
1747
- var isMediaSeries = false;
1748
- var mediaSeriesName = '';
1749
- var seriesInfo = checkIfMediaSeriesHasVideo(article);
1750
- var isFormAssembly = checkIfFormAssembly(article);
1751
-
1752
- if (article.documentGroup && article.documentGroup.isSeries) {
1753
- isMediaSeries = true;
1754
- mediaSeriesName = article.documentGroup.name;
1755
- }
1756
- if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1757
- isMediaSeries = true;
1758
- mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1759
- }
1760
-
1761
- var baseUrl = client ? client.config().baseUrl : '';
1762
-
1763
- return React__default["default"].createElement(
1764
- React__default["default"].Fragment,
1765
- null,
1766
- React__default["default"].createElement(
1767
- visibilitySensor.VisibilitySensor,
1768
- {
1769
- partialVisibility: true,
1770
- offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
1771
- onChange: function onChange(isVisible) {
1772
- if (isVisible && !isFirstArticle) {
1773
- var pageviewProperties = _extends._extends({}, targeting, {
1774
- category: article && article.category ? article.category.name : ''
1775
- });
1776
- onChangeArticle(url, meta, pageviewProperties);
1777
- setVisibleFlag(function () {
1778
- return true;
1779
- });
1780
- }
1781
- if (isFirstArticle) {
1782
- setIsFirstArticle(false);
1783
- }
1784
- } },
1785
- React__default["default"].createElement(
1786
- 'div',
1787
- { id: 'article__block', style: { position: 'relative' }, ref: ref },
1788
- React__default["default"].createElement(PixelTracking.PixelTrackingArticle, { article: article, infiniteScroll: props.infiniteScroll }),
1789
- React__default["default"].createElement(
1790
- 'div',
1791
- { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) || showIsi && Array.isArray(isi) && isi.length > 0 ? '15rem' : 0 } },
1792
- issue && React__default["default"].createElement(
1793
- Head__default["default"],
1794
- null,
1795
- article.title && React__default["default"].createElement('meta', { name: 'citation_title', content: article.title }),
1796
- published && React__default["default"].createElement('meta', { name: 'citation_date', content: moment.moment(published).format('LL') }),
1797
- issue.publication && issue.publication.name && React__default["default"].createElement('meta', { name: 'citation_journal_title', content: issue.publication.name }),
1798
- issue.year && React__default["default"].createElement('meta', { name: 'citation_year', content: issue.year }),
1799
- issue.volume && React__default["default"].createElement('meta', { name: 'citation_volume', content: issue.volume }),
1800
- issue.issueNumber && React__default["default"].createElement('meta', { name: 'citation_issue', content: issue.issueNumber }),
1801
- article.pageNumber && React__default["default"].createElement('meta', { name: 'citation_firstpage', content: article.pageNumber }),
1802
- article.pageNumber && React__default["default"].createElement('meta', { name: 'citation_lastpage', content: article.pageNumber }),
1803
- issue.name && React__default["default"].createElement('meta', { name: 'citation_series_title', content: issue.name }),
1804
- issue.isbn_issn && React__default["default"].createElement('meta', { name: 'citation_isbn', content: issue.isbn_issn }),
1805
- article.abstract && React__default["default"].createElement('meta', { name: 'citation_abstract', content: getAbstract() }),
1806
- React__default["default"].createElement('meta', { name: 'citation_author', content: getAuthorList() }),
1807
- React__default["default"].createElement('meta', { name: 'citation_publisher', content: 'MJH Life Sciences' }),
1808
- issue.pdf && React__default["default"].createElement('meta', { name: 'citation_pdf_url', content: urlForFile.urlForFile({ asset: issue.pdf }, baseUrl) })
1809
- ),
1810
- isVideoSeries && renderBlockContent(article, meta, authorImgHeight),
1811
- !isVideoSeries && React__default["default"].createElement(
1812
- 'div',
1813
- null,
1814
- isMediaSeries && React__default["default"].createElement(
1815
- 'p',
1816
- { style: { fontSize: '14px' } },
1817
- disableEpisodeNumber ? '' + mediaSeriesName : mediaSeriesName + ' - Episode ' + episodeNumber
1818
- ),
1819
- React__default["default"].createElement(
1820
- 'h1',
1821
- { className: 'page-title', style: { fontSize: '1.9rem' } },
1822
- title
1823
- )
1824
- ),
1825
- React__default["default"].createElement(
1826
- 'div',
1827
- {
1828
- className: 'mb-3 doc-group-container',
1829
- style: {
1830
- display: 'flex',
1831
- justifyContent: 'space-between',
1832
- alignItems: article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'flex-start' : 'flex-end',
1833
- margin: '0, 0, 1rem, 0'
1834
- // margin: article.documentGroup && article.documentGroup.thumbnail && article.documentGroup.thumbnail.caption ? '1rem 0 1rem 0' : '0 0 1rem 0'
1835
- } },
1836
- React__default["default"].createElement(
1837
- 'style',
1838
- { jsx: 'true' },
1839
- '\n .social-ris-container {\n display: flex;\n justify-content: space-between;\n }\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n .social-ris-container {\n flex-direction: column;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n .left-wrap {\n width: 100%;\n }\n '
1840
- ),
1841
- React__default["default"].createElement(
1842
- 'div',
1843
- { className: 'left-wrap' },
1844
- !isVideoSeries && !isFormAssembly && showPublished && React__default["default"].createElement(
1845
- 'div',
1846
- null,
1847
- 'Published on:',
1848
- '\xA0',
1849
- React__default["default"].createElement(
1850
- 'time',
1851
- {
1852
- className: 'meta-date',
1853
- dateTime: moment.moment(published).utc().format(moment.moment.HTML5_FMT.DATETIME_LOCAL_MS) },
1854
- moment.moment(published).format('LL')
1855
- )
1856
- )
1857
- /* Show Published date */
1858
- ,
1859
- React__default["default"].createElement(
1860
- 'div',
1861
- { className: 'mb-3' },
1862
- !isVideoSeries && authorDetails && authorDetails.map(function (authorDetail, index) {
1863
- return React__default["default"].createElement(
1864
- 'span',
1865
- { key: index },
1866
- getSerializers.renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor({ client: props.client, source: authorDetail.profileImage, imageHeight: authorImgHeight }), showAuthorDetails)
1867
- );
1868
- }),
1869
- React__default["default"].createElement(
1870
- 'div',
1871
- null,
1872
- source && React__default["default"].createElement(
1873
- 'p',
1874
- {
1875
- style: {
1876
- display: 'inline-block',
1877
- padding: '0 .25rem',
1878
- color: 'var(--franchise-primary, #484848)',
1879
- borderRadius: '2px',
1880
- fontWeight: 'bold',
1881
- border: '2px solid var(--franchise-primary, #484848)'
1882
- },
1883
- className: 'source-label' },
1884
- source
1885
- )
1886
- ),
1887
- issue && React__default["default"].createElement(
1888
- 'div',
1889
- { className: 'volume-issue' },
1890
- issue.publication && issue.publication.name && React__default["default"].createElement(
1891
- 'span',
1892
- { className: 'mb-0-pub' },
1893
- React__default["default"].createElement(
1894
- 'b',
1895
- null,
1896
- issue.publication.name
1897
- ),
1898
- ',',
1899
- ' '
1900
- ),
1901
- issue.name && showIssueNameOnly === undefined ? React__default["default"].createElement(
1902
- 'span',
1903
- { className: 'mb-0' },
1904
- issue.name,
1905
- ', '
1906
- ) : issue.name && showIssueNameOnly === false ? React__default["default"].createElement(
1907
- 'span',
1908
- { className: 'mb-0' },
1909
- issue.name,
1910
- ', '
1911
- ) : null,
1912
- issue.volume && React__default["default"].createElement(
1913
- 'span',
1914
- null,
1915
- 'Volume ' + issue.volume,
1916
- ', '
1917
- ),
1918
- issue.issueNumber && React__default["default"].createElement(
1919
- 'span',
1920
- null,
1921
- ' Issue ' + issue.issueNumber
1922
- )
1923
- ),
1924
- pageNumber && showPageNumber ? React__default["default"].createElement(
1925
- 'div',
1926
- { className: 'article-pageNumber' },
1927
- 'Pages: ' + pageNumber
1928
- ) : pageNumber && showPageNumber === undefined ? React__default["default"].createElement(
1929
- 'div',
1930
- { className: 'article-pageNumber' },
1931
- 'Pages: ' + pageNumber
1932
- ) : null,
1933
- props.article.doiLink && React__default["default"].createElement(
1934
- 'div',
1935
- null,
1936
- React__default["default"].createElement(
1937
- 'a',
1938
- { href: props.article.doiLink },
1939
- props.article.doiLink
1940
- )
1941
- )
1942
- ),
1943
- React__default["default"].createElement(
1944
- 'div',
1945
- { className: 'social-ris-container' },
1946
- !isVideoSeries && showSocialShare && React__default["default"].createElement(
1947
- 'p',
1948
- null,
1949
- React__default["default"].createElement(SocialShare, {
1950
- shareUrl: shareUrl,
1951
- shareTitle: shareTitle,
1952
- shareVia: shareVia,
1953
- shareSummary: shareSummary,
1954
- shareSubject: shareSubject,
1955
- shareImage: shareImage,
1956
- size: 32,
1957
- siteName: siteName,
1958
- twitterSiteName: twitterSiteName,
1959
- disableMeta: true,
1960
- hidePinterest: hidePinterestShare,
1961
- hideFacebook: hideFBShare
1962
- })
1963
- ),
1964
- downloadCitation && (parentRisToggle || issueGroupRisToggle) ? React__default["default"].createElement(
1965
- Button__default["default"],
1966
- { className: 'ris-download-button', onClick: function onClick() {
1967
- return downloadRIS();
1968
- } },
1969
- 'Download RIS'
1970
- ) : null
1971
- )
1972
- ),
1973
- React__default["default"].createElement(
1974
- 'div',
1975
- null,
1976
- React__default["default"].createElement(DocumentGroup, { article: props.article, client: props.client })
1977
- )
1978
- ),
1979
- !isVideoSeries && summary && display_summary && React__default["default"].createElement(
1980
- 'p',
1981
- null,
1982
- React__default["default"].createElement(
1983
- 'em',
1984
- null,
1985
- summary
1986
- )
1987
- ),
1988
- React__default["default"].createElement(
1989
- 'div',
1990
- { className: 'ad-box', style: { textAlign: 'center' } },
1991
- main.main_43 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
1992
- if (index === 0) {
1993
- return React__default["default"].createElement(
1994
- 'div',
1995
- {
1996
- key: index,
1997
- id: 'addid-' + index,
1998
- style: {
1999
- display: 'flex',
2000
- flex: '1 0 auto',
2001
- justifyContent: 'center',
2002
- alignItems: 'center',
2003
- textAlign: 'center'
2004
- } },
2005
- ad.component
2006
- );
2007
- }
2008
- })
2009
- ),
2010
- React__default["default"].createElement(
2011
- 'div',
2012
- { className: 'block-content mt-3' },
2013
- !isVideoSeries && renderBlockContent(article, meta),
2014
- React__default["default"].createElement('div', { className: 'clearfix' }),
2015
- React__default["default"].createElement(
2016
- 'noscript',
2017
- null,
2018
- React__default["default"].createElement(
2019
- 'div',
2020
- { style: { display: 'flex', justifyContent: 'center' }, className: 'series-links' },
2021
- props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default["default"].createElement(
2022
- 'a',
2023
- { className: 'mx-3', href: props.article.seriesDetail.prevUrl },
2024
- 'Previous ',
2025
- props.article.seriesDetail.type
2026
- ),
2027
- props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default["default"].createElement(
2028
- 'a',
2029
- { className: 'mx-3', href: props.article.seriesDetail.nextUrl },
2030
- 'Next ',
2031
- props.article.seriesDetail.type
2032
- )
2033
- )
2034
- ),
2035
- React__default["default"].createElement(
2036
- 'div',
2037
- { className: 'downloads-container' },
2038
- issue && issue.pdf && React__default["default"].createElement(
2039
- 'a',
2040
- { rel: 'noopener', href: urlForFile.urlForFile({ asset: issue.pdf }, baseUrl), target: '_blank', title: 'Download issue' },
2041
- React__default["default"].createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
2042
- article && article.pdfUrl && article.pdfUrl.hasOwnProperty('caption') && article.pdfUrl.caption,
2043
- article && article.pdfUrl && !article.pdfUrl.caption && 'Download Issue: ' + issue.name,
2044
- article && !article.pdfUrl && 'Download Issue: ' + issue.name
2045
- )
2046
- )
2047
- ),
2048
- React__default["default"].createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
2049
- article.documentGroup && article.documentGroup.isSeries && sliderData && !seriesInfo.hasVideo && React__default["default"].createElement(
2050
- 'div',
2051
- null,
2052
- false ,
2053
- React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber })
2054
- ),
2055
- showRelatedArticles && !showIsi && React__default["default"].createElement(RelatedContent, null),
2056
- disqusConfig && showDisqus && React__default["default"].createElement(
2057
- 'div',
2058
- { id: 'disqusContainer' },
2059
- React__default["default"].createElement(disqusReact.DiscussionEmbed, {
2060
- shortname: disqusConfig.shortname,
2061
- config: {
2062
- url: disqusConfig.url,
2063
- identifier: disqusConfig.identifier,
2064
- title: disqusConfig.title
2065
- }
2066
- })
2067
- )
2068
- ),
2069
- renderIsiContent(props.article)
2070
- )
2071
- ),
2072
- showIsi && Array.isArray(isi) && isi.length > 0 && React__default["default"].createElement(
2073
- ISI,
2074
- null,
2075
- React__default["default"].createElement(BlockContent.BlockContent, {
2076
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, article.Ads, targeting),
2077
- blocks: isi
2078
- })
2079
- ),
2080
- main.main_43 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
2081
- if (index > 0) {
2082
- return React__default["default"].createElement(
2083
- 'div',
2084
- { key: index, id: 'addid-' + index },
2085
- ad.component
2086
- );
2087
- }
2088
- }),
2089
- React__default["default"].createElement(
2090
- 'noscript',
2091
- null,
2092
- props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle[0] && props.article.relatedArticle[0].url && props.article.relatedArticle[0].url.current && React__default["default"].createElement(
2093
- 'div',
2094
- { style: { textAlign: 'center' } },
2095
- React__default["default"].createElement(
2096
- 'a',
2097
- { href: '/view/' + props.article.relatedArticle[0].url.current },
2098
- 'Related Article ',
2099
- '>>>'
2100
- )
2101
- )
2102
- ),
2103
- props.infiniteScroll && React__default["default"].createElement('hr', { className: 'article-seperater mb-5 mt-3' }),
2104
- React__default["default"].createElement(Schema, { article: props.article, Website: props.Website, client: props.client })
2105
- );
2106
- };
2107
-
2108
- if (passwordLock) {
2109
- if (auth === 2) {
2110
- return detail();
2111
- } else {
2112
- return form();
2113
- }
2114
- } else {
2115
- return detail();
2116
- }
2117
- }), function (prevProps, nextProps) {
2118
- if (prevProps.article._id === nextProps.article._id) return true;
2119
- return false;
2120
- });
2121
-
2122
- var _this$1 = undefined;
2123
-
2124
- var ArticleQueue = function ArticleQueue(props) {
2125
- var router = Router.useRouter();
2126
-
2127
- var _props$prevUrl = props.prevUrl,
2128
- prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
2129
- Ads = props.Ads,
2130
- _props$maxListLength = props.maxListLength,
2131
- maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength;
2132
- props.sponsoredTaxonomies;
2133
- var _props$cpModification = props.cpModificationRequired,
2134
- cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
2135
- _props$authorPrefix = props.authorPrefix,
2136
- authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix,
2137
- showRelatedArticles = props.showRelatedArticles,
2138
- canonicalTag = props.canonicalTag,
2139
- _props$disablePrevUrl = props.disablePrevUrlCheckContentPlacement,
2140
- disablePrevUrlCheckContentPlacement = _props$disablePrevUrl === undefined ? false : _props$disablePrevUrl;
2141
-
2142
- var _useState = React.useState(0),
2143
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
2144
- containerHeight = _useState2[0],
2145
- setContainerHeight = _useState2[1];
2146
-
2147
- React.useEffect(function () {
2148
- var checkFullScreen = function checkFullScreen() {
2149
- if (window.innerWidth == screen.width && window.innerHeight == screen.height) {
2150
- return true;
2151
- } else {
2152
- return false;
2153
- }
2154
- };
2155
- setContainerHeight(function () {
2156
- return window.innerHeight;
2157
- });
2158
- var handleResize = function handleResize() {
2159
- return !checkFullScreen() && setContainerHeight(function () {
2160
- return window.innerHeight;
2161
- });
2162
- };
2163
- window.addEventListener('resize', handleResize);
2164
- return function () {
2165
- return window.removeEventListener('resize', handleResize);
2166
- };
2167
- }, []);
2168
-
2169
- var firstArticle = function firstArticle() {
2170
- var article = _extends._Object$assign({}, props.article);
2171
- var targeting = getTargeting.getTargeting(props);
2172
- article.Ads = Ads.getRightItems(targeting);
2173
- return article;
2174
- };
2175
-
2176
- var _useState3 = React.useState([firstArticle()]),
2177
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
2178
- queueData = _useState4[0],
2179
- setQueueData = _useState4[1];
2180
-
2181
- var _useState5 = React.useState(queueData[0]._id),
2182
- _useState6 = slicedToArray._slicedToArray(_useState5, 2),
2183
- active = _useState6[0],
2184
- setActive = _useState6[1];
2185
-
2186
- var refreshAD = function refreshAD(path) {
2187
- var activeArticle = queueData.find(function (item) {
2188
- return item.url.current === path;
2189
- });
2190
- var targeting = getTargeting.getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl, disablePrevUrlCheckContentPlacement: disablePrevUrlCheckContentPlacement });
2191
- if (!main.main_43) {
2192
- index.lib_3.getGoogletag().then(function (googletag) {
2193
- if (window.googletag && googletag.pubadsReady) {
2194
- var slots = googletag.pubads().getSlots();
2195
- slots.forEach(function (slot) {
2196
- var pos = slot.getTargeting('pos');
2197
- slot.clearTargeting();
2198
- keys._Object$keys(targeting).forEach(function (key) {
2199
- slot.setTargeting(key, targeting[key]);
2200
- });
2201
- slot.setTargeting('pos', pos);
2202
- });
2203
- index.lib_3.refresh();
2204
- }
2205
- });
2206
- }
2207
- //Refresh leaderboard ad on mobile
2208
- if (main.main_43) {
2209
- var leaderboardSlotId = '';
2210
- index.lib_3.getGoogletag().then(function (googletag) {
2211
- if (window.googletag && googletag.pubadsReady) {
2212
- var slots = googletag.pubads().getSlots();
2213
- slots.forEach(function (slot) {
2214
- var pos = slot.getTargeting('pos');
2215
- if (pos == 'top-mobile') {
2216
- //gets the slotId of the leaderboard ad to refresh
2217
- leaderboardSlotId = slot.getSlotId().getDomId();
2218
- slot.clearTargeting();
2219
- keys._Object$keys(targeting).forEach(function (key) {
2220
- slot.setTargeting(key, targeting[key]);
2221
- });
2222
- slot.setTargeting('pos', pos);
2223
- }
2224
- });
2225
- index.lib_3.refresh(leaderboardSlotId);
2226
- }
2227
- });
2228
- }
2229
- };
2230
-
2231
- var hasVerticalScroll = function hasVerticalScroll() {
2232
- if (window.innerHeight) {
2233
- return document.body.offsetHeight > window.innerHeight;
2234
- } else {
2235
- return document.documentElement.scrollHeight > document.documentElement.offsetHeight || document.body.scrollHeight > document.body.offsetHeight;
2236
- }
2237
- };
2238
-
2239
- React.useEffect(function () {
2240
- // Fetching related article after component mounted if vertical scroll not found
2241
- setTimeout(function () {
2242
- if (!hasVerticalScroll()) {
2243
- loadmore();
2244
- }
2245
- }, 1000);
2246
- }, [queueData.length]);
2247
-
2248
- var loadmore = function () {
2249
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
2250
- var index, article, startingIndex, endingIndex, targeting;
2251
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
2252
- while (1) {
2253
- switch (_context.prev = _context.next) {
2254
- case 0:
2255
- if (!(queueData && queueData.length < maxListLength)) {
2256
- _context.next = 27;
2257
- break;
2258
- }
2259
-
2260
- index = queueData.length - 1;
2261
- article = null;
2262
- _context.prev = 3;
2263
- _context.next = 6;
2264
- return getRelatedArticle(null, props.client, props.article, prevUrl, index);
2265
-
2266
- case 6:
2267
- article = _context.sent;
2268
- _context.next = 12;
2269
- break;
2270
-
2271
- case 9:
2272
- _context.prev = 9;
2273
- _context.t0 = _context['catch'](3);
2274
-
2275
- console.error(_context.t0);
2276
-
2277
- case 12:
2278
- if (!(article && article._id)) {
2279
- _context.next = 27;
2280
- break;
2281
- }
2282
-
2283
- //query next 4 related article without repeating previous 4 related articles
2284
- startingIndex = queueData.length + 1;
2285
- endingIndex = startingIndex + 2;
2286
- _context.prev = 15;
2287
- _context.next = 18;
2288
- return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
2289
-
2290
- case 18:
2291
- article.relatedArticle = _context.sent;
2292
- _context.next = 24;
2293
- break;
2294
-
2295
- case 21:
2296
- _context.prev = 21;
2297
- _context.t1 = _context['catch'](15);
2298
-
2299
- console.error(_context.t1);
2300
-
2301
- case 24:
2302
- targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl, disablePrevUrlCheckContentPlacement: disablePrevUrlCheckContentPlacement });
2303
-
2304
- article.Ads = Ads.getRightItems(targeting);
2305
- setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
2306
-
2307
- case 27:
2308
- case 'end':
2309
- return _context.stop();
2310
- }
2311
- }
2312
- }, _callee, _this$1, [[3, 9], [15, 21]]);
2313
- }));
2314
-
2315
- return function loadmore() {
2316
- return _ref.apply(this, arguments);
2317
- };
2318
- }();
2319
-
2320
- var currentPath = router && router.asPath;
2321
- var seoLinks = props.cache.seoManager && props.cache.seoManager.filter(function (eachDocument) {
2322
- return eachDocument.urlSeo == currentPath;
2323
- });
2324
-
2325
- var metaDescriptionSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaDescription;
2326
- var metaTitleSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaTitle;
2327
- // let urlSeo = seoLinks && seoLinks.length ==1 && seoLinks[0].urlSeo
2328
-
2329
- var changeMetaFromSanity = function changeMetaFromSanity(metaDescription, metaTitle, oldMeta) {
2330
- document.title = metaTitle;
2331
- //this was throwing an error if there was no description, doing a check for the description meta
2332
- if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', metaDescription);
2333
- if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2334
- if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2335
- if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2336
- if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2337
- if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2338
- if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2339
- if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2340
- if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2341
- //this was throwing an error if there was no description, doing a check for the description meta
2342
- if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', metaDescription);
2343
- if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2344
- document.querySelector('link[rel="canonical"]').setAttribute('href', oldMeta.shareUrl);
2345
- }
2346
- };
2347
-
2348
- var changeMeta = function changeMeta(meta) {
2349
- document.title = meta.shareTitle;
2350
- //this was throwing an error if there was no description, doing a check for the description meta
2351
- if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
2352
- if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2353
- if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2354
- if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2355
- if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2356
- if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2357
- if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2358
- if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2359
- if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2360
- //this was throwing an error if there was no description, doing a check for the description meta
2361
- if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
2362
- if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2363
- document.querySelector('link[rel="canonical"]').setAttribute('href', meta.shareUrl);
2364
- }
2365
- };
2366
-
2367
- var onChangeArticle = function onChangeArticle(path, meta, pageviewProperties) {
2368
- var newPath = '/view/' + path;
2369
- var activeArticle = queueData.find(function (item) {
2370
- return item.url.current === path;
2371
- });
2372
- setActive(function () {
2373
- return activeArticle._id;
2374
- });
2375
- // Change URL and do other changes
2376
- window.history.pushState({ page: path }, meta.shareTitle, newPath);
2377
-
2378
- if (metaDescriptionSanity && metaTitleSanity && currentPath == newPath) {
2379
- changeMetaFromSanity(metaDescriptionSanity, metaTitleSanity, meta);
2380
- } else {
2381
- changeMeta(meta);
2382
- }
2383
- if (props.setCustomDimensions) {
2384
- props.setCustomDimensions(activeArticle, '200', prevUrl, '');
2385
- }
2386
- if (props.pageview) props.pageview(newPath, null, pageviewProperties);
2387
- if (props.gtagSetCustomDimensions) props.gtagSetCustomDimensions(activeArticle, '200', prevUrl, '', true);
2388
- refreshAD(path);
2389
- };
2390
-
2391
- return React__default["default"].createElement(
2392
- index_es.InfiniteScroll,
2393
- { dataLength: queueData.length, next: loadmore, scrollThreshold: '40%', hasMore: true, style: { overflow: 'hidden' } },
2394
- queueData.map(function (article, index) {
2395
- return React__default["default"].createElement(
2396
- React__default["default"].Fragment,
2397
- { key: index },
2398
- React__default["default"].createElement(Article, _extends._extends({}, props, {
2399
- containerHeight: containerHeight,
2400
- onChangeArticle: onChangeArticle,
2401
- authorPrfix: authorPrefix,
2402
- article: article,
2403
- cpModificationRequired: cpModificationRequired,
2404
- active: active === article._id
2405
- // Passing queueData to check for single article
2406
- , queueData: queueData,
2407
- showRelatedArticles: showRelatedArticles,
2408
- index: index,
2409
- showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null,
2410
- showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null
2411
- }))
2412
- );
2413
- })
2414
- );
2415
- };
2416
-
2417
- var _this = undefined;
2418
-
2419
- var View = function View(props) {
2420
- var router = Router.useRouter();
2421
- var shareOptions = props.shareOptions,
2422
- article = props.article,
2423
- _props$article = props.article,
2424
- hideComments = _props$article.hideComments,
2425
- content_placement = _props$article.content_placement,
2426
- _props$sponsoredFlag = props.sponsoredFlag,
2427
- sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag;
2428
- props.sponsoredTaxonomies;
2429
- var Ads = props.Ads,
2430
- setCustomDimensions = props.setCustomDimensions,
2431
- gtagSetCustomDimensions = props.gtagSetCustomDimensions,
2432
- statusCode = props.statusCode,
2433
- prevUrl = props.prevUrl,
2434
- pageview = props.pageview,
2435
- _props$showRelatedArt = props.showRelatedArticles,
2436
- showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt,
2437
- _props$canonicalTag = props.canonicalTag,
2438
- canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag,
2439
- _props$infiniteScroll = props.infiniteScrollFlag,
2440
- infiniteScrollFlag = _props$infiniteScroll === undefined ? true : _props$infiniteScroll,
2441
- emailList = props.emailList,
2442
- articleRecs = props.articleRecs;
2443
- var _props$article2 = props.article,
2444
- _props$article2$passw = _props$article2.passwordLock,
2445
- passwordLock = _props$article2$passw === undefined ? false : _props$article2$passw;
2446
- _props$article2.description;
2447
- var title = _props$article2.title,
2448
- seriesShareOptions = _props$article2.seriesShareOptions;
2449
-
2450
- var _useState = React.useState(0),
2451
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
2452
- currentPage = _useState2[0],
2453
- setCurrentPage = _useState2[1];
2454
- // Logging GA pageview for the initial article with custom dimensions
2455
-
2456
-
2457
- React.useEffect(function () {
2458
- if (pageview && setCustomDimensions) {
2459
- var timer = void 0;
2460
- var pageviewProperties = _extends._extends({}, getTargeting.getTargeting(props), {
2461
- category: article && article.category ? article.category.name : ''
2462
- });
2463
- var waitAndExicute = function waitAndExicute() {
2464
- if (typeof window.GA_INITIALIZED !== 'undefined') {
2465
- setCustomDimensions(article, statusCode, prevUrl, '');
2466
- pageview(router.asPath, null, pageviewProperties);
2467
- } else timer = setTimeout(waitAndExicute, 1000);
2468
- };
2469
- waitAndExicute();
2470
- return function () {
2471
- clearTimeout(timer);
2472
- };
2473
- } else if (gtagSetCustomDimensions) {
2474
- var _timer = void 0;
2475
- var _waitAndExicute = function _waitAndExicute() {
2476
- if (typeof window.GA_INITIALIZED !== 'undefined') {
2477
- gtagSetCustomDimensions(article, statusCode, prevUrl, '', false);
2478
- } else _timer = setTimeout(_waitAndExicute, 1000);
2479
- };
2480
- _waitAndExicute();
2481
- return function () {
2482
- clearTimeout(_timer);
2483
- };
2484
- }
2485
- }, []);
2486
-
2487
- var isVideoSeries = false;
2488
- // check for certain serializers that need to disable infinite scroll
2489
- var checkBodyForDisableInfiniteScroll = function checkBodyForDisableInfiniteScroll(article) {
2490
- if (!article || !article.body) {
2491
- return false;
2492
- }
2493
- for (var i = 0; i < article.body.length; i++) {
2494
- if (article.body[i]._type === 'articleSeries' || article.body[i]._type === 'slideshows' || article.body[i]._type === 'quiz') {
2495
- return true;
2496
- }
2497
- var row = article.body[i];
2498
- if (typeof row.videos !== 'undefined') {
2499
- isVideoSeries = true;
2500
- return true;
2501
- }
2502
- }
2503
- return false;
2504
- };
2505
-
2506
- var isMediaSeries = false;
2507
-
2508
- if (article.documentGroup && article.documentGroup.isSeries) {
2509
- isMediaSeries = true;
2510
- }
2511
- if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2512
- isMediaSeries = true;
2513
- }
2514
-
2515
- var disableInfiniteScroll = checkBodyForDisableInfiniteScroll(props.article);
2516
- var commentsEnabledInTaxonomy = Array.isArray(content_placement) && content_placement.some(function (t) {
2517
- return t.showComments === true;
2518
- });
2519
- var showDisqus = commentsEnabledInTaxonomy || hideComments === false;
2520
- var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && !isMediaSeries && !showDisqus;
2521
-
2522
- if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
2523
- title = null;
2524
- }
2525
-
2526
- if (!needInfiniteScroll && !title) {
2527
- title = props.article ? props.article.title : '';
2528
- }
2529
- // add mobile ads to articles not using infinite scroll
2530
- if (!needInfiniteScroll) {
2531
- var targeting = getTargeting.getTargeting(props);
2532
- article.Ads = Ads.getRightItems(targeting);
2533
- if (!sponsoredFlag && Ads.getVideoContextualAD) {
2534
- article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting.getTargeting(props, 'in-context_video'));
2535
- }
2536
- if (!sponsoredFlag && Ads.getNativeContextualAD) {
2537
- article.contextualAD = Ads.getNativeContextualAD(getTargeting.getTargeting(props, 'native-ad'));
2538
- }
2539
- }
2540
- React.useEffect(function () {
2541
- router.asPath && router.asPath.length > 0 && router.asPath.includes('?') && router.asPath.split('?')[1].split('&').forEach(function (item) {
2542
- if (item.includes('page=')) {
2543
- setCurrentPage(item.split('=')[1]);
2544
- } else {
2545
- setCurrentPage(0);
2546
- }
2547
- });
2548
- if (!router.asPath.includes('page=') && currentPage !== 0) {
2549
- setCurrentPage(0);
2550
- }
2551
- }, [router]);
2552
-
2553
- var meta_description = seriesShareOptions && seriesShareOptions.seriesSummary ? '' + seriesShareOptions.seriesSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.meta_description ? '' + article.seo.meta_description + (currentPage > 0 ? ' | Page ' + currentPage : '') : shareOptions.shareSummary ? '' + shareOptions.shareSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + (currentPage > 0 ? 'Page ' + currentPage : '');
2554
-
2555
- if (isVideoSeries) {
2556
- meta_description = seriesShareOptions && seriesShareOptions.seriesSummary ? '' + seriesShareOptions.seriesSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : '';
2557
- }
2558
-
2559
- var currentPath = router && router.asPath;
2560
- var seoLinks = props.cache.seoManager && props.cache.seoManager.filter(function (eachDocument) {
2561
- return eachDocument.urlSeo == currentPath;
2562
- });
2563
-
2564
- var metaDescriptionSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaDescription;
2565
- var metaTitleSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaTitle;
2566
- return React__default["default"].createElement(
2567
- React__default["default"].Fragment,
2568
- null,
2569
- React__default["default"].createElement(
2570
- Head__default["default"],
2571
- null,
2572
- React__default["default"].createElement(
2573
- 'title',
2574
- { key: 'title' },
2575
- metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article && article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + article.title + (currentPage > 0 ? ' | Page ' + currentPage : '')
2576
- ),
2577
- metaDescriptionSanity ? React__default["default"].createElement('meta', { name: 'description', key: 'description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { name: 'description', key: 'description', content: meta_description }),
2578
- React__default["default"].createElement('meta', { name: 'keywords', content: getKeywords(article).join(','), key: 'keywords' }),
2579
- passwordLock && React__default["default"].createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
2580
- !passwordLock && (article.applyNoIndexTag || article.applyNoFollowTag) && React__default["default"].createElement('meta', {
2581
- name: 'robots',
2582
- content: article.applyNoIndexTag && article.applyNoFollowTag ? 'noindex, nofollow' : article.applyNoIndexTag && !article.applyNoFollowTag ? 'noindex' : 'nofollow'
2583
- }),
2584
- React__default["default"].createElement('meta', {
2585
- property: 'og:url',
2586
- content: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
2587
- key: 'og:url'
2588
- }),
2589
- React__default["default"].createElement('meta', {
2590
- property: 'og:title',
2591
- content: metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + shareOptions.shareTitle + (currentPage > 0 ? ' | Page ' + currentPage : ''),
2592
- key: 'og:title'
2593
- }),
2594
- React__default["default"].createElement('meta', {
2595
- property: 'og:image',
2596
- content: seriesShareOptions && seriesShareOptions.seriesThumbnail ? seriesShareOptions.seriesThumbnail : shareOptions.shareImage,
2597
- key: 'og:image'
2598
- }),
2599
- React__default["default"].createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
2600
- metaDescriptionSanity ? React__default["default"].createElement('meta', { property: 'og:description', key: 'og:description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { property: 'og:description', key: 'og:description', content: meta_description }),
2601
- React__default["default"].createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
2602
- React__default["default"].createElement('meta', {
2603
- name: 'twitter:title',
2604
- content: metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + shareOptions.shareTitle + (currentPage > 0 ? ' | Page ' + currentPage : ''),
2605
- key: 'twitter:title'
2606
- }),
2607
- React__default["default"].createElement('meta', {
2608
- name: 'twitter:image',
2609
- content: seriesShareOptions && seriesShareOptions.seriesThumbnail ? seriesShareOptions.seriesThumbnail : shareOptions.shareImage,
2610
- key: 'twitter:image'
2611
- }),
2612
- React__default["default"].createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
2613
- metaDescriptionSanity ? React__default["default"].createElement('meta', { name: 'twitter:description', key: 'twitter:description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { name: 'twitter:description', key: 'twitter:description', content: meta_description }),
2614
- canonicalTag && React__default["default"].createElement('link', {
2615
- rel: 'canonical',
2616
- href: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
2617
- key: 'canonical'
2618
- }),
2619
- React__default["default"].createElement(
2620
- 'noscript',
2621
- null,
2622
- props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default["default"].createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
2623
- props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default["default"].createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
2624
- )
2625
- ),
2626
- !needInfiniteScroll ? React__default["default"].createElement(Article, _extends._extends({
2627
- infiniteScroll: false,
2628
- showRelatedArticles: showRelatedArticles,
2629
- showDisqus: showDisqus,
2630
- emailList: emailList,
2631
- articleRecs: articleRecs
2632
- }, props, {
2633
- showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null,
2634
- showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null
2635
- })) : React__default["default"].createElement(ArticleQueue, _extends._extends({
2636
- infiniteScroll: true,
2637
- showRelatedArticles: showRelatedArticles,
2638
- canonicalTag: canonicalTag,
2639
- checkSponsered: true,
2640
- Ads: props.WAds,
2641
- onVote: function onVote() {},
2642
- sponsoredTaxonomies: []
2643
- }, props))
2644
- );
2645
- };
2646
-
2647
- // This should be called in /view/[url] getInitialProps to fetch the article data and related articles. This will also set the sponsoredFlag to true if any taxonomies have disabled ads.
2648
- View.returnGetInitialProps = function () {
2649
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(url, prevUrl, seriesVid, client, sao) {
2650
- var context = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
2651
-
2652
- var article, relatedArticleQuery, sliderData, statusCode, sliderArticles, _sliderArticles, _context$query$series, seriesArticle, sponsoredFlag;
2653
-
2654
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
2655
- while (1) {
2656
- switch (_context.prev = _context.next) {
2657
- case 0:
2658
- _context.next = 2;
2659
- return client.fetch(getQuery('article'), { url: url });
2660
-
2661
- case 2:
2662
- article = _context.sent;
2663
- relatedArticleQuery = getQuery('related');
2664
-
2665
- article.seriesDetail = getSeriesDetail(article, seriesVid);
2666
- sliderData = [];
2667
- statusCode = 200;
2668
-
2669
- if (!article || !article._id || !article.body) {
2670
- statusCode = 404;
2671
- }
2672
-
2673
- if (!(article.documentGroup && article.documentGroup.isSeries)) {
2674
- _context.next = 15;
2675
- break;
2676
- }
2677
-
2678
- _context.next = 11;
2679
- return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
2680
-
2681
- case 11:
2682
- sliderArticles = _context.sent;
2683
-
2684
- sliderData = sliderArticles;
2685
- _context.next = 20;
2686
- break;
2687
-
2688
- case 15:
2689
- if (!(article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries)) {
2690
- _context.next = 20;
2691
- break;
2692
- }
2693
-
2694
- _context.next = 18;
2695
- return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroupMapping[0]._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
2696
-
2697
- case 18:
2698
- _sliderArticles = _context.sent;
2699
-
2700
- sliderData = _sliderArticles;
2701
-
2702
- case 20:
2703
- _context$query$series = context.query.seriesArticle, seriesArticle = _context$query$series === undefined ? false : _context$query$series;
2704
-
2705
- if ((seriesArticle || seriesVid) && article.body) {
2706
- article.body.map(function (block) {
2707
- if (block._type === 'articleSeries' && block.articles && block.articles.length > 0) {
2708
- block.articles.map(function (subArticle) {
2709
- if (subArticle.param.current === seriesArticle) {
2710
- var seriesShareOptions = {
2711
- seriesUrl: '?seriesArticle=' + seriesArticle,
2712
- seriesTitle: subArticle.title,
2713
- seriesSummary: subArticle.summary,
2714
- seriesThumbnail: subArticle.thumbnail && subArticle.thumbnail.asset ? urlFor({ client: client, source: subArticle.thumbnail.asset }) : null
2715
- };
2716
- article.seriesShareOptions = seriesShareOptions;
2717
- }
2718
- });
2719
- }
2720
- if (block._type === 'youtubeGallery' && block.videos && block.videos.length > 0) {
2721
- block.videos.map(function (video, index) {
2722
- if (index + 1 === Number(seriesVid)) {
2723
- var seriesShareOptions = {
2724
- seriesUrl: '?seriesVid=' + seriesVid,
2725
- seriesTitle: video.title,
2726
- seriesSummary: video.intro,
2727
- seriesThumbnail: video.thumbnail && video.thumbnail.asset ? urlFor({ client: client, source: video.thumbnail.asset }) : null
2728
- };
2729
- article.seriesShareOptions = seriesShareOptions;
2730
- }
2731
- });
2732
- }
2733
- });
2734
- }
2735
- sponsoredFlag = false;
2736
-
2737
- // check for disableAds flag on each taxonomoy
2738
-
2739
- if (article && article.content_placement) {
2740
- article.content_placement.forEach(function (x) {
2741
- if (x.disableAds) {
2742
- sponsoredFlag = true;
2743
- }
2744
- if (x.applyNoIndexTag) {
2745
- article.applyNoIndexTag = true;
2746
- }
2747
- if (x.applyNoFollowTag) {
2748
- article.applyNoFollowTag = true;
2749
- }
2750
- if (x.disableNativeAds) {
2751
- article.disableNativeAds = true;
2752
- }
2753
- });
2754
- }
2755
- // check for disableAds flag on content category
2756
- if (article.category && article.category.disableAds) {
2757
- sponsoredFlag = true;
2758
- }
2759
-
2760
- if (!article.disableRelatedContent) {
2761
- _context.next = 30;
2762
- break;
2763
- }
2764
-
2765
- article.relatedArticle = null;
2766
- _context.next = 34;
2767
- break;
2768
-
2769
- case 30:
2770
- if (!article) {
2771
- _context.next = 34;
2772
- break;
2773
- }
2774
-
2775
- _context.next = 33;
2776
- return getRelatedArticle(context, client, article, prevUrl, '0..2');
2777
-
2778
- case 33:
2779
- article.relatedArticle = _context.sent;
2780
-
2781
- case 34:
2782
-
2783
- //check documentGroup and documentGroupMapping for disableNativeAds:true
2784
- if (!article.disableNativeAds) {
2785
- if (article.documentGroup && article.documentGroup.length) {
2786
- article.documentGroup.forEach(function (docGroup) {
2787
- var node = docGroup.parent ? docGroup.parent : null;
2788
- if (docGroup.disableNativeAds) {
2789
- article.disableNativeAds = true;
2790
- }
2791
- while (node) {
2792
- if (node.disableNativeAds) [article.disableNativeAds = true];
2793
- node = node.parent || null;
2794
- }
2795
- });
2796
- }
2797
- if (article.documentGroupMapping && article.documentGroupMapping.length) {
2798
- article.documentGroupMapping.forEach(function (docGroup) {
2799
- var node = docGroup.parent ? docGroup.parent : null;
2800
- if (docGroup.disableNativeAds) {
2801
- article.disableNativeAds = true;
2802
- }
2803
- while (node) {
2804
- if (node.disableNativeAds) [article.disableNativeAds = true];
2805
- node = node.parent || null;
2806
- }
2807
- });
2808
- }
2809
- }
2810
-
2811
- return _context.abrupt('return', {
2812
- url: url,
2813
- sao: sao,
2814
- statusCode: statusCode,
2815
- prevUrl: prevUrl,
2816
- relatedArticleQuery: relatedArticleQuery,
2817
- article: article,
2818
- sliderData: sliderData,
2819
- sponsoredFlag: sponsoredFlag
2820
- });
2821
-
2822
- case 36:
2823
- case 'end':
2824
- return _context.stop();
2825
- }
2826
- }
2827
- }, _callee, _this);
2828
- }));
2829
-
2830
- return function (_x, _x2, _x3, _x4, _x5) {
2831
- return _ref.apply(this, arguments);
2832
- };
2833
- }();
2834
-
2835
- module.exports = View;