@mjhls/mjh-framework 1.0.120 → 1.0.122

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.
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
28
28
  var Nav = _interopDefault(require('react-bootstrap/Nav'));
29
29
  var Navbar = _interopDefault(require('react-bootstrap/Navbar'));
30
30
  var NavDropdown = _interopDefault(require('react-bootstrap/NavDropdown'));
31
+ var ReactPlayer = _interopDefault(require('react-player'));
31
32
  var Pagination = _interopDefault(require('react-bootstrap/Pagination'));
32
33
  var Carousel = _interopDefault(require('react-bootstrap/Carousel'));
33
34
  var Breadcrumb = _interopDefault(require('react-bootstrap/Breadcrumb'));
@@ -9513,7 +9514,7 @@ var DeckContent = function (_React$Component) {
9513
9514
  React__default.createElement(
9514
9515
  Card,
9515
9516
  { className: 'content-card', style: { flexDirection: mode } },
9516
- React__default.createElement(
9517
+ (row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
9517
9518
  Link,
9518
9519
  { href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
9519
9520
  React__default.createElement(
@@ -10989,7 +10990,7 @@ var GridContent = function (_React$Component) {
10989
10990
  React__default.createElement(
10990
10991
  Card,
10991
10992
  { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
10992
- React__default.createElement(
10993
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
10993
10994
  Link,
10994
10995
  { href: _this2.mapping[contentCategoryName] + '/[url]', as: _this2.mapping[contentCategoryName] + '/' + row.url.current },
10995
10996
  React__default.createElement(
@@ -11311,7 +11312,7 @@ var DeckQueue = function (_React$Component) {
11311
11312
  React__default.createElement(
11312
11313
  Row,
11313
11314
  { style: { flexDirection: mode } },
11314
- React__default.createElement(
11315
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
11315
11316
  Col,
11316
11317
  { md: 12, lg: 4 },
11317
11318
  React__default.createElement(
@@ -12085,6 +12086,105 @@ var renderAuthor = function renderAuthor(authorDetail, index$$1, length) {
12085
12086
  } else return null;
12086
12087
  };
12087
12088
 
12089
+ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems) {
12090
+ var numberOfItemsBeforeAd = 6;
12091
+ return React__default.createElement(
12092
+ 'div',
12093
+ null,
12094
+ data && data.map(function (article, index$$1) {
12095
+ var pageNumber = article.pageNumber || values.page;
12096
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
12097
+ return React__default.createElement(
12098
+ React__default.Fragment,
12099
+ { key: article._id ? article._id : index$$1 },
12100
+ React__default.createElement(
12101
+ VisibilitySensor,
12102
+ {
12103
+ key: article._id ? article._id : index$$1,
12104
+ onChange: function onChange(isVisible) {
12105
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router$$1, currentPage, setCurrentPage);
12106
+ } },
12107
+ React__default.createElement(
12108
+ React__default.Fragment,
12109
+ null,
12110
+ React__default.createElement(
12111
+ reactBootstrap.Media,
12112
+ { key: article._id ? article._id : index$$1, style: { marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
12113
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
12114
+ Link,
12115
+ { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12116
+ React__default.createElement(
12117
+ 'a',
12118
+ { className: 'img-wrapper' },
12119
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), 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 })
12120
+ )
12121
+ ),
12122
+ React__default.createElement(
12123
+ reactBootstrap.Media.Body,
12124
+ null,
12125
+ React__default.createElement(
12126
+ Link,
12127
+ { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12128
+ React__default.createElement(
12129
+ 'a',
12130
+ null,
12131
+ article.title && React__default.createElement(
12132
+ 'h4',
12133
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
12134
+ article.title
12135
+ )
12136
+ )
12137
+ ),
12138
+ showPublished && article.published && React__default.createElement(
12139
+ 'p',
12140
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
12141
+ moment(article.published).format('MMMM DD, YYYY')
12142
+ ),
12143
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
12144
+ return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
12145
+ }),
12146
+ showCategory && article.contentCategory && React__default.createElement(
12147
+ 'p',
12148
+ {
12149
+ style: {
12150
+ background: 'var(--highlight)',
12151
+ color: 'var(--highlight-accent)',
12152
+ marginBottom: '.25rem',
12153
+ display: 'inline-block',
12154
+ padding: '0 .25rem',
12155
+ fontSize: '.8rem'
12156
+ } },
12157
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
12158
+ ),
12159
+ article.summary && React__default.createElement(
12160
+ 'p',
12161
+ { className: 'pt-2 card-text' },
12162
+ article.summary
12163
+ )
12164
+ )
12165
+ )
12166
+ )
12167
+ ),
12168
+ main_36 && rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$$1, numberOfItemsBeforeAd, rightItems)
12169
+ );
12170
+ }),
12171
+ React__default.createElement(
12172
+ 'style',
12173
+ { jsx: true },
12174
+ '\n .img-wrapper img {\n max-height: 200px;\n width: 100%;\n object-fit: cover;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper {\n width: 42%;\n }\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column;\n }\n }\n '
12175
+ )
12176
+ );
12177
+ };
12178
+
12179
+ var renderMobileAd = function renderMobileAd(index$$1, numberOfItemsBeforeAd, rightItems) {
12180
+ var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
12181
+ return React__default.createElement(
12182
+ 'div',
12183
+ null,
12184
+ rightItems[i].component
12185
+ );
12186
+ };
12187
+
12088
12188
  var renderManualPagination = function renderManualPagination(currentPage) {
12089
12189
  return React__default.createElement(
12090
12190
  'div',
@@ -12126,7 +12226,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12126
12226
  showAuthor = props.showAuthor,
12127
12227
  showCategory = props.showCategory,
12128
12228
  imageHeight = props.imageHeight,
12129
- imageWidth = props.imageWidth;
12229
+ imageWidth = props.imageWidth,
12230
+ rightItems = props.rightItems;
12130
12231
  var initialCurrentPage = props.currentPage,
12131
12232
  showPublished = props.showPublished;
12132
12233
 
@@ -12170,102 +12271,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12170
12271
  }
12171
12272
  }, [values, prevValues, query, client, params, setData, setScrolling, pointer, pointerArray]);
12172
12273
 
12173
- var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth) {
12174
- var numberOfItemsBeforeAd = 6;
12175
- return React__default.createElement(
12176
- 'div',
12177
- null,
12178
- data && data.map(function (article, index$$1) {
12179
- var pageNumber = article.pageNumber || values.page;
12180
- var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
12181
- return React__default.createElement(
12182
- React__default.Fragment,
12183
- { key: article._id ? article._id : index$$1 },
12184
- React__default.createElement(
12185
- VisibilitySensor,
12186
- {
12187
- key: article._id ? article._id : index$$1,
12188
- onChange: function onChange(isVisible) {
12189
- isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router$$1, currentPage, setCurrentPage);
12190
- } },
12191
- React__default.createElement(
12192
- React__default.Fragment,
12193
- null,
12194
- React__default.createElement(
12195
- reactBootstrap.Media,
12196
- { key: article._id ? article._id : index$$1, style: { marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
12197
- React__default.createElement(
12198
- Link,
12199
- { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12200
- React__default.createElement(
12201
- 'a',
12202
- null,
12203
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3', src: renderCardImage(article, builder, imageHeight, imageWidth), 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 })
12204
- )
12205
- ),
12206
- React__default.createElement(
12207
- reactBootstrap.Media.Body,
12208
- null,
12209
- React__default.createElement(
12210
- Link,
12211
- { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12212
- React__default.createElement(
12213
- 'a',
12214
- null,
12215
- article.title && React__default.createElement(
12216
- 'h4',
12217
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
12218
- article.title
12219
- )
12220
- )
12221
- ),
12222
- showPublished && article.published && React__default.createElement(
12223
- 'p',
12224
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
12225
- moment(article.published).format('MMMM DD, YYYY')
12226
- ),
12227
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
12228
- return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
12229
- }),
12230
- showCategory && article.contentCategory && React__default.createElement(
12231
- 'p',
12232
- {
12233
- style: {
12234
- background: 'var(--highlight)',
12235
- color: 'var(--highlight-accent)',
12236
- marginBottom: '.25rem',
12237
- display: 'inline-block',
12238
- padding: '0 .25rem',
12239
- fontSize: '.8rem'
12240
- } },
12241
- article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
12242
- ),
12243
- article.summary && React__default.createElement(
12244
- 'p',
12245
- { className: 'pt-2 card-text' },
12246
- article.summary
12247
- )
12248
- )
12249
- )
12250
- )
12251
- ),
12252
- main_36 && props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$$1, numberOfItemsBeforeAd)
12253
- );
12254
- })
12255
- );
12256
- };
12257
-
12258
- var renderMobileAd = function renderMobileAd(index$$1, numberOfItemsBeforeAd) {
12259
- var rightItems = props.rightItems;
12260
-
12261
- var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
12262
- return React__default.createElement(
12263
- 'div',
12264
- null,
12265
- rightItems[i].component
12266
- );
12267
- };
12268
-
12269
12274
  return React__default.createElement(
12270
12275
  'div',
12271
12276
  null,
@@ -12280,7 +12285,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12280
12285
  React__default.createElement(
12281
12286
  reactBootstrap.Container,
12282
12287
  null,
12283
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth)
12288
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems)
12284
12289
  )
12285
12290
  ),
12286
12291
  React__default.createElement(
@@ -12294,7 +12299,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12294
12299
  React__default.createElement(
12295
12300
  reactBootstrap.Container,
12296
12301
  null,
12297
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory)
12302
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems)
12298
12303
  ),
12299
12304
  React__default.createElement(
12300
12305
  'div',
@@ -13455,342 +13460,11 @@ var NavFooter = function NavFooter(props) {
13455
13460
  );
13456
13461
  };
13457
13462
 
13458
- /*!
13459
- * cookie
13460
- * Copyright(c) 2012-2014 Roman Shtylman
13461
- * Copyright(c) 2015 Douglas Christopher Wilson
13462
- * MIT Licensed
13463
- */
13464
-
13465
- /**
13466
- * Module exports.
13467
- * @public
13468
- */
13469
-
13470
- var parse_1 = parse;
13471
- var serialize_1 = serialize;
13472
-
13473
- /**
13474
- * Module variables.
13475
- * @private
13476
- */
13477
-
13478
- var decode = decodeURIComponent;
13479
- var encode = encodeURIComponent;
13480
- var pairSplitRegExp = /; */;
13481
-
13482
- /**
13483
- * RegExp to match field-content in RFC 7230 sec 3.2
13484
- *
13485
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
13486
- * field-vchar = VCHAR / obs-text
13487
- * obs-text = %x80-FF
13488
- */
13489
-
13490
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
13491
-
13492
- /**
13493
- * Parse a cookie header.
13494
- *
13495
- * Parse the given cookie header string into an object
13496
- * The object has the various cookies as keys(names) => values
13497
- *
13498
- * @param {string} str
13499
- * @param {object} [options]
13500
- * @return {object}
13501
- * @public
13502
- */
13503
-
13504
- function parse(str, options) {
13505
- if (typeof str !== 'string') {
13506
- throw new TypeError('argument str must be a string');
13507
- }
13508
-
13509
- var obj = {};
13510
- var opt = options || {};
13511
- var pairs = str.split(pairSplitRegExp);
13512
- var dec = opt.decode || decode;
13513
-
13514
- for (var i = 0; i < pairs.length; i++) {
13515
- var pair = pairs[i];
13516
- var eq_idx = pair.indexOf('=');
13517
-
13518
- // skip things that don't look like key=value
13519
- if (eq_idx < 0) {
13520
- continue;
13521
- }
13522
-
13523
- var key = pair.substr(0, eq_idx).trim();
13524
- var val = pair.substr(++eq_idx, pair.length).trim();
13525
-
13526
- // quoted values
13527
- if ('"' == val[0]) {
13528
- val = val.slice(1, -1);
13529
- }
13530
-
13531
- // only assign once
13532
- if (undefined == obj[key]) {
13533
- obj[key] = tryDecode(val, dec);
13534
- }
13535
- }
13536
-
13537
- return obj;
13538
- }
13539
-
13540
- /**
13541
- * Serialize data into a cookie header.
13542
- *
13543
- * Serialize the a name value pair into a cookie string suitable for
13544
- * http headers. An optional options object specified cookie parameters.
13545
- *
13546
- * serialize('foo', 'bar', { httpOnly: true })
13547
- * => "foo=bar; httpOnly"
13548
- *
13549
- * @param {string} name
13550
- * @param {string} val
13551
- * @param {object} [options]
13552
- * @return {string}
13553
- * @public
13554
- */
13555
-
13556
- function serialize(name, val, options) {
13557
- var opt = options || {};
13558
- var enc = opt.encode || encode;
13559
-
13560
- if (typeof enc !== 'function') {
13561
- throw new TypeError('option encode is invalid');
13562
- }
13563
-
13564
- if (!fieldContentRegExp.test(name)) {
13565
- throw new TypeError('argument name is invalid');
13566
- }
13567
-
13568
- var value = enc(val);
13569
-
13570
- if (value && !fieldContentRegExp.test(value)) {
13571
- throw new TypeError('argument val is invalid');
13572
- }
13573
-
13574
- var str = name + '=' + value;
13575
-
13576
- if (null != opt.maxAge) {
13577
- var maxAge = opt.maxAge - 0;
13578
- if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
13579
- str += '; Max-Age=' + Math.floor(maxAge);
13580
- }
13581
-
13582
- if (opt.domain) {
13583
- if (!fieldContentRegExp.test(opt.domain)) {
13584
- throw new TypeError('option domain is invalid');
13585
- }
13586
-
13587
- str += '; Domain=' + opt.domain;
13588
- }
13589
-
13590
- if (opt.path) {
13591
- if (!fieldContentRegExp.test(opt.path)) {
13592
- throw new TypeError('option path is invalid');
13593
- }
13594
-
13595
- str += '; Path=' + opt.path;
13596
- }
13597
-
13598
- if (opt.expires) {
13599
- if (typeof opt.expires.toUTCString !== 'function') {
13600
- throw new TypeError('option expires is invalid');
13601
- }
13602
-
13603
- str += '; Expires=' + opt.expires.toUTCString();
13604
- }
13605
-
13606
- if (opt.httpOnly) {
13607
- str += '; HttpOnly';
13608
- }
13609
-
13610
- if (opt.secure) {
13611
- str += '; Secure';
13612
- }
13613
-
13614
- if (opt.sameSite) {
13615
- var sameSite = typeof opt.sameSite === 'string'
13616
- ? opt.sameSite.toLowerCase() : opt.sameSite;
13617
-
13618
- switch (sameSite) {
13619
- case true:
13620
- str += '; SameSite=Strict';
13621
- break;
13622
- case 'lax':
13623
- str += '; SameSite=Lax';
13624
- break;
13625
- case 'strict':
13626
- str += '; SameSite=Strict';
13627
- break;
13628
- case 'none':
13629
- str += '; SameSite=None';
13630
- break;
13631
- default:
13632
- throw new TypeError('option sameSite is invalid');
13633
- }
13634
- }
13635
-
13636
- return str;
13637
- }
13638
-
13639
- /**
13640
- * Try decoding a string using a decoding function.
13641
- *
13642
- * @param {string} str
13643
- * @param {function} decode
13644
- * @private
13645
- */
13646
-
13647
- function tryDecode(str, decode) {
13648
- try {
13649
- return decode(str);
13650
- } catch (e) {
13651
- return str;
13652
- }
13653
- }
13654
-
13655
- function hasDocumentCookie() {
13656
- // Can we get/set cookies on document.cookie?
13657
- return typeof document === 'object' && typeof document.cookie === 'string';
13658
- }
13659
- function parseCookies(cookies, options) {
13660
- if (typeof cookies === 'string') {
13661
- return parse_1(cookies, options);
13662
- }
13663
- else if (typeof cookies === 'object' && cookies !== null) {
13664
- return cookies;
13665
- }
13666
- else {
13667
- return {};
13668
- }
13669
- }
13670
- function isParsingCookie(value, doNotParse) {
13671
- if (typeof doNotParse === 'undefined') {
13672
- // We guess if the cookie start with { or [, it has been serialized
13673
- doNotParse =
13674
- !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
13675
- }
13676
- return !doNotParse;
13677
- }
13678
- function readCookie(value, options) {
13679
- if (options === void 0) { options = {}; }
13680
- var cleanValue = cleanupCookieValue(value);
13681
- if (isParsingCookie(cleanValue, options.doNotParse)) {
13682
- try {
13683
- return JSON.parse(cleanValue);
13684
- }
13685
- catch (e) {
13686
- // At least we tried
13687
- }
13688
- }
13689
- // Ignore clean value if we failed the deserialization
13690
- // It is not relevant anymore to trim those values
13691
- return value;
13692
- }
13693
- function cleanupCookieValue(value) {
13694
- // express prepend j: before serializing a cookie
13695
- if (value && value[0] === 'j' && value[1] === ':') {
13696
- return value.substr(2);
13697
- }
13698
- return value;
13699
- }
13700
-
13701
- // We can't please Rollup and TypeScript at the same time
13702
- // Only way to make both of them work
13703
- var objectAssign = require('object-assign');
13704
- var Cookies = /** @class */ (function () {
13705
- function Cookies(cookies, options) {
13706
- var _this = this;
13707
- this.changeListeners = [];
13708
- this.HAS_DOCUMENT_COOKIE = false;
13709
- this.cookies = parseCookies(cookies, options);
13710
- new Promise(function () {
13711
- _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
13712
- }).catch(function () { });
13713
- }
13714
- Cookies.prototype._updateBrowserValues = function (parseOptions) {
13715
- if (!this.HAS_DOCUMENT_COOKIE) {
13716
- return;
13717
- }
13718
- this.cookies = parse_1(document.cookie, parseOptions);
13719
- };
13720
- Cookies.prototype._emitChange = function (params) {
13721
- for (var i = 0; i < this.changeListeners.length; ++i) {
13722
- this.changeListeners[i](params);
13723
- }
13724
- };
13725
- Cookies.prototype.get = function (name, options, parseOptions) {
13726
- if (options === void 0) { options = {}; }
13727
- this._updateBrowserValues(parseOptions);
13728
- return readCookie(this.cookies[name], options);
13729
- };
13730
- Cookies.prototype.getAll = function (options, parseOptions) {
13731
- if (options === void 0) { options = {}; }
13732
- this._updateBrowserValues(parseOptions);
13733
- var result = {};
13734
- for (var name_1 in this.cookies) {
13735
- result[name_1] = readCookie(this.cookies[name_1], options);
13736
- }
13737
- return result;
13738
- };
13739
- Cookies.prototype.set = function (name, value, options) {
13740
- var _a;
13741
- if (typeof value === 'object') {
13742
- value = JSON.stringify(value);
13743
- }
13744
- this.cookies = objectAssign({}, this.cookies, (_a = {}, _a[name] = value, _a));
13745
- if (this.HAS_DOCUMENT_COOKIE) {
13746
- document.cookie = serialize_1(name, value, options);
13747
- }
13748
- this._emitChange({ name: name, value: value, options: options });
13749
- };
13750
- Cookies.prototype.remove = function (name, options) {
13751
- var finalOptions = (options = objectAssign({}, options, {
13752
- expires: new Date(1970, 1, 1, 0, 0, 1),
13753
- maxAge: 0
13754
- }));
13755
- this.cookies = objectAssign({}, this.cookies);
13756
- delete this.cookies[name];
13757
- if (this.HAS_DOCUMENT_COOKIE) {
13758
- document.cookie = serialize_1(name, '', finalOptions);
13759
- }
13760
- this._emitChange({ name: name, value: undefined, options: options });
13761
- };
13762
- Cookies.prototype.addChangeListener = function (callback) {
13763
- this.changeListeners.push(callback);
13764
- };
13765
- Cookies.prototype.removeChangeListener = function (callback) {
13766
- var idx = this.changeListeners.indexOf(callback);
13767
- if (idx >= 0) {
13768
- this.changeListeners.splice(idx, 1);
13769
- }
13770
- };
13771
- return Cookies;
13772
- }());
13773
-
13774
- var Cookies$1 = Cookies;
13775
- // we seem to sometimes get the ES6 version despite requesting cjs here, not sure why
13776
- // this isn't the ideal fix, but it'll do for now
13777
- Cookies$1 = Cookies$1.default || Cookies$1;
13778
-
13779
- function nextCookies(ctx, options) {
13780
- // Note: Next.js Static export sets ctx.req to a fake request with no headers
13781
- var header = ctx.req && ctx.req.headers && ctx.req.headers.cookie;
13782
- var uc = new Cookies$1(header);
13783
- return uc.getAll(options);
13784
- }
13785
-
13786
- var nextCookies_1 = nextCookies;
13787
-
13788
13463
  var NavMagazine = function NavMagazine(props) {
13789
13464
  /*
13790
13465
  Example Nav with acceptable props
13791
13466
  <MagazineNav
13792
13467
  showLogin
13793
- loginState={true}
13794
13468
  logo={props.settings.logo}
13795
13469
  dataObject={props.cache.mainNavCache}
13796
13470
  website={website}
@@ -13805,7 +13479,7 @@ var NavMagazine = function NavMagazine(props) {
13805
13479
  website = props.website,
13806
13480
  _props$showLogin = props.showLogin,
13807
13481
  showLogin = _props$showLogin === undefined ? false : _props$showLogin,
13808
- allCookies = props.allCookies;
13482
+ _props$userData = props.userData;
13809
13483
 
13810
13484
  var navRef = React.useRef(null);
13811
13485
 
@@ -13819,13 +13493,6 @@ var NavMagazine = function NavMagazine(props) {
13819
13493
  screenWidth = _useState4[0],
13820
13494
  setScreenWidth = _useState4[1];
13821
13495
 
13822
- var initialLoginState = allCookies.loggedIn;
13823
-
13824
- var _useState5 = React.useState(initialLoginState),
13825
- _useState6 = slicedToArray(_useState5, 2),
13826
- loginState = _useState6[0],
13827
- setLoginState = _useState6[1];
13828
-
13829
13496
  React.useEffect(function () {
13830
13497
  document.addEventListener('scroll', trackScrolling);
13831
13498
  return function () {
@@ -13838,50 +13505,6 @@ var NavMagazine = function NavMagazine(props) {
13838
13505
  setScreenWidth(parseInt(window.innerWidth));
13839
13506
  }, []);
13840
13507
 
13841
- React.useLayoutEffect(function () {
13842
- if (typeof GCN !== 'undefined') {
13843
- GCN.on('init').then(function (data) {
13844
- console.log('GCN init...');
13845
- setLoginState(data.loggedin);
13846
- if (data.loggedIn) {
13847
- console.log(' - logged in status');
13848
- document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
13849
- } else {
13850
- console.log(' - logged out status');
13851
- document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
13852
- }
13853
- });
13854
-
13855
- GCN.on('login').then(function (data) {
13856
- setLoginState(data.loggedin);
13857
- console.log('GCN login...');
13858
- document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
13859
- });
13860
-
13861
- GCN.on('logout').then(function (data) {
13862
- setLoginState(data.loggedin);
13863
- console.log('GCN logout...');
13864
- document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
13865
- });
13866
- } else {
13867
- console.error('GCN not defined for GCN events');
13868
- }
13869
- }, []);
13870
-
13871
- React.useEffect(function () {
13872
- toggleLogin();
13873
- }, [loginState]);
13874
-
13875
- var toggleLogin = function toggleLogin() {
13876
- if (loginState) {
13877
- document.getElementsByClassName('logged-in').style.display = '';
13878
- document.getElementsByClassName('logged-out').style.display = 'none';
13879
- } else {
13880
- document.getElementsByClassName('logged-in').style.display = 'none';
13881
- document.getElementsByClassName('logged-out').style.display = '';
13882
- }
13883
- };
13884
-
13885
13508
  var trackScrolling = function trackScrolling() {
13886
13509
  var offsetTop = navRef.current.getBoundingClientRect().top;
13887
13510
 
@@ -13894,13 +13517,7 @@ var NavMagazine = function NavMagazine(props) {
13894
13517
 
13895
13518
  var handleLogin = function handleLogin(e) {
13896
13519
  if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13897
- GCN.onecount.login().then(function (result) {
13898
- console.log('login result: ', result);
13899
- setLoginState(GCN.onecount.isLoggedIn());
13900
- }).catch(function (error) {
13901
- console.log('login error:', error);
13902
- setLoginState(GCN.onecount.isLoggedIn());
13903
- });
13520
+ GCN.onecount.login();
13904
13521
  } else {
13905
13522
  console.error('GCN not defined');
13906
13523
  }
@@ -13908,13 +13525,7 @@ var NavMagazine = function NavMagazine(props) {
13908
13525
 
13909
13526
  var handleLogout = function handleLogout(e) {
13910
13527
  if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13911
- GCN.onecount.logout().then(function (result) {
13912
- console.log('logout result:', result);
13913
- setLoginState(GCN.onecount.isLoggedIn());
13914
- }).catch(function (error) {
13915
- console.log('logout error:', error);
13916
- setLoginState(GCN.onecount.isLoggedIn());
13917
- });
13528
+ GCN.onecount.logout();
13918
13529
  } else {
13919
13530
  console.error('GCN not defined');
13920
13531
  }
@@ -13934,7 +13545,7 @@ var NavMagazine = function NavMagazine(props) {
13934
13545
  { id: 'navbar-top', className: 'justify-content-center navbar-top', style: { margin: '0 auto' } },
13935
13546
  showLogin && React__default.createElement(
13936
13547
  Nav.Item,
13937
- { id: 'nav-mobile-register', className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13548
+ { id: 'nav-mobile-register', className: 'hide-on-login', style: { display: 'none' } },
13938
13549
  React__default.createElement(
13939
13550
  'div',
13940
13551
  { className: 'px-2 py-2', onClick: function onClick(e) {
@@ -13959,7 +13570,7 @@ var NavMagazine = function NavMagazine(props) {
13959
13570
  ),
13960
13571
  showLogin && React__default.createElement(
13961
13572
  Nav.Item,
13962
- { id: 'nav-mobile-login', className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13573
+ { id: 'nav-mobile-login', className: 'hide-on-login', style: { display: 'none' } },
13963
13574
  React__default.createElement(
13964
13575
  'div',
13965
13576
  { className: 'px-2 py-2 ', onClick: function onClick(e) {
@@ -13971,10 +13582,10 @@ var NavMagazine = function NavMagazine(props) {
13971
13582
  ),
13972
13583
  showLogin && React__default.createElement(
13973
13584
  React__default.Fragment,
13974
- { className: 'logged-in', style: { display: !loginState ? 'none' : '' } },
13585
+ null,
13975
13586
  React__default.createElement(
13976
13587
  Nav.Item,
13977
- { id: 'nav-mobile-logout' },
13588
+ { id: 'nav-mobile-logout', className: 'hide-on-logout', style: { display: 'none' } },
13978
13589
  React__default.createElement(
13979
13590
  'div',
13980
13591
  { className: 'pl-2 pr-3 py-2 text-right', onClick: function onClick(e) {
@@ -13991,10 +13602,10 @@ var NavMagazine = function NavMagazine(props) {
13991
13602
  { style: { position: 'absolute', right: '15px' }, className: 'justify-content-end rightHeader' },
13992
13603
  showLogin && React__default.createElement(
13993
13604
  React__default.Fragment,
13994
- { className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13605
+ null,
13995
13606
  React__default.createElement(
13996
13607
  Nav.Item,
13997
- null,
13608
+ { className: 'hide-on-login', style: { display: 'none' } },
13998
13609
  React__default.createElement(
13999
13610
  'div',
14000
13611
  { className: 'px-2 py-2 mr-2', id: 'nav-register', onClick: function onClick(e) {
@@ -14006,7 +13617,7 @@ var NavMagazine = function NavMagazine(props) {
14006
13617
  ),
14007
13618
  React__default.createElement(
14008
13619
  Nav.Item,
14009
- null,
13620
+ { className: 'hide-on-login', style: { display: 'none' } },
14010
13621
  React__default.createElement(
14011
13622
  'div',
14012
13623
  { className: 'px-2 py-2', id: 'nav-login', onClick: function onClick(e) {
@@ -14019,10 +13630,10 @@ var NavMagazine = function NavMagazine(props) {
14019
13630
  ),
14020
13631
  showLogin && React__default.createElement(
14021
13632
  React__default.Fragment,
14022
- { className: 'logged-in', style: { display: !loginState ? 'none' : '' } },
13633
+ null,
14023
13634
  React__default.createElement(
14024
13635
  Nav.Item,
14025
- null,
13636
+ { className: 'hide-on-logout', style: { display: 'none' } },
14026
13637
  React__default.createElement(
14027
13638
  'div',
14028
13639
  { className: 'px-2 py-2', id: 'nav-logout', onClick: function onClick(e) {
@@ -14161,12 +13772,6 @@ var NavMagazine = function NavMagazine(props) {
14161
13772
  );
14162
13773
  };
14163
13774
 
14164
- NavMagazine.getInitialProps = function (ctx) {
14165
- return {
14166
- allCookies: nextCookies_1(ctx)
14167
- };
14168
- };
14169
-
14170
13775
  var NavNative = function NavNative(props) {
14171
13776
  var logo = props.logo,
14172
13777
  dataObject = props.dataObject,
@@ -15140,7 +14745,7 @@ var ms = function(val, options) {
15140
14745
  options = options || {};
15141
14746
  var type = typeof val;
15142
14747
  if (type === 'string' && val.length > 0) {
15143
- return parse$1(val);
14748
+ return parse(val);
15144
14749
  } else if (type === 'number' && isNaN(val) === false) {
15145
14750
  return options.long ? fmtLong(val) : fmtShort(val);
15146
14751
  }
@@ -15158,7 +14763,7 @@ var ms = function(val, options) {
15158
14763
  * @api private
15159
14764
  */
15160
14765
 
15161
- function parse$1(str) {
14766
+ function parse(str) {
15162
14767
  str = String(str);
15163
14768
  if (str.length > 100) {
15164
14769
  return;
@@ -17573,7 +17178,7 @@ function shouldUseNative() {
17573
17178
  }
17574
17179
  }
17575
17180
 
17576
- var objectAssign$1 = shouldUseNative() ? Object.assign : function (target, source) {
17181
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
17577
17182
  var from;
17578
17183
  var to = toObject(target);
17579
17184
  var symbols;
@@ -17648,7 +17253,7 @@ var buildUrl = function buildUrl(props) {
17648
17253
  throw new Error('Invalid image reference in block, no `_ref` found on `asset`');
17649
17254
  }
17650
17255
 
17651
- return node(objectAssign$1({
17256
+ return node(objectAssign({
17652
17257
  projectId: projectId,
17653
17258
  dataset: dataset
17654
17259
  }, options.imageOptions || {})).image(node$$1).toString();
@@ -17788,7 +17393,7 @@ var serializers = function (h, serializerOpts) {
17788
17393
  };
17789
17394
  }
17790
17395
 
17791
- var serializedNode = objectAssign$1({}, span, children);
17396
+ var serializedNode = objectAssign({}, span, children);
17792
17397
  return h(serializers.span, {
17793
17398
  key: span._key || "span-".concat(index),
17794
17399
  node: serializedNode,
@@ -18026,7 +17631,7 @@ function nestLists(blocks) {
18026
17631
  // will mutate the input, and we don't want to blindly clone the entire tree.
18027
17632
  // Clone the last child while adding our new list as the last child of it
18028
17633
  var lastListItem = lastChild(currentList);
18029
- var newLastChild = objectAssign$1({}, lastListItem, {
17634
+ var newLastChild = objectAssign({}, lastListItem, {
18030
17635
  children: lastListItem.children.concat(newList)
18031
17636
  }); // Swap the last child
18032
17637
 
@@ -18128,7 +17733,7 @@ var generateKeys = function (blocks) {
18128
17733
  return block;
18129
17734
  }
18130
17735
 
18131
- return objectAssign$1({
17736
+ return objectAssign({
18132
17737
  _key: getStaticKey(block)
18133
17738
  }, block);
18134
17739
  });
@@ -18172,7 +17777,7 @@ var mergeSerializers = function mergeSerializers(defaultSerializers, userSeriali
18172
17777
  if (type === 'function') {
18173
17778
  acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
18174
17779
  } else if (type === 'object') {
18175
- acc[key] = objectAssign$1({}, defaultSerializers[key], userSerializers[key]);
17780
+ acc[key] = objectAssign({}, defaultSerializers[key], userSerializers[key]);
18176
17781
  } else {
18177
17782
  acc[key] = typeof userSerializers[key] === 'undefined' ? defaultSerializers[key] : userSerializers[key];
18178
17783
  }
@@ -18195,7 +17800,7 @@ var defaults$1 = {
18195
17800
  };
18196
17801
 
18197
17802
  function blocksToNodes(h, properties, defaultSerializers, serializeSpan) {
18198
- var props = objectAssign$1({}, defaults$1, properties);
17803
+ var props = objectAssign({}, defaults$1, properties);
18199
17804
  var rawBlocks = Array.isArray(props.blocks) ? props.blocks : [props.blocks];
18200
17805
  var keyedBlocks = generateKeys(rawBlocks);
18201
17806
  var blocks = nestLists_1(keyedBlocks, props.listNestMode);
@@ -18679,7 +18284,7 @@ function removeEventListener(type, listener) {
18679
18284
  }
18680
18285
  }
18681
18286
 
18682
- var serialize$1 = serializeNode;
18287
+ var serialize = serializeNode;
18683
18288
 
18684
18289
  var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];
18685
18290
 
@@ -18981,7 +18586,7 @@ DOMElement.prototype.focus = function _Element_focus() {
18981
18586
  };
18982
18587
 
18983
18588
  DOMElement.prototype.toString = function _Element_toString() {
18984
- return serialize$1(this)
18589
+ return serialize(this)
18985
18590
  };
18986
18591
 
18987
18592
  DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
@@ -20773,22 +20378,31 @@ var Video = function Video(_ref) {
20773
20378
  var Audio = function Audio(_ref) {
20774
20379
  var node = _ref.node;
20775
20380
 
20776
- return React__default.createElement(
20777
- 'div',
20778
- { className: 'd-block text-center mb-3' },
20779
- React__default.createElement(
20780
- 'audio',
20781
- { controls: true, controlsList: 'nodownload' },
20782
- React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/ogg' }),
20783
- React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/mpeg' }),
20784
- 'Your browser does not support the audio element.'
20785
- ),
20786
- node.caption && React__default.createElement(
20787
- 'p',
20788
- null,
20789
- node.caption
20790
- )
20791
- );
20381
+ if (node.uploadAudio) {
20382
+ return React__default.createElement(
20383
+ 'div',
20384
+ { className: 'audio d-block text-center mb-3' },
20385
+ React__default.createElement(
20386
+ 'audio',
20387
+ { controls: true, controlsList: 'nodownload', className: 'audio' },
20388
+ React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/ogg' }),
20389
+ React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/mpeg' }),
20390
+ 'Your browser does not support the audio element.'
20391
+ )
20392
+ );
20393
+ } else if (node.audioFilePth) {
20394
+ var hostname = new URL(node.audioFilePth).hostname;
20395
+ if (hostname === 'embeds.audioboom.com') {
20396
+ return React__default.createElement('iframe', { src: node.audioFilePth, width: '100%', height: '300', className: 'audio', style: { border: 'none' } });
20397
+ }
20398
+ return React__default.createElement(
20399
+ 'div',
20400
+ { className: 'audio' },
20401
+ React__default.createElement(ReactPlayer, { url: node.audioFilePth, controls: true, width: '100%', height: '100%' })
20402
+ );
20403
+ }
20404
+
20405
+ return null;
20792
20406
  };
20793
20407
 
20794
20408
  var YouTubeGallery = function YouTubeGallery(_ref) {