@mjhls/mjh-framework 1.0.885 → 1.0.886

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 (32) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/ContentCardPaginated.js +414 -0
  3. package/dist/cjs/DeckQueuePaginated.js +345 -0
  4. package/dist/cjs/GridContent.js +44 -157
  5. package/dist/cjs/GridContentPaginated.js +704 -0
  6. package/dist/cjs/ImageSlider-b96720eb.js +2813 -0
  7. package/dist/cjs/MasterDeckPaginated.js +446 -0
  8. package/dist/cjs/MediaSeriesCard-8b4efd28.js +9505 -0
  9. package/dist/cjs/MediaSeriesLanding.js +20 -9502
  10. package/dist/cjs/MediaSeriesLandingPaginated.js +524 -0
  11. package/dist/cjs/Pagination-8f2038bf.js +53 -0
  12. package/dist/cjs/PartnerDetailListing.js +12 -2807
  13. package/dist/cjs/PartnerDetailListingPaginated.js +314 -0
  14. package/dist/cjs/PublicationFeature-5ccf9b13.js +130 -0
  15. package/dist/cjs/QueueDeckExpandedPaginated.js +1378 -0
  16. package/dist/cjs/index.js +2 -0
  17. package/dist/esm/ContentCardPaginated.js +403 -0
  18. package/dist/esm/DeckQueuePaginated.js +334 -0
  19. package/dist/esm/GridContent.js +2 -114
  20. package/dist/esm/GridContentPaginated.js +693 -0
  21. package/dist/esm/ImageSlider-de7846ea.js +2804 -0
  22. package/dist/esm/MasterDeckPaginated.js +438 -0
  23. package/dist/esm/MediaSeriesCard-51ebf1c0.js +9495 -0
  24. package/dist/esm/MediaSeriesLanding.js +16 -9496
  25. package/dist/esm/MediaSeriesLandingPaginated.js +517 -0
  26. package/dist/esm/Pagination-c0db7ca1.js +46 -0
  27. package/dist/esm/PartnerDetailListing.js +13 -2807
  28. package/dist/esm/PartnerDetailListingPaginated.js +308 -0
  29. package/dist/esm/PublicationFeature-d88e76b9.js +121 -0
  30. package/dist/esm/QueueDeckExpandedPaginated.js +1372 -0
  31. package/dist/esm/index.js +2 -0
  32. package/package.json +2 -1
