@mjhls/mjh-framework 1.0.884-gridcontent-paginated-v1 → 1.0.884

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 (76) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AlgoliaSearch.js +1 -1
  3. package/dist/cjs/AuthWrapper.js +1 -1
  4. package/dist/cjs/ConferenceArticleCard.js +15 -15
  5. package/dist/cjs/DeckContent.js +8 -8
  6. package/dist/cjs/EventsDeck.js +17 -17
  7. package/dist/cjs/GridContent.js +157 -44
  8. package/dist/cjs/HamMagazine.js +9 -9
  9. package/dist/cjs/IssueLanding.js +29 -29
  10. package/dist/cjs/KMTracker.js +15 -15
  11. package/dist/cjs/MasterDeck.js +8 -8
  12. package/dist/cjs/MediaSeriesLanding.js +9524 -42
  13. package/dist/cjs/NavMagazine.js +10 -10
  14. package/dist/cjs/NavNative.js +9 -9
  15. package/dist/cjs/PartnerDetailListing.js +2807 -12
  16. package/dist/cjs/PublicationLanding.js +26 -26
  17. package/dist/cjs/RelatedContent.js +28 -28
  18. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  19. package/dist/cjs/SeriesListingDeck.js +1 -1
  20. package/dist/cjs/{SeriesSlider-de93a303.js → SeriesSlider-ba0c5d1a.js} +4 -4
  21. package/dist/cjs/SideFooter.js +2 -2
  22. package/dist/cjs/VideoSeriesCard.js +1 -1
  23. package/dist/cjs/View.js +3 -3
  24. package/dist/cjs/YoutubeGroup.js +4 -4
  25. package/dist/cjs/{getTargeting-6d59cc5b.js → getTargeting-9d509319.js} +9 -9
  26. package/dist/cjs/getTargeting.js +1 -1
  27. package/dist/cjs/index.js +2 -4
  28. package/dist/esm/AlgoliaSearch.js +1 -1
  29. package/dist/esm/AuthWrapper.js +1 -1
  30. package/dist/esm/ConferenceArticleCard.js +15 -15
  31. package/dist/esm/DeckContent.js +8 -8
  32. package/dist/esm/EventsDeck.js +17 -17
  33. package/dist/esm/GridContent.js +114 -2
  34. package/dist/esm/HamMagazine.js +9 -9
  35. package/dist/esm/IssueLanding.js +29 -29
  36. package/dist/esm/KMTracker.js +15 -15
  37. package/dist/esm/MasterDeck.js +8 -8
  38. package/dist/esm/MediaSeriesLanding.js +9518 -38
  39. package/dist/esm/NavMagazine.js +10 -10
  40. package/dist/esm/NavNative.js +9 -9
  41. package/dist/esm/PartnerDetailListing.js +2807 -13
  42. package/dist/esm/PublicationLanding.js +26 -26
  43. package/dist/esm/RelatedContent.js +28 -28
  44. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  45. package/dist/esm/SeriesListingDeck.js +1 -1
  46. package/dist/esm/{SeriesSlider-98ad6d97.js → SeriesSlider-45adb8dc.js} +4 -4
  47. package/dist/esm/SideFooter.js +2 -2
  48. package/dist/esm/VideoSeriesCard.js +1 -1
  49. package/dist/esm/View.js +3 -3
  50. package/dist/esm/YoutubeGroup.js +4 -4
  51. package/dist/esm/{getTargeting-36031a00.js → getTargeting-4061f839.js} +9 -9
  52. package/dist/esm/getTargeting.js +1 -1
  53. package/dist/esm/index.js +2 -4
  54. package/package.json +111 -112
  55. package/dist/cjs/ContentCardPaginated.js +0 -413
  56. package/dist/cjs/DeckQueuePaginated.js +0 -344
  57. package/dist/cjs/GridContentPaginated.js +0 -695
  58. package/dist/cjs/ImageSlider-b96720eb.js +0 -2813
  59. package/dist/cjs/MasterDeckPaginated.js +0 -445
  60. package/dist/cjs/MediaSeriesCard-3d5c69ba.js +0 -9505
  61. package/dist/cjs/MediaSeriesLandingPaginated.js +0 -523
  62. package/dist/cjs/Pagination-b5e8b8dc.js +0 -60
  63. package/dist/cjs/PartnerDetailListingPaginated.js +0 -313
  64. package/dist/cjs/PublicationFeature-5ccf9b13.js +0 -130
  65. package/dist/cjs/QueueDeckExpandedPaginated.js +0 -1377
  66. package/dist/esm/ContentCardPaginated.js +0 -402
  67. package/dist/esm/DeckQueuePaginated.js +0 -333
  68. package/dist/esm/GridContentPaginated.js +0 -684
  69. package/dist/esm/ImageSlider-de7846ea.js +0 -2804
  70. package/dist/esm/MasterDeckPaginated.js +0 -437
  71. package/dist/esm/MediaSeriesCard-5b1d13dd.js +0 -9495
  72. package/dist/esm/MediaSeriesLandingPaginated.js +0 -516
  73. package/dist/esm/Pagination-481eaaf5.js +0 -54
  74. package/dist/esm/PartnerDetailListingPaginated.js +0 -307
  75. package/dist/esm/PublicationFeature-d88e76b9.js +0 -121
  76. package/dist/esm/QueueDeckExpandedPaginated.js +0 -1371
