@mjhls/mjh-framework 1.0.178 → 1.0.179
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.es.js +1462 -1225
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1461 -1224
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -9751,533 +9751,1029 @@ var main_47 = main.osName;
|
|
|
9751
9751
|
var main_48 = main.osVersion;
|
|
9752
9752
|
var main_49 = main.withOrientationChange;
|
|
9753
9753
|
|
|
9754
|
-
var
|
|
9755
|
-
if (!(instance instanceof Constructor)) {
|
|
9756
|
-
throw new TypeError("Cannot call a class as a function");
|
|
9757
|
-
}
|
|
9758
|
-
};
|
|
9754
|
+
var striptags = createCommonjsModule(function (module) {
|
|
9759
9755
|
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9756
|
+
(function (global) {
|
|
9757
|
+
|
|
9758
|
+
// minimal symbol polyfill for IE11 and others
|
|
9759
|
+
if (typeof Symbol !== 'function') {
|
|
9760
|
+
var Symbol = function(name) {
|
|
9761
|
+
return name;
|
|
9762
|
+
};
|
|
9763
|
+
|
|
9764
|
+
Symbol.nonNative = true;
|
|
9768
9765
|
}
|
|
9769
|
-
}
|
|
9770
9766
|
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
return Constructor;
|
|
9775
|
-
};
|
|
9776
|
-
}();
|
|
9767
|
+
const STATE_PLAINTEXT = Symbol('plaintext');
|
|
9768
|
+
const STATE_HTML = Symbol('html');
|
|
9769
|
+
const STATE_COMMENT = Symbol('comment');
|
|
9777
9770
|
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
var source = arguments[i];
|
|
9771
|
+
const ALLOWED_TAGS_REGEX = /<(\w*)>/g;
|
|
9772
|
+
const NORMALIZE_TAG_REGEX = /<\/?([^\s\/>]+)/;
|
|
9781
9773
|
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9774
|
+
function striptags(html, allowable_tags, tag_replacement) {
|
|
9775
|
+
html = html || '';
|
|
9776
|
+
allowable_tags = allowable_tags || [];
|
|
9777
|
+
tag_replacement = tag_replacement || '';
|
|
9778
|
+
|
|
9779
|
+
let context = init_context(allowable_tags, tag_replacement);
|
|
9780
|
+
|
|
9781
|
+
return striptags_internal(html, context);
|
|
9786
9782
|
}
|
|
9787
|
-
}
|
|
9788
9783
|
|
|
9789
|
-
|
|
9790
|
-
|
|
9784
|
+
function init_striptags_stream(allowable_tags, tag_replacement) {
|
|
9785
|
+
allowable_tags = allowable_tags || [];
|
|
9786
|
+
tag_replacement = tag_replacement || '';
|
|
9791
9787
|
|
|
9792
|
-
|
|
9793
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
9794
|
-
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
9795
|
-
}
|
|
9788
|
+
let context = init_context(allowable_tags, tag_replacement);
|
|
9796
9789
|
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
enumerable: false,
|
|
9801
|
-
writable: true,
|
|
9802
|
-
configurable: true
|
|
9790
|
+
return function striptags_stream(html) {
|
|
9791
|
+
return striptags_internal(html || '', context);
|
|
9792
|
+
};
|
|
9803
9793
|
}
|
|
9804
|
-
});
|
|
9805
|
-
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
9806
|
-
};
|
|
9807
|
-
|
|
9808
|
-
var possibleConstructorReturn = function (self, call) {
|
|
9809
|
-
if (!self) {
|
|
9810
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9811
|
-
}
|
|
9812
9794
|
|
|
9813
|
-
|
|
9814
|
-
};
|
|
9795
|
+
striptags.init_streaming_mode = init_striptags_stream;
|
|
9815
9796
|
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
var _arr = [];
|
|
9819
|
-
var _n = true;
|
|
9820
|
-
var _d = false;
|
|
9821
|
-
var _e = undefined;
|
|
9797
|
+
function init_context(allowable_tags, tag_replacement) {
|
|
9798
|
+
allowable_tags = parse_allowable_tags(allowable_tags);
|
|
9822
9799
|
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9800
|
+
return {
|
|
9801
|
+
allowable_tags : allowable_tags,
|
|
9802
|
+
tag_replacement: tag_replacement,
|
|
9826
9803
|
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
} finally {
|
|
9833
|
-
try {
|
|
9834
|
-
if (!_n && _i["return"]) _i["return"]();
|
|
9835
|
-
} finally {
|
|
9836
|
-
if (_d) throw _e;
|
|
9837
|
-
}
|
|
9804
|
+
state : STATE_PLAINTEXT,
|
|
9805
|
+
tag_buffer : '',
|
|
9806
|
+
depth : 0,
|
|
9807
|
+
in_quote_char : ''
|
|
9808
|
+
};
|
|
9838
9809
|
}
|
|
9839
9810
|
|
|
9840
|
-
|
|
9841
|
-
|
|
9811
|
+
function striptags_internal(html, context) {
|
|
9812
|
+
let allowable_tags = context.allowable_tags;
|
|
9813
|
+
let tag_replacement = context.tag_replacement;
|
|
9842
9814
|
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
} else {
|
|
9849
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
9850
|
-
}
|
|
9851
|
-
};
|
|
9852
|
-
}();
|
|
9815
|
+
let state = context.state;
|
|
9816
|
+
let tag_buffer = context.tag_buffer;
|
|
9817
|
+
let depth = context.depth;
|
|
9818
|
+
let in_quote_char = context.in_quote_char;
|
|
9819
|
+
let output = '';
|
|
9853
9820
|
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
9821
|
+
for (let idx = 0, length = html.length; idx < length; idx++) {
|
|
9822
|
+
let char = html[idx];
|
|
9857
9823
|
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9824
|
+
if (state === STATE_PLAINTEXT) {
|
|
9825
|
+
switch (char) {
|
|
9826
|
+
case '<':
|
|
9827
|
+
state = STATE_HTML;
|
|
9828
|
+
tag_buffer += char;
|
|
9829
|
+
break;
|
|
9863
9830
|
|
|
9864
|
-
|
|
9865
|
-
|
|
9831
|
+
default:
|
|
9832
|
+
output += char;
|
|
9833
|
+
break;
|
|
9834
|
+
}
|
|
9835
|
+
}
|
|
9866
9836
|
|
|
9867
|
-
|
|
9868
|
-
|
|
9837
|
+
else if (state === STATE_HTML) {
|
|
9838
|
+
switch (char) {
|
|
9839
|
+
case '<':
|
|
9840
|
+
// ignore '<' if inside a quote
|
|
9841
|
+
if (in_quote_char) {
|
|
9842
|
+
break;
|
|
9843
|
+
}
|
|
9869
9844
|
|
|
9870
|
-
|
|
9845
|
+
// we're seeing a nested '<'
|
|
9846
|
+
depth++;
|
|
9847
|
+
break;
|
|
9871
9848
|
|
|
9872
|
-
|
|
9849
|
+
case '>':
|
|
9850
|
+
// ignore '>' if inside a quote
|
|
9851
|
+
if (in_quote_char) {
|
|
9852
|
+
break;
|
|
9853
|
+
}
|
|
9873
9854
|
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9855
|
+
// something like this is happening: '<<>>'
|
|
9856
|
+
if (depth) {
|
|
9857
|
+
depth--;
|
|
9877
9858
|
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
dataKeptToCompareNewDatarecord: _this.data,
|
|
9881
|
-
per: _this.params ? _this.params.to : 2,
|
|
9882
|
-
page: _this.props.currentPage || 1,
|
|
9883
|
-
from: _this.params ? _this.params.from : 0,
|
|
9884
|
-
to: _this.params ? _this.params.to : 2,
|
|
9885
|
-
total_pages: null,
|
|
9886
|
-
scrolling: true,
|
|
9887
|
-
query: _this.query,
|
|
9888
|
-
currentPage: _this.props.currentPage || 1
|
|
9889
|
-
}, _this.loadMore = debounce_1(function () {
|
|
9890
|
-
_this.setState(function (state) {
|
|
9891
|
-
var page = state.page,
|
|
9892
|
-
from = state.from,
|
|
9893
|
-
per = state.per,
|
|
9894
|
-
to = state.to;
|
|
9859
|
+
break;
|
|
9860
|
+
}
|
|
9895
9861
|
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
};
|
|
9901
|
-
}, _this.loadData);
|
|
9902
|
-
}, 0), _this.loadData = function () {
|
|
9903
|
-
var _this$state = _this.state,
|
|
9904
|
-
from = _this$state.from,
|
|
9905
|
-
to = _this$state.to,
|
|
9906
|
-
data = _this$state.data,
|
|
9907
|
-
query = _this$state.query,
|
|
9908
|
-
page = _this$state.page;
|
|
9909
|
-
var client = _this.props.client;
|
|
9862
|
+
// this is closing the tag in tag_buffer
|
|
9863
|
+
in_quote_char = '';
|
|
9864
|
+
state = STATE_PLAINTEXT;
|
|
9865
|
+
tag_buffer += '>';
|
|
9910
9866
|
|
|
9867
|
+
if (allowable_tags.has(normalize_tag(tag_buffer))) {
|
|
9868
|
+
output += tag_buffer;
|
|
9869
|
+
} else {
|
|
9870
|
+
output += tag_replacement;
|
|
9871
|
+
}
|
|
9911
9872
|
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
9915
|
-
});client.fetch(query, params).then(function (dataArr) {
|
|
9916
|
-
if (_this.pointer && _this.pointerArray) {
|
|
9917
|
-
var pointer = _this.pointer;
|
|
9918
|
-
dataArr = dataArr[_this.pointerArray][pointer];
|
|
9919
|
-
}
|
|
9920
|
-
dataArr = dataArr.map(function (item) {
|
|
9921
|
-
return _extends({}, item, {
|
|
9922
|
-
pageNumber: page
|
|
9923
|
-
});
|
|
9924
|
-
});
|
|
9873
|
+
tag_buffer = '';
|
|
9874
|
+
break;
|
|
9925
9875
|
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
|
|
9930
|
-
scrolling: true
|
|
9931
|
-
};
|
|
9932
|
-
} else {
|
|
9933
|
-
return {
|
|
9934
|
-
scrolling: false
|
|
9935
|
-
};
|
|
9936
|
-
}
|
|
9937
|
-
});
|
|
9938
|
-
});
|
|
9939
|
-
}, _this.urlFor = function (source) {
|
|
9940
|
-
var client = _this.props.client;
|
|
9876
|
+
case '"':
|
|
9877
|
+
case '\'':
|
|
9878
|
+
// catch both single and double quotes
|
|
9941
9879
|
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
|
|
9948
|
-
if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
|
|
9949
|
-
return url.url();
|
|
9950
|
-
} else {
|
|
9951
|
-
return _this.defaultImage;
|
|
9952
|
-
}
|
|
9953
|
-
}, _this.changePageNumber = function (pageNumber) {
|
|
9954
|
-
var _this$props = _this.props,
|
|
9955
|
-
seoPaginate = _this$props.seoPaginate,
|
|
9956
|
-
pageview = _this$props.pageview,
|
|
9957
|
-
router = _this$props.router;
|
|
9958
|
-
var currentPage = _this.state.currentPage;
|
|
9880
|
+
if (char === in_quote_char) {
|
|
9881
|
+
in_quote_char = '';
|
|
9882
|
+
} else {
|
|
9883
|
+
in_quote_char = in_quote_char || char;
|
|
9884
|
+
}
|
|
9959
9885
|
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
var qrIndex = path.indexOf('?');
|
|
9963
|
-
var pathname = router.pathname;
|
|
9964
|
-
var queryString = '';
|
|
9886
|
+
tag_buffer += char;
|
|
9887
|
+
break;
|
|
9965
9888
|
|
|
9966
|
-
|
|
9967
|
-
|
|
9889
|
+
case '-':
|
|
9890
|
+
if (tag_buffer === '<!-') {
|
|
9891
|
+
state = STATE_COMMENT;
|
|
9892
|
+
}
|
|
9968
9893
|
|
|
9969
|
-
|
|
9970
|
-
|
|
9894
|
+
tag_buffer += char;
|
|
9895
|
+
break;
|
|
9971
9896
|
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9897
|
+
case ' ':
|
|
9898
|
+
case '\n':
|
|
9899
|
+
if (tag_buffer === '<') {
|
|
9900
|
+
state = STATE_PLAINTEXT;
|
|
9901
|
+
output += '< ';
|
|
9902
|
+
tag_buffer = '';
|
|
9977
9903
|
|
|
9978
|
-
|
|
9979
|
-
|
|
9904
|
+
break;
|
|
9905
|
+
}
|
|
9906
|
+
|
|
9907
|
+
tag_buffer += char;
|
|
9908
|
+
break;
|
|
9909
|
+
|
|
9910
|
+
default:
|
|
9911
|
+
tag_buffer += char;
|
|
9912
|
+
break;
|
|
9913
|
+
}
|
|
9980
9914
|
}
|
|
9981
|
-
});
|
|
9982
|
-
}
|
|
9983
9915
|
|
|
9984
|
-
|
|
9985
|
-
|
|
9916
|
+
else if (state === STATE_COMMENT) {
|
|
9917
|
+
switch (char) {
|
|
9918
|
+
case '>':
|
|
9919
|
+
if (tag_buffer.slice(-2) == '--') {
|
|
9920
|
+
// close the comment
|
|
9921
|
+
state = STATE_PLAINTEXT;
|
|
9922
|
+
}
|
|
9923
|
+
|
|
9924
|
+
tag_buffer = '';
|
|
9925
|
+
break;
|
|
9926
|
+
|
|
9927
|
+
default:
|
|
9928
|
+
tag_buffer += char;
|
|
9929
|
+
break;
|
|
9930
|
+
}
|
|
9931
|
+
}
|
|
9986
9932
|
}
|
|
9987
9933
|
|
|
9988
|
-
|
|
9934
|
+
// save the context for future iterations
|
|
9935
|
+
context.state = state;
|
|
9936
|
+
context.tag_buffer = tag_buffer;
|
|
9937
|
+
context.depth = depth;
|
|
9938
|
+
context.in_quote_char = in_quote_char;
|
|
9989
9939
|
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
if (pageview) {
|
|
9993
|
-
_this.setState({
|
|
9994
|
-
currentPage: pageNumber
|
|
9995
|
-
}, function () {
|
|
9996
|
-
if (path[0] !== '/') {
|
|
9997
|
-
path = '/' + path;
|
|
9998
|
-
}
|
|
9940
|
+
return output;
|
|
9941
|
+
}
|
|
9999
9942
|
|
|
10000
|
-
|
|
9943
|
+
function parse_allowable_tags(allowable_tags) {
|
|
9944
|
+
let tag_set = new Set();
|
|
10001
9945
|
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
currentPage: currentPage,
|
|
10005
|
-
pageNumber: pageNumber,
|
|
10006
|
-
pathname: pathname,
|
|
10007
|
-
path: path,
|
|
10008
|
-
newPath: newPath,
|
|
10009
|
-
firstPage: pageNumber === 1,
|
|
10010
|
-
queryString: queryString
|
|
10011
|
-
}) */
|
|
9946
|
+
if (typeof allowable_tags === 'string') {
|
|
9947
|
+
let match;
|
|
10012
9948
|
|
|
10013
|
-
|
|
9949
|
+
while ((match = ALLOWED_TAGS_REGEX.exec(allowable_tags))) {
|
|
9950
|
+
tag_set.add(match[1]);
|
|
9951
|
+
}
|
|
9952
|
+
}
|
|
10014
9953
|
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
});
|
|
10018
|
-
});
|
|
10019
|
-
}
|
|
10020
|
-
}
|
|
10021
|
-
}
|
|
10022
|
-
}, _this.renderAuthor = function (authorDetail, index$$1, length) {
|
|
10023
|
-
if (authorDetail) {
|
|
10024
|
-
var _id = authorDetail._id,
|
|
10025
|
-
displayName = authorDetail.displayName,
|
|
10026
|
-
url = authorDetail.url;
|
|
9954
|
+
else if (!Symbol.nonNative &&
|
|
9955
|
+
typeof allowable_tags[Symbol.iterator] === 'function') {
|
|
10027
9956
|
|
|
10028
|
-
|
|
10029
|
-
return React__default.createElement(
|
|
10030
|
-
'div',
|
|
10031
|
-
{ key: _id },
|
|
10032
|
-
index$$1 === 0 && React__default.createElement(
|
|
10033
|
-
'span',
|
|
10034
|
-
{ className: 'pr-1' },
|
|
10035
|
-
'By'
|
|
10036
|
-
),
|
|
10037
|
-
React__default.createElement(
|
|
10038
|
-
Link,
|
|
10039
|
-
{ href: '/authors/[url]', as: '/authors/' + url.current },
|
|
10040
|
-
React__default.createElement(
|
|
10041
|
-
'a',
|
|
10042
|
-
{ className: 'text-muted' },
|
|
10043
|
-
displayName,
|
|
10044
|
-
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10045
|
-
)
|
|
10046
|
-
)
|
|
10047
|
-
);
|
|
10048
|
-
} else if (displayName) {
|
|
10049
|
-
return React__default.createElement(
|
|
10050
|
-
'div',
|
|
10051
|
-
{ key: _id },
|
|
10052
|
-
index$$1 === 0 && React__default.createElement(
|
|
10053
|
-
'span',
|
|
10054
|
-
{ className: 'pr-1' },
|
|
10055
|
-
'By'
|
|
10056
|
-
),
|
|
10057
|
-
React__default.createElement(
|
|
10058
|
-
'span',
|
|
10059
|
-
{ className: 'text-muted' },
|
|
10060
|
-
displayName,
|
|
10061
|
-
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10062
|
-
)
|
|
10063
|
-
);
|
|
9957
|
+
tag_set = new Set(allowable_tags);
|
|
10064
9958
|
}
|
|
10065
|
-
} else return null;
|
|
10066
|
-
}, _this.cardLoader = function (page, columns, variant) {
|
|
10067
|
-
var mode = variant && variant === 'bottom' ? 'column-reverse' : 'column';
|
|
10068
|
-
|
|
10069
|
-
var itemCounter = 0;
|
|
10070
|
-
var lgVar = 12;
|
|
10071
|
-
var numberOfItemsBeforeAd = 6;
|
|
10072
|
-
return React__default.createElement(
|
|
10073
|
-
Row,
|
|
10074
|
-
null,
|
|
10075
|
-
_this.state.data && _this.state.data.map(function (row, index$$1) {
|
|
10076
|
-
if (columns === 'rotate' && itemCounter % 3 === 0) {
|
|
10077
|
-
lgVar = 12;
|
|
10078
|
-
} else if (columns && columns !== 'rotate') {
|
|
10079
|
-
lgVar = Math.floor(12 / columns);
|
|
10080
|
-
} else {
|
|
10081
|
-
lgVar = 6;
|
|
10082
|
-
}
|
|
10083
|
-
|
|
10084
|
-
var pageNumber = row.pageNumber || _this.state.page;
|
|
10085
|
-
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
10086
|
-
return React__default.createElement(
|
|
10087
|
-
React__default.Fragment,
|
|
10088
|
-
{ key: itemCounter },
|
|
10089
|
-
React__default.createElement(
|
|
10090
|
-
VisibilitySensor,
|
|
10091
|
-
{
|
|
10092
|
-
onChange: function onChange(isVisible) {
|
|
10093
|
-
isVisible && _this.changePageNumber(pageNumber);
|
|
10094
|
-
} },
|
|
10095
|
-
React__default.createElement(
|
|
10096
|
-
Col,
|
|
10097
|
-
{ md: 12, lg: lgVar, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10098
|
-
React__default.createElement(
|
|
10099
|
-
Card,
|
|
10100
|
-
{ className: 'content-card', style: { flexDirection: mode } },
|
|
10101
|
-
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
10102
|
-
Link,
|
|
10103
|
-
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10104
|
-
React__default.createElement(
|
|
10105
|
-
'a',
|
|
10106
|
-
null,
|
|
10107
|
-
React__default.createElement(
|
|
10108
|
-
LazyLoad,
|
|
10109
|
-
{ height: _this.props.imageHeight },
|
|
10110
|
-
React__default.createElement(Card.Img, {
|
|
10111
|
-
variant: 'top',
|
|
10112
|
-
src: _this.renderCardImage(row, page),
|
|
10113
|
-
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
10114
|
-
})
|
|
10115
|
-
)
|
|
10116
|
-
)
|
|
10117
|
-
),
|
|
10118
|
-
React__default.createElement(
|
|
10119
|
-
Card.Body,
|
|
10120
|
-
null,
|
|
10121
|
-
React__default.createElement(
|
|
10122
|
-
Link,
|
|
10123
|
-
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10124
|
-
React__default.createElement(
|
|
10125
|
-
'a',
|
|
10126
|
-
null,
|
|
10127
|
-
React__default.createElement(
|
|
10128
|
-
Card.Title,
|
|
10129
|
-
null,
|
|
10130
|
-
row.title
|
|
10131
|
-
)
|
|
10132
|
-
)
|
|
10133
|
-
),
|
|
10134
|
-
_this.props.showPublished && row.published && React__default.createElement(
|
|
10135
|
-
Card.Subtitle,
|
|
10136
|
-
null,
|
|
10137
|
-
moment(row.published).format('MMMM DD, YYYY')
|
|
10138
|
-
),
|
|
10139
|
-
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
|
|
10140
|
-
return _this.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
|
|
10141
|
-
}),
|
|
10142
|
-
React__default.createElement(
|
|
10143
|
-
Card.Text,
|
|
10144
|
-
null,
|
|
10145
|
-
row.summary
|
|
10146
|
-
)
|
|
10147
|
-
)
|
|
10148
|
-
)
|
|
10149
|
-
)
|
|
10150
|
-
),
|
|
10151
|
-
main_36 && _this.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this.renderMobileAd(index$$1, numberOfItemsBeforeAd)
|
|
10152
|
-
);
|
|
10153
|
-
})
|
|
10154
|
-
);
|
|
10155
|
-
}, _this.renderMobileAd = function (index$$1, numberOfItemsBeforeAd) {
|
|
10156
|
-
var rightItems = _this.props.rightItems;
|
|
10157
|
-
|
|
10158
|
-
var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
10159
|
-
return React__default.createElement(
|
|
10160
|
-
Col,
|
|
10161
|
-
{ md: 12, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10162
|
-
rightItems[i].component
|
|
10163
|
-
);
|
|
10164
|
-
}, _this.renderManualPagination = function () {
|
|
10165
|
-
var currentPage = _this.state.currentPage;
|
|
10166
9959
|
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
'a',
|
|
10172
|
-
{ href: '?page=' + (currentPage - 1) },
|
|
10173
|
-
'<< Previous'
|
|
10174
|
-
),
|
|
10175
|
-
React__default.createElement(
|
|
10176
|
-
'a',
|
|
10177
|
-
{ href: '?page=' + (currentPage + 1) },
|
|
10178
|
-
'Next >>'
|
|
10179
|
-
)
|
|
10180
|
-
);
|
|
10181
|
-
}, _temp), possibleConstructorReturn(_this, _ret);
|
|
10182
|
-
}
|
|
9960
|
+
else if (typeof allowable_tags.forEach === 'function') {
|
|
9961
|
+
// IE11 compatible
|
|
9962
|
+
allowable_tags.forEach(tag_set.add, tag_set);
|
|
9963
|
+
}
|
|
10183
9964
|
|
|
10184
|
-
|
|
10185
|
-
key: 'componentDidUpdate',
|
|
10186
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
10187
|
-
if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
|
|
10188
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
10189
|
-
this.setState({
|
|
10190
|
-
data: this.props.dataRecord,
|
|
10191
|
-
dataKeptToCompareNewDatarecord: this.props.dataRecord,
|
|
10192
|
-
per: this.props.params ? this.props.params.to : 2,
|
|
10193
|
-
page: 1,
|
|
10194
|
-
from: this.props.params ? this.props.params.from : 0,
|
|
10195
|
-
to: this.props.params ? this.props.params.to : 2,
|
|
10196
|
-
total_pages: null,
|
|
10197
|
-
scrolling: true,
|
|
10198
|
-
query: this.props.query
|
|
10199
|
-
});
|
|
10200
|
-
}
|
|
10201
|
-
}
|
|
10202
|
-
}, {
|
|
10203
|
-
key: 'componentDidMount',
|
|
10204
|
-
value: function componentDidMount() {
|
|
10205
|
-
// this.loadData();
|
|
9965
|
+
return tag_set;
|
|
10206
9966
|
}
|
|
10207
|
-
}, {
|
|
10208
|
-
key: 'render',
|
|
10209
|
-
value: function render() {
|
|
10210
|
-
var _this2 = this;
|
|
10211
9967
|
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
variant = _props.variant,
|
|
10215
|
-
autoScroll = _props.autoScroll,
|
|
10216
|
-
page = _props.page;
|
|
9968
|
+
function normalize_tag(tag_buffer) {
|
|
9969
|
+
let match = NORMALIZE_TAG_REGEX.exec(tag_buffer);
|
|
10217
9970
|
|
|
9971
|
+
return match ? match[1].toLowerCase() : null;
|
|
9972
|
+
}
|
|
10218
9973
|
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
autoScroll ? React__default.createElement(
|
|
10223
|
-
React__default.Fragment,
|
|
10224
|
-
null,
|
|
10225
|
-
React__default.createElement(
|
|
10226
|
-
InfiniteScroll,
|
|
10227
|
-
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
10228
|
-
React__default.createElement(
|
|
10229
|
-
Container,
|
|
10230
|
-
null,
|
|
10231
|
-
this.cardLoader(page, columns, variant)
|
|
10232
|
-
)
|
|
10233
|
-
),
|
|
10234
|
-
React__default.createElement(
|
|
10235
|
-
'noscript',
|
|
10236
|
-
null,
|
|
10237
|
-
this.renderManualPagination()
|
|
10238
|
-
)
|
|
10239
|
-
) : React__default.createElement(
|
|
10240
|
-
React__default.Fragment,
|
|
10241
|
-
null,
|
|
10242
|
-
React__default.createElement(
|
|
10243
|
-
Container,
|
|
10244
|
-
null,
|
|
10245
|
-
this.cardLoader(page, columns, variant)
|
|
10246
|
-
),
|
|
10247
|
-
React__default.createElement(
|
|
10248
|
-
'div',
|
|
10249
|
-
{ style: { padding: '0px 10px' } },
|
|
10250
|
-
this.state.scrolling ? React__default.createElement(
|
|
10251
|
-
'button',
|
|
10252
|
-
{
|
|
10253
|
-
style: { margin: 'auto', width: '100%' },
|
|
10254
|
-
onClick: function onClick(e) {
|
|
10255
|
-
_this2.loadMore();
|
|
10256
|
-
} },
|
|
10257
|
-
'Load More'
|
|
10258
|
-
) : React__default.createElement(
|
|
10259
|
-
'p',
|
|
10260
|
-
{ style: { textAlign: 'center' } },
|
|
10261
|
-
React__default.createElement(
|
|
10262
|
-
'b',
|
|
10263
|
-
null,
|
|
10264
|
-
'End of data'
|
|
10265
|
-
)
|
|
10266
|
-
)
|
|
10267
|
-
),
|
|
10268
|
-
React__default.createElement(
|
|
10269
|
-
'noscript',
|
|
10270
|
-
null,
|
|
10271
|
-
this.renderManualPagination()
|
|
10272
|
-
)
|
|
10273
|
-
)
|
|
10274
|
-
);
|
|
9974
|
+
if (module.exports) {
|
|
9975
|
+
// Node
|
|
9976
|
+
module.exports = striptags;
|
|
10275
9977
|
}
|
|
10276
|
-
}]);
|
|
10277
|
-
return DeckContent;
|
|
10278
|
-
}(React__default.Component);
|
|
10279
9978
|
|
|
10280
|
-
|
|
9979
|
+
else {
|
|
9980
|
+
// Browser
|
|
9981
|
+
global.striptags = striptags;
|
|
9982
|
+
}
|
|
9983
|
+
}(commonjsGlobal));
|
|
9984
|
+
});
|
|
9985
|
+
|
|
9986
|
+
var html_map = {
|
|
9987
|
+
"'": "'",
|
|
9988
|
+
"<": "<",
|
|
9989
|
+
">": ">",
|
|
9990
|
+
" ": " ",
|
|
9991
|
+
"¡": "¡",
|
|
9992
|
+
"¢": "¢",
|
|
9993
|
+
"£": "£",
|
|
9994
|
+
"¤": "¤",
|
|
9995
|
+
"¥": "¥",
|
|
9996
|
+
"¦": "¦",
|
|
9997
|
+
"§": "§",
|
|
9998
|
+
"¨": "¨",
|
|
9999
|
+
"©": "©",
|
|
10000
|
+
"ª": "ª",
|
|
10001
|
+
"«": "«",
|
|
10002
|
+
"¬": "¬",
|
|
10003
|
+
"®": "®",
|
|
10004
|
+
"¯": "¯",
|
|
10005
|
+
"°": "°",
|
|
10006
|
+
"±": "±",
|
|
10007
|
+
"²": "²",
|
|
10008
|
+
"³": "³",
|
|
10009
|
+
"´": "´",
|
|
10010
|
+
"µ": "µ",
|
|
10011
|
+
"¶": "¶",
|
|
10012
|
+
"·": "·",
|
|
10013
|
+
"¸": "¸",
|
|
10014
|
+
"¹": "¹",
|
|
10015
|
+
"º": "º",
|
|
10016
|
+
"»": "»",
|
|
10017
|
+
"¼": "¼",
|
|
10018
|
+
"½": "½",
|
|
10019
|
+
"¾": "¾",
|
|
10020
|
+
"¿": "¿",
|
|
10021
|
+
"À": "À",
|
|
10022
|
+
"Á": "Á",
|
|
10023
|
+
"Â": "Â",
|
|
10024
|
+
"Ã": "Ã",
|
|
10025
|
+
"Ä": "Ä",
|
|
10026
|
+
"Å": "Å",
|
|
10027
|
+
"Æ": "Æ",
|
|
10028
|
+
"Ç": "Ç",
|
|
10029
|
+
"È": "È",
|
|
10030
|
+
"É": "É",
|
|
10031
|
+
"Ê": "Ê",
|
|
10032
|
+
"Ë": "Ë",
|
|
10033
|
+
"Ì": "Ì",
|
|
10034
|
+
"Í": "Í",
|
|
10035
|
+
"Î": "Î",
|
|
10036
|
+
"Ï": "Ï",
|
|
10037
|
+
"Ð": "Ð",
|
|
10038
|
+
"Ñ": "Ñ",
|
|
10039
|
+
"Ò": "Ò",
|
|
10040
|
+
"Ó": "Ó",
|
|
10041
|
+
"Ô": "Ô",
|
|
10042
|
+
"Õ": "Õ",
|
|
10043
|
+
"Ö": "Ö",
|
|
10044
|
+
"×": "×",
|
|
10045
|
+
"Ø": "Ø",
|
|
10046
|
+
"Ù": "Ù",
|
|
10047
|
+
"Ú": "Ú",
|
|
10048
|
+
"Û": "Û",
|
|
10049
|
+
"Ü": "Ü",
|
|
10050
|
+
"Ý": "Ý",
|
|
10051
|
+
"Þ": "Þ",
|
|
10052
|
+
"ß": "ß",
|
|
10053
|
+
"à": "à",
|
|
10054
|
+
"á": "á",
|
|
10055
|
+
"â": "â",
|
|
10056
|
+
"ã": "ã",
|
|
10057
|
+
"ä": "ä",
|
|
10058
|
+
"å": "å",
|
|
10059
|
+
"æ": "æ",
|
|
10060
|
+
"ç": "ç",
|
|
10061
|
+
"è": "è",
|
|
10062
|
+
"é": "é",
|
|
10063
|
+
"ê": "ê",
|
|
10064
|
+
"ë": "ë",
|
|
10065
|
+
"ì": "ì",
|
|
10066
|
+
"í": "í",
|
|
10067
|
+
"î": "î",
|
|
10068
|
+
"ï": "ï",
|
|
10069
|
+
"ð": "ð",
|
|
10070
|
+
"ñ": "ñ",
|
|
10071
|
+
"ò": "ò",
|
|
10072
|
+
"ó": "ó",
|
|
10073
|
+
"ô": "ô",
|
|
10074
|
+
"õ": "õ",
|
|
10075
|
+
"ö": "ö",
|
|
10076
|
+
"÷": "÷",
|
|
10077
|
+
"ø": "ø",
|
|
10078
|
+
"ù": "ù",
|
|
10079
|
+
"ú": "ú",
|
|
10080
|
+
"û": "û",
|
|
10081
|
+
"ü": "ü",
|
|
10082
|
+
"ý": "ý",
|
|
10083
|
+
"þ": "þ",
|
|
10084
|
+
"ÿ": "ÿ",
|
|
10085
|
+
"Œ": "Œ",
|
|
10086
|
+
"œ": "œ",
|
|
10087
|
+
"Š": "Š",
|
|
10088
|
+
"š": "š",
|
|
10089
|
+
"Ÿ": "Ÿ",
|
|
10090
|
+
"ƒ": "ƒ",
|
|
10091
|
+
"ˆ": "ˆ",
|
|
10092
|
+
"˜": "˜",
|
|
10093
|
+
"Α": "Α",
|
|
10094
|
+
"Β": "Β",
|
|
10095
|
+
"Γ": "Γ",
|
|
10096
|
+
"Δ": "Δ",
|
|
10097
|
+
"Ε": "Ε",
|
|
10098
|
+
"Ζ": "Ζ",
|
|
10099
|
+
"Η": "Η",
|
|
10100
|
+
"Θ": "Θ",
|
|
10101
|
+
"Ι": "Ι",
|
|
10102
|
+
"Κ": "Κ",
|
|
10103
|
+
"Λ": "Λ",
|
|
10104
|
+
"Μ": "Μ",
|
|
10105
|
+
"Ν": "Ν",
|
|
10106
|
+
"Ξ": "Ξ",
|
|
10107
|
+
"Ο": "Ο",
|
|
10108
|
+
"Π": "Π",
|
|
10109
|
+
"Ρ": "Ρ",
|
|
10110
|
+
"Σ": "Σ",
|
|
10111
|
+
"Τ": "Τ",
|
|
10112
|
+
"Υ": "Υ",
|
|
10113
|
+
"Φ": "Φ",
|
|
10114
|
+
"Χ": "Χ",
|
|
10115
|
+
"Ψ": "Ψ",
|
|
10116
|
+
"Ω": "Ω",
|
|
10117
|
+
"α": "α",
|
|
10118
|
+
"β": "β",
|
|
10119
|
+
"γ": "γ",
|
|
10120
|
+
"δ": "δ",
|
|
10121
|
+
"ε": "ε",
|
|
10122
|
+
"ζ": "ζ",
|
|
10123
|
+
"η": "η",
|
|
10124
|
+
"θ": "θ",
|
|
10125
|
+
"ι": "ι",
|
|
10126
|
+
"κ": "κ",
|
|
10127
|
+
"λ": "λ",
|
|
10128
|
+
"μ": "μ",
|
|
10129
|
+
"ν": "ν",
|
|
10130
|
+
"ξ": "ξ",
|
|
10131
|
+
"ο": "ο",
|
|
10132
|
+
"π": "π",
|
|
10133
|
+
"ρ": "ρ",
|
|
10134
|
+
"ς": "ς",
|
|
10135
|
+
"σ": "σ",
|
|
10136
|
+
"τ": "τ",
|
|
10137
|
+
"υ": "υ",
|
|
10138
|
+
"φ": "φ",
|
|
10139
|
+
"χ": "χ",
|
|
10140
|
+
"ψ": "ψ",
|
|
10141
|
+
"ω": "ω",
|
|
10142
|
+
"ϑ": "ϑ",
|
|
10143
|
+
"ϒ": "&Upsih;",
|
|
10144
|
+
"ϖ": "ϖ",
|
|
10145
|
+
"–": "–",
|
|
10146
|
+
"—": "—",
|
|
10147
|
+
"‘": "‘",
|
|
10148
|
+
"’": "’",
|
|
10149
|
+
"‚": "‚",
|
|
10150
|
+
"“": "“",
|
|
10151
|
+
"”": "”",
|
|
10152
|
+
"„": "„",
|
|
10153
|
+
"†": "†",
|
|
10154
|
+
"‡": "‡",
|
|
10155
|
+
"•": "•",
|
|
10156
|
+
"…": "…",
|
|
10157
|
+
"‰": "‰",
|
|
10158
|
+
"′": "′",
|
|
10159
|
+
"″": "″",
|
|
10160
|
+
"‹": "‹",
|
|
10161
|
+
"›": "›",
|
|
10162
|
+
"‾": "‾",
|
|
10163
|
+
"⁄": "⁄",
|
|
10164
|
+
"€": "€",
|
|
10165
|
+
"ℑ": "ℑ",
|
|
10166
|
+
"℘": "℘",
|
|
10167
|
+
"ℜ": "ℜ",
|
|
10168
|
+
"™": "™",
|
|
10169
|
+
"ℵ": "ℵ",
|
|
10170
|
+
"←": "←",
|
|
10171
|
+
"↑": "↑",
|
|
10172
|
+
"→": "→",
|
|
10173
|
+
"↓": "↓",
|
|
10174
|
+
"↔": "↔",
|
|
10175
|
+
"↵": "↵",
|
|
10176
|
+
"⇐": "⇐",
|
|
10177
|
+
"⇑": "&UArr;",
|
|
10178
|
+
"⇒": "⇒",
|
|
10179
|
+
"⇓": "⇓",
|
|
10180
|
+
"⇔": "⇔",
|
|
10181
|
+
"∀": "∀",
|
|
10182
|
+
"∂": "∂",
|
|
10183
|
+
"∃": "∃",
|
|
10184
|
+
"∅": "∅",
|
|
10185
|
+
"∇": "∇",
|
|
10186
|
+
"∈": "∈",
|
|
10187
|
+
"∉": "∉",
|
|
10188
|
+
"∋": "∋",
|
|
10189
|
+
"∏": "∏",
|
|
10190
|
+
"∑": "∑",
|
|
10191
|
+
"−": "−",
|
|
10192
|
+
"∗": "∗",
|
|
10193
|
+
"√": "√",
|
|
10194
|
+
"∝": "∝",
|
|
10195
|
+
"∞": "∞",
|
|
10196
|
+
"∠": "∠",
|
|
10197
|
+
"∧": "∧",
|
|
10198
|
+
"∨": "∨",
|
|
10199
|
+
"∩": "∩",
|
|
10200
|
+
"∪": "∪",
|
|
10201
|
+
"∫": "∫",
|
|
10202
|
+
"∴": "∴",
|
|
10203
|
+
"∼": "∼",
|
|
10204
|
+
"≅": "≅",
|
|
10205
|
+
"≈": "≈",
|
|
10206
|
+
"≠": "≠",
|
|
10207
|
+
"≡": "≡",
|
|
10208
|
+
"≤": "≤",
|
|
10209
|
+
"≥": "≥",
|
|
10210
|
+
"⊂": "⊂",
|
|
10211
|
+
"⊃": "⊃",
|
|
10212
|
+
"⊄": "⊄",
|
|
10213
|
+
"⊆": "⊆",
|
|
10214
|
+
"⊇": "⊇",
|
|
10215
|
+
"⊕": "⊕",
|
|
10216
|
+
"⊗": "⊗",
|
|
10217
|
+
"⊥": "⊥",
|
|
10218
|
+
"⋅": "⋅",
|
|
10219
|
+
"⌈": "⌈",
|
|
10220
|
+
"⌉": "⌉",
|
|
10221
|
+
"⌊": "⌊",
|
|
10222
|
+
"⌋": "⌋",
|
|
10223
|
+
"⟨": "⟨",
|
|
10224
|
+
"⟩": "⟩",
|
|
10225
|
+
"◊": "◊",
|
|
10226
|
+
"♠": "♠",
|
|
10227
|
+
"♣": "♣",
|
|
10228
|
+
"♥": "♥",
|
|
10229
|
+
"♦": "♦"
|
|
10230
|
+
};
|
|
10231
|
+
|
|
10232
|
+
var html_decode = function html_decode(string) {
|
|
10233
|
+
var entityMap = html_map;
|
|
10234
|
+
for (var key in entityMap) {
|
|
10235
|
+
var entity = entityMap[key];
|
|
10236
|
+
var regex = new RegExp(entity, 'g');
|
|
10237
|
+
string = string.replace(regex, key);
|
|
10238
|
+
}
|
|
10239
|
+
string = string.replace(/"/g, '"');
|
|
10240
|
+
string = string.replace(/&/g, '&');
|
|
10241
|
+
return string;
|
|
10242
|
+
};
|
|
10243
|
+
|
|
10244
|
+
var clean_html = function clean_html(string) {
|
|
10245
|
+
return striptags(html_decode(string));
|
|
10246
|
+
};
|
|
10247
|
+
var html_decode_1 = html_decode;
|
|
10248
|
+
var clean_html_1 = clean_html;
|
|
10249
|
+
|
|
10250
|
+
var classCallCheck = function (instance, Constructor) {
|
|
10251
|
+
if (!(instance instanceof Constructor)) {
|
|
10252
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10253
|
+
}
|
|
10254
|
+
};
|
|
10255
|
+
|
|
10256
|
+
var createClass = function () {
|
|
10257
|
+
function defineProperties(target, props) {
|
|
10258
|
+
for (var i = 0; i < props.length; i++) {
|
|
10259
|
+
var descriptor = props[i];
|
|
10260
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10261
|
+
descriptor.configurable = true;
|
|
10262
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
10263
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
10264
|
+
}
|
|
10265
|
+
}
|
|
10266
|
+
|
|
10267
|
+
return function (Constructor, protoProps, staticProps) {
|
|
10268
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
10269
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
10270
|
+
return Constructor;
|
|
10271
|
+
};
|
|
10272
|
+
}();
|
|
10273
|
+
|
|
10274
|
+
var _extends = Object.assign || function (target) {
|
|
10275
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
10276
|
+
var source = arguments[i];
|
|
10277
|
+
|
|
10278
|
+
for (var key in source) {
|
|
10279
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10280
|
+
target[key] = source[key];
|
|
10281
|
+
}
|
|
10282
|
+
}
|
|
10283
|
+
}
|
|
10284
|
+
|
|
10285
|
+
return target;
|
|
10286
|
+
};
|
|
10287
|
+
|
|
10288
|
+
var inherits = function (subClass, superClass) {
|
|
10289
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
10290
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
10291
|
+
}
|
|
10292
|
+
|
|
10293
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
10294
|
+
constructor: {
|
|
10295
|
+
value: subClass,
|
|
10296
|
+
enumerable: false,
|
|
10297
|
+
writable: true,
|
|
10298
|
+
configurable: true
|
|
10299
|
+
}
|
|
10300
|
+
});
|
|
10301
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
10302
|
+
};
|
|
10303
|
+
|
|
10304
|
+
var possibleConstructorReturn = function (self, call) {
|
|
10305
|
+
if (!self) {
|
|
10306
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
10307
|
+
}
|
|
10308
|
+
|
|
10309
|
+
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
10310
|
+
};
|
|
10311
|
+
|
|
10312
|
+
var slicedToArray = function () {
|
|
10313
|
+
function sliceIterator(arr, i) {
|
|
10314
|
+
var _arr = [];
|
|
10315
|
+
var _n = true;
|
|
10316
|
+
var _d = false;
|
|
10317
|
+
var _e = undefined;
|
|
10318
|
+
|
|
10319
|
+
try {
|
|
10320
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
10321
|
+
_arr.push(_s.value);
|
|
10322
|
+
|
|
10323
|
+
if (i && _arr.length === i) break;
|
|
10324
|
+
}
|
|
10325
|
+
} catch (err) {
|
|
10326
|
+
_d = true;
|
|
10327
|
+
_e = err;
|
|
10328
|
+
} finally {
|
|
10329
|
+
try {
|
|
10330
|
+
if (!_n && _i["return"]) _i["return"]();
|
|
10331
|
+
} finally {
|
|
10332
|
+
if (_d) throw _e;
|
|
10333
|
+
}
|
|
10334
|
+
}
|
|
10335
|
+
|
|
10336
|
+
return _arr;
|
|
10337
|
+
}
|
|
10338
|
+
|
|
10339
|
+
return function (arr, i) {
|
|
10340
|
+
if (Array.isArray(arr)) {
|
|
10341
|
+
return arr;
|
|
10342
|
+
} else if (Symbol.iterator in Object(arr)) {
|
|
10343
|
+
return sliceIterator(arr, i);
|
|
10344
|
+
} else {
|
|
10345
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
10346
|
+
}
|
|
10347
|
+
};
|
|
10348
|
+
}();
|
|
10349
|
+
|
|
10350
|
+
var toConsumableArray = function (arr) {
|
|
10351
|
+
if (Array.isArray(arr)) {
|
|
10352
|
+
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
10353
|
+
|
|
10354
|
+
return arr2;
|
|
10355
|
+
} else {
|
|
10356
|
+
return Array.from(arr);
|
|
10357
|
+
}
|
|
10358
|
+
};
|
|
10359
|
+
|
|
10360
|
+
var DeckContent = function (_React$Component) {
|
|
10361
|
+
inherits(DeckContent, _React$Component);
|
|
10362
|
+
|
|
10363
|
+
function DeckContent() {
|
|
10364
|
+
var _ref;
|
|
10365
|
+
|
|
10366
|
+
var _temp, _this, _ret;
|
|
10367
|
+
|
|
10368
|
+
classCallCheck(this, DeckContent);
|
|
10369
|
+
|
|
10370
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
10371
|
+
args[_key] = arguments[_key];
|
|
10372
|
+
}
|
|
10373
|
+
|
|
10374
|
+
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DeckContent.__proto__ || Object.getPrototypeOf(DeckContent)).call.apply(_ref, [this].concat(args))), _this), _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord || [], _this.query = _this.props.query, _this.params = _this.props.params, _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 = {
|
|
10375
|
+
data: _this.data,
|
|
10376
|
+
dataKeptToCompareNewDatarecord: _this.data,
|
|
10377
|
+
per: _this.params ? _this.params.to : 2,
|
|
10378
|
+
page: _this.props.currentPage || 1,
|
|
10379
|
+
from: _this.params ? _this.params.from : 0,
|
|
10380
|
+
to: _this.params ? _this.params.to : 2,
|
|
10381
|
+
total_pages: null,
|
|
10382
|
+
scrolling: true,
|
|
10383
|
+
query: _this.query,
|
|
10384
|
+
currentPage: _this.props.currentPage || 1
|
|
10385
|
+
}, _this.loadMore = debounce_1(function () {
|
|
10386
|
+
_this.setState(function (state) {
|
|
10387
|
+
var page = state.page,
|
|
10388
|
+
from = state.from,
|
|
10389
|
+
per = state.per,
|
|
10390
|
+
to = state.to;
|
|
10391
|
+
|
|
10392
|
+
return {
|
|
10393
|
+
page: page + 1,
|
|
10394
|
+
from: from + per,
|
|
10395
|
+
to: to + per
|
|
10396
|
+
};
|
|
10397
|
+
}, _this.loadData);
|
|
10398
|
+
}, 0), _this.loadData = function () {
|
|
10399
|
+
var _this$state = _this.state,
|
|
10400
|
+
from = _this$state.from,
|
|
10401
|
+
to = _this$state.to,
|
|
10402
|
+
data = _this$state.data,
|
|
10403
|
+
query = _this$state.query,
|
|
10404
|
+
page = _this$state.page;
|
|
10405
|
+
var client = _this.props.client;
|
|
10406
|
+
|
|
10407
|
+
|
|
10408
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
10409
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
10410
|
+
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
10411
|
+
});client.fetch(query, params).then(function (dataArr) {
|
|
10412
|
+
if (_this.pointer && _this.pointerArray) {
|
|
10413
|
+
var pointer = _this.pointer;
|
|
10414
|
+
dataArr = dataArr[_this.pointerArray][pointer];
|
|
10415
|
+
}
|
|
10416
|
+
dataArr = dataArr.map(function (item) {
|
|
10417
|
+
return _extends({}, item, {
|
|
10418
|
+
pageNumber: page
|
|
10419
|
+
});
|
|
10420
|
+
});
|
|
10421
|
+
|
|
10422
|
+
_this.setState(function () {
|
|
10423
|
+
if (dataArr.length > 0) {
|
|
10424
|
+
return {
|
|
10425
|
+
data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
|
|
10426
|
+
scrolling: true
|
|
10427
|
+
};
|
|
10428
|
+
} else {
|
|
10429
|
+
return {
|
|
10430
|
+
scrolling: false
|
|
10431
|
+
};
|
|
10432
|
+
}
|
|
10433
|
+
});
|
|
10434
|
+
});
|
|
10435
|
+
}, _this.urlFor = function (source) {
|
|
10436
|
+
var client = _this.props.client;
|
|
10437
|
+
|
|
10438
|
+
var builder = imageUrlBuilder(client);
|
|
10439
|
+
return builder.image(source).auto('format');
|
|
10440
|
+
}, _this.renderCardImage = function (row, page) {
|
|
10441
|
+
if (row.thumbnail && row.thumbnail.asset) {
|
|
10442
|
+
var url = _this.urlFor(row.thumbnail);
|
|
10443
|
+
if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
|
|
10444
|
+
if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
|
|
10445
|
+
return url.url();
|
|
10446
|
+
} else {
|
|
10447
|
+
return _this.defaultImage;
|
|
10448
|
+
}
|
|
10449
|
+
}, _this.changePageNumber = function (pageNumber) {
|
|
10450
|
+
var _this$props = _this.props,
|
|
10451
|
+
seoPaginate = _this$props.seoPaginate,
|
|
10452
|
+
pageview = _this$props.pageview,
|
|
10453
|
+
router = _this$props.router;
|
|
10454
|
+
var currentPage = _this.state.currentPage;
|
|
10455
|
+
|
|
10456
|
+
if (seoPaginate) {
|
|
10457
|
+
var path = router.asPath;
|
|
10458
|
+
var qrIndex = path.indexOf('?');
|
|
10459
|
+
var pathname = router.pathname;
|
|
10460
|
+
var queryString = '';
|
|
10461
|
+
|
|
10462
|
+
if (qrIndex > 0) {
|
|
10463
|
+
path = path.substring(1, qrIndex);
|
|
10464
|
+
|
|
10465
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
10466
|
+
var partialQSArr = partialQS.split('&');
|
|
10467
|
+
|
|
10468
|
+
// exclude page=xxx from query string
|
|
10469
|
+
partialQSArr.map(function (item) {
|
|
10470
|
+
var itemArr = item.split('=');
|
|
10471
|
+
var key = itemArr[0];
|
|
10472
|
+
var val = itemArr[1];
|
|
10473
|
+
|
|
10474
|
+
if (key !== 'page') {
|
|
10475
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
10476
|
+
}
|
|
10477
|
+
});
|
|
10478
|
+
}
|
|
10479
|
+
|
|
10480
|
+
if (queryString.length > 0) {
|
|
10481
|
+
path += '?' + queryString;
|
|
10482
|
+
}
|
|
10483
|
+
|
|
10484
|
+
pageNumber = parseInt(pageNumber);
|
|
10485
|
+
|
|
10486
|
+
if (currentPage !== pageNumber) {
|
|
10487
|
+
lib_3.refresh();
|
|
10488
|
+
if (pageview) {
|
|
10489
|
+
_this.setState({
|
|
10490
|
+
currentPage: pageNumber
|
|
10491
|
+
}, function () {
|
|
10492
|
+
if (path[0] !== '/') {
|
|
10493
|
+
path = '/' + path;
|
|
10494
|
+
}
|
|
10495
|
+
|
|
10496
|
+
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
10497
|
+
|
|
10498
|
+
// please leave this for later debug purpose : Yong Jun.
|
|
10499
|
+
/* console.log('page change reported', {
|
|
10500
|
+
currentPage: currentPage,
|
|
10501
|
+
pageNumber: pageNumber,
|
|
10502
|
+
pathname: pathname,
|
|
10503
|
+
path: path,
|
|
10504
|
+
newPath: newPath,
|
|
10505
|
+
firstPage: pageNumber === 1,
|
|
10506
|
+
queryString: queryString
|
|
10507
|
+
}) */
|
|
10508
|
+
|
|
10509
|
+
pageview(newPath);
|
|
10510
|
+
|
|
10511
|
+
router.push(pathname, newPath, {
|
|
10512
|
+
shallow: true
|
|
10513
|
+
});
|
|
10514
|
+
});
|
|
10515
|
+
}
|
|
10516
|
+
}
|
|
10517
|
+
}
|
|
10518
|
+
}, _this.renderAuthor = function (authorDetail, index$$1, length) {
|
|
10519
|
+
if (authorDetail) {
|
|
10520
|
+
var _id = authorDetail._id,
|
|
10521
|
+
displayName = authorDetail.displayName,
|
|
10522
|
+
url = authorDetail.url;
|
|
10523
|
+
|
|
10524
|
+
if (displayName && url && url.current) {
|
|
10525
|
+
return React__default.createElement(
|
|
10526
|
+
'div',
|
|
10527
|
+
{ key: _id },
|
|
10528
|
+
index$$1 === 0 && React__default.createElement(
|
|
10529
|
+
'span',
|
|
10530
|
+
{ className: 'pr-1' },
|
|
10531
|
+
'By'
|
|
10532
|
+
),
|
|
10533
|
+
React__default.createElement(
|
|
10534
|
+
Link,
|
|
10535
|
+
{ href: '/authors/[url]', as: '/authors/' + url.current },
|
|
10536
|
+
React__default.createElement(
|
|
10537
|
+
'a',
|
|
10538
|
+
{ className: 'text-muted' },
|
|
10539
|
+
displayName,
|
|
10540
|
+
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10541
|
+
)
|
|
10542
|
+
)
|
|
10543
|
+
);
|
|
10544
|
+
} else if (displayName) {
|
|
10545
|
+
return React__default.createElement(
|
|
10546
|
+
'div',
|
|
10547
|
+
{ key: _id },
|
|
10548
|
+
index$$1 === 0 && React__default.createElement(
|
|
10549
|
+
'span',
|
|
10550
|
+
{ className: 'pr-1' },
|
|
10551
|
+
'By'
|
|
10552
|
+
),
|
|
10553
|
+
React__default.createElement(
|
|
10554
|
+
'span',
|
|
10555
|
+
{ className: 'text-muted' },
|
|
10556
|
+
displayName,
|
|
10557
|
+
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10558
|
+
)
|
|
10559
|
+
);
|
|
10560
|
+
}
|
|
10561
|
+
} else return null;
|
|
10562
|
+
}, _this.cardLoader = function (page, columns, variant) {
|
|
10563
|
+
var mode = variant && variant === 'bottom' ? 'column-reverse' : 'column';
|
|
10564
|
+
|
|
10565
|
+
var itemCounter = 0;
|
|
10566
|
+
var lgVar = 12;
|
|
10567
|
+
var numberOfItemsBeforeAd = 6;
|
|
10568
|
+
return React__default.createElement(
|
|
10569
|
+
Row,
|
|
10570
|
+
null,
|
|
10571
|
+
_this.state.data && _this.state.data.map(function (row, index$$1) {
|
|
10572
|
+
if (columns === 'rotate' && itemCounter % 3 === 0) {
|
|
10573
|
+
lgVar = 12;
|
|
10574
|
+
} else if (columns && columns !== 'rotate') {
|
|
10575
|
+
lgVar = Math.floor(12 / columns);
|
|
10576
|
+
} else {
|
|
10577
|
+
lgVar = 6;
|
|
10578
|
+
}
|
|
10579
|
+
|
|
10580
|
+
var pageNumber = row.pageNumber || _this.state.page;
|
|
10581
|
+
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
10582
|
+
return React__default.createElement(
|
|
10583
|
+
React__default.Fragment,
|
|
10584
|
+
{ key: itemCounter },
|
|
10585
|
+
React__default.createElement(
|
|
10586
|
+
VisibilitySensor,
|
|
10587
|
+
{
|
|
10588
|
+
onChange: function onChange(isVisible) {
|
|
10589
|
+
isVisible && _this.changePageNumber(pageNumber);
|
|
10590
|
+
} },
|
|
10591
|
+
React__default.createElement(
|
|
10592
|
+
Col,
|
|
10593
|
+
{ md: 12, lg: lgVar, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10594
|
+
React__default.createElement(
|
|
10595
|
+
Card,
|
|
10596
|
+
{ className: 'content-card', style: { flexDirection: mode } },
|
|
10597
|
+
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
10598
|
+
Link,
|
|
10599
|
+
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10600
|
+
React__default.createElement(
|
|
10601
|
+
'a',
|
|
10602
|
+
null,
|
|
10603
|
+
React__default.createElement(
|
|
10604
|
+
LazyLoad,
|
|
10605
|
+
{ height: _this.props.imageHeight },
|
|
10606
|
+
React__default.createElement(Card.Img, {
|
|
10607
|
+
variant: 'top',
|
|
10608
|
+
src: _this.renderCardImage(row, page),
|
|
10609
|
+
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
10610
|
+
})
|
|
10611
|
+
)
|
|
10612
|
+
)
|
|
10613
|
+
),
|
|
10614
|
+
React__default.createElement(
|
|
10615
|
+
Card.Body,
|
|
10616
|
+
null,
|
|
10617
|
+
React__default.createElement(
|
|
10618
|
+
Link,
|
|
10619
|
+
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10620
|
+
React__default.createElement(
|
|
10621
|
+
'a',
|
|
10622
|
+
null,
|
|
10623
|
+
React__default.createElement(
|
|
10624
|
+
Card.Title,
|
|
10625
|
+
null,
|
|
10626
|
+
row.title
|
|
10627
|
+
)
|
|
10628
|
+
)
|
|
10629
|
+
),
|
|
10630
|
+
_this.props.showPublished && row.published && React__default.createElement(
|
|
10631
|
+
Card.Subtitle,
|
|
10632
|
+
null,
|
|
10633
|
+
moment(row.published).format('MMMM DD, YYYY')
|
|
10634
|
+
),
|
|
10635
|
+
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
|
|
10636
|
+
return _this.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
|
|
10637
|
+
}),
|
|
10638
|
+
React__default.createElement(
|
|
10639
|
+
Card.Text,
|
|
10640
|
+
null,
|
|
10641
|
+
clean_html_1(row.summary)
|
|
10642
|
+
)
|
|
10643
|
+
)
|
|
10644
|
+
)
|
|
10645
|
+
)
|
|
10646
|
+
),
|
|
10647
|
+
main_36 && _this.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this.renderMobileAd(index$$1, numberOfItemsBeforeAd)
|
|
10648
|
+
);
|
|
10649
|
+
})
|
|
10650
|
+
);
|
|
10651
|
+
}, _this.renderMobileAd = function (index$$1, numberOfItemsBeforeAd) {
|
|
10652
|
+
var rightItems = _this.props.rightItems;
|
|
10653
|
+
|
|
10654
|
+
var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
10655
|
+
return React__default.createElement(
|
|
10656
|
+
Col,
|
|
10657
|
+
{ md: 12, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10658
|
+
rightItems[i].component
|
|
10659
|
+
);
|
|
10660
|
+
}, _this.renderManualPagination = function () {
|
|
10661
|
+
var currentPage = _this.state.currentPage;
|
|
10662
|
+
|
|
10663
|
+
return React__default.createElement(
|
|
10664
|
+
'div',
|
|
10665
|
+
{ className: 'd-flex justify-content-between' },
|
|
10666
|
+
currentPage && currentPage > 1 && React__default.createElement(
|
|
10667
|
+
'a',
|
|
10668
|
+
{ href: '?page=' + (currentPage - 1) },
|
|
10669
|
+
'<< Previous'
|
|
10670
|
+
),
|
|
10671
|
+
React__default.createElement(
|
|
10672
|
+
'a',
|
|
10673
|
+
{ href: '?page=' + (currentPage + 1) },
|
|
10674
|
+
'Next >>'
|
|
10675
|
+
)
|
|
10676
|
+
);
|
|
10677
|
+
}, _temp), possibleConstructorReturn(_this, _ret);
|
|
10678
|
+
}
|
|
10679
|
+
|
|
10680
|
+
createClass(DeckContent, [{
|
|
10681
|
+
key: 'componentDidUpdate',
|
|
10682
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
10683
|
+
if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
|
|
10684
|
+
// eslint-disable-next-line react/no-did-update-set-state
|
|
10685
|
+
this.setState({
|
|
10686
|
+
data: this.props.dataRecord,
|
|
10687
|
+
dataKeptToCompareNewDatarecord: this.props.dataRecord,
|
|
10688
|
+
per: this.props.params ? this.props.params.to : 2,
|
|
10689
|
+
page: 1,
|
|
10690
|
+
from: this.props.params ? this.props.params.from : 0,
|
|
10691
|
+
to: this.props.params ? this.props.params.to : 2,
|
|
10692
|
+
total_pages: null,
|
|
10693
|
+
scrolling: true,
|
|
10694
|
+
query: this.props.query
|
|
10695
|
+
});
|
|
10696
|
+
}
|
|
10697
|
+
}
|
|
10698
|
+
}, {
|
|
10699
|
+
key: 'componentDidMount',
|
|
10700
|
+
value: function componentDidMount() {
|
|
10701
|
+
// this.loadData();
|
|
10702
|
+
}
|
|
10703
|
+
}, {
|
|
10704
|
+
key: 'render',
|
|
10705
|
+
value: function render() {
|
|
10706
|
+
var _this2 = this;
|
|
10707
|
+
|
|
10708
|
+
var _props = this.props,
|
|
10709
|
+
columns = _props.columns,
|
|
10710
|
+
variant = _props.variant,
|
|
10711
|
+
autoScroll = _props.autoScroll,
|
|
10712
|
+
page = _props.page;
|
|
10713
|
+
|
|
10714
|
+
|
|
10715
|
+
return React__default.createElement(
|
|
10716
|
+
'div',
|
|
10717
|
+
{ className: 'contentDeck' },
|
|
10718
|
+
autoScroll ? React__default.createElement(
|
|
10719
|
+
React__default.Fragment,
|
|
10720
|
+
null,
|
|
10721
|
+
React__default.createElement(
|
|
10722
|
+
InfiniteScroll,
|
|
10723
|
+
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
10724
|
+
React__default.createElement(
|
|
10725
|
+
Container,
|
|
10726
|
+
null,
|
|
10727
|
+
this.cardLoader(page, columns, variant)
|
|
10728
|
+
)
|
|
10729
|
+
),
|
|
10730
|
+
React__default.createElement(
|
|
10731
|
+
'noscript',
|
|
10732
|
+
null,
|
|
10733
|
+
this.renderManualPagination()
|
|
10734
|
+
)
|
|
10735
|
+
) : React__default.createElement(
|
|
10736
|
+
React__default.Fragment,
|
|
10737
|
+
null,
|
|
10738
|
+
React__default.createElement(
|
|
10739
|
+
Container,
|
|
10740
|
+
null,
|
|
10741
|
+
this.cardLoader(page, columns, variant)
|
|
10742
|
+
),
|
|
10743
|
+
React__default.createElement(
|
|
10744
|
+
'div',
|
|
10745
|
+
{ style: { padding: '0px 10px' } },
|
|
10746
|
+
this.state.scrolling ? React__default.createElement(
|
|
10747
|
+
'button',
|
|
10748
|
+
{
|
|
10749
|
+
style: { margin: 'auto', width: '100%' },
|
|
10750
|
+
onClick: function onClick(e) {
|
|
10751
|
+
_this2.loadMore();
|
|
10752
|
+
} },
|
|
10753
|
+
'Load More'
|
|
10754
|
+
) : React__default.createElement(
|
|
10755
|
+
'p',
|
|
10756
|
+
{ style: { textAlign: 'center' } },
|
|
10757
|
+
React__default.createElement(
|
|
10758
|
+
'b',
|
|
10759
|
+
null,
|
|
10760
|
+
'End of data'
|
|
10761
|
+
)
|
|
10762
|
+
)
|
|
10763
|
+
),
|
|
10764
|
+
React__default.createElement(
|
|
10765
|
+
'noscript',
|
|
10766
|
+
null,
|
|
10767
|
+
this.renderManualPagination()
|
|
10768
|
+
)
|
|
10769
|
+
)
|
|
10770
|
+
);
|
|
10771
|
+
}
|
|
10772
|
+
}]);
|
|
10773
|
+
return DeckContent;
|
|
10774
|
+
}(React__default.Component);
|
|
10775
|
+
|
|
10776
|
+
var ContentCard = Router.withRouter(DeckContent);
|
|
10281
10777
|
|
|
10282
10778
|
/**
|
|
10283
10779
|
* Checks if `value` is classified as an `Array` object.
|
|
@@ -11561,7 +12057,7 @@ var GridContent = function (_React$Component) {
|
|
|
11561
12057
|
React__default.createElement(
|
|
11562
12058
|
Card.Text,
|
|
11563
12059
|
null,
|
|
11564
|
-
row.summary
|
|
12060
|
+
clean_html_1(row.summary)
|
|
11565
12061
|
)
|
|
11566
12062
|
)
|
|
11567
12063
|
)
|
|
@@ -11631,7 +12127,7 @@ var GridContent = function (_React$Component) {
|
|
|
11631
12127
|
React__default.createElement(
|
|
11632
12128
|
Card.Text,
|
|
11633
12129
|
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
11634
|
-
row.summary
|
|
12130
|
+
clean_html_1(row.summary)
|
|
11635
12131
|
)
|
|
11636
12132
|
)
|
|
11637
12133
|
)
|
|
@@ -11700,7 +12196,7 @@ var GridContent = function (_React$Component) {
|
|
|
11700
12196
|
React__default.createElement(
|
|
11701
12197
|
Card.Text,
|
|
11702
12198
|
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
11703
|
-
row.summary
|
|
12199
|
+
clean_html_1(row.summary)
|
|
11704
12200
|
)
|
|
11705
12201
|
)
|
|
11706
12202
|
)
|
|
@@ -11770,7 +12266,7 @@ var GridContent = function (_React$Component) {
|
|
|
11770
12266
|
React__default.createElement(
|
|
11771
12267
|
Card.Text,
|
|
11772
12268
|
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
11773
|
-
row.summary
|
|
12269
|
+
clean_html_1(row.summary)
|
|
11774
12270
|
)
|
|
11775
12271
|
)
|
|
11776
12272
|
)
|
|
@@ -12107,7 +12603,7 @@ var DeckQueue = function (_React$Component) {
|
|
|
12107
12603
|
React__default.createElement(
|
|
12108
12604
|
Link,
|
|
12109
12605
|
{ href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
|
|
12110
|
-
row.summary
|
|
12606
|
+
clean_html_1(row.summary)
|
|
12111
12607
|
)
|
|
12112
12608
|
)
|
|
12113
12609
|
)
|
|
@@ -12222,7 +12718,7 @@ var ThumbnailCard = function ThumbnailCard(_ref) {
|
|
|
12222
12718
|
React__default.createElement(
|
|
12223
12719
|
'p',
|
|
12224
12720
|
null,
|
|
12225
|
-
item.summary
|
|
12721
|
+
clean_html_1(item.summary)
|
|
12226
12722
|
)
|
|
12227
12723
|
)
|
|
12228
12724
|
);
|
|
@@ -12322,7 +12818,7 @@ var TaxonomyCard = function TaxonomyCard(props) {
|
|
|
12322
12818
|
React__default.createElement(
|
|
12323
12819
|
Card.Text,
|
|
12324
12820
|
null,
|
|
12325
|
-
row.summary
|
|
12821
|
+
clean_html_1(row.summary)
|
|
12326
12822
|
)
|
|
12327
12823
|
)
|
|
12328
12824
|
),
|
|
@@ -12925,7 +13421,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
12925
13421
|
article.summary && React__default.createElement(
|
|
12926
13422
|
'p',
|
|
12927
13423
|
{ className: 'pt-2 card-text' },
|
|
12928
|
-
article.summary
|
|
13424
|
+
clean_html_1(article.summary)
|
|
12929
13425
|
)
|
|
12930
13426
|
)
|
|
12931
13427
|
)
|
|
@@ -13006,7 +13502,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
13006
13502
|
article.summary && React__default.createElement(
|
|
13007
13503
|
'p',
|
|
13008
13504
|
{ className: 'pt-2 card-text' },
|
|
13009
|
-
article.summary
|
|
13505
|
+
clean_html_1(article.summary)
|
|
13010
13506
|
)
|
|
13011
13507
|
)
|
|
13012
13508
|
)
|
|
@@ -13088,7 +13584,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
13088
13584
|
article.summary && React__default.createElement(
|
|
13089
13585
|
'p',
|
|
13090
13586
|
{ className: 'pt-2 card-text' },
|
|
13091
|
-
article.summary
|
|
13587
|
+
clean_html_1(article.summary)
|
|
13092
13588
|
)
|
|
13093
13589
|
)
|
|
13094
13590
|
)
|
|
@@ -27643,792 +28139,533 @@ var ReactPlayer = /*#__PURE__*/function (_Component) {
|
|
|
27643
28139
|
light: light,
|
|
27644
28140
|
playIcon: playIcon,
|
|
27645
28141
|
onClick: this.handleClickPreview
|
|
27646
|
-
});
|
|
27647
|
-
|
|
27648
|
-
return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
|
|
27649
|
-
ref: this.wrapperRef,
|
|
27650
|
-
style: _objectSpread({}, style, {
|
|
27651
|
-
width: width,
|
|
27652
|
-
height: height
|
|
27653
|
-
})
|
|
27654
|
-
}, otherProps), showPreview ? preview : players$$1);
|
|
27655
|
-
}
|
|
27656
|
-
}]);
|
|
27657
|
-
|
|
27658
|
-
return ReactPlayer;
|
|
27659
|
-
}(_react.Component);
|
|
27660
|
-
|
|
27661
|
-
exports["default"] = ReactPlayer;
|
|
27662
|
-
|
|
27663
|
-
_defineProperty(ReactPlayer, "addCustomPlayer", function (player) {
|
|
27664
|
-
customPlayers.push(player);
|
|
27665
|
-
});
|
|
27666
|
-
|
|
27667
|
-
_defineProperty(ReactPlayer, "removeCustomPlayers", function () {
|
|
27668
|
-
customPlayers = [];
|
|
27669
|
-
});
|
|
27670
|
-
|
|
27671
|
-
_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
|
|
27672
|
-
|
|
27673
|
-
_defineProperty(ReactPlayer, "propTypes", props.propTypes);
|
|
27674
|
-
|
|
27675
|
-
_defineProperty(ReactPlayer, "defaultProps", props.defaultProps);
|
|
27676
|
-
|
|
27677
|
-
_defineProperty(ReactPlayer, "canPlay", function (url) {
|
|
27678
|
-
for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {
|
|
27679
|
-
var _Player2 = _arr2[_i2];
|
|
27680
|
-
|
|
27681
|
-
if (_Player2.canPlay(url)) {
|
|
27682
|
-
return true;
|
|
27683
|
-
}
|
|
27684
|
-
}
|
|
27685
|
-
|
|
27686
|
-
return false;
|
|
27687
|
-
});
|
|
27688
|
-
|
|
27689
|
-
_defineProperty(ReactPlayer, "canEnablePIP", function (url) {
|
|
27690
|
-
for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) {
|
|
27691
|
-
var _Player3 = _arr3[_i3];
|
|
27692
|
-
|
|
27693
|
-
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
|
|
27694
|
-
return true;
|
|
27695
|
-
}
|
|
27696
|
-
}
|
|
27697
|
-
|
|
27698
|
-
return false;
|
|
27699
|
-
});
|
|
27700
|
-
});
|
|
27701
|
-
|
|
27702
|
-
var ReactPlayer = unwrapExports(ReactPlayer_1);
|
|
27703
|
-
|
|
27704
|
-
var Audio = function Audio(_ref) {
|
|
27705
|
-
var node = _ref.node;
|
|
27706
|
-
|
|
27707
|
-
if (node.uploadAudio) {
|
|
27708
|
-
return React__default.createElement(
|
|
27709
|
-
'div',
|
|
27710
|
-
{ className: 'audio d-block text-center mb-3' },
|
|
27711
|
-
React__default.createElement(
|
|
27712
|
-
'audio',
|
|
27713
|
-
{ controls: true, controlsList: 'nodownload', className: 'audio' },
|
|
27714
|
-
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/ogg' }),
|
|
27715
|
-
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/mpeg' }),
|
|
27716
|
-
'Your browser does not support the audio element.'
|
|
27717
|
-
)
|
|
27718
|
-
);
|
|
27719
|
-
} else if (node.audioFilePth) {
|
|
27720
|
-
var hostname = new URL(node.audioFilePth).hostname;
|
|
27721
|
-
if (hostname === 'embeds.audioboom.com') {
|
|
27722
|
-
return React__default.createElement('iframe', { src: node.audioFilePth, width: '100%', height: '300', className: 'audio', style: { border: 'none' } });
|
|
27723
|
-
}
|
|
27724
|
-
return React__default.createElement(
|
|
27725
|
-
'div',
|
|
27726
|
-
{ className: 'audio' },
|
|
27727
|
-
React__default.createElement(ReactPlayer, { url: node.audioFilePth, controls: true, width: '100%', height: '100%' })
|
|
27728
|
-
);
|
|
27729
|
-
}
|
|
27730
|
-
|
|
27731
|
-
return null;
|
|
27732
|
-
};
|
|
27733
|
-
|
|
27734
|
-
var YouTubeGallery = function YouTubeGallery(_ref) {
|
|
27735
|
-
var nodes = _ref.nodes,
|
|
27736
|
-
client = _ref.client;
|
|
27737
|
-
|
|
27738
|
-
var router = Router.useRouter();
|
|
27739
|
-
//state
|
|
27740
|
-
|
|
27741
|
-
var _useState = React.useState(''),
|
|
27742
|
-
_useState2 = slicedToArray(_useState, 2),
|
|
27743
|
-
vidUrl = _useState2[0],
|
|
27744
|
-
setVidUrl = _useState2[1];
|
|
27745
|
-
|
|
27746
|
-
var _useState3 = React.useState(''),
|
|
27747
|
-
_useState4 = slicedToArray(_useState3, 2),
|
|
27748
|
-
series = _useState4[0],
|
|
27749
|
-
setSeries = _useState4[1];
|
|
27750
|
-
|
|
27751
|
-
var _useState5 = React.useState([]),
|
|
27752
|
-
_useState6 = slicedToArray(_useState5, 2),
|
|
27753
|
-
seriesData = _useState6[0],
|
|
27754
|
-
setData = _useState6[1];
|
|
27755
|
-
//variables
|
|
27756
|
-
|
|
27757
|
-
|
|
27758
|
-
var get2 = router && router.asPath ? router.asPath.split('/')[1] : '';
|
|
27759
|
-
var get3 = router && router.asPath ? router.asPath.split('/')[2].split('?')[0] : '';
|
|
27760
|
-
|
|
27761
|
-
// Once component mounts, set the variables
|
|
27762
|
-
React.useEffect(function () {
|
|
27763
|
-
var params = new URL(document.location).searchParams;
|
|
27764
|
-
var seriesVid = params.get('seriesVid') || 1;
|
|
27765
|
-
var data = [];
|
|
27766
|
-
nodes.videos.forEach(function (vid) {
|
|
27767
|
-
data.push({ title: vid.title, thumbnail: 'http://img.youtube.com/vi/' + getYoutubeId(vid.url) + '/hqdefault.jpg', url: vid.url });
|
|
27768
|
-
});
|
|
27769
|
-
// if series number doesn't exist, route back to first vid of series
|
|
27770
|
-
if (data.length < seriesVid) {
|
|
27771
|
-
setSeries(1);
|
|
27772
|
-
setVidUrl(nodes.videos[0].url);
|
|
27773
|
-
var newPath = '/' + get2 + '/' + get3 + '?seriesVid=1';
|
|
27774
|
-
var vidState = { vid_id: seriesVid };
|
|
27775
|
-
window.history.pushState(vidState, '', newPath);
|
|
27776
|
-
} else {
|
|
27777
|
-
setSeries(seriesVid);
|
|
27778
|
-
setVidUrl(nodes.videos[seriesVid - 1].url);
|
|
27779
|
-
}
|
|
27780
|
-
setData(data);
|
|
27781
|
-
}, []);
|
|
27782
|
-
|
|
27783
|
-
function toggleSeries() {
|
|
27784
|
-
var series = document.querySelector('.vid-series');
|
|
27785
|
-
if (series.classList.contains('active')) {
|
|
27786
|
-
series.style.bottom = '-100%';
|
|
27787
|
-
} else {
|
|
27788
|
-
series.style.bottom = '6px';
|
|
27789
|
-
}
|
|
27790
|
-
series.classList.toggle('active');
|
|
27791
|
-
}
|
|
27792
|
-
// This function is passed to the GroupDeck to change the youtube iframe src
|
|
27793
|
-
function setState(url, vidIndex) {
|
|
27794
|
-
setVidUrl(url);
|
|
27795
|
-
toggleSeries();
|
|
27796
|
-
lib_3.refresh();
|
|
27797
|
-
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + vidIndex);
|
|
27798
|
-
var vidState = { vid_id: vidIndex };
|
|
27799
|
-
window.history.pushState(vidState, '', newPath);
|
|
27800
|
-
setSeries(vidIndex);
|
|
27801
|
-
}
|
|
27802
|
-
|
|
27803
|
-
// Handle video end
|
|
27804
|
-
function handleOnEnd(e) {
|
|
27805
|
-
var currentVid = void 0;
|
|
27806
|
-
var nextVid = void 0;
|
|
27807
|
-
//Find index of video currently playing
|
|
27808
|
-
seriesData.forEach(function (vid, index$$1) {
|
|
27809
|
-
if (vid.url === vidUrl) {
|
|
27810
|
-
currentVid = index$$1;
|
|
27811
|
-
}
|
|
27812
|
-
});
|
|
27813
|
-
//increment +1, or if at the end of the series list, go back to the beginning
|
|
27814
|
-
if (currentVid + 1 >= seriesData.length) {
|
|
27815
|
-
nextVid = 0;
|
|
27816
|
-
} else {
|
|
27817
|
-
nextVid = currentVid + 1;
|
|
27818
|
-
}
|
|
27819
|
-
// set the new Video URL
|
|
27820
|
-
setState(nodes.videos[nextVid].url, nextVid + 1);
|
|
27821
|
-
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + (nextVid + 1));
|
|
27822
|
-
var vidState = { vid_id: nextVid + 1 };
|
|
27823
|
-
var title = '';
|
|
27824
|
-
window.history.pushState(vidState, title, newPath);
|
|
27825
|
-
|
|
27826
|
-
//Small pause before starting next video
|
|
27827
|
-
setTimeout(function () {
|
|
27828
|
-
//Youtube API to start video playing automatically
|
|
27829
|
-
var id = getYoutubeId(nodes.videos['' + nextVid].url);
|
|
27830
|
-
e.target.loadVideoById(id);
|
|
27831
|
-
toggleSeries();
|
|
27832
|
-
}, 1000);
|
|
27833
|
-
}
|
|
27834
|
-
// Youtube Options
|
|
27835
|
-
var opts = {
|
|
27836
|
-
width: '100%',
|
|
27837
|
-
playerVars: {
|
|
27838
|
-
rel: 0
|
|
28142
|
+
});
|
|
28143
|
+
|
|
28144
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
|
|
28145
|
+
ref: this.wrapperRef,
|
|
28146
|
+
style: _objectSpread({}, style, {
|
|
28147
|
+
width: width,
|
|
28148
|
+
height: height
|
|
28149
|
+
})
|
|
28150
|
+
}, otherProps), showPreview ? preview : players$$1);
|
|
27839
28151
|
}
|
|
27840
|
-
};
|
|
28152
|
+
}]);
|
|
27841
28153
|
|
|
27842
|
-
return
|
|
27843
|
-
|
|
27844
|
-
{ className: 'video-container', style: { marginBottom: '2rem' } },
|
|
27845
|
-
React__default.createElement(
|
|
27846
|
-
'div',
|
|
27847
|
-
{ className: 'video-block', style: { position: 'relative', overflow: 'hidden' } },
|
|
27848
|
-
vidUrl && React__default.createElement(YouTube, { videoId: getYoutubeId(vidUrl), opts: opts, onEnd: function onEnd(e) {
|
|
27849
|
-
return handleOnEnd(e);
|
|
27850
|
-
} }),
|
|
27851
|
-
React__default.createElement(
|
|
27852
|
-
'div',
|
|
27853
|
-
{
|
|
27854
|
-
className: 'vid-series',
|
|
27855
|
-
style: {
|
|
27856
|
-
position: 'absolute',
|
|
27857
|
-
width: '100%',
|
|
27858
|
-
height: '250px',
|
|
27859
|
-
background: 'linear-gradient(to bottom, transparent,black)',
|
|
27860
|
-
bottom: '-100%',
|
|
27861
|
-
transition: 'all .5s ease',
|
|
27862
|
-
padding: '0 1rem',
|
|
27863
|
-
left: '0'
|
|
27864
|
-
} },
|
|
27865
|
-
vidUrl && React__default.createElement(GroupDeck, { dark: true, dataset: seriesData, setState: setState, seriesVid: series, current: vidUrl })
|
|
27866
|
-
)
|
|
27867
|
-
),
|
|
27868
|
-
React__default.createElement(
|
|
27869
|
-
'div',
|
|
27870
|
-
{ className: 'vid-controls', style: { width: '100%', background: 'transparent', display: 'flex', justifyContent: 'center' } },
|
|
27871
|
-
React__default.createElement(
|
|
27872
|
-
'button',
|
|
27873
|
-
{
|
|
27874
|
-
'aria-label': 'Toggles video series',
|
|
27875
|
-
id: 'vid-series-btn',
|
|
27876
|
-
onClick: toggleSeries,
|
|
27877
|
-
className: 'btn btn-block btn-lg ',
|
|
27878
|
-
style: { borderRadius: '0', background: 'rgb(241,185,63)', color: 'white' } },
|
|
27879
|
-
'View Series'
|
|
27880
|
-
)
|
|
27881
|
-
),
|
|
27882
|
-
React__default.createElement(
|
|
27883
|
-
'div',
|
|
27884
|
-
{ className: 'my-5' },
|
|
27885
|
-
series && React__default.createElement(
|
|
27886
|
-
'h3',
|
|
27887
|
-
null,
|
|
27888
|
-
'Episode ',
|
|
27889
|
-
series
|
|
27890
|
-
),
|
|
27891
|
-
nodes.videos[series - 1] && React__default.createElement(
|
|
27892
|
-
'h2',
|
|
27893
|
-
{ className: 'mb-3' },
|
|
27894
|
-
nodes.videos[series - 1].title
|
|
27895
|
-
),
|
|
27896
|
-
nodes.videos[series - 1] && React__default.createElement(BlockContent, _extends({ serializers: getSerializers$1(client), blocks: nodes.videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
27897
|
-
),
|
|
27898
|
-
React__default.createElement(
|
|
27899
|
-
'style',
|
|
27900
|
-
{ jsx: 'true' },
|
|
27901
|
-
'\n .vid-series .video-detail iframe {\n height: 415px !important;\n }\n span.btn {\n margin: 0 1rem;\n }\n '
|
|
27902
|
-
)
|
|
27903
|
-
);
|
|
27904
|
-
};
|
|
28154
|
+
return ReactPlayer;
|
|
28155
|
+
}(_react.Component);
|
|
27905
28156
|
|
|
27906
|
-
|
|
27907
|
-
var node = _ref.node,
|
|
27908
|
-
client = _ref.client,
|
|
27909
|
-
pageview = _ref.pageview,
|
|
27910
|
-
videoAccountIDs = _ref.videoAccountIDs,
|
|
27911
|
-
onVote = _ref.onVote,
|
|
27912
|
-
_ref$showVotes = _ref.showVotes,
|
|
27913
|
-
showVotes = _ref$showVotes === undefined ? false : _ref$showVotes;
|
|
28157
|
+
exports["default"] = ReactPlayer;
|
|
27914
28158
|
|
|
27915
|
-
|
|
27916
|
-
|
|
27917
|
-
|
|
27918
|
-
setSelectedChoice = _useState2[1];
|
|
28159
|
+
_defineProperty(ReactPlayer, "addCustomPlayer", function (player) {
|
|
28160
|
+
customPlayers.push(player);
|
|
28161
|
+
});
|
|
27919
28162
|
|
|
27920
|
-
|
|
27921
|
-
|
|
27922
|
-
|
|
27923
|
-
setShowAnswer = _useState4[1];
|
|
28163
|
+
_defineProperty(ReactPlayer, "removeCustomPlayers", function () {
|
|
28164
|
+
customPlayers = [];
|
|
28165
|
+
});
|
|
27924
28166
|
|
|
27925
|
-
|
|
27926
|
-
question = node.question,
|
|
27927
|
-
response = node.response;
|
|
28167
|
+
_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
|
|
27928
28168
|
|
|
28169
|
+
_defineProperty(ReactPlayer, "propTypes", props.propTypes);
|
|
27929
28170
|
|
|
27930
|
-
|
|
27931
|
-
e.preventDefault();
|
|
27932
|
-
onVote(node._key, selectedChoice);
|
|
27933
|
-
setShowAnswer(true);
|
|
27934
|
-
};
|
|
28171
|
+
_defineProperty(ReactPlayer, "defaultProps", props.defaultProps);
|
|
27935
28172
|
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
|
|
27939
|
-
|
|
27940
|
-
|
|
27941
|
-
|
|
27942
|
-
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
|
|
27946
|
-
|
|
27947
|
-
|
|
27948
|
-
|
|
27949
|
-
|
|
27950
|
-
|
|
27951
|
-
|
|
27952
|
-
|
|
27953
|
-
|
|
27954
|
-
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
|
|
27959
|
-
|
|
27960
|
-
|
|
27961
|
-
|
|
27962
|
-
|
|
27963
|
-
|
|
27964
|
-
|
|
27965
|
-
|
|
27966
|
-
|
|
28173
|
+
_defineProperty(ReactPlayer, "canPlay", function (url) {
|
|
28174
|
+
for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {
|
|
28175
|
+
var _Player2 = _arr2[_i2];
|
|
28176
|
+
|
|
28177
|
+
if (_Player2.canPlay(url)) {
|
|
28178
|
+
return true;
|
|
28179
|
+
}
|
|
28180
|
+
}
|
|
28181
|
+
|
|
28182
|
+
return false;
|
|
28183
|
+
});
|
|
28184
|
+
|
|
28185
|
+
_defineProperty(ReactPlayer, "canEnablePIP", function (url) {
|
|
28186
|
+
for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) {
|
|
28187
|
+
var _Player3 = _arr3[_i3];
|
|
28188
|
+
|
|
28189
|
+
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
|
|
28190
|
+
return true;
|
|
28191
|
+
}
|
|
28192
|
+
}
|
|
28193
|
+
|
|
28194
|
+
return false;
|
|
28195
|
+
});
|
|
28196
|
+
});
|
|
28197
|
+
|
|
28198
|
+
var ReactPlayer = unwrapExports(ReactPlayer_1);
|
|
28199
|
+
|
|
28200
|
+
var Audio = function Audio(_ref) {
|
|
28201
|
+
var node = _ref.node;
|
|
28202
|
+
|
|
28203
|
+
if (node.uploadAudio) {
|
|
28204
|
+
return React__default.createElement(
|
|
28205
|
+
'div',
|
|
28206
|
+
{ className: 'audio d-block text-center mb-3' },
|
|
27967
28207
|
React__default.createElement(
|
|
27968
|
-
|
|
27969
|
-
{
|
|
27970
|
-
'
|
|
28208
|
+
'audio',
|
|
28209
|
+
{ controls: true, controlsList: 'nodownload', className: 'audio' },
|
|
28210
|
+
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/ogg' }),
|
|
28211
|
+
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/mpeg' }),
|
|
28212
|
+
'Your browser does not support the audio element.'
|
|
27971
28213
|
)
|
|
27972
|
-
)
|
|
27973
|
-
|
|
28214
|
+
);
|
|
28215
|
+
} else if (node.audioFilePth) {
|
|
28216
|
+
var hostname = new URL(node.audioFilePth).hostname;
|
|
28217
|
+
if (hostname === 'embeds.audioboom.com') {
|
|
28218
|
+
return React__default.createElement('iframe', { src: node.audioFilePth, width: '100%', height: '300', className: 'audio', style: { border: 'none' } });
|
|
28219
|
+
}
|
|
28220
|
+
return React__default.createElement(
|
|
27974
28221
|
'div',
|
|
27975
|
-
{ className: '
|
|
27976
|
-
|
|
27977
|
-
|
|
27978
|
-
|
|
27979
|
-
'div',
|
|
27980
|
-
{ key: choice._key, className: 'mb-3' },
|
|
27981
|
-
React__default.createElement(
|
|
27982
|
-
'span',
|
|
27983
|
-
null,
|
|
27984
|
-
choice.choiceText
|
|
27985
|
-
),
|
|
27986
|
-
React__default.createElement(reactBootstrap.ProgressBar, { now: percentage }),
|
|
27987
|
-
React__default.createElement(
|
|
27988
|
-
'span',
|
|
27989
|
-
{ className: 'float-right' },
|
|
27990
|
-
percentage,
|
|
27991
|
-
'% (',
|
|
27992
|
-
choice.choiceCount,
|
|
27993
|
-
' Votes)'
|
|
27994
|
-
)
|
|
27995
|
-
);
|
|
27996
|
-
})
|
|
27997
|
-
),
|
|
27998
|
-
showAnswer && React__default.createElement(
|
|
27999
|
-
'h4',
|
|
28000
|
-
{ className: 'text-center small p-3' },
|
|
28001
|
-
'Total Votes: ',
|
|
28002
|
-
choicesTotalCount
|
|
28003
|
-
),
|
|
28004
|
-
showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers$1(client, pageview, videoAccountIDs) }),
|
|
28005
|
-
React__default.createElement(
|
|
28006
|
-
'style',
|
|
28007
|
-
{ jsx: 'true' },
|
|
28008
|
-
'\n .progress-bar {\n color: #fff;\n }\n '
|
|
28009
|
-
)
|
|
28010
|
-
);
|
|
28011
|
-
};
|
|
28222
|
+
{ className: 'audio' },
|
|
28223
|
+
React__default.createElement(ReactPlayer, { url: node.audioFilePth, controls: true, width: '100%', height: '100%' })
|
|
28224
|
+
);
|
|
28225
|
+
}
|
|
28012
28226
|
|
|
28013
|
-
|
|
28227
|
+
return null;
|
|
28228
|
+
};
|
|
28014
28229
|
|
|
28015
|
-
var
|
|
28016
|
-
var
|
|
28017
|
-
|
|
28230
|
+
var YouTubeGallery = function YouTubeGallery(_ref) {
|
|
28231
|
+
var nodes = _ref.nodes,
|
|
28232
|
+
client = _ref.client;
|
|
28018
28233
|
|
|
28019
|
-
var
|
|
28234
|
+
var router = Router.useRouter();
|
|
28235
|
+
//state
|
|
28020
28236
|
|
|
28021
|
-
var _useState = React.useState(
|
|
28237
|
+
var _useState = React.useState(''),
|
|
28022
28238
|
_useState2 = slicedToArray(_useState, 2),
|
|
28023
|
-
|
|
28024
|
-
|
|
28239
|
+
vidUrl = _useState2[0],
|
|
28240
|
+
setVidUrl = _useState2[1];
|
|
28025
28241
|
|
|
28026
|
-
var _useState3 = React.useState(
|
|
28242
|
+
var _useState3 = React.useState(''),
|
|
28027
28243
|
_useState4 = slicedToArray(_useState3, 2),
|
|
28028
|
-
|
|
28029
|
-
|
|
28244
|
+
series = _useState4[0],
|
|
28245
|
+
setSeries = _useState4[1];
|
|
28030
28246
|
|
|
28031
|
-
var _useState5 = React.useState(
|
|
28247
|
+
var _useState5 = React.useState([]),
|
|
28032
28248
|
_useState6 = slicedToArray(_useState5, 2),
|
|
28033
|
-
|
|
28034
|
-
|
|
28249
|
+
seriesData = _useState6[0],
|
|
28250
|
+
setData = _useState6[1];
|
|
28251
|
+
//variables
|
|
28035
28252
|
|
|
28036
|
-
var _useState7 = React.useState(numberOfPaginations - 1),
|
|
28037
|
-
_useState8 = slicedToArray(_useState7, 2),
|
|
28038
|
-
endIndex = _useState8[0],
|
|
28039
|
-
setEndIndex = _useState8[1];
|
|
28040
28253
|
|
|
28041
|
-
var
|
|
28042
|
-
|
|
28043
|
-
pages = _useState10[0],
|
|
28044
|
-
setPages = _useState10[1];
|
|
28254
|
+
var get2 = router && router.asPath ? router.asPath.split('/')[1] : '';
|
|
28255
|
+
var get3 = router && router.asPath ? router.asPath.split('/')[2].split('?')[0] : '';
|
|
28045
28256
|
|
|
28257
|
+
// Once component mounts, set the variables
|
|
28046
28258
|
React.useEffect(function () {
|
|
28047
|
-
var
|
|
28048
|
-
|
|
28259
|
+
var params = new URL(document.location).searchParams;
|
|
28260
|
+
var seriesVid = params.get('seriesVid') || 1;
|
|
28261
|
+
var data = [];
|
|
28262
|
+
nodes.videos.forEach(function (vid) {
|
|
28263
|
+
data.push({ title: vid.title, thumbnail: 'http://img.youtube.com/vi/' + getYoutubeId(vid.url) + '/hqdefault.jpg', url: vid.url });
|
|
28049
28264
|
});
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28054
|
-
|
|
28055
|
-
|
|
28056
|
-
|
|
28265
|
+
// if series number doesn't exist, route back to first vid of series
|
|
28266
|
+
if (data.length < seriesVid) {
|
|
28267
|
+
setSeries(1);
|
|
28268
|
+
setVidUrl(nodes.videos[0].url);
|
|
28269
|
+
var newPath = '/' + get2 + '/' + get3 + '?seriesVid=1';
|
|
28270
|
+
var vidState = { vid_id: seriesVid };
|
|
28271
|
+
window.history.pushState(vidState, '', newPath);
|
|
28272
|
+
} else {
|
|
28273
|
+
setSeries(seriesVid);
|
|
28274
|
+
setVidUrl(nodes.videos[seriesVid - 1].url);
|
|
28275
|
+
}
|
|
28276
|
+
setData(data);
|
|
28277
|
+
}, []);
|
|
28057
28278
|
|
|
28058
|
-
|
|
28059
|
-
|
|
28060
|
-
|
|
28061
|
-
|
|
28062
|
-
|
|
28063
|
-
|
|
28064
|
-
setEndIndex(numberOfPaginations - 1);
|
|
28065
|
-
break;
|
|
28066
|
-
case 'last':
|
|
28067
|
-
setCurrentPage(pageCount);
|
|
28068
|
-
setStartIndex(pageCount - pageCount % numberOfPaginations);
|
|
28069
|
-
setEndIndex(pageCount - pageCount % numberOfPaginations + numberOfPaginations - 1);
|
|
28070
|
-
break;
|
|
28071
|
-
case 'next':
|
|
28072
|
-
setCurrentPage(currentPage + 1);
|
|
28073
|
-
if (currentPage % numberOfPaginations === 0) {
|
|
28074
|
-
setStartIndex(startIndex + numberOfPaginations);
|
|
28075
|
-
setEndIndex(endIndex + numberOfPaginations);
|
|
28076
|
-
}
|
|
28077
|
-
break;
|
|
28078
|
-
case 'prev':
|
|
28079
|
-
setCurrentPage(currentPage - 1);
|
|
28080
|
-
if (currentPage % numberOfPaginations === 1) {
|
|
28081
|
-
setStartIndex(startIndex - numberOfPaginations);
|
|
28082
|
-
setEndIndex(endIndex - numberOfPaginations);
|
|
28083
|
-
}
|
|
28084
|
-
break;
|
|
28085
|
-
default:
|
|
28086
|
-
setCurrentPage(control);
|
|
28279
|
+
function toggleSeries() {
|
|
28280
|
+
var series = document.querySelector('.vid-series');
|
|
28281
|
+
if (series.classList.contains('active')) {
|
|
28282
|
+
series.style.bottom = '-100%';
|
|
28283
|
+
} else {
|
|
28284
|
+
series.style.bottom = '6px';
|
|
28087
28285
|
}
|
|
28088
|
-
|
|
28286
|
+
series.classList.toggle('active');
|
|
28287
|
+
}
|
|
28288
|
+
// This function is passed to the GroupDeck to change the youtube iframe src
|
|
28289
|
+
function setState(url, vidIndex) {
|
|
28290
|
+
setVidUrl(url);
|
|
28291
|
+
toggleSeries();
|
|
28292
|
+
lib_3.refresh();
|
|
28293
|
+
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + vidIndex);
|
|
28294
|
+
var vidState = { vid_id: vidIndex };
|
|
28295
|
+
window.history.pushState(vidState, '', newPath);
|
|
28296
|
+
setSeries(vidIndex);
|
|
28297
|
+
}
|
|
28089
28298
|
|
|
28090
|
-
|
|
28091
|
-
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
|
|
28095
|
-
|
|
28096
|
-
|
|
28299
|
+
// Handle video end
|
|
28300
|
+
function handleOnEnd(e) {
|
|
28301
|
+
var currentVid = void 0;
|
|
28302
|
+
var nextVid = void 0;
|
|
28303
|
+
//Find index of video currently playing
|
|
28304
|
+
seriesData.forEach(function (vid, index$$1) {
|
|
28305
|
+
if (vid.url === vidUrl) {
|
|
28306
|
+
currentVid = index$$1;
|
|
28307
|
+
}
|
|
28308
|
+
});
|
|
28309
|
+
//increment +1, or if at the end of the series list, go back to the beginning
|
|
28310
|
+
if (currentVid + 1 >= seriesData.length) {
|
|
28311
|
+
nextVid = 0;
|
|
28312
|
+
} else {
|
|
28313
|
+
nextVid = currentVid + 1;
|
|
28097
28314
|
}
|
|
28098
|
-
|
|
28315
|
+
// set the new Video URL
|
|
28316
|
+
setState(nodes.videos[nextVid].url, nextVid + 1);
|
|
28317
|
+
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + (nextVid + 1));
|
|
28318
|
+
var vidState = { vid_id: nextVid + 1 };
|
|
28319
|
+
var title = '';
|
|
28320
|
+
window.history.pushState(vidState, title, newPath);
|
|
28099
28321
|
|
|
28100
|
-
|
|
28101
|
-
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28114
|
-
return React__default.createElement(
|
|
28115
|
-
Pagination.Item,
|
|
28116
|
-
{ key: page, active: page === currentPage, onClick: function onClick() {
|
|
28117
|
-
return changePage(page);
|
|
28118
|
-
} },
|
|
28119
|
-
page
|
|
28120
|
-
);
|
|
28121
|
-
}),
|
|
28122
|
-
React__default.createElement(Pagination.Ellipsis, { onClick: function onClick() {
|
|
28123
|
-
return renderNewPages('next');
|
|
28124
|
-
}, disabled: !validateIndex(startIndex + numberOfPaginations) }),
|
|
28125
|
-
React__default.createElement(Pagination.Next, { onClick: function onClick() {
|
|
28126
|
-
return changePage('next');
|
|
28127
|
-
}, disabled: currentPage === pageCount }),
|
|
28128
|
-
React__default.createElement(Pagination.Last, { onClick: function onClick() {
|
|
28129
|
-
return changePage('last');
|
|
28130
|
-
}, disabled: currentPage === pageCount })
|
|
28131
|
-
);
|
|
28322
|
+
//Small pause before starting next video
|
|
28323
|
+
setTimeout(function () {
|
|
28324
|
+
//Youtube API to start video playing automatically
|
|
28325
|
+
var id = getYoutubeId(nodes.videos['' + nextVid].url);
|
|
28326
|
+
e.target.loadVideoById(id);
|
|
28327
|
+
toggleSeries();
|
|
28328
|
+
}, 1000);
|
|
28329
|
+
}
|
|
28330
|
+
// Youtube Options
|
|
28331
|
+
var opts = {
|
|
28332
|
+
width: '100%',
|
|
28333
|
+
playerVars: {
|
|
28334
|
+
rel: 0
|
|
28335
|
+
}
|
|
28132
28336
|
};
|
|
28133
28337
|
|
|
28134
28338
|
return React__default.createElement(
|
|
28135
|
-
|
|
28136
|
-
|
|
28137
|
-
|
|
28138
|
-
|
|
28139
|
-
|
|
28140
|
-
{
|
|
28141
|
-
return
|
|
28142
|
-
}
|
|
28143
|
-
|
|
28339
|
+
'div',
|
|
28340
|
+
{ className: 'video-container', style: { marginBottom: '2rem' } },
|
|
28341
|
+
React__default.createElement(
|
|
28342
|
+
'div',
|
|
28343
|
+
{ className: 'video-block', style: { position: 'relative', overflow: 'hidden' } },
|
|
28344
|
+
vidUrl && React__default.createElement(YouTube, { videoId: getYoutubeId(vidUrl), opts: opts, onEnd: function onEnd(e) {
|
|
28345
|
+
return handleOnEnd(e);
|
|
28346
|
+
} }),
|
|
28347
|
+
React__default.createElement(
|
|
28348
|
+
'div',
|
|
28349
|
+
{
|
|
28350
|
+
className: 'vid-series',
|
|
28351
|
+
style: {
|
|
28352
|
+
position: 'absolute',
|
|
28353
|
+
width: '100%',
|
|
28354
|
+
height: '250px',
|
|
28355
|
+
background: 'linear-gradient(to bottom, transparent,black)',
|
|
28356
|
+
bottom: '-100%',
|
|
28357
|
+
transition: 'all .5s ease',
|
|
28358
|
+
padding: '0 1rem',
|
|
28359
|
+
left: '0'
|
|
28360
|
+
} },
|
|
28361
|
+
vidUrl && React__default.createElement(GroupDeck, { dark: true, dataset: seriesData, setState: setState, seriesVid: series, current: vidUrl })
|
|
28362
|
+
)
|
|
28144
28363
|
),
|
|
28145
|
-
|
|
28146
|
-
|
|
28147
|
-
|
|
28364
|
+
React__default.createElement(
|
|
28365
|
+
'div',
|
|
28366
|
+
{ className: 'vid-controls', style: { width: '100%', background: 'transparent', display: 'flex', justifyContent: 'center' } },
|
|
28148
28367
|
React__default.createElement(
|
|
28149
|
-
'
|
|
28368
|
+
'button',
|
|
28369
|
+
{
|
|
28370
|
+
'aria-label': 'Toggles video series',
|
|
28371
|
+
id: 'vid-series-btn',
|
|
28372
|
+
onClick: toggleSeries,
|
|
28373
|
+
className: 'btn btn-block btn-lg ',
|
|
28374
|
+
style: { borderRadius: '0', background: 'rgb(241,185,63)', color: 'white' } },
|
|
28375
|
+
'View Series'
|
|
28376
|
+
)
|
|
28377
|
+
),
|
|
28378
|
+
React__default.createElement(
|
|
28379
|
+
'div',
|
|
28380
|
+
{ className: 'my-5' },
|
|
28381
|
+
series && React__default.createElement(
|
|
28382
|
+
'h3',
|
|
28150
28383
|
null,
|
|
28151
|
-
'
|
|
28384
|
+
'Episode ',
|
|
28385
|
+
series
|
|
28152
28386
|
),
|
|
28153
|
-
|
|
28387
|
+
nodes.videos[series - 1] && React__default.createElement(
|
|
28388
|
+
'h2',
|
|
28389
|
+
{ className: 'mb-3' },
|
|
28390
|
+
nodes.videos[series - 1].title
|
|
28391
|
+
),
|
|
28392
|
+
nodes.videos[series - 1] && React__default.createElement(BlockContent, _extends({ serializers: getSerializers$1(client), blocks: nodes.videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
28154
28393
|
),
|
|
28155
|
-
React__default.createElement(
|
|
28156
|
-
|
|
28157
|
-
'
|
|
28158
|
-
{
|
|
28159
|
-
renderPagination()
|
|
28394
|
+
React__default.createElement(
|
|
28395
|
+
'style',
|
|
28396
|
+
{ jsx: 'true' },
|
|
28397
|
+
'\n .vid-series .video-detail iframe {\n height: 415px !important;\n }\n span.btn {\n margin: 0 1rem;\n }\n '
|
|
28160
28398
|
)
|
|
28161
28399
|
);
|
|
28162
28400
|
};
|
|
28163
28401
|
|
|
28164
|
-
var
|
|
28165
|
-
var
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28172
|
-
};
|
|
28402
|
+
var Poll = function Poll(_ref) {
|
|
28403
|
+
var node = _ref.node,
|
|
28404
|
+
client = _ref.client,
|
|
28405
|
+
pageview = _ref.pageview,
|
|
28406
|
+
videoAccountIDs = _ref.videoAccountIDs,
|
|
28407
|
+
onVote = _ref.onVote,
|
|
28408
|
+
_ref$showVotes = _ref.showVotes,
|
|
28409
|
+
showVotes = _ref$showVotes === undefined ? false : _ref$showVotes;
|
|
28173
28410
|
|
|
28174
|
-
var
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
|
|
28183
|
-
|
|
28184
|
-
|
|
28185
|
-
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28190
|
-
|
|
28191
|
-
|
|
28192
|
-
|
|
28193
|
-
|
|
28194
|
-
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28222
|
-
|
|
28223
|
-
|
|
28224
|
-
|
|
28225
|
-
|
|
28226
|
-
|
|
28227
|
-
|
|
28228
|
-
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28248
|
-
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
|
|
28253
|
-
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
|
|
28263
|
-
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
"ý": "ý",
|
|
28271
|
-
"þ": "þ",
|
|
28272
|
-
"ÿ": "ÿ",
|
|
28273
|
-
"Œ": "Œ",
|
|
28274
|
-
"œ": "œ",
|
|
28275
|
-
"Š": "Š",
|
|
28276
|
-
"š": "š",
|
|
28277
|
-
"Ÿ": "Ÿ",
|
|
28278
|
-
"ƒ": "ƒ",
|
|
28279
|
-
"ˆ": "ˆ",
|
|
28280
|
-
"˜": "˜",
|
|
28281
|
-
"Α": "Α",
|
|
28282
|
-
"Β": "Β",
|
|
28283
|
-
"Γ": "Γ",
|
|
28284
|
-
"Δ": "Δ",
|
|
28285
|
-
"Ε": "Ε",
|
|
28286
|
-
"Ζ": "Ζ",
|
|
28287
|
-
"Η": "Η",
|
|
28288
|
-
"Θ": "Θ",
|
|
28289
|
-
"Ι": "Ι",
|
|
28290
|
-
"Κ": "Κ",
|
|
28291
|
-
"Λ": "Λ",
|
|
28292
|
-
"Μ": "Μ",
|
|
28293
|
-
"Ν": "Ν",
|
|
28294
|
-
"Ξ": "Ξ",
|
|
28295
|
-
"Ο": "Ο",
|
|
28296
|
-
"Π": "Π",
|
|
28297
|
-
"Ρ": "Ρ",
|
|
28298
|
-
"Σ": "Σ",
|
|
28299
|
-
"Τ": "Τ",
|
|
28300
|
-
"Υ": "Υ",
|
|
28301
|
-
"Φ": "Φ",
|
|
28302
|
-
"Χ": "Χ",
|
|
28303
|
-
"Ψ": "Ψ",
|
|
28304
|
-
"Ω": "Ω",
|
|
28305
|
-
"α": "α",
|
|
28306
|
-
"β": "β",
|
|
28307
|
-
"γ": "γ",
|
|
28308
|
-
"δ": "δ",
|
|
28309
|
-
"ε": "ε",
|
|
28310
|
-
"ζ": "ζ",
|
|
28311
|
-
"η": "η",
|
|
28312
|
-
"θ": "θ",
|
|
28313
|
-
"ι": "ι",
|
|
28314
|
-
"κ": "κ",
|
|
28315
|
-
"λ": "λ",
|
|
28316
|
-
"μ": "μ",
|
|
28317
|
-
"ν": "ν",
|
|
28318
|
-
"ξ": "ξ",
|
|
28319
|
-
"ο": "ο",
|
|
28320
|
-
"π": "π",
|
|
28321
|
-
"ρ": "ρ",
|
|
28322
|
-
"ς": "ς",
|
|
28323
|
-
"σ": "σ",
|
|
28324
|
-
"τ": "τ",
|
|
28325
|
-
"υ": "υ",
|
|
28326
|
-
"φ": "φ",
|
|
28327
|
-
"χ": "χ",
|
|
28328
|
-
"ψ": "ψ",
|
|
28329
|
-
"ω": "ω",
|
|
28330
|
-
"ϑ": "ϑ",
|
|
28331
|
-
"ϒ": "&Upsih;",
|
|
28332
|
-
"ϖ": "ϖ",
|
|
28333
|
-
"–": "–",
|
|
28334
|
-
"—": "—",
|
|
28335
|
-
"‘": "‘",
|
|
28336
|
-
"’": "’",
|
|
28337
|
-
"‚": "‚",
|
|
28338
|
-
"“": "“",
|
|
28339
|
-
"”": "”",
|
|
28340
|
-
"„": "„",
|
|
28341
|
-
"†": "†",
|
|
28342
|
-
"‡": "‡",
|
|
28343
|
-
"•": "•",
|
|
28344
|
-
"…": "…",
|
|
28345
|
-
"‰": "‰",
|
|
28346
|
-
"′": "′",
|
|
28347
|
-
"″": "″",
|
|
28348
|
-
"‹": "‹",
|
|
28349
|
-
"›": "›",
|
|
28350
|
-
"‾": "‾",
|
|
28351
|
-
"⁄": "⁄",
|
|
28352
|
-
"€": "€",
|
|
28353
|
-
"ℑ": "ℑ",
|
|
28354
|
-
"℘": "℘",
|
|
28355
|
-
"ℜ": "ℜ",
|
|
28356
|
-
"™": "™",
|
|
28357
|
-
"ℵ": "ℵ",
|
|
28358
|
-
"←": "←",
|
|
28359
|
-
"↑": "↑",
|
|
28360
|
-
"→": "→",
|
|
28361
|
-
"↓": "↓",
|
|
28362
|
-
"↔": "↔",
|
|
28363
|
-
"↵": "↵",
|
|
28364
|
-
"⇐": "⇐",
|
|
28365
|
-
"⇑": "&UArr;",
|
|
28366
|
-
"⇒": "⇒",
|
|
28367
|
-
"⇓": "⇓",
|
|
28368
|
-
"⇔": "⇔",
|
|
28369
|
-
"∀": "∀",
|
|
28370
|
-
"∂": "∂",
|
|
28371
|
-
"∃": "∃",
|
|
28372
|
-
"∅": "∅",
|
|
28373
|
-
"∇": "∇",
|
|
28374
|
-
"∈": "∈",
|
|
28375
|
-
"∉": "∉",
|
|
28376
|
-
"∋": "∋",
|
|
28377
|
-
"∏": "∏",
|
|
28378
|
-
"∑": "∑",
|
|
28379
|
-
"−": "−",
|
|
28380
|
-
"∗": "∗",
|
|
28381
|
-
"√": "√",
|
|
28382
|
-
"∝": "∝",
|
|
28383
|
-
"∞": "∞",
|
|
28384
|
-
"∠": "∠",
|
|
28385
|
-
"∧": "∧",
|
|
28386
|
-
"∨": "∨",
|
|
28387
|
-
"∩": "∩",
|
|
28388
|
-
"∪": "∪",
|
|
28389
|
-
"∫": "∫",
|
|
28390
|
-
"∴": "∴",
|
|
28391
|
-
"∼": "∼",
|
|
28392
|
-
"≅": "≅",
|
|
28393
|
-
"≈": "≈",
|
|
28394
|
-
"≠": "≠",
|
|
28395
|
-
"≡": "≡",
|
|
28396
|
-
"≤": "≤",
|
|
28397
|
-
"≥": "≥",
|
|
28398
|
-
"⊂": "⊂",
|
|
28399
|
-
"⊃": "⊃",
|
|
28400
|
-
"⊄": "⊄",
|
|
28401
|
-
"⊆": "⊆",
|
|
28402
|
-
"⊇": "⊇",
|
|
28403
|
-
"⊕": "⊕",
|
|
28404
|
-
"⊗": "⊗",
|
|
28405
|
-
"⊥": "⊥",
|
|
28406
|
-
"⋅": "⋅",
|
|
28407
|
-
"⌈": "⌈",
|
|
28408
|
-
"⌉": "⌉",
|
|
28409
|
-
"⌊": "⌊",
|
|
28410
|
-
"⌋": "⌋",
|
|
28411
|
-
"⟨": "⟨",
|
|
28412
|
-
"⟩": "⟩",
|
|
28413
|
-
"◊": "◊",
|
|
28414
|
-
"♠": "♠",
|
|
28415
|
-
"♣": "♣",
|
|
28416
|
-
"♥": "♥",
|
|
28417
|
-
"♦": "♦"
|
|
28411
|
+
var _useState = React.useState(null),
|
|
28412
|
+
_useState2 = slicedToArray(_useState, 2),
|
|
28413
|
+
selectedChoice = _useState2[0],
|
|
28414
|
+
setSelectedChoice = _useState2[1];
|
|
28415
|
+
|
|
28416
|
+
var _useState3 = React.useState(showVotes),
|
|
28417
|
+
_useState4 = slicedToArray(_useState3, 2),
|
|
28418
|
+
showAnswer = _useState4[0],
|
|
28419
|
+
setShowAnswer = _useState4[1];
|
|
28420
|
+
|
|
28421
|
+
var choices = node.choices,
|
|
28422
|
+
question = node.question,
|
|
28423
|
+
response = node.response;
|
|
28424
|
+
|
|
28425
|
+
|
|
28426
|
+
var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
|
|
28427
|
+
e.preventDefault();
|
|
28428
|
+
onVote(node._key, selectedChoice);
|
|
28429
|
+
setShowAnswer(true);
|
|
28430
|
+
};
|
|
28431
|
+
|
|
28432
|
+
var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
|
|
28433
|
+
acc = acc + parseInt(choice.choiceCount);
|
|
28434
|
+
return acc;
|
|
28435
|
+
}, 0);
|
|
28436
|
+
return React__default.createElement(
|
|
28437
|
+
React__default.Fragment,
|
|
28438
|
+
null,
|
|
28439
|
+
question && React__default.createElement(
|
|
28440
|
+
'p',
|
|
28441
|
+
{ className: 'font-weight-bold' },
|
|
28442
|
+
question
|
|
28443
|
+
),
|
|
28444
|
+
!showAnswer && choices && choices.length > 0 && React__default.createElement(
|
|
28445
|
+
'form',
|
|
28446
|
+
{ onSubmit: function onSubmit(e) {
|
|
28447
|
+
return onSubmitPoll(e, setShowAnswer);
|
|
28448
|
+
} },
|
|
28449
|
+
choices && choices.map(function (choice) {
|
|
28450
|
+
return React__default.createElement(
|
|
28451
|
+
'div',
|
|
28452
|
+
{ key: choice._key },
|
|
28453
|
+
React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
|
|
28454
|
+
return setSelectedChoice(e.target.value);
|
|
28455
|
+
} }),
|
|
28456
|
+
React__default.createElement(
|
|
28457
|
+
'label',
|
|
28458
|
+
{ className: 'pl-2' },
|
|
28459
|
+
choice.choiceText
|
|
28460
|
+
)
|
|
28461
|
+
);
|
|
28462
|
+
}),
|
|
28463
|
+
React__default.createElement(
|
|
28464
|
+
reactBootstrap.Button,
|
|
28465
|
+
{ disabled: !selectedChoice, type: 'submit' },
|
|
28466
|
+
'Vote'
|
|
28467
|
+
)
|
|
28468
|
+
),
|
|
28469
|
+
React__default.createElement(
|
|
28470
|
+
'div',
|
|
28471
|
+
{ className: 'progress-container' },
|
|
28472
|
+
showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
|
|
28473
|
+
var percentage = choicesTotalCount && choicesTotalCount > 0 ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0;
|
|
28474
|
+
return React__default.createElement(
|
|
28475
|
+
'div',
|
|
28476
|
+
{ key: choice._key, className: 'mb-3' },
|
|
28477
|
+
React__default.createElement(
|
|
28478
|
+
'span',
|
|
28479
|
+
null,
|
|
28480
|
+
choice.choiceText
|
|
28481
|
+
),
|
|
28482
|
+
React__default.createElement(reactBootstrap.ProgressBar, { now: percentage }),
|
|
28483
|
+
React__default.createElement(
|
|
28484
|
+
'span',
|
|
28485
|
+
{ className: 'float-right' },
|
|
28486
|
+
percentage,
|
|
28487
|
+
'% (',
|
|
28488
|
+
choice.choiceCount,
|
|
28489
|
+
' Votes)'
|
|
28490
|
+
)
|
|
28491
|
+
);
|
|
28492
|
+
})
|
|
28493
|
+
),
|
|
28494
|
+
showAnswer && React__default.createElement(
|
|
28495
|
+
'h4',
|
|
28496
|
+
{ className: 'text-center small p-3' },
|
|
28497
|
+
'Total Votes: ',
|
|
28498
|
+
choicesTotalCount
|
|
28499
|
+
),
|
|
28500
|
+
showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers$1(client, pageview, videoAccountIDs) }),
|
|
28501
|
+
React__default.createElement(
|
|
28502
|
+
'style',
|
|
28503
|
+
{ jsx: 'true' },
|
|
28504
|
+
'\n .progress-bar {\n color: #fff;\n }\n '
|
|
28505
|
+
)
|
|
28506
|
+
);
|
|
28418
28507
|
};
|
|
28419
28508
|
|
|
28420
|
-
var
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28509
|
+
var numberOfPaginations = main_35 ? 4 : 10;
|
|
28510
|
+
|
|
28511
|
+
var Quiz = function Quiz(_ref) {
|
|
28512
|
+
var quizzes = _ref.quizzes,
|
|
28513
|
+
serializerArguments = _ref.serializerArguments;
|
|
28514
|
+
|
|
28515
|
+
var pageCount = quizzes.length;
|
|
28516
|
+
|
|
28517
|
+
var _useState = React.useState(1),
|
|
28518
|
+
_useState2 = slicedToArray(_useState, 2),
|
|
28519
|
+
currentPage = _useState2[0],
|
|
28520
|
+
setCurrentPage = _useState2[1];
|
|
28521
|
+
|
|
28522
|
+
var _useState3 = React.useState(false),
|
|
28523
|
+
_useState4 = slicedToArray(_useState3, 2),
|
|
28524
|
+
showAnswer = _useState4[0],
|
|
28525
|
+
setShowAnswer = _useState4[1];
|
|
28526
|
+
|
|
28527
|
+
var _useState5 = React.useState(0),
|
|
28528
|
+
_useState6 = slicedToArray(_useState5, 2),
|
|
28529
|
+
startIndex = _useState6[0],
|
|
28530
|
+
setStartIndex = _useState6[1];
|
|
28531
|
+
|
|
28532
|
+
var _useState7 = React.useState(numberOfPaginations - 1),
|
|
28533
|
+
_useState8 = slicedToArray(_useState7, 2),
|
|
28534
|
+
endIndex = _useState8[0],
|
|
28535
|
+
setEndIndex = _useState8[1];
|
|
28536
|
+
|
|
28537
|
+
var _useState9 = React.useState([]),
|
|
28538
|
+
_useState10 = slicedToArray(_useState9, 2),
|
|
28539
|
+
pages = _useState10[0],
|
|
28540
|
+
setPages = _useState10[1];
|
|
28541
|
+
|
|
28542
|
+
React.useEffect(function () {
|
|
28543
|
+
var totalPages = Array.from({ length: pageCount }, function (v, k) {
|
|
28544
|
+
return k + 1;
|
|
28545
|
+
});
|
|
28546
|
+
var filteredPages = totalPages.slice(startIndex, endIndex + 1);
|
|
28547
|
+
setPages(filteredPages);
|
|
28548
|
+
}, [startIndex, endIndex, pageCount]);
|
|
28549
|
+
|
|
28550
|
+
var validateIndex = function validateIndex(index) {
|
|
28551
|
+
return index >= 0 && index <= pageCount - 1;
|
|
28552
|
+
};
|
|
28553
|
+
|
|
28554
|
+
var changePage = function changePage(control) {
|
|
28555
|
+
setShowAnswer(false);
|
|
28556
|
+
switch (control) {
|
|
28557
|
+
case 'first':
|
|
28558
|
+
setCurrentPage(1);
|
|
28559
|
+
setStartIndex(0);
|
|
28560
|
+
setEndIndex(numberOfPaginations - 1);
|
|
28561
|
+
break;
|
|
28562
|
+
case 'last':
|
|
28563
|
+
setCurrentPage(pageCount);
|
|
28564
|
+
setStartIndex(pageCount - pageCount % numberOfPaginations);
|
|
28565
|
+
setEndIndex(pageCount - pageCount % numberOfPaginations + numberOfPaginations - 1);
|
|
28566
|
+
break;
|
|
28567
|
+
case 'next':
|
|
28568
|
+
setCurrentPage(currentPage + 1);
|
|
28569
|
+
if (currentPage % numberOfPaginations === 0) {
|
|
28570
|
+
setStartIndex(startIndex + numberOfPaginations);
|
|
28571
|
+
setEndIndex(endIndex + numberOfPaginations);
|
|
28572
|
+
}
|
|
28573
|
+
break;
|
|
28574
|
+
case 'prev':
|
|
28575
|
+
setCurrentPage(currentPage - 1);
|
|
28576
|
+
if (currentPage % numberOfPaginations === 1) {
|
|
28577
|
+
setStartIndex(startIndex - numberOfPaginations);
|
|
28578
|
+
setEndIndex(endIndex - numberOfPaginations);
|
|
28579
|
+
}
|
|
28580
|
+
break;
|
|
28581
|
+
default:
|
|
28582
|
+
setCurrentPage(control);
|
|
28426
28583
|
}
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
|
|
28584
|
+
};
|
|
28585
|
+
|
|
28586
|
+
var renderNewPages = function renderNewPages(section) {
|
|
28587
|
+
if (section === 'prev') {
|
|
28588
|
+
setStartIndex(startIndex - numberOfPaginations);
|
|
28589
|
+
setEndIndex(endIndex - numberOfPaginations);
|
|
28590
|
+
} else if (section === 'next') {
|
|
28591
|
+
setStartIndex(startIndex + numberOfPaginations);
|
|
28592
|
+
setEndIndex(endIndex + numberOfPaginations);
|
|
28593
|
+
}
|
|
28594
|
+
};
|
|
28595
|
+
|
|
28596
|
+
var renderPagination = function renderPagination() {
|
|
28597
|
+
return React__default.createElement(
|
|
28598
|
+
Pagination,
|
|
28599
|
+
{ className: 'p-0 m-0', size: main_35 && 'sm' },
|
|
28600
|
+
React__default.createElement(Pagination.First, { onClick: function onClick() {
|
|
28601
|
+
return changePage('first');
|
|
28602
|
+
}, disabled: currentPage === 1 }),
|
|
28603
|
+
React__default.createElement(Pagination.Prev, { onClick: function onClick() {
|
|
28604
|
+
return changePage('prev');
|
|
28605
|
+
}, disabled: currentPage === 1 }),
|
|
28606
|
+
React__default.createElement(Pagination.Ellipsis, { onClick: function onClick() {
|
|
28607
|
+
return renderNewPages('prev');
|
|
28608
|
+
}, disabled: !validateIndex(startIndex - numberOfPaginations) }),
|
|
28609
|
+
pages.map(function (page) {
|
|
28610
|
+
return React__default.createElement(
|
|
28611
|
+
Pagination.Item,
|
|
28612
|
+
{ key: page, active: page === currentPage, onClick: function onClick() {
|
|
28613
|
+
return changePage(page);
|
|
28614
|
+
} },
|
|
28615
|
+
page
|
|
28616
|
+
);
|
|
28617
|
+
}),
|
|
28618
|
+
React__default.createElement(Pagination.Ellipsis, { onClick: function onClick() {
|
|
28619
|
+
return renderNewPages('next');
|
|
28620
|
+
}, disabled: !validateIndex(startIndex + numberOfPaginations) }),
|
|
28621
|
+
React__default.createElement(Pagination.Next, { onClick: function onClick() {
|
|
28622
|
+
return changePage('next');
|
|
28623
|
+
}, disabled: currentPage === pageCount }),
|
|
28624
|
+
React__default.createElement(Pagination.Last, { onClick: function onClick() {
|
|
28625
|
+
return changePage('last');
|
|
28626
|
+
}, disabled: currentPage === pageCount })
|
|
28627
|
+
);
|
|
28628
|
+
};
|
|
28629
|
+
|
|
28630
|
+
return React__default.createElement(
|
|
28631
|
+
React__default.Fragment,
|
|
28632
|
+
null,
|
|
28633
|
+
quizzes[currentPage - 1] && React__default.createElement(BlockContent, { blocks: quizzes[currentPage - 1].question, serializers: getSerializers$1(serializerArguments) }),
|
|
28634
|
+
!showAnswer && React__default.createElement(
|
|
28635
|
+
Button,
|
|
28636
|
+
{ onClick: function onClick() {
|
|
28637
|
+
return setShowAnswer(true);
|
|
28638
|
+
}, variant: 'info', block: true },
|
|
28639
|
+
'Please click here for answer'
|
|
28640
|
+
),
|
|
28641
|
+
quizzes[currentPage - 1] && showAnswer && React__default.createElement(
|
|
28642
|
+
React__default.Fragment,
|
|
28643
|
+
null,
|
|
28644
|
+
React__default.createElement(
|
|
28645
|
+
'h4',
|
|
28646
|
+
null,
|
|
28647
|
+
'Answer:'
|
|
28648
|
+
),
|
|
28649
|
+
React__default.createElement(BlockContent, { blocks: quizzes[currentPage - 1].answer, serializers: getSerializers$1(serializerArguments) })
|
|
28650
|
+
),
|
|
28651
|
+
React__default.createElement('br', null),
|
|
28652
|
+
pageCount > 1 && React__default.createElement(
|
|
28653
|
+
'div',
|
|
28654
|
+
{ className: 'd-flex justify-content-center' },
|
|
28655
|
+
renderPagination()
|
|
28656
|
+
)
|
|
28657
|
+
);
|
|
28658
|
+
};
|
|
28659
|
+
|
|
28660
|
+
var Leads = function Leads(_ref) {
|
|
28661
|
+
var url = _ref.url;
|
|
28662
|
+
|
|
28663
|
+
return React__default.createElement(
|
|
28664
|
+
'div',
|
|
28665
|
+
{ className: 'd-block text-center mb-3' },
|
|
28666
|
+
url && React__default.createElement('iframe', { className: 'w-100 h-100 leads-block', scrolling: 'no', src: url, frameBorder: '0', allow: 'fullscreen' })
|
|
28667
|
+
);
|
|
28430
28668
|
};
|
|
28431
|
-
var html_decode_1 = html_decode;
|
|
28432
28669
|
|
|
28433
28670
|
var urlFor$3 = function urlFor(source, builder) {
|
|
28434
28671
|
return builder.image(source);
|
|
@@ -29065,7 +29302,7 @@ var Hero = function Hero(_ref) {
|
|
|
29065
29302
|
summary && React__default.createElement(
|
|
29066
29303
|
reactBootstrap.Card.Footer,
|
|
29067
29304
|
{ className: 'h6' },
|
|
29068
|
-
summary
|
|
29305
|
+
clean_html_1(summary)
|
|
29069
29306
|
)
|
|
29070
29307
|
)
|
|
29071
29308
|
)
|
|
@@ -29687,7 +29924,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
|
|
|
29687
29924
|
React__default.createElement(
|
|
29688
29925
|
'p',
|
|
29689
29926
|
null,
|
|
29690
|
-
topArticle.summary
|
|
29927
|
+
clean_html_1(topArticle.summary)
|
|
29691
29928
|
)
|
|
29692
29929
|
)
|
|
29693
29930
|
)
|
|
@@ -29849,7 +30086,7 @@ var YahooHero = function YahooHero(props) {
|
|
|
29849
30086
|
React__default.createElement(
|
|
29850
30087
|
'p',
|
|
29851
30088
|
null,
|
|
29852
|
-
topArticle.summary
|
|
30089
|
+
clean_html_1(topArticle.summary)
|
|
29853
30090
|
)
|
|
29854
30091
|
)
|
|
29855
30092
|
)
|