@@ -0,0 +1,693 @@
1
+ import { _ as _JSON$stringify } from './stringify-2b084bee.js';
2
+ import { _ as _toConsumableArray } from './toConsumableArray-f7074d7c.js';
3
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-5ef104a7.js';
4
+ import { _ as _extends } from './extends-6d8e3924.js';
5
+ import { _ as _inherits, a as _classCallCheck, b as _possibleConstructorReturn, c as _Object$getPrototypeOf, d as _createClass } from './inherits-a6ba2ec4.js';
6
+ import React__default from 'react';
7
+ import { l as lib_3 } from './index-f0fc23eb.js';
8
+ import Container from 'react-bootstrap/Container';
9
+ import Row from 'react-bootstrap/Row';
10
+ import Col from 'react-bootstrap/Col';
11
+ import Card from 'react-bootstrap/Card';
12
+ import { m as moment } from './moment-bc12cb97.js';
13
+ import { withRouter } from 'next/router';
14
+ import { L as LazyLoad } from './index-755f2cc2.js';
15
+ import { c as clean_html_1 } from './entities-6d9154b4.js';
16
+ import { A as ADInfeed } from './ADInfeed-0a55cd2d.js';
17
+ import { l as lodash } from './lodash-f97fd99a.js';
18
+ import { A as ADlgInfeed } from './ADlgInfeed-013e1f4a.js';
19
+ import { g as getContentCategory } from './getContentCategory-15dcc413.js';
20
+ import { g as get_1 } from './get-3c308da4.js';
21
+ import urlFor from './urlFor.js';
22
+ import { m as main_43 } from './main-1894c974.js';
23
+ import { A as AuthorComponent } from './AuthorComponent-11adff02.js';
24
+ import { P as PublicationFeature } from './PublicationFeature-d88e76b9.js';
25
+ import { P as Pagination } from './Pagination-c0db7ca1.js';
26
+ import Spinner from 'react-bootstrap/Spinner';
27
+ import './_commonjsHelpers-0c4b6f40.js';
28
+ import './core.get-iterator-method-ea258bb1.js';
29
+ import './_iter-detect-98db3b07.js';
30
+ import './web.dom.iterable-ab4dea5c.js';
31
+ import './_library-528f1934.js';
32
+ import './_object-pie-133f504a.js';
33
+ import './_object-sap-7cee6f84.js';
34
+ import './define-property-5f1bda73.js';
35
+ import './typeof-e9fc0c5d.js';
36
+ import './_is-array-8d21b9e3.js';
37
+ import './events-6c3a7a63.js';
38
+ import 'prop-types';
39
+ import 'react-dom';
40
+ import './slicedToArray-6ebcbfea.js';
41
+ import './AdSlot.js';
42
+ import './debounce-533d9748.js';
43
+ import './isSymbol-a7e9aafe.js';
44
+ import './toNumber-5aeba6e7.js';
45
+ import './Beam.js';
46
+ import './Segment.js';
47
+ import './eq-bdcbf886.js';
48
+ import './index-3f5c03b2.js';
49
+ import 'react-bootstrap/Button';
50
+ import 'react-paginate';
51
+
52
+ var GridContent = function (_React$Component) {
53
+ _inherits(GridContent, _React$Component);
54
+
55
+ function GridContent() {
56
+ var _ref,
57
+ _this2 = this;
58
+
59
+ var _temp, _this, _ret;
60
+
61
+ _classCallCheck(this, GridContent);
62
+
63
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
64
+ args[_key] = arguments[_key];
65
+ }
66
+
67
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = GridContent.__proto__ || _Object$getPrototypeOf(GridContent)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.client = _this.props.client, _this.seoPaginate = _this.props.seoPaginate, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
68
+ isDataLoading: false,
69
+ data: _this.data,
70
+ prevData: _this.data,
71
+ itemsPerPage: _this.params ? _this.params.itemsPerPage : _this.params.from && _this.params.to ? _this.params.to - _this.params.from : 30,
72
+ currentPage: _this.props.currentPage || 1,
73
+ lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
74
+ showCategory: _this.props.showCategory ? _this.props.showCategory : false,
75
+ contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
76
+ totalDataCount: _this.props.totalDataCount
77
+ }, _this.componentDidUpdate = function (prevProps, prevState) {
78
+ var _this$props = _this.props,
79
+ pageview = _this$props.pageview,
80
+ currentPath = _this$props.router.asPath;
81
+ var prevPath = prevProps.router.asPath;
82
+
83
+ if (pageview && currentPath !== prevPath) {
84
+ pageview(currentPath);
85
+ }
86
+ }, _this.renderCardImage = function (row, page) {
87
+ if (row.thumbnail && row.thumbnail.asset) {
88
+ var url = urlFor({
89
+ client: _this.client,
90
+ source: row.thumbnail,
91
+ imageHeight: _this.props.imageHeight || null,
92
+ imageWidth: _this.props.imageWidth || null,
93
+ imageFit: _this.props.imageFit || null
94
+ });
95
+ return url;
96
+ } else {
97
+ return _this.defaultImage;
98
+ }
99
+ }, _this.seoPagination = function (pageNumber) {
100
+ var router = _this.props.router;
101
+
102
+ var path = router.asPath;
103
+ var qrIndex = path.indexOf('?');
104
+ var pathname = router.pathname;
105
+ var queryString = '';
106
+ if (qrIndex > 0) {
107
+ path = path.substring(1, qrIndex);
108
+ var partialQS = router.asPath.substring(qrIndex + 1);
109
+ var partialQSArr = partialQS.split('&');
110
+ // exclude page=xxx from query string
111
+ partialQSArr.map(function (item) {
112
+ var itemArr = item.split('=');
113
+ var key = itemArr[0];
114
+ var val = itemArr[1];
115
+ if (key !== 'page') queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
116
+ });
117
+ }
118
+ if (queryString.length > 0) path += '?' + queryString;
119
+ pageNumber = parseInt(pageNumber);
120
+ if (_this.state.page !== pageNumber) {
121
+ if (path[0] !== '/') path = '/' + path;
122
+ var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
123
+ router.push(pathname, newPath, {
124
+ shallow: true
125
+ });
126
+ }
127
+ }, _this.handlePageChange = function () {
128
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(selectedPage) {
129
+ var start, newParams, newData;
130
+ return regenerator.wrap(function _callee$(_context) {
131
+ while (1) {
132
+ switch (_context.prev = _context.next) {
133
+ case 0:
134
+ console.log('selectedPage', selectedPage);
135
+ _this.setState({
136
+ isDataLoading: true,
137
+ currentPage: selectedPage
138
+ });
139
+ _this.seoPaginate && _this.seoPagination(selectedPage);
140
+ lib_3.refresh();
141
+ document.body.scrollTop = 0;
142
+ document.documentElement.scrollTop = 0;
143
+ start = (selectedPage - 1) * _this.state.itemsPerPage;
144
+ newParams = _extends({}, _this.params, {
145
+ from: start,
146
+ to: start + _this.state.itemsPerPage
147
+ });
148
+ _context.prev = 8;
149
+ _context.next = 11;
150
+ return _this.client.fetch(_this.query, newParams);
151
+
152
+ case 11:
153
+ newData = _context.sent;
154
+
155
+ if (_this.pointer && _this.pointerArray) newData = newData[pointerArray][pointer];
156
+ if (newData && newData.length > 0) {
157
+ _this.setState({
158
+ isDataLoading: false,
159
+ data: newData,
160
+ page: selectedPage
161
+ });
162
+ }
163
+ _context.next = 19;
164
+ break;
165
+
166
+ case 16:
167
+ _context.prev = 16;
168
+ _context.t0 = _context['catch'](8);
169
+
170
+ console.error(_context.t0);
171
+
172
+ case 19:
173
+ case 'end':
174
+ return _context.stop();
175
+ }
176
+ }
177
+ }, _callee, _this2, [[8, 16]]);
178
+ }));
179
+
180
+ return function (_x) {
181
+ return _ref2.apply(this, arguments);
182
+ };
183
+ }(), _this.checkExternalUrl = function (url) {
184
+ return new RegExp(['http', 'https'].join('|')).test(url);
185
+ }, _this.renderMobileAd = function (index, numberOfItemsBeforeAd) {
186
+ var rightItems = _this.props.rightItems;
187
+
188
+ var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
189
+ return React__default.createElement(
190
+ 'div',
191
+ { style: { display: 'flex', flex: '1 0 auto' } },
192
+ rightItems[i].component
193
+ );
194
+ }, _temp), _possibleConstructorReturn(_this, _ret);
195
+ }
196
+
197
+ _createClass(GridContent, [{
198
+ key: 'cardLoader',
199
+ value: function cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight, lgInfeedAd, contentCategoryMapping) {
200
+ var _this3 = this;
201
+
202
+ var lgVar = Math.floor(12 / columns);
203
+ var itemCounter = 0;
204
+ var numberOfItemsBeforeAd = 6;
205
+ var numberOfItemsBeforeVideo = 3;
206
+ if (variant === 'stack') {
207
+ return React__default.createElement(
208
+ Row,
209
+ null,
210
+ this.state.data && this.state.data.length > 0 ? this.state.data.map(function (row, index) {
211
+ // const thumbnailURL = get(row, 'thumbnail.asset.url', this.props.defaultImage)
212
+ return React__default.createElement(
213
+ Col,
214
+ { key: index, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
215
+ React__default.createElement(
216
+ Card,
217
+ { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
218
+ React__default.createElement(
219
+ Row,
220
+ { style: { flexDirection: 'row' } },
221
+ React__default.createElement(
222
+ Col,
223
+ { md: 12, lg: 4 },
224
+ React__default.createElement(
225
+ 'a',
226
+ { href: _this3.page + '/' + get_1(row, 'url.current') },
227
+ React__default.createElement(
228
+ LazyLoad,
229
+ { height: _this3.props.imageHeight },
230
+ React__default.createElement(Card.Img, { variant: 'top', src: _this3.renderCardImage(row, page), alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : '' })
231
+ )
232
+ )
233
+ ),
234
+ React__default.createElement(
235
+ Col,
236
+ null,
237
+ React__default.createElement(
238
+ Card.Body,
239
+ { style: { padding: '20px' } },
240
+ React__default.createElement(
241
+ Card.Title,
242
+ null,
243
+ React__default.createElement(
244
+ 'a',
245
+ { href: _this3.page + '/' + get_1(row, 'url.current') },
246
+ row.title
247
+ )
248
+ ),
249
+ _this3.props.showPublished && row.published && React__default.createElement(
250
+ Card.Subtitle,
251
+ { style: { marginTop: 0 } },
252
+ moment(row.published).format('MMMM DD, YYYY')
253
+ ),
254
+ _this3.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && React__default.createElement(
255
+ LazyLoad,
256
+ { height: 50 },
257
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
258
+ ),
259
+ _this3.props.showCategory && row.contentCategory && React__default.createElement(
260
+ LazyLoad,
261
+ { height: 50 },
262
+ React__default.createElement(
263
+ 'p',
264
+ {
265
+ className: 'article-category',
266
+ style: {
267
+ background: '#3FB618',
268
+ color: '#ffffff',
269
+ marginBottom: '.25rem',
270
+ display: 'inline-block',
271
+ padding: '0 .25rem',
272
+ fontSize: '.8rem'
273
+ } },
274
+ getContentCategory(row.contentCategory.name, contentCategoryMapping)
275
+ )
276
+ ),
277
+ React__default.createElement(
278
+ Card.Text,
279
+ null,
280
+ clean_html_1(row.summary)
281
+ )
282
+ )
283
+ )
284
+ )
285
+ )
286
+ );
287
+ }) : React__default.createElement(
288
+ 'div',
289
+ null,
290
+ React__default.createElement(
291
+ 'h5',
292
+ null,
293
+ React__default.createElement(
294
+ 'em',
295
+ null,
296
+ 'New content coming soon, please check back later.'
297
+ )
298
+ )
299
+ )
300
+ );
301
+ }
302
+
303
+ var insert = function insert(arr, index, newElement) {
304
+ return [].concat(_toConsumableArray(arr.slice(0, index)), [newElement], _toConsumableArray(arr.slice(index)));
305
+ };
306
+ var posts = [];
307
+ if (brandInsight && (lgInfeedAd || showBI)) {
308
+ var firstThree = this.state.data.slice(0, 3);
309
+ var data = this.state.data.slice(3);
310
+
311
+ // Need to pass flag "lgInfeedAd={true}" along with brandInsight from site level for large infeed-ad to render
312
+ // Checking lgInfeedAd flag in desktop view ( window >= 1400px ).
313
+ if (lgInfeedAd && typeof window !== 'undefined' && window.innerWidth >= 1400) {
314
+ var lgInFeedAd = {
315
+ _type: 'lg-infeed',
316
+ adUnit: brandInsight.adUnit,
317
+ className: 'lg-infeed',
318
+ networkID: brandInsight.networkID,
319
+ sizes: [728, 90],
320
+ // Adding sizeMapping for showing ad above 1400px
321
+ sizeMapping: [{
322
+ viewport: [1400, 0],
323
+ sizes: [[728, 90]]
324
+ }, { viewport: [0, 0], sizes: [] }],
325
+ targeting: {
326
+ content_placement: brandInsight.targeting.content_placement,
327
+ document_url: brandInsight.targeting.document_url,
328
+ rootDocumentGroup: brandInsight.targeting.rootDocumentGroup
329
+ },
330
+ /* Passing refresh flag */
331
+ refreshFlag: brandInsight.refreshFlag ? brandInsight.refreshFlag : false
332
+ };
333
+ var chunks = lodash.chunk(data, 6).map(function (chunk) {
334
+ var set = lodash.chunk(chunk, 2);
335
+ for (var i = 0; i < set.length; i++) {
336
+ if (i !== set.length - 1) {
337
+ set[i].push(lgInFeedAd);
338
+ }
339
+ }
340
+ return lodash.flattenDeep(set);
341
+ });
342
+
343
+ posts = lodash.flatten(chunks);
344
+ }
345
+
346
+ if (showBI) {
347
+ // Checking lgInfeedAd flag in desktop view ( window >= 1400px ).
348
+ if (lgInfeedAd && typeof window !== 'undefined' && window.innerWidth >= 1400) {
349
+ brandInsight.interval = 8;
350
+ } else if (typeof window !== 'undefined' && window.innerWidth < 1400) {
351
+ brandInsight.interval = 5;
352
+ posts = data;
353
+ }
354
+
355
+ var pos = 0;
356
+ for (var i = 1; pos < posts.length; i++) {
357
+ var inFeedAd = {
358
+ adUnit: brandInsight.adUnit,
359
+ className: brandInsight.className,
360
+ networkID: brandInsight.networkID,
361
+ sizes: brandInsight.sizes,
362
+ slotId: brandInsight.slotId + '_' + i,
363
+ targeting: {
364
+ pos: 'infeed',
365
+ content_placement: brandInsight.targeting.content_placement,
366
+ document_url: brandInsight.targeting.document_url,
367
+ rootDocumentGroup: brandInsight.targeting.rootDocumentGroup
368
+ },
369
+ _type: 'brandInsightAd',
370
+ /* Passing refresh flag */
371
+ refreshFlag: brandInsight.refreshFlag ? brandInsight.refreshFlag : false
372
+ };
373
+
374
+ posts = insert(posts, pos, inFeedAd);
375
+ pos += brandInsight.interval + 1;
376
+ }
377
+ }
378
+ posts = firstThree.concat(posts);
379
+ } else {
380
+ posts = this.state.data;
381
+ }
382
+
383
+ // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
384
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
385
+ // 'articleCount' will be the indexes of only the articles in the deck.
386
+ var articleCount = -1;
387
+ posts = posts.map(function (ele, i) {
388
+ if (ele._type === 'lg-infeed') {
389
+ // Setting pos as top2 for the first occurence of large infeed ad
390
+ // const pos = posts.indexOf(posts.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
391
+ return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: 'lg-infeed' }) });
392
+ } else if (ele._type === 'article') {
393
+ // incrementing 'articleCount' for each article.
394
+ ++articleCount;
395
+ return _extends({}, ele, { articleCount: articleCount });
396
+ } else {
397
+ return ele;
398
+ }
399
+ });
400
+
401
+ var publicationFeature = this.props.publicationFeature;
402
+
403
+ if (publicationFeature) posts = insert(posts, 3, publicationFeature);
404
+
405
+ this.props.params && this.props.params.itemsPerPage ? this.props.params.itemsPerPage : 10;
406
+ var heroContent = this.props.heroContent ? this.props.heroContent : 0;
407
+ var featureCount = 0;
408
+ return React__default.createElement(
409
+ 'div',
410
+ { className: 'grid-container' },
411
+ posts && posts.length > 0 ? posts.map(function (row, index) {
412
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this3.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
413
+ var linkHref = row.url && row.url.current ? _this3.mapping[contentCategoryName] + '/' + row.url.current : '';
414
+ if (row._type === 'feature') {
415
+ featureCount++;
416
+ if (row.blank || _this3.checkExternalUrl(row.url.current)) {
417
+ return React__default.createElement(
418
+ React__default.Fragment,
419
+ { key: itemCounter },
420
+ React__default.createElement(
421
+ 'div',
422
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
423
+ React__default.createElement(
424
+ Card,
425
+ { className: 'content-card', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
426
+ (row.thumbnail && row.thumbnail.asset || _this3.props.defaultImage) && React__default.createElement(
427
+ 'a',
428
+ { rel: 'noopener', href: row.url.current, target: '_blank', className: index === 0 || index % 4 === 0 ? '' : 'card-image' },
429
+ React__default.createElement(
430
+ LazyLoad,
431
+ { height: _this3.props.imageHeight },
432
+ React__default.createElement(Card.Img, {
433
+ variant: 'top',
434
+ src: _this3.renderCardImage(row, page),
435
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
436
+ })
437
+ )
438
+ ),
439
+ React__default.createElement(
440
+ Card.Body,
441
+ null,
442
+ React__default.createElement(
443
+ 'a',
444
+ { rel: 'noopener', href: row.url.current, target: '_blank' },
445
+ React__default.createElement(
446
+ Card.Title,
447
+ null,
448
+ row.title
449
+ )
450
+ ),
451
+ _this3.props.showPublished && row.published && React__default.createElement(
452
+ Card.Subtitle,
453
+ { style: { marginTop: 0 } },
454
+ moment(row.published).format('MMMM DD, YYYY')
455
+ ),
456
+ _this3.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && React__default.createElement(
457
+ LazyLoad,
458
+ { height: 50 },
459
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
460
+ ),
461
+ React__default.createElement(
462
+ Card.Text,
463
+ { className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
464
+ clean_html_1(row.summary)
465
+ )
466
+ )
467
+ )
468
+ ),
469
+ showVideo && (posts.length < numberOfItemsBeforeVideo || index + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
470
+ main_43 && _this3.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this3.renderMobileAd(index, numberOfItemsBeforeAd)
471
+ );
472
+ } else {
473
+ return React__default.createElement(
474
+ React__default.Fragment,
475
+ { key: itemCounter },
476
+ React__default.createElement(
477
+ 'div',
478
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
479
+ React__default.createElement(
480
+ Card,
481
+ { className: 'content-card', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
482
+ (row.thumbnail && row.thumbnail.asset || _this3.props.defaultImage) && React__default.createElement(
483
+ 'a',
484
+ { href: row.url.current, className: index === 0 || index % 4 === 0 ? '' : 'card-image' },
485
+ React__default.createElement(
486
+ LazyLoad,
487
+ { height: _this3.props.imageHeight },
488
+ React__default.createElement(Card.Img, {
489
+ variant: 'top',
490
+ src: _this3.renderCardImage(row, page),
491
+ alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
492
+ })
493
+ )
494
+ ),
495
+ React__default.createElement(
496
+ Card.Body,
497
+ null,
498
+ React__default.createElement(
499
+ 'a',
500
+ { href: row.url.current },
501
+ React__default.createElement(
502
+ Card.Title,
503
+ null,
504
+ row.title
505
+ )
506
+ ),
507
+ _this3.props.showPublished && row.published && React__default.createElement(
508
+ Card.Subtitle,
509
+ { style: { marginTop: 0 } },
510
+ moment(row.published).format('MMMM DD, YYYY')
511
+ ),
512
+ _this3.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && React__default.createElement(
513
+ LazyLoad,
514
+ { height: 50 },
515
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
516
+ ),
517
+ React__default.createElement(
518
+ Card.Text,
519
+ { className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
520
+ clean_html_1(row.summary)
521
+ )
522
+ )
523
+ )
524
+ ),
525
+ showVideo && (posts.length < numberOfItemsBeforeVideo || index + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
526
+ main_43 && _this3.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this3.renderMobileAd(index, numberOfItemsBeforeAd)
527
+ );
528
+ }
529
+ } else if (row._type === 'lg-infeed' && row.adUnit) {
530
+ return React__default.createElement(ADlgInfeed, _extends({ index: index }, row));
531
+ } else if (row._type === 'brandInsightAd' && row.adUnit) {
532
+ return React__default.createElement(ADInfeed, { index: index, infeedAd: row });
533
+ } else if (row._type === 'publication') return React__default.createElement(PublicationFeature, { data: row, defaultImage: _this3.defaultImage, issueMapping: _this3.props.issueMapping, client: _this3.client });
534
+ if (index + 1 > heroContent + featureCount && (!row._type || !['lg-infeed', 'brandInsightAd'].includes(row._type))) {
535
+ return React__default.createElement(
536
+ React__default.Fragment,
537
+ { key: itemCounter },
538
+ React__default.createElement(
539
+ 'div',
540
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
541
+ React__default.createElement(
542
+ Card,
543
+ { className: 'content-card', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
544
+ (row.thumbnail && row.thumbnail.asset || _this3.props.defaultImage) && React__default.createElement(
545
+ 'a',
546
+ { href: linkHref, className: index === 0 || index % 4 === 0 ? '' : 'card-image' },
547
+ React__default.createElement(
548
+ LazyLoad,
549
+ { height: _this3.props.imageHeight },
550
+ React__default.createElement(Card.Img, { variant: 'top', src: _this3.renderCardImage(row, page), alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : '' })
551
+ )
552
+ ),
553
+ React__default.createElement(
554
+ Card.Body,
555
+ null,
556
+ React__default.createElement(
557
+ 'a',
558
+ { href: linkHref },
559
+ React__default.createElement(
560
+ Card.Title,
561
+ null,
562
+ row.title
563
+ )
564
+ ),
565
+ _this3.props.showPublished && row.published && React__default.createElement(
566
+ Card.Subtitle,
567
+ { style: { marginTop: 0 } },
568
+ moment(row.published).format('MMMM DD, YYYY')
569
+ ),
570
+ _this3.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && React__default.createElement(
571
+ LazyLoad,
572
+ { height: 50 },
573
+ React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
574
+ ),
575
+ _this3.props.showCategory && row.contentCategory && React__default.createElement(
576
+ LazyLoad,
577
+ { height: 50 },
578
+ React__default.createElement(
579
+ 'p',
580
+ {
581
+ className: 'article-category',
582
+ style: {
583
+ background: '#3FB618',
584
+ color: '#ffffff',
585
+ marginBottom: '.25rem',
586
+ display: 'inline-block',
587
+ padding: '0 .25rem',
588
+ fontSize: '.8rem'
589
+ } },
590
+ getContentCategory(row.contentCategory.name, contentCategoryMapping)
591
+ )
592
+ ),
593
+ React__default.createElement(
594
+ Card.Text,
595
+ { className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
596
+ clean_html_1(row.summary)
597
+ )
598
+ )
599
+ )
600
+ ),
601
+ showVideo && (posts.length < numberOfItemsBeforeVideo || index + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
602
+ main_43 && _this3.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this3.renderMobileAd(index, numberOfItemsBeforeAd)
603
+ );
604
+ } else return null;
605
+ }) : React__default.createElement(
606
+ 'div',
607
+ null,
608
+ React__default.createElement(
609
+ 'h5',
610
+ null,
611
+ React__default.createElement(
612
+ 'em',
613
+ null,
614
+ 'New content coming soon, please check back later.'
615
+ )
616
+ )
617
+ )
618
+ );
619
+ }
620
+ }, {
621
+ key: 'render',
622
+ value: function render() {
623
+ var _props = this.props,
624
+ columns = _props.columns,
625
+ variant = _props.variant,
626
+ page = _props.page,
627
+ showVideo = _props.showVideo,
628
+ VideoPlayer = _props.VideoPlayer,
629
+ showBI = _props.showBI,
630
+ brandInsight = _props.brandInsight;
631
+
632
+
633
+ return React__default.createElement(
634
+ 'div',
635
+ { className: 'contentDeck' },
636
+ this.state.isDataLoading ? React__default.createElement(
637
+ 'div',
638
+ { className: 'd-flex justify-content-center', style: { marginTop: '100px' } },
639
+ React__default.createElement(
640
+ Spinner,
641
+ { animation: 'border', role: 'status' },
642
+ React__default.createElement(
643
+ 'span',
644
+ { className: 'sr-only' },
645
+ 'Loading...'
646
+ )
647
+ )
648
+ ) : React__default.createElement(
649
+ React__default.Fragment,
650
+ null,
651
+ React__default.createElement(
652
+ 'div',
653
+ { className: 'pagination-wrapper' },
654
+ React__default.createElement(
655
+ Container,
656
+ null,
657
+ this.cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight, this.state.lgInfeedAd, this.state.contentCategoryMapping)
658
+ ),
659
+ React__default.createElement(Pagination, {
660
+ pageCount: Math.ceil(this.state.totalDataCount / this.state.itemsPerPage),
661
+ pageRangeDisplayed: main_43 ? 3 : 9,
662
+ currentPage: this.state.currentPage,
663
+ onPageChange: this.handlePageChange
664
+ }),
665
+ React__default.createElement(
666
+ 'style',
667
+ { jsx: 'true' },
668
+ '\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 '
669
+ )
670
+ )
671
+ )
672
+ );
673
+ }
674
+ }], [{
675
+ key: 'getDerivedStateFromProps',
676
+ value: function getDerivedStateFromProps(props, state) {
677
+ if (_JSON$stringify(props.dataRecord) !== _JSON$stringify(state.prevData)) {
678
+ return {
679
+ data: props.dataRecord,
680
+ prevData: props.dataRecord,
681
+ currentPage: props.currentPage
682
+ };
683
+ }
684
+ return null;
685
+ }
686
+ }]);
687
+
688
+ return GridContent;
689
+ }(React__default.Component);
690
+
691
+ var GridContentPaginated = React__default.memo(withRouter(GridContent));
692
+
693
+ export default GridContentPaginated;