@@ -1,1371 +0,0 @@
1
- import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-5ef104a7.js';
2
- import { _ as _extends } from './extends-6d8e3924.js';
3
- import { _ as _slicedToArray } from './slicedToArray-6ebcbfea.js';
4
- import { _ as _toConsumableArray } from './toConsumableArray-f7074d7c.js';
5
- import React__default, { useState, useEffect, useRef } from 'react';
6
- import { Spinner, Container, Media } from 'react-bootstrap';
7
- import { m as moment } from './moment-bc12cb97.js';
8
- import { l as lib_3 } from './index-f0fc23eb.js';
9
- import { useRouter } from 'next/router';
10
- import { L as LazyLoad } from './index-755f2cc2.js';
11
- import { l as lodash } from './lodash-f97fd99a.js';
12
- import { m as main_43 } from './main-1894c974.js';
13
- import { c as clean_html_1 } from './entities-6d9154b4.js';
14
- import { A as ADInfeed } from './ADInfeed-0a55cd2d.js';
15
- import { A as AuthorComponent } from './AuthorComponent-11adff02.js';
16
- import { A as ADlgInfeed } from './ADlgInfeed-013e1f4a.js';
17
- import { g as getContentCategory } from './getContentCategory-15dcc413.js';
18
- import timeDifferenceCalc from './timeDifferenceCalc.js';
19
- import urlFor from './urlFor.js';
20
- import { P as Pagination } from './Pagination-481eaaf5.js';
21
- import './_commonjsHelpers-0c4b6f40.js';
22
- import './core.get-iterator-method-ea258bb1.js';
23
- import './web.dom.iterable-ab4dea5c.js';
24
- import './_library-528f1934.js';
25
- import './_iter-detect-98db3b07.js';
26
- import './_object-pie-133f504a.js';
27
- import './events-6c3a7a63.js';
28
- import 'prop-types';
29
- import 'react-dom';
30
- import 'react-bootstrap/Card';
31
- import './AdSlot.js';
32
- import './debounce-533d9748.js';
33
- import './isSymbol-a7e9aafe.js';
34
- import './toNumber-5aeba6e7.js';
35
- import './Beam.js';
36
- import './stringify-2b084bee.js';
37
- import './Segment.js';
38
- import './index-3f5c03b2.js';
39
-
40
- var _this = undefined;
41
-
42
- var renderCardImage = function renderCardImage(row, client) {
43
- var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
44
- var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
45
- var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
46
- var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
47
- return urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
48
- };
49
-
50
- var checkExternalUrl = function checkExternalUrl(url) {
51
- return new RegExp(['http', 'https'].join('|')).test(url);
52
- };
53
-
54
- var CardLoader = function CardLoader(_ref) {
55
- var data = _ref.data,
56
- client = _ref.client,
57
- mapping = _ref.mapping,
58
- showPublished = _ref.showPublished,
59
- defaultImage = _ref.defaultImage,
60
- showAuthor = _ref.showAuthor,
61
- showCategory = _ref.showCategory,
62
- imageHeight = _ref.imageHeight,
63
- imageWidth = _ref.imageWidth,
64
- imageMaxHeight = _ref.imageMaxHeight,
65
- imageFit = _ref.imageFit,
66
- rightItems = _ref.rightItems,
67
- brandInsightAd = _ref.brandInsightAd,
68
- showBI = _ref.showBI,
69
- heroContent = _ref.heroContent,
70
- lgInfeedAd = _ref.lgInfeedAd,
71
- showPubInfo = _ref.showPubInfo,
72
- contentCategoryMapping = _ref.contentCategoryMapping,
73
- showTimeDiff = _ref.showTimeDiff,
74
- showTaxonomies = _ref.showTaxonomies,
75
- showIntro = _ref.showIntro;
76
-
77
- var numberOfItemsBeforeAd = data.length < 6 ? data.length : 6;
78
- var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
79
- return [].concat(_toConsumableArray(arr.slice(0, index)), [newElement], _toConsumableArray(arr.slice(index)));
80
- };
81
-
82
- var _useState = useState(!showBI || !brandInsightAd ? true : false),
83
- _useState2 = _slicedToArray(_useState, 2),
84
- dataRemapped = _useState2[0],
85
- setDataRemapped = _useState2[1];
86
- // Need to pass flag "lgInfeedAd={true}" along with brandInsightAd from site level for large infeed-ad to render
87
- // Checking window and lgInfeedAd flag in desktop view ( window >= 1400px ).
88
-
89
-
90
- if (lgInfeedAd && brandInsightAd && typeof window !== 'undefined' && window.innerWidth >= 1400) {
91
- var lgInfeed = {
92
- _type: 'lg-infeed',
93
- adUnit: brandInsightAd.adUnit,
94
- className: 'lg-infeed',
95
- networkID: brandInsightAd.networkID,
96
- sizes: [728, 90],
97
- // Adding sizeMapping for showing ad above 1400px
98
- sizeMapping: [{
99
- viewport: [1400, 0],
100
- sizes: [[728, 90]]
101
- }, { viewport: [0, 0], sizes: [] }],
102
- targeting: {
103
- content_placement: brandInsightAd.targeting.content_placement,
104
- document_url: brandInsightAd.targeting.document_url,
105
- rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
106
- },
107
- /* Passing refresh flag */
108
- refreshFlag: brandInsightAd.refreshFlag ? brandInsightAd.refreshFlag : false
109
- };
110
-
111
- var chunks = lodash.chunk(data, 6).map(function (chunk) {
112
- var set = lodash.chunk(chunk, 2);
113
- for (var i = 0; i < set.length; i++) {
114
- if (i !== set.length - 1) {
115
- set[i].push(lgInfeed);
116
- }
117
- }
118
- return lodash.flattenDeep(set);
119
- });
120
- data = lodash.flatten(chunks);
121
- !dataRemapped && setDataRemapped(true); // To detect if appending of insights ads are completed
122
- }
123
-
124
- // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
125
- useEffect(function () {
126
- if (typeof window !== 'undefined' && (!lgInfeedAd || !brandInsightAd || window.innerWidth < 1400) && !dataRemapped) {
127
- setDataRemapped(true);
128
- }
129
- }, []);
130
-
131
- if (showBI && brandInsightAd) {
132
- // Checking window and lgInfeedAd flag in desktop view ( window >= 1400px ).
133
- if (lgInfeedAd && typeof window !== 'undefined' && window.innerWidth >= 1400) brandInsightAd.interval = 8;
134
- var pos = 0;
135
- for (var i = 1; pos < data.length; i++) {
136
- var inFeedAd = {
137
- adUnit: brandInsightAd.adUnit,
138
- className: brandInsightAd.className,
139
- networkID: brandInsightAd.networkID,
140
- sizes: brandInsightAd.sizes,
141
- slotId: brandInsightAd.slotId + '_' + i,
142
- targeting: {
143
- pos: 'infeed',
144
- content_placement: brandInsightAd.targeting.content_placement,
145
- document_url: brandInsightAd.targeting.document_url,
146
- rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
147
- },
148
- _type: 'brandInsightAd',
149
- /* Passing refresh flag */
150
- refreshFlag: brandInsightAd.refreshFlag ? brandInsightAd.refreshFlag : false
151
- };
152
-
153
- data = insertBrandInsightAd(data, pos, inFeedAd);
154
- pos += brandInsightAd.interval + 1;
155
- }
156
- }
157
-
158
- data = data.map(function (ele, i) {
159
- if (ele._type === 'lg-infeed') {
160
- // Setting pos as top2 for the first occurence of large infeed ad
161
- // const pos = data.indexOf(data.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
162
- return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: 'lg-infeed' }) });
163
- } else return ele;
164
- });
165
-
166
- var featureCount = 0;
167
- return React__default.createElement(
168
- 'div',
169
- null,
170
- data && data.length > 0 ? dataRemapped ? // For Javascript Enabled Cases
171
- data.map(function (article, index) {
172
- var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
173
-
174
- if (article._type === 'feature') {
175
- featureCount++;
176
- if (article.blank || checkExternalUrl(article.url.current)) {
177
- return React__default.createElement(
178
- Media,
179
- {
180
- key: article._id ? article._id : index,
181
- className: 'feature-media',
182
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
183
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
184
- 'a',
185
- { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
186
- React__default.createElement(
187
- LazyLoad,
188
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
189
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
190
- ),
191
- article.source && React__default.createElement(
192
- 'div',
193
- { className: 'content-category-label' },
194
- React__default.createElement(
195
- 'div',
196
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
197
- article.source
198
- )
199
- )
200
- ),
201
- React__default.createElement(
202
- Media.Body,
203
- null,
204
- React__default.createElement(
205
- 'a',
206
- { rel: 'noopener', href: article.url.current, target: '_blank' },
207
- article.title && React__default.createElement(
208
- 'h4',
209
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
210
- article.title
211
- )
212
- ),
213
- showPublished && !showTimeDiff && article.published && React__default.createElement(
214
- 'p',
215
- { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
216
- moment(article.published).format('MMMM DD, YYYY')
217
- ),
218
- showTimeDiff && article.published && React__default.createElement(
219
- 'p',
220
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
221
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
222
- if (index > 3) {
223
- return null;
224
- }
225
- if (index === 3) {
226
- return React__default.createElement(
227
- React__default.Fragment,
228
- null,
229
- React__default.createElement(
230
- 'em',
231
- { style: { marginRight: '.5rem' } },
232
- '...'
233
- )
234
- );
235
- }
236
- return React__default.createElement(
237
- React__default.Fragment,
238
- null,
239
- React__default.createElement(
240
- 'em',
241
- null,
242
- taxonomy.name
243
- ),
244
- ' |',
245
- ' '
246
- );
247
- }),
248
- ' ',
249
- React__default.createElement(
250
- 'span',
251
- { style: { display: 'inline-block' } },
252
- timeDifferenceCalc(article.published)
253
- )
254
- ),
255
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
256
- LazyLoad,
257
- { height: 50 },
258
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
259
- ),
260
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
261
- 'div',
262
- { className: 'content-category-label' },
263
- React__default.createElement(
264
- 'div',
265
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
266
- article.source
267
- )
268
- ),
269
- React__default.createElement(
270
- 'div',
271
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
272
- showCategory && article.contentCategory && React__default.createElement(
273
- 'p',
274
- {
275
- className: 'article-category',
276
- style: {
277
- background: '#3FB618',
278
- color: '#ffffff',
279
- marginBottom: '.25rem',
280
- display: 'inline-block',
281
- padding: '0 .25rem',
282
- fontSize: '.8rem'
283
- } },
284
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
285
- ),
286
- article.issueSection && article.issueSection.name && React__default.createElement(
287
- 'p',
288
- {
289
- className: 'issueSection',
290
- style: {
291
- background: '#000000',
292
- color: '#ffffff',
293
- marginBottom: '.25rem',
294
- marginLeft: '.25rem',
295
- display: 'inline-block',
296
- padding: '0 .25rem',
297
- fontSize: '.8rem'
298
- } },
299
- article.issueSection.name
300
- )
301
- ),
302
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
303
- 'div',
304
- { className: 'pubInfo' },
305
- article.volume && React__default.createElement(
306
- 'p',
307
- { className: 'qdeVolume' },
308
- article.volume
309
- ),
310
- article.issue && React__default.createElement(
311
- 'p',
312
- { className: 'qdeIssue' },
313
- article.issue
314
- )
315
- ),
316
- showIntro && article.summary && React__default.createElement(
317
- 'p',
318
- { className: 'pt-2 card-text' },
319
- clean_html_1(article.summary)
320
- )
321
- )
322
- );
323
- } else {
324
- return React__default.createElement(
325
- Media,
326
- {
327
- key: article._id ? article._id : index,
328
- className: 'feature-media',
329
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
330
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
331
- 'a',
332
- { href: article.url.current, className: 'feature-wrapper' },
333
- React__default.createElement(
334
- LazyLoad,
335
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
336
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
337
- ),
338
- article.source && React__default.createElement(
339
- 'div',
340
- { className: 'content-category-label' },
341
- React__default.createElement(
342
- 'div',
343
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
344
- article.source
345
- )
346
- )
347
- ),
348
- React__default.createElement(
349
- Media.Body,
350
- null,
351
- React__default.createElement(
352
- 'a',
353
- { href: article.url.current },
354
- article.title && React__default.createElement(
355
- 'h4',
356
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
357
- article.title
358
- )
359
- ),
360
- showPublished && !showTimeDiff && article.published && React__default.createElement(
361
- 'p',
362
- { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
363
- moment(article.published).format('MMMM DD, YYYY')
364
- ),
365
- showTimeDiff && article.published && React__default.createElement(
366
- 'p',
367
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
368
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
369
- if (index > 3) {
370
- return null;
371
- }
372
- if (index === 3) {
373
- return React__default.createElement(
374
- React__default.Fragment,
375
- null,
376
- React__default.createElement(
377
- 'em',
378
- { style: { marginRight: '.5rem' } },
379
- '...'
380
- )
381
- );
382
- }
383
- if (index === 3) {
384
- return React__default.createElement(
385
- React__default.Fragment,
386
- null,
387
- React__default.createElement(
388
- 'em',
389
- { style: { marginRight: '.5rem' } },
390
- '...'
391
- )
392
- );
393
- }
394
- return React__default.createElement(
395
- React__default.Fragment,
396
- null,
397
- React__default.createElement(
398
- 'em',
399
- null,
400
- taxonomy.name
401
- ),
402
- ' |',
403
- ' '
404
- );
405
- }),
406
- ' ',
407
- React__default.createElement(
408
- 'span',
409
- { style: { display: 'inline-block' } },
410
- timeDifferenceCalc(article.published)
411
- )
412
- ),
413
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
414
- LazyLoad,
415
- { height: 50 },
416
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
417
- ),
418
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
419
- 'div',
420
- { className: 'content-category-label' },
421
- React__default.createElement(
422
- 'div',
423
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
424
- article.source
425
- )
426
- ),
427
- React__default.createElement(
428
- 'div',
429
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
430
- showCategory && article.contentCategory && React__default.createElement(
431
- 'p',
432
- {
433
- className: 'article-category',
434
- style: {
435
- background: '#3FB618',
436
- color: '#ffffff',
437
- marginBottom: '.25rem',
438
- display: 'inline-block',
439
- padding: '0 .25rem',
440
- fontSize: '.8rem'
441
- } },
442
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
443
- ),
444
- article.issueSection && article.issueSection.name && React__default.createElement(
445
- 'p',
446
- {
447
- className: 'issueSection',
448
- style: {
449
- background: '#000000',
450
- color: '#ffffff',
451
- marginBottom: '.25rem',
452
- marginLeft: '.25rem',
453
- display: 'inline-block',
454
- padding: '0 .25rem',
455
- fontSize: '.8rem'
456
- } },
457
- article.issueSection.name
458
- )
459
- ),
460
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
461
- 'div',
462
- { className: 'pubInfo' },
463
- article.volume && React__default.createElement(
464
- 'p',
465
- { className: 'qdeVolume' },
466
- article.volume
467
- ),
468
- article.issue && React__default.createElement(
469
- 'p',
470
- { className: 'qdeIssue' },
471
- article.issue
472
- )
473
- ),
474
- showIntro && article.summary && React__default.createElement(
475
- 'p',
476
- { className: 'pt-2 card-text' },
477
- clean_html_1(article.summary)
478
- )
479
- )
480
- );
481
- }
482
- } else if (article._type === 'lg-infeed' && article.adUnit) {
483
- return React__default.createElement(ADlgInfeed, _extends({ index: index }, article));
484
- } else if (article._type === 'brandInsightAd' && article.adUnit) {
485
- return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
486
- }
487
- if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
488
- return React__default.createElement(
489
- React__default.Fragment,
490
- { key: article._id ? article._id : index },
491
- React__default.createElement(
492
- Media,
493
- {
494
- key: article._id ? article._id : index,
495
- style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
496
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
497
- 'a',
498
- { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
499
- React__default.createElement(
500
- LazyLoad,
501
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
502
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
503
- ),
504
- article.source && React__default.createElement(
505
- 'div',
506
- { className: 'content-category-label' },
507
- React__default.createElement(
508
- 'div',
509
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
510
- article.source
511
- )
512
- )
513
- ),
514
- React__default.createElement(
515
- Media.Body,
516
- null,
517
- React__default.createElement(
518
- 'a',
519
- { href: mapping[contentCategoryName] + '/' + article.url.current },
520
- article.title && React__default.createElement(
521
- 'h4',
522
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
523
- article.title
524
- )
525
- ),
526
- showPublished && !showTimeDiff && article.published && React__default.createElement(
527
- 'p',
528
- { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
529
- moment(article.published).format('MMMM DD, YYYY')
530
- ),
531
- showTimeDiff && article.published && React__default.createElement(
532
- 'p',
533
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
534
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
535
- if (index > 3) {
536
- return null;
537
- }
538
- if (index === 3) {
539
- return React__default.createElement(
540
- React__default.Fragment,
541
- null,
542
- React__default.createElement(
543
- 'em',
544
- { style: { marginRight: '.5rem' } },
545
- '...'
546
- )
547
- );
548
- }
549
- return React__default.createElement(
550
- React__default.Fragment,
551
- null,
552
- React__default.createElement(
553
- 'em',
554
- null,
555
- taxonomy.name
556
- ),
557
- ' |',
558
- ' '
559
- );
560
- }),
561
- ' ',
562
- React__default.createElement(
563
- 'span',
564
- { style: { display: 'inline-block' } },
565
- timeDifferenceCalc(article.published)
566
- )
567
- ),
568
- React__default.createElement(
569
- 'div',
570
- { className: 'author-sec', style: { lineHeight: 1.5 } },
571
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
572
- LazyLoad,
573
- { height: 50 },
574
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
575
- )
576
- ),
577
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
578
- 'div',
579
- { className: 'content-category-label' },
580
- React__default.createElement(
581
- 'div',
582
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
583
- article.source
584
- )
585
- ),
586
- React__default.createElement(
587
- 'div',
588
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
589
- showCategory && article.contentCategory && React__default.createElement(
590
- 'p',
591
- {
592
- className: 'article-category',
593
- style: {
594
- background: '#3FB618',
595
- color: '#ffffff',
596
- marginBottom: '.25rem',
597
- display: 'inline-block',
598
- padding: '0 .25rem',
599
- fontSize: '.8rem'
600
- } },
601
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
602
- ),
603
- article.issueSection && article.issueSection.name && React__default.createElement(
604
- 'p',
605
- {
606
- className: 'issueSection',
607
- style: {
608
- background: '#000000',
609
- color: '#ffffff',
610
- marginBottom: '.25rem',
611
- marginLeft: '.25rem',
612
- display: 'inline-block',
613
- padding: '0 .25rem',
614
- fontSize: '.8rem'
615
- } },
616
- article.issueSection.name
617
- )
618
- ),
619
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
620
- 'div',
621
- { className: 'pubInfo' },
622
- article.volume && React__default.createElement(
623
- 'p',
624
- { className: 'qdeVolume' },
625
- article.volume
626
- ),
627
- article.issue && React__default.createElement(
628
- 'p',
629
- { className: 'qdeIssue' },
630
- article.issue
631
- )
632
- ),
633
- showIntro && article.summary && React__default.createElement(
634
- 'p',
635
- { className: 'pt-2 card-text' },
636
- clean_html_1(article.summary)
637
- )
638
- )
639
- ),
640
- React__default.createElement(
641
- 'div',
642
- null,
643
- main_43 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
644
- )
645
- );
646
- } else return null;
647
- }) :
648
- // For Javascript Disabled Cases
649
- React__default.createElement(
650
- 'noscript',
651
- null,
652
- data.map(function (article, index) {
653
- var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
654
-
655
- if (article._type === 'feature') {
656
- featureCount++;
657
- if (article.blank || checkExternalUrl(article.url.current)) {
658
- return React__default.createElement(
659
- Media,
660
- {
661
- key: article._id ? article._id : index,
662
- className: 'feature-media',
663
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
664
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
665
- 'a',
666
- { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
667
- React__default.createElement(
668
- LazyLoad,
669
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
670
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
671
- ),
672
- article.source && React__default.createElement(
673
- 'div',
674
- { className: 'content-category-label' },
675
- React__default.createElement(
676
- 'div',
677
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
678
- article.source
679
- )
680
- )
681
- ),
682
- React__default.createElement(
683
- Media.Body,
684
- null,
685
- React__default.createElement(
686
- 'a',
687
- { rel: 'noopener', href: article.url.current, target: '_blank' },
688
- article.title && React__default.createElement(
689
- 'h4',
690
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
691
- article.title
692
- )
693
- ),
694
- showPublished && article.published && React__default.createElement(
695
- 'p',
696
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
697
- moment(article.published).format('MMMM DD, YYYY')
698
- ),
699
- showTimeDiff && article.published && React__default.createElement(
700
- 'p',
701
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
702
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
703
- if (index > 3) {
704
- return null;
705
- }
706
- if (index === 3) {
707
- return React__default.createElement(
708
- React__default.Fragment,
709
- null,
710
- React__default.createElement(
711
- 'em',
712
- { style: { marginRight: '.5rem' } },
713
- '...'
714
- )
715
- );
716
- }
717
- return React__default.createElement(
718
- React__default.Fragment,
719
- null,
720
- React__default.createElement(
721
- 'em',
722
- null,
723
- taxonomy.name
724
- ),
725
- ' |',
726
- ' '
727
- );
728
- }),
729
- ' ',
730
- React__default.createElement(
731
- 'span',
732
- { style: { display: 'inline-block' } },
733
- timeDifferenceCalc(article.published)
734
- )
735
- ),
736
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
737
- LazyLoad,
738
- { height: 50 },
739
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
740
- ),
741
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
742
- 'div',
743
- { className: 'content-category-label' },
744
- React__default.createElement(
745
- 'div',
746
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
747
- article.source
748
- )
749
- ),
750
- React__default.createElement(
751
- 'div',
752
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
753
- showCategory && article.contentCategory && React__default.createElement(
754
- 'p',
755
- {
756
- className: 'article-category',
757
- style: {
758
- background: '#3FB618',
759
- color: '#ffffff',
760
- marginBottom: '.25rem',
761
- display: 'inline-block',
762
- padding: '0 .25rem',
763
- fontSize: '.8rem'
764
- } },
765
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
766
- ),
767
- article.issueSection && article.issueSection.name && React__default.createElement(
768
- 'p',
769
- {
770
- className: 'issueSection',
771
- style: {
772
- background: '#000000',
773
- color: '#ffffff',
774
- marginBottom: '.25rem',
775
- marginLeft: '.25rem',
776
- display: 'inline-block',
777
- padding: '0 .25rem',
778
- fontSize: '.8rem'
779
- } },
780
- article.issueSection.name
781
- )
782
- ),
783
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
784
- 'div',
785
- { className: 'pubInfo' },
786
- article.volume && React__default.createElement(
787
- 'p',
788
- { className: 'qdeVolume' },
789
- article.volume
790
- ),
791
- article.issue && React__default.createElement(
792
- 'p',
793
- { className: 'qdeIssue' },
794
- article.issue
795
- )
796
- ),
797
- showIntro && article.summary && React__default.createElement(
798
- 'p',
799
- { className: 'pt-2 card-text' },
800
- clean_html_1(article.summary)
801
- )
802
- )
803
- );
804
- } else {
805
- return React__default.createElement(
806
- Media,
807
- {
808
- key: article._id ? article._id : index,
809
- className: 'feature-media',
810
- style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
811
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
812
- 'a',
813
- { href: article.url.current, className: 'feature-wrapper' },
814
- React__default.createElement(
815
- LazyLoad,
816
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
817
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
818
- ),
819
- article.source && React__default.createElement(
820
- 'div',
821
- { className: 'content-category-label' },
822
- React__default.createElement(
823
- 'div',
824
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
825
- article.source
826
- )
827
- )
828
- ),
829
- React__default.createElement(
830
- Media.Body,
831
- null,
832
- React__default.createElement(
833
- 'a',
834
- { href: article.url.current },
835
- article.title && React__default.createElement(
836
- 'h4',
837
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
838
- article.title
839
- )
840
- ),
841
- showPublished && article.published && React__default.createElement(
842
- 'p',
843
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
844
- moment(article.published).format('MMMM DD, YYYY')
845
- ),
846
- showTimeDiff && article.published && React__default.createElement(
847
- 'p',
848
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
849
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
850
- if (index > 3) {
851
- return null;
852
- }
853
- if (index === 3) {
854
- return React__default.createElement(
855
- React__default.Fragment,
856
- null,
857
- React__default.createElement(
858
- 'em',
859
- { style: { marginRight: '.5rem' } },
860
- '...'
861
- )
862
- );
863
- }
864
- return React__default.createElement(
865
- React__default.Fragment,
866
- null,
867
- React__default.createElement(
868
- 'em',
869
- null,
870
- taxonomy.name
871
- ),
872
- ' |',
873
- ' '
874
- );
875
- }),
876
- ' ',
877
- React__default.createElement(
878
- 'span',
879
- { style: { display: 'inline-block' } },
880
- timeDifferenceCalc(article.published)
881
- )
882
- ),
883
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
884
- LazyLoad,
885
- { height: 50 },
886
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
887
- ),
888
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
889
- 'div',
890
- { className: 'content-category-label' },
891
- React__default.createElement(
892
- 'div',
893
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
894
- article.source
895
- )
896
- ),
897
- React__default.createElement(
898
- 'div',
899
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
900
- showCategory && article.contentCategory && React__default.createElement(
901
- 'p',
902
- {
903
- className: 'article-category',
904
- style: {
905
- background: '#3FB618',
906
- color: '#ffffff',
907
- marginBottom: '.25rem',
908
- display: 'inline-block',
909
- padding: '0 .25rem',
910
- fontSize: '.8rem'
911
- } },
912
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
913
- ),
914
- article.issueSection && article.issueSection.name && React__default.createElement(
915
- 'p',
916
- {
917
- className: 'issueSection',
918
- style: {
919
- background: '#000000',
920
- color: '#ffffff',
921
- marginBottom: '.25rem',
922
- marginLeft: '.25rem',
923
- display: 'inline-block',
924
- padding: '0 .25rem',
925
- fontSize: '.8rem'
926
- } },
927
- article.issueSection.name
928
- )
929
- ),
930
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
931
- 'div',
932
- { className: 'pubInfo' },
933
- article.volume && React__default.createElement(
934
- 'p',
935
- { className: 'qdeVolume' },
936
- article.volume
937
- ),
938
- article.issue && React__default.createElement(
939
- 'p',
940
- { className: 'qdeIssue' },
941
- article.issue
942
- )
943
- ),
944
- showIntro && article.summary && React__default.createElement(
945
- 'p',
946
- { className: 'pt-2 card-text' },
947
- clean_html_1(article.summary)
948
- )
949
- )
950
- );
951
- }
952
- } else if (article._type === 'lg-infeed' && article.adUnit) {
953
- return React__default.createElement(ADlgInfeed, _extends({ index: index }, article));
954
- } else if (article._type === 'brandInsightAd' && article.adUnit) {
955
- return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
956
- }
957
- if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
958
- return React__default.createElement(
959
- React__default.Fragment,
960
- { key: article._id ? article._id : index },
961
- React__default.createElement(
962
- Media,
963
- {
964
- key: article._id ? article._id : index,
965
- style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
966
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
967
- 'a',
968
- { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
969
- React__default.createElement(
970
- LazyLoad,
971
- { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
972
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
973
- ),
974
- article.source && React__default.createElement(
975
- 'div',
976
- { className: 'content-category-label' },
977
- React__default.createElement(
978
- 'div',
979
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
980
- article.source
981
- )
982
- )
983
- ),
984
- React__default.createElement(
985
- Media.Body,
986
- null,
987
- React__default.createElement(
988
- 'a',
989
- { href: mapping[contentCategoryName] + '/' + article.url.current },
990
- article.title && React__default.createElement(
991
- 'h4',
992
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
993
- article.title
994
- )
995
- ),
996
- showPublished && article.published && React__default.createElement(
997
- 'p',
998
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
999
- moment(article.published).format('MMMM DD, YYYY')
1000
- ),
1001
- showTimeDiff && article.published && React__default.createElement(
1002
- 'p',
1003
- { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1004
- showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1005
- if (index > 3) {
1006
- return null;
1007
- }
1008
- if (index === 3) {
1009
- return React__default.createElement(
1010
- React__default.Fragment,
1011
- null,
1012
- React__default.createElement(
1013
- 'em',
1014
- { style: { marginRight: '.5rem' } },
1015
- '...'
1016
- )
1017
- );
1018
- }
1019
- return React__default.createElement(
1020
- React__default.Fragment,
1021
- null,
1022
- React__default.createElement(
1023
- 'em',
1024
- null,
1025
- taxonomy.name
1026
- ),
1027
- ' |',
1028
- ' '
1029
- );
1030
- }),
1031
- ' ',
1032
- React__default.createElement(
1033
- 'span',
1034
- { style: { display: 'inline-block' } },
1035
- timeDifferenceCalc(article.published)
1036
- )
1037
- ),
1038
- React__default.createElement(
1039
- 'div',
1040
- { className: 'author-sec', style: { lineHeight: 1.5 } },
1041
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1042
- LazyLoad,
1043
- { height: 50 },
1044
- React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1045
- )
1046
- ),
1047
- !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1048
- 'div',
1049
- { className: 'content-category-label' },
1050
- React__default.createElement(
1051
- 'div',
1052
- { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1053
- article.source
1054
- )
1055
- ),
1056
- React__default.createElement(
1057
- 'div',
1058
- { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1059
- showCategory && article.contentCategory && React__default.createElement(
1060
- 'p',
1061
- {
1062
- className: 'article-category',
1063
- style: {
1064
- background: '#3FB618',
1065
- color: '#ffffff',
1066
- marginBottom: '.25rem',
1067
- display: 'inline-block',
1068
- padding: '0 .25rem',
1069
- fontSize: '.8rem'
1070
- } },
1071
- getContentCategory(article.contentCategory.name, contentCategoryMapping)
1072
- ),
1073
- article.issueSection && article.issueSection.name && React__default.createElement(
1074
- 'p',
1075
- {
1076
- className: 'issueSection',
1077
- style: {
1078
- background: '#000000',
1079
- color: '#ffffff',
1080
- marginBottom: '.25rem',
1081
- marginLeft: '.25rem',
1082
- display: 'inline-block',
1083
- padding: '0 .25rem',
1084
- fontSize: '.8rem'
1085
- } },
1086
- article.issueSection.name
1087
- )
1088
- ),
1089
- showPubInfo && (article.issue || article.volume) && React__default.createElement(
1090
- 'div',
1091
- { className: 'pubInfo' },
1092
- article.volume && React__default.createElement(
1093
- 'p',
1094
- { className: 'qdeVolume' },
1095
- article.volume
1096
- ),
1097
- article.issue && React__default.createElement(
1098
- 'p',
1099
- { className: 'qdeIssue' },
1100
- article.issue
1101
- )
1102
- ),
1103
- showIntro && article.summary && React__default.createElement(
1104
- 'p',
1105
- { className: 'pt-2 card-text' },
1106
- clean_html_1(article.summary)
1107
- )
1108
- )
1109
- ),
1110
- React__default.createElement(
1111
- 'div',
1112
- null,
1113
- main_43 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
1114
- )
1115
- );
1116
- } else return null;
1117
- })
1118
- ) : React__default.createElement(
1119
- 'div',
1120
- null,
1121
- React__default.createElement(
1122
- 'h5',
1123
- null,
1124
- React__default.createElement(
1125
- 'em',
1126
- null,
1127
- 'New content coming soon, please check back later.'
1128
- )
1129
- )
1130
- ),
1131
- React__default.createElement(
1132
- 'style',
1133
- { jsx: 'true' },
1134
- '\n .displayLabelThumb {\n margin: 0 auto;\n margin-top: -1.25rem;\n background-color: white;\n position: relative;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n width: fit-content;\n width: -moz-fit-content;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .feature-media > .media-body {\n -webkit-box-flex: none;\n -ms-flex: none;\n flex: none;\n }\n .img-wrapper img {\n max-height: 240px;\n height: auto;\n width: 100%;\n object-fit: contain;\n }\n .feature-wrapper {\n height: 100%;\n width: 100%;\n }\n .feature-wrapper img {\n width: 100%;\n margin-bottom: 1em;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .sanityDisplayLabel {\n max-width: 100%;\n }\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column !important;\n }\n }\n '
1135
- )
1136
- );
1137
- };
1138
-
1139
- var ImagePlaceholder = function ImagePlaceholder() {
1140
- return React__default.createElement(
1141
- React__default.Fragment,
1142
- null,
1143
- React__default.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
1144
- React__default.createElement(
1145
- 'style',
1146
- { jsx: 'true' },
1147
- '\n .queuedeck-exp-image-placeholder {\n width: 240px;\n height: 0;\n padding-top: calc(240px * 9 / 16);\n margin: 0 1rem 0 0;\n }\n @media only screen and (max-width: 767px) {\n .queuedeck-exp-image-placeholder {\n width: 100%;\n height: 0;\n padding-top: calc(100% * 9 / 16);\n margin: 0 0 1rem 0;\n }\n }\n '
1148
- )
1149
- );
1150
- };
1151
-
1152
- var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
1153
- var i = numberOfItemsBeforeAd < 6 ? 0 : ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
1154
- return React__default.createElement(
1155
- 'div',
1156
- { style: { display: 'flex', flex: '1 0 auto' } },
1157
- rightItems[i].component
1158
- );
1159
- };
1160
-
1161
- var usePrevious = function usePrevious(value) {
1162
- var ref = useRef();
1163
- useEffect(function () {
1164
- ref.current = value;
1165
- });
1166
- return ref.current;
1167
- };
1168
-
1169
- var QueueDeckExpanded = function QueueDeckExpanded(props) {
1170
- var router = useRouter();
1171
- var initialData = props.dataRecord,
1172
- initialCurrentPage = props.currentPage,
1173
- client = props.client,
1174
- params = props.params,
1175
- query = props.query,
1176
- pointer = props.pointer,
1177
- pointerArray = props.pointerArray,
1178
- mapping = props.mapping,
1179
- seoPaginate = props.seoPaginate,
1180
- pageview = props.pageview,
1181
- defaultImage = props.defaultImage,
1182
- showAuthor = props.showAuthor,
1183
- showCategory = props.showCategory,
1184
- imageHeight = props.imageHeight,
1185
- imageWidth = props.imageWidth,
1186
- imageMaxHeight = props.imageMaxHeight,
1187
- imageFit = props.imageFit,
1188
- rightItems = props.rightItems,
1189
- brandInsightAd = props.brandInsightAd,
1190
- _props$showBI = props.showBI,
1191
- showBI = _props$showBI === undefined ? false : _props$showBI,
1192
- _props$heroContent = props.heroContent,
1193
- heroContent = _props$heroContent === undefined ? 0 : _props$heroContent,
1194
- _props$lgInfeedAd = props.lgInfeedAd,
1195
- lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd,
1196
- _props$showPubInfo = props.showPubInfo,
1197
- showPubInfo = _props$showPubInfo === undefined ? false : _props$showPubInfo,
1198
- _props$showTimeDiff = props.showTimeDiff,
1199
- showTimeDiff = _props$showTimeDiff === undefined ? false : _props$showTimeDiff,
1200
- _props$showTaxonomies = props.showTaxonomies,
1201
- showTaxonomies = _props$showTaxonomies === undefined ? false : _props$showTaxonomies,
1202
- _props$showIntro = props.showIntro,
1203
- showIntro = _props$showIntro === undefined ? true : _props$showIntro,
1204
- _props$contentCategor = props.contentCategoryMapping,
1205
- contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor,
1206
- showPublished = props.showPublished,
1207
- totalDataCount = props.totalDataCount;
1208
-
1209
- var _useState3 = useState(initialData),
1210
- _useState4 = _slicedToArray(_useState3, 2),
1211
- data = _useState4[0],
1212
- setData = _useState4[1];
1213
-
1214
- var _useState5 = useState(false),
1215
- _useState6 = _slicedToArray(_useState5, 2),
1216
- isDataLoading = _useState6[0],
1217
- setIsDataLoading = _useState6[1];
1218
-
1219
- var _useState7 = useState(initialCurrentPage || 1),
1220
- _useState8 = _slicedToArray(_useState7, 2),
1221
- currentPage = _useState8[0],
1222
- setCurrentPage = _useState8[1];
1223
-
1224
- var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : params && params.from && params.to ? params.to - params.from : 10;
1225
-
1226
- // Logging GA Pageview on path change
1227
- var prevPath = usePrevious(lodash.get(router, 'asPath', undefined));
1228
- useEffect(function () {
1229
- var currentPath = router.asPath;
1230
- if (prevPath && prevPath !== currentPath && pageview) {
1231
- pageview(router.asPath);
1232
- }
1233
- }, [router]);
1234
-
1235
- var seoPagination = function seoPagination(pageNumber) {
1236
- var path = router.asPath;
1237
- var qrIndex = path.indexOf('?');
1238
- var pathname = router.pathname;
1239
- var queryString = '';
1240
- if (qrIndex > 0) {
1241
- path = path.substring(1, qrIndex);
1242
- var partialQS = router.asPath.substring(qrIndex + 1);
1243
- var partialQSArr = partialQS.split('&');
1244
- // exclude page=xxx from query string
1245
- partialQSArr.map(function (item) {
1246
- var itemArr = item.split('=');
1247
- var key = itemArr[0];
1248
- var val = itemArr[1];
1249
- if (key !== 'page') queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
1250
- });
1251
- }
1252
- if (queryString.length > 0) path += '?' + queryString;
1253
- pageNumber = parseInt(pageNumber);
1254
- if (currentPage !== pageNumber) {
1255
- if (path[0] !== '/') path = '/' + path;
1256
- var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
1257
- router.push(pathname, newPath, {
1258
- shallow: true
1259
- });
1260
- }
1261
- };
1262
-
1263
- var handlePageChange = function () {
1264
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(selectedPage) {
1265
- var start, newParams, newData;
1266
- return regenerator.wrap(function _callee$(_context) {
1267
- while (1) {
1268
- switch (_context.prev = _context.next) {
1269
- case 0:
1270
- console.log('selectedPage', selectedPage);
1271
- setIsDataLoading(true);
1272
- setCurrentPage(selectedPage);
1273
- seoPaginate && seoPagination(selectedPage);
1274
- lib_3.refresh();
1275
- document.body.scrollTop = 0;
1276
- document.documentElement.scrollTop = 0;
1277
- start = (selectedPage - 1) * itemsPerPage;
1278
- newParams = _extends({}, params, {
1279
- from: start,
1280
- to: start + itemsPerPage
1281
- });
1282
- _context.prev = 9;
1283
- _context.next = 12;
1284
- return client.fetch(query, newParams);
1285
-
1286
- case 12:
1287
- newData = _context.sent;
1288
-
1289
- if (pointer && pointerArray) newData = newData[pointerArray][pointer];
1290
- if (newData && newData.length > 0) {
1291
- setIsDataLoading(false);
1292
- setData(newData);
1293
- }
1294
- _context.next = 20;
1295
- break;
1296
-
1297
- case 17:
1298
- _context.prev = 17;
1299
- _context.t0 = _context['catch'](9);
1300
-
1301
- console.error(_context.t0);
1302
-
1303
- case 20:
1304
- case 'end':
1305
- return _context.stop();
1306
- }
1307
- }
1308
- }, _callee, _this, [[9, 17]]);
1309
- }));
1310
-
1311
- return function handlePageChange(_x5) {
1312
- return _ref2.apply(this, arguments);
1313
- };
1314
- }();
1315
-
1316
- return React__default.createElement(
1317
- 'div',
1318
- { className: 'queuedeck-expanded' },
1319
- isDataLoading ? React__default.createElement(
1320
- 'div',
1321
- { className: 'd-flex justify-content-center', style: { marginTop: '100px' } },
1322
- React__default.createElement(
1323
- Spinner,
1324
- { animation: 'border', role: 'status' },
1325
- React__default.createElement(
1326
- 'span',
1327
- { className: 'sr-only' },
1328
- 'Loading...'
1329
- )
1330
- )
1331
- ) : React__default.createElement(
1332
- Container,
1333
- null,
1334
- React__default.createElement(CardLoader, {
1335
- data: data,
1336
- client: client,
1337
- mapping: mapping,
1338
- showPublished: showPublished,
1339
- defaultImage: defaultImage,
1340
- showAuthor: showAuthor,
1341
- showCategory: showCategory,
1342
- imageHeight: imageHeight,
1343
- imageWidth: imageWidth,
1344
- imageMaxHeight: imageMaxHeight,
1345
- imageFit: imageFit,
1346
- rightItems: rightItems,
1347
- brandInsightAd: brandInsightAd,
1348
- showBI: showBI,
1349
- heroContent: heroContent,
1350
- lgInfeedAd: lgInfeedAd,
1351
- showPubInfo: showPubInfo,
1352
- contentCategoryMapping: contentCategoryMapping,
1353
- showTimeDif: showTimeDiff,
1354
- showTaxonomies: showTaxonomies,
1355
- showIntro: showIntro
1356
- }),
1357
- React__default.createElement(
1358
- 'div',
1359
- { className: 'pagination-wrapper' },
1360
- React__default.createElement(Pagination, { pageCount: Math.ceil(totalDataCount / itemsPerPage), pageRangeDisplayed: main_43 ? 3 : 9, currentPage: currentPage, onPageChange: handlePageChange }),
1361
- React__default.createElement(
1362
- 'style',
1363
- { jsx: 'true' },
1364
- '\n .pagination-wrapper {\n margin: 3rem 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-wrapper {\n margin-bottom: 6rem;\n }\n }\n '
1365
- )
1366
- )
1367
- )
1368
- );
1369
- };
1370
-
1371
- export default QueueDeckExpanded;