@mjhls/mjh-framework 1.0.122 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -28,7 +28,6 @@ var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
28
28
  var Nav = _interopDefault(require('react-bootstrap/Nav'));
29
29
  var Navbar = _interopDefault(require('react-bootstrap/Navbar'));
30
30
  var NavDropdown = _interopDefault(require('react-bootstrap/NavDropdown'));
31
- var ReactPlayer = _interopDefault(require('react-player'));
32
31
  var Pagination = _interopDefault(require('react-bootstrap/Pagination'));
33
32
  var Carousel = _interopDefault(require('react-bootstrap/Carousel'));
34
33
  var Breadcrumb = _interopDefault(require('react-bootstrap/Breadcrumb'));
@@ -20375,6 +20374,4481 @@ var Video = function Video(_ref) {
20375
20374
  return null;
20376
20375
  };
20377
20376
 
20377
+ var props = createCommonjsModule(function (module, exports) {
20378
+
20379
+ Object.defineProperty(exports, "__esModule", {
20380
+ value: true
20381
+ });
20382
+ exports.DEPRECATED_CONFIG_PROPS = exports.defaultProps = exports.propTypes = void 0;
20383
+
20384
+ var _propTypes = _interopRequireDefault(PropTypes);
20385
+
20386
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20387
+
20388
+ var string = _propTypes["default"].string,
20389
+ bool = _propTypes["default"].bool,
20390
+ number = _propTypes["default"].number,
20391
+ array = _propTypes["default"].array,
20392
+ oneOfType = _propTypes["default"].oneOfType,
20393
+ shape = _propTypes["default"].shape,
20394
+ object = _propTypes["default"].object,
20395
+ func = _propTypes["default"].func,
20396
+ node = _propTypes["default"].node;
20397
+ var propTypes = {
20398
+ url: oneOfType([string, array, object]),
20399
+ playing: bool,
20400
+ loop: bool,
20401
+ controls: bool,
20402
+ volume: number,
20403
+ muted: bool,
20404
+ playbackRate: number,
20405
+ width: oneOfType([string, number]),
20406
+ height: oneOfType([string, number]),
20407
+ style: object,
20408
+ progressInterval: number,
20409
+ playsinline: bool,
20410
+ pip: bool,
20411
+ light: oneOfType([bool, string]),
20412
+ playIcon: node,
20413
+ wrapper: oneOfType([string, func, shape({
20414
+ render: func.isRequired
20415
+ })]),
20416
+ config: shape({
20417
+ soundcloud: shape({
20418
+ options: object,
20419
+ preload: bool
20420
+ }),
20421
+ youtube: shape({
20422
+ playerVars: object,
20423
+ embedOptions: object,
20424
+ preload: bool
20425
+ }),
20426
+ facebook: shape({
20427
+ appId: string,
20428
+ version: string,
20429
+ playerId: string
20430
+ }),
20431
+ dailymotion: shape({
20432
+ params: object,
20433
+ preload: bool
20434
+ }),
20435
+ vimeo: shape({
20436
+ playerOptions: object,
20437
+ preload: bool
20438
+ }),
20439
+ file: shape({
20440
+ attributes: object,
20441
+ tracks: array,
20442
+ forceVideo: bool,
20443
+ forceAudio: bool,
20444
+ forceHLS: bool,
20445
+ forceDASH: bool,
20446
+ hlsOptions: object,
20447
+ hlsVersion: string,
20448
+ dashVersion: string
20449
+ }),
20450
+ wistia: shape({
20451
+ options: object
20452
+ }),
20453
+ mixcloud: shape({
20454
+ options: object
20455
+ }),
20456
+ twitch: shape({
20457
+ options: object,
20458
+ playerId: string
20459
+ })
20460
+ }),
20461
+ onReady: func,
20462
+ onStart: func,
20463
+ onPlay: func,
20464
+ onPause: func,
20465
+ onBuffer: func,
20466
+ onBufferEnd: func,
20467
+ onEnded: func,
20468
+ onError: func,
20469
+ onDuration: func,
20470
+ onSeek: func,
20471
+ onProgress: func,
20472
+ onEnablePIP: func,
20473
+ onDisablePIP: func
20474
+ };
20475
+ exports.propTypes = propTypes;
20476
+ var defaultProps = {
20477
+ playing: false,
20478
+ loop: false,
20479
+ controls: false,
20480
+ volume: null,
20481
+ muted: false,
20482
+ playbackRate: 1,
20483
+ width: '640px',
20484
+ height: '360px',
20485
+ style: {},
20486
+ progressInterval: 1000,
20487
+ playsinline: false,
20488
+ pip: false,
20489
+ light: false,
20490
+ wrapper: 'div',
20491
+ config: {
20492
+ soundcloud: {
20493
+ options: {
20494
+ visual: true,
20495
+ // Undocumented, but makes player fill container and look better
20496
+ buying: false,
20497
+ liking: false,
20498
+ download: false,
20499
+ sharing: false,
20500
+ show_comments: false,
20501
+ show_playcount: false
20502
+ }
20503
+ },
20504
+ youtube: {
20505
+ playerVars: {
20506
+ playsinline: 1,
20507
+ showinfo: 0,
20508
+ rel: 0,
20509
+ iv_load_policy: 3,
20510
+ modestbranding: 1
20511
+ },
20512
+ embedOptions: {},
20513
+ preload: false
20514
+ },
20515
+ facebook: {
20516
+ appId: '1309697205772819',
20517
+ version: 'v3.3',
20518
+ playerId: null
20519
+ },
20520
+ dailymotion: {
20521
+ params: {
20522
+ api: 1,
20523
+ 'endscreen-enable': false
20524
+ },
20525
+ preload: false
20526
+ },
20527
+ vimeo: {
20528
+ playerOptions: {
20529
+ autopause: false,
20530
+ byline: false,
20531
+ portrait: false,
20532
+ title: false
20533
+ },
20534
+ preload: false
20535
+ },
20536
+ file: {
20537
+ attributes: {},
20538
+ tracks: [],
20539
+ forceVideo: false,
20540
+ forceAudio: false,
20541
+ forceHLS: false,
20542
+ forceDASH: false,
20543
+ hlsOptions: {},
20544
+ hlsVersion: '0.13.1',
20545
+ dashVersion: '2.9.2'
20546
+ },
20547
+ wistia: {
20548
+ options: {}
20549
+ },
20550
+ mixcloud: {
20551
+ options: {
20552
+ hide_cover: 1
20553
+ }
20554
+ },
20555
+ twitch: {
20556
+ options: {},
20557
+ playerId: null
20558
+ }
20559
+ },
20560
+ onReady: function onReady() {},
20561
+ onStart: function onStart() {},
20562
+ onPlay: function onPlay() {},
20563
+ onPause: function onPause() {},
20564
+ onBuffer: function onBuffer() {},
20565
+ onBufferEnd: function onBufferEnd() {},
20566
+ onEnded: function onEnded() {},
20567
+ onError: function onError() {},
20568
+ onDuration: function onDuration() {},
20569
+ onSeek: function onSeek() {},
20570
+ onProgress: function onProgress() {},
20571
+ onEnablePIP: function onEnablePIP() {},
20572
+ onDisablePIP: function onDisablePIP() {}
20573
+ };
20574
+ exports.defaultProps = defaultProps;
20575
+ var DEPRECATED_CONFIG_PROPS = ['soundcloudConfig', 'youtubeConfig', 'facebookConfig', 'dailymotionConfig', 'vimeoConfig', 'fileConfig', 'wistiaConfig'];
20576
+ exports.DEPRECATED_CONFIG_PROPS = DEPRECATED_CONFIG_PROPS;
20577
+ });
20578
+
20579
+ unwrapExports(props);
20580
+ var props_1 = props.DEPRECATED_CONFIG_PROPS;
20581
+ var props_2 = props.defaultProps;
20582
+ var props_3 = props.propTypes;
20583
+
20584
+ var isMergeableObject = function isMergeableObject(value) {
20585
+ return isNonNullObject(value)
20586
+ && !isSpecial(value)
20587
+ };
20588
+
20589
+ function isNonNullObject(value) {
20590
+ return !!value && typeof value === 'object'
20591
+ }
20592
+
20593
+ function isSpecial(value) {
20594
+ var stringValue = Object.prototype.toString.call(value);
20595
+
20596
+ return stringValue === '[object RegExp]'
20597
+ || stringValue === '[object Date]'
20598
+ || isReactElement(value)
20599
+ }
20600
+
20601
+ // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
20602
+ var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
20603
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
20604
+
20605
+ function isReactElement(value) {
20606
+ return value.$$typeof === REACT_ELEMENT_TYPE
20607
+ }
20608
+
20609
+ function emptyTarget(val) {
20610
+ return Array.isArray(val) ? [] : {}
20611
+ }
20612
+
20613
+ function cloneUnlessOtherwiseSpecified(value, options) {
20614
+ return (options.clone !== false && options.isMergeableObject(value))
20615
+ ? deepmerge(emptyTarget(value), value, options)
20616
+ : value
20617
+ }
20618
+
20619
+ function defaultArrayMerge(target, source, options) {
20620
+ return target.concat(source).map(function(element) {
20621
+ return cloneUnlessOtherwiseSpecified(element, options)
20622
+ })
20623
+ }
20624
+
20625
+ function getMergeFunction(key, options) {
20626
+ if (!options.customMerge) {
20627
+ return deepmerge
20628
+ }
20629
+ var customMerge = options.customMerge(key);
20630
+ return typeof customMerge === 'function' ? customMerge : deepmerge
20631
+ }
20632
+
20633
+ function getEnumerableOwnPropertySymbols(target) {
20634
+ return Object.getOwnPropertySymbols
20635
+ ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
20636
+ return target.propertyIsEnumerable(symbol)
20637
+ })
20638
+ : []
20639
+ }
20640
+
20641
+ function getKeys(target) {
20642
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
20643
+ }
20644
+
20645
+ function propertyIsOnObject(object, property) {
20646
+ try {
20647
+ return property in object
20648
+ } catch(_) {
20649
+ return false
20650
+ }
20651
+ }
20652
+
20653
+ // Protects from prototype poisoning and unexpected merging up the prototype chain.
20654
+ function propertyIsUnsafe(target, key) {
20655
+ return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
20656
+ && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
20657
+ && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
20658
+ }
20659
+
20660
+ function mergeObject(target, source, options) {
20661
+ var destination = {};
20662
+ if (options.isMergeableObject(target)) {
20663
+ getKeys(target).forEach(function(key) {
20664
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
20665
+ });
20666
+ }
20667
+ getKeys(source).forEach(function(key) {
20668
+ if (propertyIsUnsafe(target, key)) {
20669
+ return
20670
+ }
20671
+
20672
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
20673
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
20674
+ } else {
20675
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
20676
+ }
20677
+ });
20678
+ return destination
20679
+ }
20680
+
20681
+ function deepmerge(target, source, options) {
20682
+ options = options || {};
20683
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
20684
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
20685
+ // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
20686
+ // implementations can use it. The caller may not replace it.
20687
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
20688
+
20689
+ var sourceIsArray = Array.isArray(source);
20690
+ var targetIsArray = Array.isArray(target);
20691
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
20692
+
20693
+ if (!sourceAndTargetTypesMatch) {
20694
+ return cloneUnlessOtherwiseSpecified(source, options)
20695
+ } else if (sourceIsArray) {
20696
+ return options.arrayMerge(target, source, options)
20697
+ } else {
20698
+ return mergeObject(target, source, options)
20699
+ }
20700
+ }
20701
+
20702
+ deepmerge.all = function deepmergeAll(array, options) {
20703
+ if (!Array.isArray(array)) {
20704
+ throw new Error('first argument should be an array')
20705
+ }
20706
+
20707
+ return array.reduce(function(prev, next) {
20708
+ return deepmerge(prev, next, options)
20709
+ }, {})
20710
+ };
20711
+
20712
+ var deepmerge_1 = deepmerge;
20713
+
20714
+ var cjs = deepmerge_1;
20715
+
20716
+ var utils$2 = createCommonjsModule(function (module, exports) {
20717
+
20718
+ Object.defineProperty(exports, "__esModule", {
20719
+ value: true
20720
+ });
20721
+ exports.parseStartTime = parseStartTime;
20722
+ exports.parseEndTime = parseEndTime;
20723
+ exports.randomString = randomString;
20724
+ exports.queryString = queryString;
20725
+ exports.getSDK = getSDK;
20726
+ exports.getConfig = getConfig;
20727
+ exports.omit = omit;
20728
+ exports.callPlayer = callPlayer;
20729
+ exports.isObject = isObject;
20730
+ exports.isEqual = isEqual;
20731
+ exports.isMediaStream = isMediaStream;
20732
+
20733
+
20734
+
20735
+ var _loadScript = _interopRequireDefault(loadScript);
20736
+
20737
+ var _deepmerge = _interopRequireDefault(cjs);
20738
+
20739
+
20740
+
20741
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20742
+
20743
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
20744
+
20745
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20746
+
20747
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
20748
+
20749
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
20750
+
20751
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
20752
+
20753
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20754
+
20755
+ var MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/;
20756
+ var MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/;
20757
+ var MATCH_START_STAMP = /(\d+)(h|m|s)/g;
20758
+ var MATCH_NUMERIC = /^\d+$/; // Parse YouTube URL for a start time param, ie ?t=1h14m30s
20759
+ // and return the start time in seconds
20760
+
20761
+ function parseTimeParam(url, pattern) {
20762
+ var match = url.match(pattern);
20763
+
20764
+ if (match) {
20765
+ var stamp = match[1];
20766
+
20767
+ if (stamp.match(MATCH_START_STAMP)) {
20768
+ return parseTimeString(stamp);
20769
+ }
20770
+
20771
+ if (MATCH_NUMERIC.test(stamp)) {
20772
+ return parseInt(stamp);
20773
+ }
20774
+ }
20775
+
20776
+ return undefined;
20777
+ }
20778
+
20779
+ function parseTimeString(stamp) {
20780
+ var seconds = 0;
20781
+ var array = MATCH_START_STAMP.exec(stamp);
20782
+
20783
+ while (array !== null) {
20784
+ var _array = array,
20785
+ _array2 = _slicedToArray(_array, 3),
20786
+ count = _array2[1],
20787
+ period = _array2[2];
20788
+
20789
+ if (period === 'h') seconds += parseInt(count, 10) * 60 * 60;
20790
+ if (period === 'm') seconds += parseInt(count, 10) * 60;
20791
+ if (period === 's') seconds += parseInt(count, 10);
20792
+ array = MATCH_START_STAMP.exec(stamp);
20793
+ }
20794
+
20795
+ return seconds;
20796
+ }
20797
+
20798
+ function parseStartTime(url) {
20799
+ return parseTimeParam(url, MATCH_START_QUERY);
20800
+ }
20801
+
20802
+ function parseEndTime(url) {
20803
+ return parseTimeParam(url, MATCH_END_QUERY);
20804
+ } // http://stackoverflow.com/a/38622545
20805
+
20806
+
20807
+ function randomString() {
20808
+ return Math.random().toString(36).substr(2, 5);
20809
+ }
20810
+
20811
+ function queryString(object) {
20812
+ return Object.keys(object).map(function (key) {
20813
+ return "".concat(key, "=").concat(object[key]);
20814
+ }).join('&');
20815
+ } // Util function to load an external SDK
20816
+ // or return the SDK if it is already loaded
20817
+
20818
+
20819
+ var requests = {};
20820
+
20821
+ function getSDK(url, sdkGlobal) {
20822
+ var sdkReady = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
20823
+ var isLoaded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
20824
+ return true;
20825
+ };
20826
+ var fetchScript = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _loadScript["default"];
20827
+
20828
+ if (window[sdkGlobal] && isLoaded(window[sdkGlobal])) {
20829
+ return Promise.resolve(window[sdkGlobal]);
20830
+ }
20831
+
20832
+ return new Promise(function (resolve, reject) {
20833
+ // If we are already loading the SDK, add the resolve and reject
20834
+ // functions to the existing array of requests
20835
+ if (requests[url]) {
20836
+ requests[url].push({
20837
+ resolve: resolve,
20838
+ reject: reject
20839
+ });
20840
+ return;
20841
+ }
20842
+
20843
+ requests[url] = [{
20844
+ resolve: resolve,
20845
+ reject: reject
20846
+ }];
20847
+
20848
+ var onLoaded = function onLoaded(sdk) {
20849
+ // When loaded, resolve all pending request promises
20850
+ requests[url].forEach(function (request) {
20851
+ return request.resolve(sdk);
20852
+ });
20853
+ };
20854
+
20855
+ if (sdkReady) {
20856
+ var previousOnReady = window[sdkReady];
20857
+
20858
+ window[sdkReady] = function () {
20859
+ if (previousOnReady) previousOnReady();
20860
+ onLoaded(window[sdkGlobal]);
20861
+ };
20862
+ }
20863
+
20864
+ fetchScript(url, function (err) {
20865
+ if (err) {
20866
+ // Loading the SDK failed – reject all requests and
20867
+ // reset the array of requests for this SDK
20868
+ requests[url].forEach(function (request) {
20869
+ return request.reject(err);
20870
+ });
20871
+ requests[url] = null;
20872
+ } else if (!sdkReady) {
20873
+ onLoaded(window[sdkGlobal]);
20874
+ }
20875
+ });
20876
+ });
20877
+ }
20878
+
20879
+ function getConfig(props$$1, defaultProps, showWarning) {
20880
+ var config = (0, _deepmerge["default"])(defaultProps.config, props$$1.config);
20881
+ var _iteratorNormalCompletion = true;
20882
+ var _didIteratorError = false;
20883
+ var _iteratorError = undefined;
20884
+
20885
+ try {
20886
+ for (var _iterator = props.DEPRECATED_CONFIG_PROPS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
20887
+ var p = _step.value;
20888
+
20889
+ if (props$$1[p]) {
20890
+ var key = p.replace(/Config$/, '');
20891
+ config = (0, _deepmerge["default"])(config, _defineProperty({}, key, props$$1[p]));
20892
+
20893
+ if (showWarning) {
20894
+ var link = 'https://github.com/CookPete/react-player#config-prop';
20895
+ var message = "ReactPlayer: %c".concat(p, " %cis deprecated, please use the config prop instead \u2013 ").concat(link);
20896
+ console.warn(message, 'font-weight: bold', '');
20897
+ }
20898
+ }
20899
+ }
20900
+ } catch (err) {
20901
+ _didIteratorError = true;
20902
+ _iteratorError = err;
20903
+ } finally {
20904
+ try {
20905
+ if (!_iteratorNormalCompletion && _iterator["return"] != null) {
20906
+ _iterator["return"]();
20907
+ }
20908
+ } finally {
20909
+ if (_didIteratorError) {
20910
+ throw _iteratorError;
20911
+ }
20912
+ }
20913
+ }
20914
+
20915
+ return config;
20916
+ }
20917
+
20918
+ function omit(object) {
20919
+ var _ref;
20920
+
20921
+ for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
20922
+ arrays[_key - 1] = arguments[_key];
20923
+ }
20924
+
20925
+ var omitKeys = (_ref = []).concat.apply(_ref, arrays);
20926
+
20927
+ var output = {};
20928
+ var keys = Object.keys(object);
20929
+
20930
+ for (var _i2 = 0, _keys = keys; _i2 < _keys.length; _i2++) {
20931
+ var key = _keys[_i2];
20932
+
20933
+ if (omitKeys.indexOf(key) === -1) {
20934
+ output[key] = object[key];
20935
+ }
20936
+ }
20937
+
20938
+ return output;
20939
+ }
20940
+
20941
+ function callPlayer(method) {
20942
+ var _this$player;
20943
+
20944
+ // Util method for calling a method on this.player
20945
+ // but guard against errors and console.warn instead
20946
+ if (!this.player || !this.player[method]) {
20947
+ var message = "ReactPlayer: ".concat(this.constructor.displayName, " player could not call %c").concat(method, "%c \u2013 ");
20948
+
20949
+ if (!this.player) {
20950
+ message += 'The player was not available';
20951
+ } else if (!this.player[method]) {
20952
+ message += 'The method was not available';
20953
+ }
20954
+
20955
+ console.warn(message, 'font-weight: bold', '');
20956
+ return null;
20957
+ }
20958
+
20959
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
20960
+ args[_key2 - 1] = arguments[_key2];
20961
+ }
20962
+
20963
+ return (_this$player = this.player)[method].apply(_this$player, args);
20964
+ }
20965
+
20966
+ function isObject(val) {
20967
+ return val !== null && _typeof(val) === 'object';
20968
+ } // Deep comparison of two objects, but ignoring functions
20969
+ // and React elements, for use in shouldComponentUpdate
20970
+
20971
+
20972
+ function isEqual(a, b) {
20973
+ if (typeof a === 'function' && typeof b === 'function') {
20974
+ return true;
20975
+ }
20976
+
20977
+ if ((0, React__default.isValidElement)(a) && (0, React__default.isValidElement)(b)) {
20978
+ return true;
20979
+ }
20980
+
20981
+ if (a instanceof Array && b instanceof Array) {
20982
+ if (a.length !== b.length) {
20983
+ return false;
20984
+ }
20985
+
20986
+ for (var i = 0; i !== a.length; i++) {
20987
+ if (!isEqual(a[i], b[i])) {
20988
+ return false;
20989
+ }
20990
+ }
20991
+
20992
+ return true;
20993
+ }
20994
+
20995
+ if (isObject(a) && isObject(b)) {
20996
+ if (Object.keys(a).length !== Object.keys(b).length) {
20997
+ return false;
20998
+ }
20999
+
21000
+ for (var _i3 = 0, _Object$keys = Object.keys(a); _i3 < _Object$keys.length; _i3++) {
21001
+ var key = _Object$keys[_i3];
21002
+
21003
+ if (!isEqual(a[key], b[key])) {
21004
+ return false;
21005
+ }
21006
+ }
21007
+
21008
+ return true;
21009
+ }
21010
+
21011
+ return a === b;
21012
+ }
21013
+
21014
+ function isMediaStream(url) {
21015
+ return typeof window !== 'undefined' && typeof window.MediaStream !== 'undefined' && url instanceof window.MediaStream;
21016
+ }
21017
+ });
21018
+
21019
+ unwrapExports(utils$2);
21020
+ var utils_1$1 = utils$2.parseStartTime;
21021
+ var utils_2 = utils$2.parseEndTime;
21022
+ var utils_3 = utils$2.randomString;
21023
+ var utils_4 = utils$2.queryString;
21024
+ var utils_5 = utils$2.getSDK;
21025
+ var utils_6 = utils$2.getConfig;
21026
+ var utils_7 = utils$2.omit;
21027
+ var utils_8 = utils$2.callPlayer;
21028
+ var utils_9 = utils$2.isObject;
21029
+ var utils_10 = utils$2.isEqual;
21030
+ var utils_11 = utils$2.isMediaStream;
21031
+
21032
+ var Player_1 = createCommonjsModule(function (module, exports) {
21033
+
21034
+ Object.defineProperty(exports, "__esModule", {
21035
+ value: true
21036
+ });
21037
+ exports["default"] = void 0;
21038
+
21039
+ var _react = _interopRequireWildcard(React__default);
21040
+
21041
+
21042
+
21043
+
21044
+
21045
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21046
+
21047
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21048
+
21049
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
21050
+
21051
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21052
+
21053
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21054
+
21055
+ function _defineProperties(target, props$$1) { for (var i = 0; i < props$$1.length; i++) { var descriptor = props$$1[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
21056
+
21057
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21058
+
21059
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
21060
+
21061
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21062
+
21063
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21064
+
21065
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
21066
+
21067
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21068
+
21069
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21070
+
21071
+ var SEEK_ON_PLAY_EXPIRY = 5000;
21072
+
21073
+ var Player =
21074
+ /*#__PURE__*/
21075
+ function (_Component) {
21076
+ _inherits(Player, _Component);
21077
+
21078
+ function Player() {
21079
+ var _getPrototypeOf2;
21080
+
21081
+ var _this;
21082
+
21083
+ _classCallCheck(this, Player);
21084
+
21085
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
21086
+ _args[_key] = arguments[_key];
21087
+ }
21088
+
21089
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Player)).call.apply(_getPrototypeOf2, [this].concat(_args)));
21090
+
21091
+ _defineProperty(_assertThisInitialized(_this), "mounted", false);
21092
+
21093
+ _defineProperty(_assertThisInitialized(_this), "isReady", false);
21094
+
21095
+ _defineProperty(_assertThisInitialized(_this), "isPlaying", false);
21096
+
21097
+ _defineProperty(_assertThisInitialized(_this), "isLoading", true);
21098
+
21099
+ _defineProperty(_assertThisInitialized(_this), "loadOnReady", null);
21100
+
21101
+ _defineProperty(_assertThisInitialized(_this), "startOnPlay", true);
21102
+
21103
+ _defineProperty(_assertThisInitialized(_this), "seekOnPlay", null);
21104
+
21105
+ _defineProperty(_assertThisInitialized(_this), "onDurationCalled", false);
21106
+
21107
+ _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function (key) {
21108
+ if (!_this.player) return null;
21109
+ return _this.player[key];
21110
+ });
21111
+
21112
+ _defineProperty(_assertThisInitialized(_this), "progress", function () {
21113
+ if (_this.props.url && _this.player && _this.isReady) {
21114
+ var playedSeconds = _this.getCurrentTime() || 0;
21115
+
21116
+ var loadedSeconds = _this.getSecondsLoaded();
21117
+
21118
+ var duration = _this.getDuration();
21119
+
21120
+ if (duration) {
21121
+ var progress = {
21122
+ playedSeconds: playedSeconds,
21123
+ played: playedSeconds / duration
21124
+ };
21125
+
21126
+ if (loadedSeconds !== null) {
21127
+ progress.loadedSeconds = loadedSeconds;
21128
+ progress.loaded = loadedSeconds / duration;
21129
+ } // Only call onProgress if values have changed
21130
+
21131
+
21132
+ if (progress.playedSeconds !== _this.prevPlayed || progress.loadedSeconds !== _this.prevLoaded) {
21133
+ _this.props.onProgress(progress);
21134
+ }
21135
+
21136
+ _this.prevPlayed = progress.playedSeconds;
21137
+ _this.prevLoaded = progress.loadedSeconds;
21138
+ }
21139
+ }
21140
+
21141
+ _this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);
21142
+ });
21143
+
21144
+ _defineProperty(_assertThisInitialized(_this), "handleReady", function () {
21145
+ if (!_this.mounted) return;
21146
+ _this.isReady = true;
21147
+ _this.isLoading = false;
21148
+ var _this$props = _this.props,
21149
+ onReady = _this$props.onReady,
21150
+ playing = _this$props.playing,
21151
+ volume = _this$props.volume,
21152
+ muted = _this$props.muted;
21153
+ onReady();
21154
+
21155
+ if (!muted && volume !== null) {
21156
+ _this.player.setVolume(volume);
21157
+ }
21158
+
21159
+ if (_this.loadOnReady) {
21160
+ _this.player.load(_this.loadOnReady, true);
21161
+
21162
+ _this.loadOnReady = null;
21163
+ } else if (playing) {
21164
+ _this.player.play();
21165
+ }
21166
+
21167
+ _this.handleDurationCheck();
21168
+ });
21169
+
21170
+ _defineProperty(_assertThisInitialized(_this), "handlePlay", function () {
21171
+ _this.isPlaying = true;
21172
+ _this.isLoading = false;
21173
+ var _this$props2 = _this.props,
21174
+ onStart = _this$props2.onStart,
21175
+ onPlay = _this$props2.onPlay,
21176
+ playbackRate = _this$props2.playbackRate;
21177
+
21178
+ if (_this.startOnPlay) {
21179
+ if (_this.player.setPlaybackRate && playbackRate !== 1) {
21180
+ _this.player.setPlaybackRate(playbackRate);
21181
+ }
21182
+
21183
+ onStart();
21184
+ _this.startOnPlay = false;
21185
+ }
21186
+
21187
+ onPlay();
21188
+
21189
+ if (_this.seekOnPlay) {
21190
+ _this.seekTo(_this.seekOnPlay);
21191
+
21192
+ _this.seekOnPlay = null;
21193
+ }
21194
+
21195
+ _this.handleDurationCheck();
21196
+ });
21197
+
21198
+ _defineProperty(_assertThisInitialized(_this), "handlePause", function (e) {
21199
+ _this.isPlaying = false;
21200
+
21201
+ if (!_this.isLoading) {
21202
+ _this.props.onPause(e);
21203
+ }
21204
+ });
21205
+
21206
+ _defineProperty(_assertThisInitialized(_this), "handleEnded", function () {
21207
+ var _this$props3 = _this.props,
21208
+ activePlayer = _this$props3.activePlayer,
21209
+ loop = _this$props3.loop,
21210
+ onEnded = _this$props3.onEnded;
21211
+
21212
+ if (activePlayer.loopOnEnded && loop) {
21213
+ _this.seekTo(0);
21214
+ }
21215
+
21216
+ if (!loop) {
21217
+ _this.isPlaying = false;
21218
+ onEnded();
21219
+ }
21220
+ });
21221
+
21222
+ _defineProperty(_assertThisInitialized(_this), "handleError", function () {
21223
+ var _this$props4;
21224
+
21225
+ _this.isLoading = false;
21226
+
21227
+ (_this$props4 = _this.props).onError.apply(_this$props4, arguments);
21228
+ });
21229
+
21230
+ _defineProperty(_assertThisInitialized(_this), "handleDurationCheck", function () {
21231
+ clearTimeout(_this.durationCheckTimeout);
21232
+
21233
+ var duration = _this.getDuration();
21234
+
21235
+ if (duration) {
21236
+ if (!_this.onDurationCalled) {
21237
+ _this.props.onDuration(duration);
21238
+
21239
+ _this.onDurationCalled = true;
21240
+ }
21241
+ } else {
21242
+ _this.durationCheckTimeout = setTimeout(_this.handleDurationCheck, 100);
21243
+ }
21244
+ });
21245
+
21246
+ _defineProperty(_assertThisInitialized(_this), "handleLoaded", function () {
21247
+ // Sometimes we know loading has stopped but onReady/onPlay are never called
21248
+ // so this provides a way for players to avoid getting stuck
21249
+ _this.isLoading = false;
21250
+ });
21251
+
21252
+ _defineProperty(_assertThisInitialized(_this), "ref", function (player) {
21253
+ if (player) {
21254
+ _this.player = player;
21255
+ }
21256
+ });
21257
+
21258
+ return _this;
21259
+ }
21260
+
21261
+ _createClass(Player, [{
21262
+ key: "componentDidMount",
21263
+ value: function componentDidMount() {
21264
+ this.mounted = true;
21265
+ this.player.load(this.props.url);
21266
+ this.progress();
21267
+ }
21268
+ }, {
21269
+ key: "componentWillUnmount",
21270
+ value: function componentWillUnmount() {
21271
+ clearTimeout(this.progressTimeout);
21272
+ clearTimeout(this.durationCheckTimeout);
21273
+
21274
+ if (this.isReady) {
21275
+ this.player.stop();
21276
+ }
21277
+
21278
+ if (this.player.disablePIP) {
21279
+ this.player.disablePIP();
21280
+ }
21281
+
21282
+ this.mounted = false;
21283
+ }
21284
+ }, {
21285
+ key: "componentDidUpdate",
21286
+ value: function componentDidUpdate(prevProps) {
21287
+ var _this2 = this;
21288
+
21289
+ // Invoke player methods based on changed props
21290
+ var _this$props5 = this.props,
21291
+ url = _this$props5.url,
21292
+ playing = _this$props5.playing,
21293
+ volume = _this$props5.volume,
21294
+ muted = _this$props5.muted,
21295
+ playbackRate = _this$props5.playbackRate,
21296
+ pip = _this$props5.pip,
21297
+ loop = _this$props5.loop,
21298
+ activePlayer = _this$props5.activePlayer;
21299
+
21300
+ if (!(0, utils$2.isEqual)(prevProps.url, url)) {
21301
+ if (this.isLoading && !activePlayer.forceLoad) {
21302
+ console.warn("ReactPlayer: the attempt to load ".concat(url, " is being deferred until the player has loaded"));
21303
+ this.loadOnReady = url;
21304
+ return;
21305
+ }
21306
+
21307
+ this.isLoading = true;
21308
+ this.startOnPlay = true;
21309
+ this.onDurationCalled = false;
21310
+ this.player.load(url, this.isReady);
21311
+ }
21312
+
21313
+ if (!prevProps.playing && playing && !this.isPlaying) {
21314
+ this.player.play();
21315
+ }
21316
+
21317
+ if (prevProps.playing && !playing && this.isPlaying) {
21318
+ this.player.pause();
21319
+ }
21320
+
21321
+ if (!prevProps.pip && pip && this.player.enablePIP) {
21322
+ this.player.enablePIP();
21323
+ }
21324
+
21325
+ if (prevProps.pip && !pip && this.player.disablePIP) {
21326
+ this.player.disablePIP();
21327
+ }
21328
+
21329
+ if (prevProps.volume !== volume && volume !== null) {
21330
+ this.player.setVolume(volume);
21331
+ }
21332
+
21333
+ if (prevProps.muted !== muted) {
21334
+ if (muted) {
21335
+ this.player.mute();
21336
+ } else {
21337
+ this.player.unmute();
21338
+
21339
+ if (volume !== null) {
21340
+ // Set volume next tick to fix a bug with DailyMotion
21341
+ setTimeout(function () {
21342
+ return _this2.player.setVolume(volume);
21343
+ });
21344
+ }
21345
+ }
21346
+ }
21347
+
21348
+ if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {
21349
+ this.player.setPlaybackRate(playbackRate);
21350
+ }
21351
+
21352
+ if (prevProps.loop !== loop && this.player.setLoop) {
21353
+ this.player.setLoop(loop);
21354
+ }
21355
+ }
21356
+ }, {
21357
+ key: "getDuration",
21358
+ value: function getDuration() {
21359
+ if (!this.isReady) return null;
21360
+ return this.player.getDuration();
21361
+ }
21362
+ }, {
21363
+ key: "getCurrentTime",
21364
+ value: function getCurrentTime() {
21365
+ if (!this.isReady) return null;
21366
+ return this.player.getCurrentTime();
21367
+ }
21368
+ }, {
21369
+ key: "getSecondsLoaded",
21370
+ value: function getSecondsLoaded() {
21371
+ if (!this.isReady) return null;
21372
+ return this.player.getSecondsLoaded();
21373
+ }
21374
+ }, {
21375
+ key: "seekTo",
21376
+ value: function seekTo(amount, type) {
21377
+ var _this3 = this;
21378
+
21379
+ // When seeking before player is ready, store value and seek later
21380
+ if (!this.isReady && amount !== 0) {
21381
+ this.seekOnPlay = amount;
21382
+ setTimeout(function () {
21383
+ _this3.seekOnPlay = null;
21384
+ }, SEEK_ON_PLAY_EXPIRY);
21385
+ return;
21386
+ }
21387
+
21388
+ var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';
21389
+
21390
+ if (isFraction) {
21391
+ // Convert fraction to seconds based on duration
21392
+ var duration = this.player.getDuration();
21393
+
21394
+ if (!duration) {
21395
+ console.warn('ReactPlayer: could not seek using fraction – duration not yet available');
21396
+ return;
21397
+ }
21398
+
21399
+ this.player.seekTo(duration * amount);
21400
+ return;
21401
+ }
21402
+
21403
+ this.player.seekTo(amount);
21404
+ }
21405
+ }, {
21406
+ key: "render",
21407
+ value: function render() {
21408
+ var Player = this.props.activePlayer;
21409
+
21410
+ if (!Player) {
21411
+ return null;
21412
+ }
21413
+
21414
+ return _react["default"].createElement(Player, _extends({}, this.props, {
21415
+ ref: this.ref,
21416
+ onReady: this.handleReady,
21417
+ onPlay: this.handlePlay,
21418
+ onPause: this.handlePause,
21419
+ onEnded: this.handleEnded,
21420
+ onLoaded: this.handleLoaded,
21421
+ onError: this.handleError
21422
+ }));
21423
+ }
21424
+ }]);
21425
+
21426
+ return Player;
21427
+ }(_react.Component);
21428
+
21429
+ exports["default"] = Player;
21430
+
21431
+ _defineProperty(Player, "displayName", 'Player');
21432
+
21433
+ _defineProperty(Player, "propTypes", props.propTypes);
21434
+
21435
+ _defineProperty(Player, "defaultProps", props.defaultProps);
21436
+ });
21437
+
21438
+ unwrapExports(Player_1);
21439
+
21440
+ var singlePlayer = createCommonjsModule(function (module, exports) {
21441
+
21442
+ Object.defineProperty(exports, "__esModule", {
21443
+ value: true
21444
+ });
21445
+ exports["default"] = createSinglePlayer;
21446
+
21447
+ var _react = _interopRequireWildcard(React__default);
21448
+
21449
+
21450
+
21451
+
21452
+
21453
+ var _Player = _interopRequireDefault(Player_1);
21454
+
21455
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21456
+
21457
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21458
+
21459
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21460
+
21461
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
21462
+
21463
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21464
+
21465
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
21466
+
21467
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21468
+
21469
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21470
+
21471
+ function _defineProperties(target, props$$1) { for (var i = 0; i < props$$1.length; i++) { var descriptor = props$$1[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
21472
+
21473
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21474
+
21475
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
21476
+
21477
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21478
+
21479
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21480
+
21481
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
21482
+
21483
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21484
+
21485
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21486
+
21487
+ var SUPPORTED_PROPS = Object.keys(props.propTypes);
21488
+
21489
+ function createSinglePlayer(activePlayer) {
21490
+ var _class, _temp;
21491
+
21492
+ return _temp = _class =
21493
+ /*#__PURE__*/
21494
+ function (_Component) {
21495
+ _inherits(SinglePlayer, _Component);
21496
+
21497
+ function SinglePlayer() {
21498
+ var _getPrototypeOf2;
21499
+
21500
+ var _this;
21501
+
21502
+ _classCallCheck(this, SinglePlayer);
21503
+
21504
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21505
+ args[_key] = arguments[_key];
21506
+ }
21507
+
21508
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SinglePlayer)).call.apply(_getPrototypeOf2, [this].concat(args)));
21509
+
21510
+ _defineProperty(_assertThisInitialized(_this), "config", (0, utils$2.getConfig)(_this.props, props.defaultProps, true));
21511
+
21512
+ _defineProperty(_assertThisInitialized(_this), "getDuration", function () {
21513
+ if (!_this.player) return null;
21514
+ return _this.player.getDuration();
21515
+ });
21516
+
21517
+ _defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
21518
+ if (!_this.player) return null;
21519
+ return _this.player.getCurrentTime();
21520
+ });
21521
+
21522
+ _defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
21523
+ if (!_this.player) return null;
21524
+ return _this.player.getSecondsLoaded();
21525
+ });
21526
+
21527
+ _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
21528
+ var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
21529
+ if (!_this.player) return null;
21530
+ return _this.player.getInternalPlayer(key);
21531
+ });
21532
+
21533
+ _defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type) {
21534
+ if (!_this.player) return null;
21535
+
21536
+ _this.player.seekTo(fraction, type);
21537
+ });
21538
+
21539
+ _defineProperty(_assertThisInitialized(_this), "ref", function (player) {
21540
+ _this.player = player;
21541
+ });
21542
+
21543
+ return _this;
21544
+ }
21545
+
21546
+ _createClass(SinglePlayer, [{
21547
+ key: "shouldComponentUpdate",
21548
+ value: function shouldComponentUpdate(nextProps) {
21549
+ return !(0, utils$2.isEqual)(this.props, nextProps);
21550
+ }
21551
+ }, {
21552
+ key: "componentDidUpdate",
21553
+ value: function componentDidUpdate() {
21554
+ this.config = (0, utils$2.getConfig)(this.props, props.defaultProps);
21555
+ }
21556
+ }, {
21557
+ key: "render",
21558
+ value: function render() {
21559
+ var _this$config$file = this.config.file,
21560
+ forceVideo = _this$config$file.forceVideo,
21561
+ forceAudio = _this$config$file.forceAudio,
21562
+ forceHLS = _this$config$file.forceHLS,
21563
+ forceDASH = _this$config$file.forceDASH;
21564
+ var skipCanPlay = forceVideo || forceAudio || forceHLS || forceDASH;
21565
+
21566
+ if (!activePlayer.canPlay(this.props.url) && !skipCanPlay) {
21567
+ return null;
21568
+ }
21569
+
21570
+ var _this$props = this.props,
21571
+ style = _this$props.style,
21572
+ width = _this$props.width,
21573
+ height = _this$props.height,
21574
+ Wrapper = _this$props.wrapper;
21575
+ var otherProps = (0, utils$2.omit)(this.props, SUPPORTED_PROPS, props.DEPRECATED_CONFIG_PROPS);
21576
+ return _react["default"].createElement(Wrapper, _extends({
21577
+ style: _objectSpread({}, style, {
21578
+ width: width,
21579
+ height: height
21580
+ })
21581
+ }, otherProps), _react["default"].createElement(_Player["default"], _extends({}, this.props, {
21582
+ ref: this.ref,
21583
+ activePlayer: activePlayer,
21584
+ config: this.config
21585
+ })));
21586
+ }
21587
+ }]);
21588
+
21589
+ return SinglePlayer;
21590
+ }(_react.Component), _defineProperty(_class, "displayName", "".concat(activePlayer.displayName, "Player")), _defineProperty(_class, "propTypes", props.propTypes), _defineProperty(_class, "defaultProps", props.defaultProps), _defineProperty(_class, "canPlay", activePlayer.canPlay), _temp;
21591
+ }
21592
+ });
21593
+
21594
+ unwrapExports(singlePlayer);
21595
+
21596
+ var YouTube_1 = createCommonjsModule(function (module, exports) {
21597
+
21598
+ Object.defineProperty(exports, "__esModule", {
21599
+ value: true
21600
+ });
21601
+ exports["default"] = exports.YouTube = void 0;
21602
+
21603
+ var _react = _interopRequireWildcard(React__default);
21604
+
21605
+
21606
+
21607
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
21608
+
21609
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21610
+
21611
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21612
+
21613
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21614
+
21615
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
21616
+
21617
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
21618
+
21619
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21620
+
21621
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21622
+
21623
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
21624
+
21625
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21626
+
21627
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
21628
+
21629
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21630
+
21631
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21632
+
21633
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
21634
+
21635
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21636
+
21637
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21638
+
21639
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
21640
+
21641
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
21642
+
21643
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
21644
+
21645
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21646
+
21647
+ var SDK_URL = 'https://www.youtube.com/iframe_api';
21648
+ var SDK_GLOBAL = 'YT';
21649
+ var SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady';
21650
+ var MATCH_URL = /(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/;
21651
+ var MATCH_PLAYLIST = /list=([a-zA-Z0-9_-]+)/;
21652
+
21653
+ function parsePlaylist(url) {
21654
+ if (MATCH_PLAYLIST.test(url)) {
21655
+ var _url$match = url.match(MATCH_PLAYLIST),
21656
+ _url$match2 = _slicedToArray(_url$match, 2),
21657
+ playlistId = _url$match2[1];
21658
+
21659
+ return {
21660
+ listType: 'playlist',
21661
+ list: playlistId
21662
+ };
21663
+ }
21664
+
21665
+ return {};
21666
+ }
21667
+
21668
+ var YouTube =
21669
+ /*#__PURE__*/
21670
+ function (_Component) {
21671
+ _inherits(YouTube, _Component);
21672
+
21673
+ function YouTube() {
21674
+ var _getPrototypeOf2;
21675
+
21676
+ var _this;
21677
+
21678
+ _classCallCheck(this, YouTube);
21679
+
21680
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21681
+ args[_key] = arguments[_key];
21682
+ }
21683
+
21684
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(YouTube)).call.apply(_getPrototypeOf2, [this].concat(args)));
21685
+
21686
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
21687
+
21688
+ _defineProperty(_assertThisInitialized(_this), "onStateChange", function (_ref) {
21689
+ var data = _ref.data;
21690
+ var _this$props = _this.props,
21691
+ onPlay = _this$props.onPlay,
21692
+ onPause = _this$props.onPause,
21693
+ onBuffer = _this$props.onBuffer,
21694
+ onBufferEnd = _this$props.onBufferEnd,
21695
+ onEnded = _this$props.onEnded,
21696
+ onReady = _this$props.onReady,
21697
+ loop = _this$props.loop;
21698
+ var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState,
21699
+ PLAYING = _window$SDK_GLOBAL$Pl.PLAYING,
21700
+ PAUSED = _window$SDK_GLOBAL$Pl.PAUSED,
21701
+ BUFFERING = _window$SDK_GLOBAL$Pl.BUFFERING,
21702
+ ENDED = _window$SDK_GLOBAL$Pl.ENDED,
21703
+ CUED = _window$SDK_GLOBAL$Pl.CUED;
21704
+
21705
+ if (data === PLAYING) {
21706
+ onPlay();
21707
+ onBufferEnd();
21708
+ }
21709
+
21710
+ if (data === PAUSED) onPause();
21711
+ if (data === BUFFERING) onBuffer();
21712
+
21713
+ if (data === ENDED) {
21714
+ var isPlaylist = !!_this.callPlayer('getPlaylist');
21715
+
21716
+ if (loop && !isPlaylist) {
21717
+ _this.play(); // Only loop manually if not playing a playlist
21718
+
21719
+ }
21720
+
21721
+ onEnded();
21722
+ }
21723
+
21724
+ if (data === CUED) onReady();
21725
+ });
21726
+
21727
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
21728
+ _this.callPlayer('mute');
21729
+ });
21730
+
21731
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
21732
+ _this.callPlayer('unMute');
21733
+ });
21734
+
21735
+ _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
21736
+ _this.container = container;
21737
+ });
21738
+
21739
+ return _this;
21740
+ }
21741
+
21742
+ _createClass(YouTube, [{
21743
+ key: "load",
21744
+ value: function load(url, isReady) {
21745
+ var _this2 = this;
21746
+
21747
+ var _this$props2 = this.props,
21748
+ playing = _this$props2.playing,
21749
+ muted = _this$props2.muted,
21750
+ playsinline = _this$props2.playsinline,
21751
+ controls = _this$props2.controls,
21752
+ loop = _this$props2.loop,
21753
+ config = _this$props2.config,
21754
+ _onError = _this$props2.onError;
21755
+ var _config$youtube = config.youtube,
21756
+ playerVars = _config$youtube.playerVars,
21757
+ embedOptions = _config$youtube.embedOptions;
21758
+ var id = url && url.match(MATCH_URL)[1];
21759
+
21760
+ if (isReady) {
21761
+ if (MATCH_PLAYLIST.test(url)) {
21762
+ this.player.loadPlaylist(parsePlaylist(url));
21763
+ return;
21764
+ }
21765
+
21766
+ this.player.cueVideoById({
21767
+ videoId: id,
21768
+ startSeconds: (0, utils$2.parseStartTime)(url) || playerVars.start,
21769
+ endSeconds: (0, utils$2.parseEndTime)(url) || playerVars.end
21770
+ });
21771
+ return;
21772
+ }
21773
+
21774
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (YT) {
21775
+ return YT.loaded;
21776
+ }).then(function (YT) {
21777
+ if (!_this2.container) return;
21778
+ _this2.player = new YT.Player(_this2.container, _objectSpread({
21779
+ width: '100%',
21780
+ height: '100%',
21781
+ videoId: id,
21782
+ playerVars: _objectSpread({
21783
+ autoplay: playing ? 1 : 0,
21784
+ mute: muted ? 1 : 0,
21785
+ controls: controls ? 1 : 0,
21786
+ start: (0, utils$2.parseStartTime)(url),
21787
+ end: (0, utils$2.parseEndTime)(url),
21788
+ origin: window.location.origin,
21789
+ playsinline: playsinline
21790
+ }, parsePlaylist(url), {}, playerVars),
21791
+ events: {
21792
+ onReady: function onReady() {
21793
+ if (loop) {
21794
+ _this2.player.setLoop(true); // Enable playlist looping
21795
+
21796
+ }
21797
+
21798
+ _this2.props.onReady();
21799
+ },
21800
+ onStateChange: _this2.onStateChange,
21801
+ onError: function onError(event) {
21802
+ return _onError(event.data);
21803
+ }
21804
+ }
21805
+ }, embedOptions));
21806
+ }, _onError);
21807
+ }
21808
+ }, {
21809
+ key: "play",
21810
+ value: function play() {
21811
+ this.callPlayer('playVideo');
21812
+ }
21813
+ }, {
21814
+ key: "pause",
21815
+ value: function pause() {
21816
+ this.callPlayer('pauseVideo');
21817
+ }
21818
+ }, {
21819
+ key: "stop",
21820
+ value: function stop() {
21821
+ if (!document.body.contains(this.callPlayer('getIframe'))) return;
21822
+ this.callPlayer('stopVideo');
21823
+ }
21824
+ }, {
21825
+ key: "seekTo",
21826
+ value: function seekTo(amount) {
21827
+ this.callPlayer('seekTo', amount);
21828
+
21829
+ if (!this.props.playing) {
21830
+ this.pause();
21831
+ }
21832
+ }
21833
+ }, {
21834
+ key: "setVolume",
21835
+ value: function setVolume(fraction) {
21836
+ this.callPlayer('setVolume', fraction * 100);
21837
+ }
21838
+ }, {
21839
+ key: "setPlaybackRate",
21840
+ value: function setPlaybackRate(rate) {
21841
+ this.callPlayer('setPlaybackRate', rate);
21842
+ }
21843
+ }, {
21844
+ key: "setLoop",
21845
+ value: function setLoop(loop) {
21846
+ this.callPlayer('setLoop', loop);
21847
+ }
21848
+ }, {
21849
+ key: "getDuration",
21850
+ value: function getDuration() {
21851
+ return this.callPlayer('getDuration');
21852
+ }
21853
+ }, {
21854
+ key: "getCurrentTime",
21855
+ value: function getCurrentTime() {
21856
+ return this.callPlayer('getCurrentTime');
21857
+ }
21858
+ }, {
21859
+ key: "getSecondsLoaded",
21860
+ value: function getSecondsLoaded() {
21861
+ return this.callPlayer('getVideoLoadedFraction') * this.getDuration();
21862
+ }
21863
+ }, {
21864
+ key: "render",
21865
+ value: function render() {
21866
+ var display = this.props.display;
21867
+ var style = {
21868
+ width: '100%',
21869
+ height: '100%',
21870
+ display: display
21871
+ };
21872
+ return _react["default"].createElement("div", {
21873
+ style: style
21874
+ }, _react["default"].createElement("div", {
21875
+ ref: this.ref
21876
+ }));
21877
+ }
21878
+ }]);
21879
+
21880
+ return YouTube;
21881
+ }(_react.Component);
21882
+
21883
+ exports.YouTube = YouTube;
21884
+
21885
+ _defineProperty(YouTube, "displayName", 'YouTube');
21886
+
21887
+ _defineProperty(YouTube, "canPlay", function (url) {
21888
+ return MATCH_URL.test(url);
21889
+ });
21890
+
21891
+ var _default = (0, _singlePlayer["default"])(YouTube);
21892
+
21893
+ exports["default"] = _default;
21894
+ });
21895
+
21896
+ unwrapExports(YouTube_1);
21897
+ var YouTube_2 = YouTube_1.YouTube;
21898
+
21899
+ var SoundCloud_1 = createCommonjsModule(function (module, exports) {
21900
+
21901
+ Object.defineProperty(exports, "__esModule", {
21902
+ value: true
21903
+ });
21904
+ exports["default"] = exports.SoundCloud = void 0;
21905
+
21906
+ var _react = _interopRequireWildcard(React__default);
21907
+
21908
+
21909
+
21910
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
21911
+
21912
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21913
+
21914
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21915
+
21916
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21917
+
21918
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
21919
+
21920
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
21921
+
21922
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21923
+
21924
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21925
+
21926
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
21927
+
21928
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21929
+
21930
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
21931
+
21932
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21933
+
21934
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21935
+
21936
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
21937
+
21938
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21939
+
21940
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21941
+
21942
+ var SDK_URL = 'https://w.soundcloud.com/player/api.js';
21943
+ var SDK_GLOBAL = 'SC';
21944
+ var MATCH_URL = /(soundcloud\.com|snd\.sc)\/.+$/;
21945
+
21946
+ var SoundCloud =
21947
+ /*#__PURE__*/
21948
+ function (_Component) {
21949
+ _inherits(SoundCloud, _Component);
21950
+
21951
+ function SoundCloud() {
21952
+ var _getPrototypeOf2;
21953
+
21954
+ var _this;
21955
+
21956
+ _classCallCheck(this, SoundCloud);
21957
+
21958
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21959
+ args[_key] = arguments[_key];
21960
+ }
21961
+
21962
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SoundCloud)).call.apply(_getPrototypeOf2, [this].concat(args)));
21963
+
21964
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
21965
+
21966
+ _defineProperty(_assertThisInitialized(_this), "duration", null);
21967
+
21968
+ _defineProperty(_assertThisInitialized(_this), "currentTime", null);
21969
+
21970
+ _defineProperty(_assertThisInitialized(_this), "fractionLoaded", null);
21971
+
21972
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
21973
+ _this.setVolume(0);
21974
+ });
21975
+
21976
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
21977
+ if (_this.props.volume !== null) {
21978
+ _this.setVolume(_this.props.volume);
21979
+ }
21980
+ });
21981
+
21982
+ _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
21983
+ _this.iframe = iframe;
21984
+ });
21985
+
21986
+ return _this;
21987
+ }
21988
+
21989
+ _createClass(SoundCloud, [{
21990
+ key: "load",
21991
+ value: function load(url, isReady) {
21992
+ var _this2 = this;
21993
+
21994
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (SC) {
21995
+ if (!_this2.iframe) return;
21996
+ var _SC$Widget$Events = SC.Widget.Events,
21997
+ PLAY = _SC$Widget$Events.PLAY,
21998
+ PLAY_PROGRESS = _SC$Widget$Events.PLAY_PROGRESS,
21999
+ PAUSE = _SC$Widget$Events.PAUSE,
22000
+ FINISH = _SC$Widget$Events.FINISH,
22001
+ ERROR = _SC$Widget$Events.ERROR;
22002
+
22003
+ if (!isReady) {
22004
+ _this2.player = SC.Widget(_this2.iframe);
22005
+
22006
+ _this2.player.bind(PLAY, _this2.props.onPlay);
22007
+
22008
+ _this2.player.bind(PAUSE, _this2.props.onPause);
22009
+
22010
+ _this2.player.bind(PLAY_PROGRESS, function (e) {
22011
+ _this2.currentTime = e.currentPosition / 1000;
22012
+ _this2.fractionLoaded = e.loadedProgress;
22013
+ });
22014
+
22015
+ _this2.player.bind(FINISH, function () {
22016
+ return _this2.props.onEnded();
22017
+ });
22018
+
22019
+ _this2.player.bind(ERROR, function (e) {
22020
+ return _this2.props.onError(e);
22021
+ });
22022
+ }
22023
+
22024
+ _this2.player.load(url, _objectSpread({}, _this2.props.config.soundcloud.options, {
22025
+ callback: function callback() {
22026
+ _this2.player.getDuration(function (duration) {
22027
+ _this2.duration = duration / 1000;
22028
+
22029
+ _this2.props.onReady();
22030
+ });
22031
+ }
22032
+ }));
22033
+ });
22034
+ }
22035
+ }, {
22036
+ key: "play",
22037
+ value: function play() {
22038
+ this.callPlayer('play');
22039
+ }
22040
+ }, {
22041
+ key: "pause",
22042
+ value: function pause() {
22043
+ this.callPlayer('pause');
22044
+ }
22045
+ }, {
22046
+ key: "stop",
22047
+ value: function stop() {// Nothing to do
22048
+ }
22049
+ }, {
22050
+ key: "seekTo",
22051
+ value: function seekTo(seconds) {
22052
+ this.callPlayer('seekTo', seconds * 1000);
22053
+ }
22054
+ }, {
22055
+ key: "setVolume",
22056
+ value: function setVolume(fraction) {
22057
+ this.callPlayer('setVolume', fraction * 100);
22058
+ }
22059
+ }, {
22060
+ key: "getDuration",
22061
+ value: function getDuration() {
22062
+ return this.duration;
22063
+ }
22064
+ }, {
22065
+ key: "getCurrentTime",
22066
+ value: function getCurrentTime() {
22067
+ return this.currentTime;
22068
+ }
22069
+ }, {
22070
+ key: "getSecondsLoaded",
22071
+ value: function getSecondsLoaded() {
22072
+ return this.fractionLoaded * this.duration;
22073
+ }
22074
+ }, {
22075
+ key: "render",
22076
+ value: function render() {
22077
+ var display = this.props.display;
22078
+ var style = {
22079
+ width: '100%',
22080
+ height: '100%',
22081
+ display: display
22082
+ };
22083
+ return _react["default"].createElement("iframe", {
22084
+ ref: this.ref,
22085
+ src: "https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),
22086
+ style: style,
22087
+ frameBorder: 0,
22088
+ allow: "autoplay"
22089
+ });
22090
+ }
22091
+ }]);
22092
+
22093
+ return SoundCloud;
22094
+ }(_react.Component);
22095
+
22096
+ exports.SoundCloud = SoundCloud;
22097
+
22098
+ _defineProperty(SoundCloud, "displayName", 'SoundCloud');
22099
+
22100
+ _defineProperty(SoundCloud, "canPlay", function (url) {
22101
+ return MATCH_URL.test(url);
22102
+ });
22103
+
22104
+ _defineProperty(SoundCloud, "loopOnEnded", true);
22105
+
22106
+ var _default = (0, _singlePlayer["default"])(SoundCloud);
22107
+
22108
+ exports["default"] = _default;
22109
+ });
22110
+
22111
+ unwrapExports(SoundCloud_1);
22112
+ var SoundCloud_2 = SoundCloud_1.SoundCloud;
22113
+
22114
+ var Vimeo_1 = createCommonjsModule(function (module, exports) {
22115
+
22116
+ Object.defineProperty(exports, "__esModule", {
22117
+ value: true
22118
+ });
22119
+ exports["default"] = exports.Vimeo = void 0;
22120
+
22121
+ var _react = _interopRequireWildcard(React__default);
22122
+
22123
+
22124
+
22125
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
22126
+
22127
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22128
+
22129
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
22130
+
22131
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22132
+
22133
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
22134
+
22135
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22136
+
22137
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22138
+
22139
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22140
+
22141
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22142
+
22143
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22144
+
22145
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22146
+
22147
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22148
+
22149
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22150
+
22151
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
22152
+
22153
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22154
+
22155
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22156
+
22157
+ var SDK_URL = 'https://player.vimeo.com/api/player.js';
22158
+ var SDK_GLOBAL = 'Vimeo';
22159
+ var MATCH_URL = /vimeo\.com\/.+/;
22160
+ var MATCH_FILE_URL = /vimeo\.com\/external\/[0-9]+\..+/;
22161
+
22162
+ var Vimeo =
22163
+ /*#__PURE__*/
22164
+ function (_Component) {
22165
+ _inherits(Vimeo, _Component);
22166
+
22167
+ function Vimeo() {
22168
+ var _getPrototypeOf2;
22169
+
22170
+ var _this;
22171
+
22172
+ _classCallCheck(this, Vimeo);
22173
+
22174
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22175
+ args[_key] = arguments[_key];
22176
+ }
22177
+
22178
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Vimeo)).call.apply(_getPrototypeOf2, [this].concat(args)));
22179
+
22180
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
22181
+
22182
+ _defineProperty(_assertThisInitialized(_this), "duration", null);
22183
+
22184
+ _defineProperty(_assertThisInitialized(_this), "currentTime", null);
22185
+
22186
+ _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
22187
+
22188
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
22189
+ _this.setVolume(0);
22190
+ });
22191
+
22192
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
22193
+ if (_this.props.volume !== null) {
22194
+ _this.setVolume(_this.props.volume);
22195
+ }
22196
+ });
22197
+
22198
+ _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
22199
+ _this.container = container;
22200
+ });
22201
+
22202
+ return _this;
22203
+ }
22204
+
22205
+ _createClass(Vimeo, [{
22206
+ key: "load",
22207
+ value: function load(url) {
22208
+ var _this2 = this;
22209
+
22210
+ this.duration = null;
22211
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Vimeo) {
22212
+ if (!_this2.container) return;
22213
+ _this2.player = new Vimeo.Player(_this2.container, _objectSpread({
22214
+ url: url,
22215
+ autoplay: _this2.props.playing,
22216
+ muted: _this2.props.muted,
22217
+ loop: _this2.props.loop,
22218
+ playsinline: _this2.props.playsinline,
22219
+ controls: _this2.props.controls
22220
+ }, _this2.props.config.vimeo.playerOptions));
22221
+
22222
+ _this2.player.ready().then(function () {
22223
+ var iframe = _this2.container.querySelector('iframe');
22224
+
22225
+ iframe.style.width = '100%';
22226
+ iframe.style.height = '100%';
22227
+ })["catch"](_this2.props.onError);
22228
+
22229
+ _this2.player.on('loaded', function () {
22230
+ _this2.props.onReady();
22231
+
22232
+ _this2.refreshDuration();
22233
+ });
22234
+
22235
+ _this2.player.on('play', function () {
22236
+ _this2.props.onPlay();
22237
+
22238
+ _this2.refreshDuration();
22239
+ });
22240
+
22241
+ _this2.player.on('pause', _this2.props.onPause);
22242
+
22243
+ _this2.player.on('seeked', function (e) {
22244
+ return _this2.props.onSeek(e.seconds);
22245
+ });
22246
+
22247
+ _this2.player.on('ended', _this2.props.onEnded);
22248
+
22249
+ _this2.player.on('error', _this2.props.onError);
22250
+
22251
+ _this2.player.on('timeupdate', function (_ref) {
22252
+ var seconds = _ref.seconds;
22253
+ _this2.currentTime = seconds;
22254
+ });
22255
+
22256
+ _this2.player.on('progress', function (_ref2) {
22257
+ var seconds = _ref2.seconds;
22258
+ _this2.secondsLoaded = seconds;
22259
+ });
22260
+ }, this.props.onError);
22261
+ }
22262
+ }, {
22263
+ key: "refreshDuration",
22264
+ value: function refreshDuration() {
22265
+ var _this3 = this;
22266
+
22267
+ this.player.getDuration().then(function (duration) {
22268
+ _this3.duration = duration;
22269
+ });
22270
+ }
22271
+ }, {
22272
+ key: "play",
22273
+ value: function play() {
22274
+ var promise = this.callPlayer('play');
22275
+
22276
+ if (promise) {
22277
+ promise["catch"](this.props.onError);
22278
+ }
22279
+ }
22280
+ }, {
22281
+ key: "pause",
22282
+ value: function pause() {
22283
+ this.callPlayer('pause');
22284
+ }
22285
+ }, {
22286
+ key: "stop",
22287
+ value: function stop() {
22288
+ this.callPlayer('unload');
22289
+ }
22290
+ }, {
22291
+ key: "seekTo",
22292
+ value: function seekTo(seconds) {
22293
+ this.callPlayer('setCurrentTime', seconds);
22294
+ }
22295
+ }, {
22296
+ key: "setVolume",
22297
+ value: function setVolume(fraction) {
22298
+ this.callPlayer('setVolume', fraction);
22299
+ }
22300
+ }, {
22301
+ key: "setLoop",
22302
+ value: function setLoop(loop) {
22303
+ this.callPlayer('setLoop', loop);
22304
+ }
22305
+ }, {
22306
+ key: "setPlaybackRate",
22307
+ value: function setPlaybackRate(rate) {
22308
+ this.callPlayer('setPlaybackRate', rate);
22309
+ }
22310
+ }, {
22311
+ key: "getDuration",
22312
+ value: function getDuration() {
22313
+ return this.duration;
22314
+ }
22315
+ }, {
22316
+ key: "getCurrentTime",
22317
+ value: function getCurrentTime() {
22318
+ return this.currentTime;
22319
+ }
22320
+ }, {
22321
+ key: "getSecondsLoaded",
22322
+ value: function getSecondsLoaded() {
22323
+ return this.secondsLoaded;
22324
+ }
22325
+ }, {
22326
+ key: "render",
22327
+ value: function render() {
22328
+ var display = this.props.display;
22329
+ var style = {
22330
+ width: '100%',
22331
+ height: '100%',
22332
+ overflow: 'hidden',
22333
+ display: display
22334
+ };
22335
+ return _react["default"].createElement("div", {
22336
+ key: this.props.url,
22337
+ ref: this.ref,
22338
+ style: style
22339
+ });
22340
+ }
22341
+ }]);
22342
+
22343
+ return Vimeo;
22344
+ }(_react.Component);
22345
+
22346
+ exports.Vimeo = Vimeo;
22347
+
22348
+ _defineProperty(Vimeo, "displayName", 'Vimeo');
22349
+
22350
+ _defineProperty(Vimeo, "forceLoad", true);
22351
+
22352
+ _defineProperty(Vimeo, "canPlay", function (url) {
22353
+ if (MATCH_FILE_URL.test(url)) {
22354
+ return false;
22355
+ }
22356
+
22357
+ return MATCH_URL.test(url);
22358
+ });
22359
+
22360
+ var _default = (0, _singlePlayer["default"])(Vimeo);
22361
+
22362
+ exports["default"] = _default;
22363
+ });
22364
+
22365
+ unwrapExports(Vimeo_1);
22366
+ var Vimeo_2 = Vimeo_1.Vimeo;
22367
+
22368
+ var Facebook_1 = createCommonjsModule(function (module, exports) {
22369
+
22370
+ Object.defineProperty(exports, "__esModule", {
22371
+ value: true
22372
+ });
22373
+ exports["default"] = exports.Facebook = void 0;
22374
+
22375
+ var _react = _interopRequireWildcard(React__default);
22376
+
22377
+
22378
+
22379
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
22380
+
22381
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22382
+
22383
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
22384
+
22385
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22386
+
22387
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
22388
+
22389
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22390
+
22391
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22392
+
22393
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22394
+
22395
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22396
+
22397
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22398
+
22399
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22400
+
22401
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
22402
+
22403
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22404
+
22405
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22406
+
22407
+ var SDK_URL = 'https://connect.facebook.net/en_US/sdk.js';
22408
+ var SDK_GLOBAL = 'FB';
22409
+ var SDK_GLOBAL_READY = 'fbAsyncInit';
22410
+ var MATCH_URL = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/;
22411
+ var PLAYER_ID_PREFIX = 'facebook-player-';
22412
+
22413
+ var Facebook =
22414
+ /*#__PURE__*/
22415
+ function (_Component) {
22416
+ _inherits(Facebook, _Component);
22417
+
22418
+ function Facebook() {
22419
+ var _getPrototypeOf2;
22420
+
22421
+ var _this;
22422
+
22423
+ _classCallCheck(this, Facebook);
22424
+
22425
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22426
+ args[_key] = arguments[_key];
22427
+ }
22428
+
22429
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Facebook)).call.apply(_getPrototypeOf2, [this].concat(args)));
22430
+
22431
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
22432
+
22433
+ _defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.facebook.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, utils$2.randomString)()));
22434
+
22435
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
22436
+ _this.callPlayer('mute');
22437
+ });
22438
+
22439
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
22440
+ _this.callPlayer('unmute');
22441
+ });
22442
+
22443
+ return _this;
22444
+ }
22445
+
22446
+ _createClass(Facebook, [{
22447
+ key: "load",
22448
+ value: function load(url, isReady) {
22449
+ var _this2 = this;
22450
+
22451
+ if (isReady) {
22452
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
22453
+ return FB.XFBML.parse();
22454
+ });
22455
+ return;
22456
+ }
22457
+
22458
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
22459
+ FB.init({
22460
+ appId: _this2.props.config.facebook.appId,
22461
+ xfbml: true,
22462
+ version: _this2.props.config.facebook.version
22463
+ });
22464
+ FB.Event.subscribe('xfbml.render', function (msg) {
22465
+ // Here we know the SDK has loaded, even if onReady/onPlay
22466
+ // is not called due to a video that cannot be embedded
22467
+ _this2.props.onLoaded();
22468
+ });
22469
+ FB.Event.subscribe('xfbml.ready', function (msg) {
22470
+ if (msg.type === 'video' && msg.id === _this2.playerID) {
22471
+ _this2.player = msg.instance;
22472
+
22473
+ _this2.player.subscribe('startedPlaying', _this2.props.onPlay);
22474
+
22475
+ _this2.player.subscribe('paused', _this2.props.onPause);
22476
+
22477
+ _this2.player.subscribe('finishedPlaying', _this2.props.onEnded);
22478
+
22479
+ _this2.player.subscribe('startedBuffering', _this2.props.onBuffer);
22480
+
22481
+ _this2.player.subscribe('finishedBuffering', _this2.props.onBufferEnd);
22482
+
22483
+ _this2.player.subscribe('error', _this2.props.onError);
22484
+
22485
+ if (!_this2.props.muted) {
22486
+ // Player is muted by default
22487
+ _this2.callPlayer('unmute');
22488
+ }
22489
+
22490
+ _this2.props.onReady(); // For some reason Facebook have added `visibility: hidden`
22491
+ // to the iframe when autoplay fails, so here we set it back
22492
+
22493
+
22494
+ document.getElementById(_this2.playerID).querySelector('iframe').style.visibility = 'visible';
22495
+ }
22496
+ });
22497
+ });
22498
+ }
22499
+ }, {
22500
+ key: "play",
22501
+ value: function play() {
22502
+ this.callPlayer('play');
22503
+ }
22504
+ }, {
22505
+ key: "pause",
22506
+ value: function pause() {
22507
+ this.callPlayer('pause');
22508
+ }
22509
+ }, {
22510
+ key: "stop",
22511
+ value: function stop() {// Nothing to do
22512
+ }
22513
+ }, {
22514
+ key: "seekTo",
22515
+ value: function seekTo(seconds) {
22516
+ this.callPlayer('seek', seconds);
22517
+ }
22518
+ }, {
22519
+ key: "setVolume",
22520
+ value: function setVolume(fraction) {
22521
+ this.callPlayer('setVolume', fraction);
22522
+ }
22523
+ }, {
22524
+ key: "getDuration",
22525
+ value: function getDuration() {
22526
+ return this.callPlayer('getDuration');
22527
+ }
22528
+ }, {
22529
+ key: "getCurrentTime",
22530
+ value: function getCurrentTime() {
22531
+ return this.callPlayer('getCurrentPosition');
22532
+ }
22533
+ }, {
22534
+ key: "getSecondsLoaded",
22535
+ value: function getSecondsLoaded() {
22536
+ return null;
22537
+ }
22538
+ }, {
22539
+ key: "render",
22540
+ value: function render() {
22541
+ var style = {
22542
+ width: '100%',
22543
+ height: '100%'
22544
+ };
22545
+ return _react["default"].createElement("div", {
22546
+ style: style,
22547
+ id: this.playerID,
22548
+ className: "fb-video",
22549
+ "data-href": this.props.url,
22550
+ "data-autoplay": this.props.playing ? 'true' : 'false',
22551
+ "data-allowfullscreen": "true",
22552
+ "data-controls": this.props.controls ? 'true' : 'false'
22553
+ });
22554
+ }
22555
+ }]);
22556
+
22557
+ return Facebook;
22558
+ }(_react.Component);
22559
+
22560
+ exports.Facebook = Facebook;
22561
+
22562
+ _defineProperty(Facebook, "displayName", 'Facebook');
22563
+
22564
+ _defineProperty(Facebook, "canPlay", function (url) {
22565
+ return MATCH_URL.test(url);
22566
+ });
22567
+
22568
+ _defineProperty(Facebook, "loopOnEnded", true);
22569
+
22570
+ var _default = (0, _singlePlayer["default"])(Facebook);
22571
+
22572
+ exports["default"] = _default;
22573
+ });
22574
+
22575
+ unwrapExports(Facebook_1);
22576
+ var Facebook_2 = Facebook_1.Facebook;
22577
+
22578
+ var Streamable_1 = createCommonjsModule(function (module, exports) {
22579
+
22580
+ Object.defineProperty(exports, "__esModule", {
22581
+ value: true
22582
+ });
22583
+ exports["default"] = exports.Streamable = void 0;
22584
+
22585
+ var _react = _interopRequireWildcard(React__default);
22586
+
22587
+
22588
+
22589
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
22590
+
22591
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22592
+
22593
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
22594
+
22595
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22596
+
22597
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
22598
+
22599
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22600
+
22601
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22602
+
22603
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22604
+
22605
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22606
+
22607
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22608
+
22609
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22610
+
22611
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
22612
+
22613
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22614
+
22615
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22616
+
22617
+ var SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js';
22618
+ var SDK_GLOBAL = 'playerjs';
22619
+ var MATCH_URL = /streamable\.com\/([a-z0-9]+)$/;
22620
+
22621
+ var Streamable =
22622
+ /*#__PURE__*/
22623
+ function (_Component) {
22624
+ _inherits(Streamable, _Component);
22625
+
22626
+ function Streamable() {
22627
+ var _getPrototypeOf2;
22628
+
22629
+ var _this;
22630
+
22631
+ _classCallCheck(this, Streamable);
22632
+
22633
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22634
+ args[_key] = arguments[_key];
22635
+ }
22636
+
22637
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Streamable)).call.apply(_getPrototypeOf2, [this].concat(args)));
22638
+
22639
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
22640
+
22641
+ _defineProperty(_assertThisInitialized(_this), "duration", null);
22642
+
22643
+ _defineProperty(_assertThisInitialized(_this), "currentTime", null);
22644
+
22645
+ _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
22646
+
22647
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
22648
+ _this.callPlayer('mute');
22649
+ });
22650
+
22651
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
22652
+ _this.callPlayer('unmute');
22653
+ });
22654
+
22655
+ _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
22656
+ _this.iframe = iframe;
22657
+ });
22658
+
22659
+ return _this;
22660
+ }
22661
+
22662
+ _createClass(Streamable, [{
22663
+ key: "load",
22664
+ value: function load(url) {
22665
+ var _this2 = this;
22666
+
22667
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
22668
+ if (!_this2.iframe) return;
22669
+ _this2.player = new playerjs.Player(_this2.iframe);
22670
+
22671
+ _this2.player.setLoop(_this2.props.loop);
22672
+
22673
+ _this2.player.on('ready', _this2.props.onReady);
22674
+
22675
+ _this2.player.on('play', _this2.props.onPlay);
22676
+
22677
+ _this2.player.on('pause', _this2.props.onPause);
22678
+
22679
+ _this2.player.on('seeked', _this2.props.onSeek);
22680
+
22681
+ _this2.player.on('ended', _this2.props.onEnded);
22682
+
22683
+ _this2.player.on('error', _this2.props.onError);
22684
+
22685
+ _this2.player.on('timeupdate', function (_ref) {
22686
+ var duration = _ref.duration,
22687
+ seconds = _ref.seconds;
22688
+ _this2.duration = duration;
22689
+ _this2.currentTime = seconds;
22690
+ });
22691
+
22692
+ _this2.player.on('buffered', function (_ref2) {
22693
+ var percent = _ref2.percent;
22694
+
22695
+ if (_this2.duration) {
22696
+ _this2.secondsLoaded = _this2.duration * percent;
22697
+ }
22698
+ });
22699
+
22700
+ if (_this2.props.muted) {
22701
+ _this2.player.mute();
22702
+ }
22703
+ }, this.props.onError);
22704
+ }
22705
+ }, {
22706
+ key: "play",
22707
+ value: function play() {
22708
+ this.callPlayer('play');
22709
+ }
22710
+ }, {
22711
+ key: "pause",
22712
+ value: function pause() {
22713
+ this.callPlayer('pause');
22714
+ }
22715
+ }, {
22716
+ key: "stop",
22717
+ value: function stop() {// Nothing to do
22718
+ }
22719
+ }, {
22720
+ key: "seekTo",
22721
+ value: function seekTo(seconds) {
22722
+ this.callPlayer('setCurrentTime', seconds);
22723
+ }
22724
+ }, {
22725
+ key: "setVolume",
22726
+ value: function setVolume(fraction) {
22727
+ this.callPlayer('setVolume', fraction * 100);
22728
+ }
22729
+ }, {
22730
+ key: "setLoop",
22731
+ value: function setLoop(loop) {
22732
+ this.callPlayer('setLoop', loop);
22733
+ }
22734
+ }, {
22735
+ key: "getDuration",
22736
+ value: function getDuration() {
22737
+ return this.duration;
22738
+ }
22739
+ }, {
22740
+ key: "getCurrentTime",
22741
+ value: function getCurrentTime() {
22742
+ return this.currentTime;
22743
+ }
22744
+ }, {
22745
+ key: "getSecondsLoaded",
22746
+ value: function getSecondsLoaded() {
22747
+ return this.secondsLoaded;
22748
+ }
22749
+ }, {
22750
+ key: "render",
22751
+ value: function render() {
22752
+ var id = this.props.url.match(MATCH_URL)[1];
22753
+ var style = {
22754
+ width: '100%',
22755
+ height: '100%'
22756
+ };
22757
+ return _react["default"].createElement("iframe", {
22758
+ ref: this.ref,
22759
+ src: "https://streamable.com/o/".concat(id),
22760
+ frameBorder: "0",
22761
+ scrolling: "no",
22762
+ style: style,
22763
+ allowFullScreen: true
22764
+ });
22765
+ }
22766
+ }]);
22767
+
22768
+ return Streamable;
22769
+ }(_react.Component);
22770
+
22771
+ exports.Streamable = Streamable;
22772
+
22773
+ _defineProperty(Streamable, "displayName", 'Streamable');
22774
+
22775
+ _defineProperty(Streamable, "canPlay", function (url) {
22776
+ return MATCH_URL.test(url);
22777
+ });
22778
+
22779
+ var _default = (0, _singlePlayer["default"])(Streamable);
22780
+
22781
+ exports["default"] = _default;
22782
+ });
22783
+
22784
+ unwrapExports(Streamable_1);
22785
+ var Streamable_2 = Streamable_1.Streamable;
22786
+
22787
+ var Wistia_1 = createCommonjsModule(function (module, exports) {
22788
+
22789
+ Object.defineProperty(exports, "__esModule", {
22790
+ value: true
22791
+ });
22792
+ exports["default"] = exports.Wistia = void 0;
22793
+
22794
+ var _react = _interopRequireWildcard(React__default);
22795
+
22796
+
22797
+
22798
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
22799
+
22800
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22801
+
22802
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
22803
+
22804
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22805
+
22806
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
22807
+
22808
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22809
+
22810
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22811
+
22812
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22813
+
22814
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22815
+
22816
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22817
+
22818
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22819
+
22820
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22821
+
22822
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22823
+
22824
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
22825
+
22826
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22827
+
22828
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22829
+
22830
+ var SDK_URL = 'https://fast.wistia.com/assets/external/E-v1.js';
22831
+ var SDK_GLOBAL = 'Wistia';
22832
+ var MATCH_URL = /(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/;
22833
+
22834
+ var Wistia =
22835
+ /*#__PURE__*/
22836
+ function (_Component) {
22837
+ _inherits(Wistia, _Component);
22838
+
22839
+ function Wistia() {
22840
+ var _getPrototypeOf2;
22841
+
22842
+ var _this;
22843
+
22844
+ _classCallCheck(this, Wistia);
22845
+
22846
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22847
+ args[_key] = arguments[_key];
22848
+ }
22849
+
22850
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Wistia)).call.apply(_getPrototypeOf2, [this].concat(args)));
22851
+
22852
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
22853
+
22854
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
22855
+ _this.callPlayer('mute');
22856
+ });
22857
+
22858
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
22859
+ _this.callPlayer('unmute');
22860
+ });
22861
+
22862
+ return _this;
22863
+ }
22864
+
22865
+ _createClass(Wistia, [{
22866
+ key: "getID",
22867
+ value: function getID(url) {
22868
+ return url && url.match(MATCH_URL)[1];
22869
+ }
22870
+ }, {
22871
+ key: "load",
22872
+ value: function load(url) {
22873
+ var _this2 = this;
22874
+
22875
+ var _this$props = this.props,
22876
+ playing = _this$props.playing,
22877
+ muted = _this$props.muted,
22878
+ controls = _this$props.controls,
22879
+ _onReady = _this$props.onReady,
22880
+ onPlay = _this$props.onPlay,
22881
+ onPause = _this$props.onPause,
22882
+ onSeek = _this$props.onSeek,
22883
+ onEnded = _this$props.onEnded,
22884
+ config = _this$props.config,
22885
+ onError = _this$props.onError;
22886
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function () {
22887
+ window._wq = window._wq || [];
22888
+
22889
+ window._wq.push({
22890
+ id: _this2.getID(url),
22891
+ options: _objectSpread({
22892
+ autoPlay: playing,
22893
+ silentAutoPlay: 'allow',
22894
+ muted: muted,
22895
+ controlsVisibleOnLoad: controls
22896
+ }, config.wistia.options),
22897
+ onReady: function onReady(player) {
22898
+ _this2.player = player;
22899
+
22900
+ _this2.unbind();
22901
+
22902
+ _this2.player.bind('play', onPlay);
22903
+
22904
+ _this2.player.bind('pause', onPause);
22905
+
22906
+ _this2.player.bind('seek', onSeek);
22907
+
22908
+ _this2.player.bind('end', onEnded);
22909
+
22910
+ _onReady();
22911
+ }
22912
+ });
22913
+ }, onError);
22914
+ }
22915
+ }, {
22916
+ key: "play",
22917
+ value: function play() {
22918
+ this.callPlayer('play');
22919
+ }
22920
+ }, {
22921
+ key: "pause",
22922
+ value: function pause() {
22923
+ this.callPlayer('pause');
22924
+ }
22925
+ }, {
22926
+ key: "unbind",
22927
+ value: function unbind() {
22928
+ var _this$props2 = this.props,
22929
+ onPlay = _this$props2.onPlay,
22930
+ onPause = _this$props2.onPause,
22931
+ onSeek = _this$props2.onSeek,
22932
+ onEnded = _this$props2.onEnded;
22933
+ this.player.unbind('play', onPlay);
22934
+ this.player.unbind('pause', onPause);
22935
+ this.player.unbind('seek', onSeek);
22936
+ this.player.unbind('end', onEnded);
22937
+ }
22938
+ }, {
22939
+ key: "stop",
22940
+ value: function stop() {
22941
+ this.unbind();
22942
+ this.callPlayer('remove');
22943
+ }
22944
+ }, {
22945
+ key: "seekTo",
22946
+ value: function seekTo(seconds) {
22947
+ this.callPlayer('time', seconds);
22948
+ }
22949
+ }, {
22950
+ key: "setVolume",
22951
+ value: function setVolume(fraction) {
22952
+ this.callPlayer('volume', fraction);
22953
+ }
22954
+ }, {
22955
+ key: "setPlaybackRate",
22956
+ value: function setPlaybackRate(rate) {
22957
+ this.callPlayer('playbackRate', rate);
22958
+ }
22959
+ }, {
22960
+ key: "getDuration",
22961
+ value: function getDuration() {
22962
+ return this.callPlayer('duration');
22963
+ }
22964
+ }, {
22965
+ key: "getCurrentTime",
22966
+ value: function getCurrentTime() {
22967
+ return this.callPlayer('time');
22968
+ }
22969
+ }, {
22970
+ key: "getSecondsLoaded",
22971
+ value: function getSecondsLoaded() {
22972
+ return null;
22973
+ }
22974
+ }, {
22975
+ key: "render",
22976
+ value: function render() {
22977
+ var id = this.getID(this.props.url);
22978
+ var className = "wistia_embed wistia_async_".concat(id);
22979
+ var style = {
22980
+ width: '100%',
22981
+ height: '100%'
22982
+ };
22983
+ return _react["default"].createElement("div", {
22984
+ key: id,
22985
+ className: className,
22986
+ style: style
22987
+ });
22988
+ }
22989
+ }]);
22990
+
22991
+ return Wistia;
22992
+ }(_react.Component);
22993
+
22994
+ exports.Wistia = Wistia;
22995
+
22996
+ _defineProperty(Wistia, "displayName", 'Wistia');
22997
+
22998
+ _defineProperty(Wistia, "canPlay", function (url) {
22999
+ return MATCH_URL.test(url);
23000
+ });
23001
+
23002
+ _defineProperty(Wistia, "loopOnEnded", true);
23003
+
23004
+ var _default = (0, _singlePlayer["default"])(Wistia);
23005
+
23006
+ exports["default"] = _default;
23007
+ });
23008
+
23009
+ unwrapExports(Wistia_1);
23010
+ var Wistia_2 = Wistia_1.Wistia;
23011
+
23012
+ var Twitch_1 = createCommonjsModule(function (module, exports) {
23013
+
23014
+ Object.defineProperty(exports, "__esModule", {
23015
+ value: true
23016
+ });
23017
+ exports["default"] = exports.Twitch = void 0;
23018
+
23019
+ var _react = _interopRequireWildcard(React__default);
23020
+
23021
+
23022
+
23023
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
23024
+
23025
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23026
+
23027
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23028
+
23029
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23030
+
23031
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23032
+
23033
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
23034
+
23035
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23036
+
23037
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23038
+
23039
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23040
+
23041
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23042
+
23043
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
23044
+
23045
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23046
+
23047
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
23048
+
23049
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
23050
+
23051
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23052
+
23053
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23054
+
23055
+ var SDK_URL = 'https://player.twitch.tv/js/embed/v1.js';
23056
+ var SDK_GLOBAL = 'Twitch';
23057
+ var MATCH_VIDEO_URL = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
23058
+ var MATCH_CHANNEL_URL = /(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/;
23059
+ var PLAYER_ID_PREFIX = 'twitch-player-';
23060
+
23061
+ var Twitch =
23062
+ /*#__PURE__*/
23063
+ function (_Component) {
23064
+ _inherits(Twitch, _Component);
23065
+
23066
+ function Twitch() {
23067
+ var _getPrototypeOf2;
23068
+
23069
+ var _this;
23070
+
23071
+ _classCallCheck(this, Twitch);
23072
+
23073
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23074
+ args[_key] = arguments[_key];
23075
+ }
23076
+
23077
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Twitch)).call.apply(_getPrototypeOf2, [this].concat(args)));
23078
+
23079
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
23080
+
23081
+ _defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.twitch.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, utils$2.randomString)()));
23082
+
23083
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
23084
+ _this.callPlayer('setMuted', true);
23085
+ });
23086
+
23087
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
23088
+ _this.callPlayer('setMuted', false);
23089
+ });
23090
+
23091
+ return _this;
23092
+ }
23093
+
23094
+ _createClass(Twitch, [{
23095
+ key: "load",
23096
+ value: function load(url, isReady) {
23097
+ var _this2 = this;
23098
+
23099
+ var _this$props = this.props,
23100
+ playsinline = _this$props.playsinline,
23101
+ onError = _this$props.onError,
23102
+ config = _this$props.config,
23103
+ controls = _this$props.controls;
23104
+ var isChannel = MATCH_CHANNEL_URL.test(url);
23105
+ var id = isChannel ? url.match(MATCH_CHANNEL_URL)[1] : url.match(MATCH_VIDEO_URL)[1];
23106
+
23107
+ if (isReady) {
23108
+ if (isChannel) {
23109
+ this.player.setChannel(id);
23110
+ } else {
23111
+ this.player.setVideo('v' + id);
23112
+ }
23113
+
23114
+ return;
23115
+ }
23116
+
23117
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Twitch) {
23118
+ _this2.player = new Twitch.Player(_this2.playerID, _objectSpread({
23119
+ video: isChannel ? '' : id,
23120
+ channel: isChannel ? id : '',
23121
+ height: '100%',
23122
+ width: '100%',
23123
+ playsinline: playsinline,
23124
+ autoplay: _this2.props.playing,
23125
+ muted: _this2.props.muted,
23126
+ // https://github.com/CookPete/react-player/issues/733#issuecomment-549085859
23127
+ controls: isChannel ? true : controls
23128
+ }, config.twitch.options));
23129
+ var _Twitch$Player = Twitch.Player,
23130
+ READY = _Twitch$Player.READY,
23131
+ PLAYING = _Twitch$Player.PLAYING,
23132
+ PAUSE = _Twitch$Player.PAUSE,
23133
+ ENDED = _Twitch$Player.ENDED,
23134
+ ONLINE = _Twitch$Player.ONLINE,
23135
+ OFFLINE = _Twitch$Player.OFFLINE;
23136
+
23137
+ _this2.player.addEventListener(READY, _this2.props.onReady);
23138
+
23139
+ _this2.player.addEventListener(PLAYING, _this2.props.onPlay);
23140
+
23141
+ _this2.player.addEventListener(PAUSE, _this2.props.onPause);
23142
+
23143
+ _this2.player.addEventListener(ENDED, _this2.props.onEnded); // Prevent weird isLoading behaviour when streams are offline
23144
+
23145
+
23146
+ _this2.player.addEventListener(ONLINE, _this2.props.onLoaded);
23147
+
23148
+ _this2.player.addEventListener(OFFLINE, _this2.props.onLoaded);
23149
+ }, onError);
23150
+ }
23151
+ }, {
23152
+ key: "play",
23153
+ value: function play() {
23154
+ this.callPlayer('play');
23155
+ }
23156
+ }, {
23157
+ key: "pause",
23158
+ value: function pause() {
23159
+ this.callPlayer('pause');
23160
+ }
23161
+ }, {
23162
+ key: "stop",
23163
+ value: function stop() {
23164
+ this.callPlayer('pause');
23165
+ }
23166
+ }, {
23167
+ key: "seekTo",
23168
+ value: function seekTo(seconds) {
23169
+ this.callPlayer('seek', seconds);
23170
+ }
23171
+ }, {
23172
+ key: "setVolume",
23173
+ value: function setVolume(fraction) {
23174
+ this.callPlayer('setVolume', fraction);
23175
+ }
23176
+ }, {
23177
+ key: "getDuration",
23178
+ value: function getDuration() {
23179
+ return this.callPlayer('getDuration');
23180
+ }
23181
+ }, {
23182
+ key: "getCurrentTime",
23183
+ value: function getCurrentTime() {
23184
+ return this.callPlayer('getCurrentTime');
23185
+ }
23186
+ }, {
23187
+ key: "getSecondsLoaded",
23188
+ value: function getSecondsLoaded() {
23189
+ return null;
23190
+ }
23191
+ }, {
23192
+ key: "render",
23193
+ value: function render() {
23194
+ var style = {
23195
+ width: '100%',
23196
+ height: '100%'
23197
+ };
23198
+ return _react["default"].createElement("div", {
23199
+ style: style,
23200
+ id: this.playerID
23201
+ });
23202
+ }
23203
+ }]);
23204
+
23205
+ return Twitch;
23206
+ }(_react.Component);
23207
+
23208
+ exports.Twitch = Twitch;
23209
+
23210
+ _defineProperty(Twitch, "displayName", 'Twitch');
23211
+
23212
+ _defineProperty(Twitch, "canPlay", function (url) {
23213
+ return MATCH_VIDEO_URL.test(url) || MATCH_CHANNEL_URL.test(url);
23214
+ });
23215
+
23216
+ _defineProperty(Twitch, "loopOnEnded", true);
23217
+
23218
+ var _default = (0, _singlePlayer["default"])(Twitch);
23219
+
23220
+ exports["default"] = _default;
23221
+ });
23222
+
23223
+ unwrapExports(Twitch_1);
23224
+ var Twitch_2 = Twitch_1.Twitch;
23225
+
23226
+ var DailyMotion_1 = createCommonjsModule(function (module, exports) {
23227
+
23228
+ Object.defineProperty(exports, "__esModule", {
23229
+ value: true
23230
+ });
23231
+ exports["default"] = exports.DailyMotion = void 0;
23232
+
23233
+ var _react = _interopRequireWildcard(React__default);
23234
+
23235
+
23236
+
23237
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
23238
+
23239
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23240
+
23241
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23242
+
23243
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23244
+
23245
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23246
+
23247
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
23248
+
23249
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23250
+
23251
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
23252
+
23253
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
23254
+
23255
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
23256
+
23257
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23258
+
23259
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23260
+
23261
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23262
+
23263
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23264
+
23265
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
23266
+
23267
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23268
+
23269
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
23270
+
23271
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
23272
+
23273
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23274
+
23275
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23276
+
23277
+ var SDK_URL = 'https://api.dmcdn.net/all.js';
23278
+ var SDK_GLOBAL = 'DM';
23279
+ var SDK_GLOBAL_READY = 'dmAsyncInit';
23280
+ var MATCH_URL = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/;
23281
+
23282
+ var DailyMotion =
23283
+ /*#__PURE__*/
23284
+ function (_Component) {
23285
+ _inherits(DailyMotion, _Component);
23286
+
23287
+ function DailyMotion() {
23288
+ var _getPrototypeOf2;
23289
+
23290
+ var _this;
23291
+
23292
+ _classCallCheck(this, DailyMotion);
23293
+
23294
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23295
+ args[_key] = arguments[_key];
23296
+ }
23297
+
23298
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DailyMotion)).call.apply(_getPrototypeOf2, [this].concat(args)));
23299
+
23300
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
23301
+
23302
+ _defineProperty(_assertThisInitialized(_this), "onDurationChange", function () {
23303
+ var duration = _this.getDuration();
23304
+
23305
+ _this.props.onDuration(duration);
23306
+ });
23307
+
23308
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
23309
+ _this.callPlayer('setMuted', true);
23310
+ });
23311
+
23312
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
23313
+ _this.callPlayer('setMuted', false);
23314
+ });
23315
+
23316
+ _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
23317
+ _this.container = container;
23318
+ });
23319
+
23320
+ return _this;
23321
+ }
23322
+
23323
+ _createClass(DailyMotion, [{
23324
+ key: "load",
23325
+ value: function load(url) {
23326
+ var _this2 = this;
23327
+
23328
+ var _this$props = this.props,
23329
+ controls = _this$props.controls,
23330
+ config = _this$props.config,
23331
+ onError = _this$props.onError,
23332
+ playing = _this$props.playing;
23333
+
23334
+ var _url$match = url.match(MATCH_URL),
23335
+ _url$match2 = _slicedToArray(_url$match, 2),
23336
+ id = _url$match2[1];
23337
+
23338
+ if (this.player) {
23339
+ this.player.load(id, {
23340
+ start: (0, utils$2.parseStartTime)(url),
23341
+ autoplay: playing
23342
+ });
23343
+ return;
23344
+ }
23345
+
23346
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {
23347
+ return DM.player;
23348
+ }).then(function (DM) {
23349
+ if (!_this2.container) return;
23350
+ var Player = DM.player;
23351
+ _this2.player = new Player(_this2.container, {
23352
+ width: '100%',
23353
+ height: '100%',
23354
+ video: id,
23355
+ params: _objectSpread({
23356
+ controls: controls,
23357
+ autoplay: _this2.props.playing,
23358
+ mute: _this2.props.muted,
23359
+ start: (0, utils$2.parseStartTime)(url),
23360
+ origin: window.location.origin
23361
+ }, config.dailymotion.params),
23362
+ events: {
23363
+ apiready: _this2.props.onReady,
23364
+ seeked: function seeked() {
23365
+ return _this2.props.onSeek(_this2.player.currentTime);
23366
+ },
23367
+ video_end: _this2.props.onEnded,
23368
+ durationchange: _this2.onDurationChange,
23369
+ pause: _this2.props.onPause,
23370
+ playing: _this2.props.onPlay,
23371
+ waiting: _this2.props.onBuffer,
23372
+ error: function error(event) {
23373
+ return onError(event);
23374
+ }
23375
+ }
23376
+ });
23377
+ }, onError);
23378
+ }
23379
+ }, {
23380
+ key: "play",
23381
+ value: function play() {
23382
+ this.callPlayer('play');
23383
+ }
23384
+ }, {
23385
+ key: "pause",
23386
+ value: function pause() {
23387
+ this.callPlayer('pause');
23388
+ }
23389
+ }, {
23390
+ key: "stop",
23391
+ value: function stop() {// Nothing to do
23392
+ }
23393
+ }, {
23394
+ key: "seekTo",
23395
+ value: function seekTo(seconds) {
23396
+ this.callPlayer('seek', seconds);
23397
+ }
23398
+ }, {
23399
+ key: "setVolume",
23400
+ value: function setVolume(fraction) {
23401
+ this.callPlayer('setVolume', fraction);
23402
+ }
23403
+ }, {
23404
+ key: "getDuration",
23405
+ value: function getDuration() {
23406
+ return this.player.duration || null;
23407
+ }
23408
+ }, {
23409
+ key: "getCurrentTime",
23410
+ value: function getCurrentTime() {
23411
+ return this.player.currentTime;
23412
+ }
23413
+ }, {
23414
+ key: "getSecondsLoaded",
23415
+ value: function getSecondsLoaded() {
23416
+ return this.player.bufferedTime;
23417
+ }
23418
+ }, {
23419
+ key: "render",
23420
+ value: function render() {
23421
+ var display = this.props.display;
23422
+ var style = {
23423
+ width: '100%',
23424
+ height: '100%',
23425
+ display: display
23426
+ };
23427
+ return _react["default"].createElement("div", {
23428
+ style: style
23429
+ }, _react["default"].createElement("div", {
23430
+ ref: this.ref
23431
+ }));
23432
+ }
23433
+ }]);
23434
+
23435
+ return DailyMotion;
23436
+ }(_react.Component);
23437
+
23438
+ exports.DailyMotion = DailyMotion;
23439
+
23440
+ _defineProperty(DailyMotion, "displayName", 'DailyMotion');
23441
+
23442
+ _defineProperty(DailyMotion, "canPlay", function (url) {
23443
+ return MATCH_URL.test(url);
23444
+ });
23445
+
23446
+ _defineProperty(DailyMotion, "loopOnEnded", true);
23447
+
23448
+ var _default = (0, _singlePlayer["default"])(DailyMotion);
23449
+
23450
+ exports["default"] = _default;
23451
+ });
23452
+
23453
+ unwrapExports(DailyMotion_1);
23454
+ var DailyMotion_2 = DailyMotion_1.DailyMotion;
23455
+
23456
+ var Mixcloud_1 = createCommonjsModule(function (module, exports) {
23457
+
23458
+ Object.defineProperty(exports, "__esModule", {
23459
+ value: true
23460
+ });
23461
+ exports["default"] = exports.Mixcloud = void 0;
23462
+
23463
+ var _react = _interopRequireWildcard(React__default);
23464
+
23465
+
23466
+
23467
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
23468
+
23469
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23470
+
23471
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23472
+
23473
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23474
+
23475
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23476
+
23477
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
23478
+
23479
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23480
+
23481
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23482
+
23483
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23484
+
23485
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23486
+
23487
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
23488
+
23489
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23490
+
23491
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
23492
+
23493
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
23494
+
23495
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23496
+
23497
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23498
+
23499
+ var SDK_URL = 'https://widget.mixcloud.com/media/js/widgetApi.js';
23500
+ var SDK_GLOBAL = 'Mixcloud';
23501
+ var MATCH_URL = /mixcloud\.com\/([^/]+\/[^/]+)/;
23502
+
23503
+ var Mixcloud =
23504
+ /*#__PURE__*/
23505
+ function (_Component) {
23506
+ _inherits(Mixcloud, _Component);
23507
+
23508
+ function Mixcloud() {
23509
+ var _getPrototypeOf2;
23510
+
23511
+ var _this;
23512
+
23513
+ _classCallCheck(this, Mixcloud);
23514
+
23515
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23516
+ args[_key] = arguments[_key];
23517
+ }
23518
+
23519
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Mixcloud)).call.apply(_getPrototypeOf2, [this].concat(args)));
23520
+
23521
+ _defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
23522
+
23523
+ _defineProperty(_assertThisInitialized(_this), "duration", null);
23524
+
23525
+ _defineProperty(_assertThisInitialized(_this), "currentTime", null);
23526
+
23527
+ _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
23528
+
23529
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {// No volume support
23530
+ });
23531
+
23532
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {// No volume support
23533
+ });
23534
+
23535
+ _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
23536
+ _this.iframe = iframe;
23537
+ });
23538
+
23539
+ return _this;
23540
+ }
23541
+
23542
+ _createClass(Mixcloud, [{
23543
+ key: "load",
23544
+ value: function load(url) {
23545
+ var _this2 = this;
23546
+
23547
+ (0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Mixcloud) {
23548
+ _this2.player = Mixcloud.PlayerWidget(_this2.iframe);
23549
+
23550
+ _this2.player.ready.then(function () {
23551
+ _this2.player.events.play.on(_this2.props.onPlay);
23552
+
23553
+ _this2.player.events.pause.on(_this2.props.onPause);
23554
+
23555
+ _this2.player.events.ended.on(_this2.props.onEnded);
23556
+
23557
+ _this2.player.events.error.on(_this2.props.error);
23558
+
23559
+ _this2.player.events.progress.on(function (seconds, duration) {
23560
+ _this2.currentTime = seconds;
23561
+ _this2.duration = duration;
23562
+ });
23563
+
23564
+ _this2.props.onReady();
23565
+ });
23566
+ }, this.props.onError);
23567
+ }
23568
+ }, {
23569
+ key: "play",
23570
+ value: function play() {
23571
+ this.callPlayer('play');
23572
+ }
23573
+ }, {
23574
+ key: "pause",
23575
+ value: function pause() {
23576
+ this.callPlayer('pause');
23577
+ }
23578
+ }, {
23579
+ key: "stop",
23580
+ value: function stop() {// Nothing to do
23581
+ }
23582
+ }, {
23583
+ key: "seekTo",
23584
+ value: function seekTo(seconds) {
23585
+ this.callPlayer('seek', seconds);
23586
+ }
23587
+ }, {
23588
+ key: "setVolume",
23589
+ value: function setVolume(fraction) {// No volume support
23590
+ }
23591
+ }, {
23592
+ key: "getDuration",
23593
+ value: function getDuration() {
23594
+ return this.duration;
23595
+ }
23596
+ }, {
23597
+ key: "getCurrentTime",
23598
+ value: function getCurrentTime() {
23599
+ return this.currentTime;
23600
+ }
23601
+ }, {
23602
+ key: "getSecondsLoaded",
23603
+ value: function getSecondsLoaded() {
23604
+ return null;
23605
+ }
23606
+ }, {
23607
+ key: "render",
23608
+ value: function render() {
23609
+ var _this$props = this.props,
23610
+ url = _this$props.url,
23611
+ config = _this$props.config;
23612
+ var id = url.match(MATCH_URL)[1];
23613
+ var style = {
23614
+ width: '100%',
23615
+ height: '100%'
23616
+ };
23617
+ var query = (0, utils$2.queryString)(_objectSpread({}, config.mixcloud.options, {
23618
+ feed: "/".concat(id, "/")
23619
+ })); // We have to give the iframe a key here to prevent a
23620
+ // weird dialog appearing when loading a new track
23621
+
23622
+ return _react["default"].createElement("iframe", {
23623
+ key: id,
23624
+ ref: this.ref,
23625
+ style: style,
23626
+ src: "https://www.mixcloud.com/widget/iframe/?".concat(query),
23627
+ frameBorder: "0"
23628
+ });
23629
+ }
23630
+ }]);
23631
+
23632
+ return Mixcloud;
23633
+ }(_react.Component);
23634
+
23635
+ exports.Mixcloud = Mixcloud;
23636
+
23637
+ _defineProperty(Mixcloud, "displayName", 'Mixcloud');
23638
+
23639
+ _defineProperty(Mixcloud, "canPlay", function (url) {
23640
+ return MATCH_URL.test(url);
23641
+ });
23642
+
23643
+ _defineProperty(Mixcloud, "loopOnEnded", true);
23644
+
23645
+ var _default = (0, _singlePlayer["default"])(Mixcloud);
23646
+
23647
+ exports["default"] = _default;
23648
+ });
23649
+
23650
+ unwrapExports(Mixcloud_1);
23651
+ var Mixcloud_2 = Mixcloud_1.Mixcloud;
23652
+
23653
+ var FilePlayer_1 = createCommonjsModule(function (module, exports) {
23654
+
23655
+ Object.defineProperty(exports, "__esModule", {
23656
+ value: true
23657
+ });
23658
+ exports["default"] = exports.FilePlayer = void 0;
23659
+
23660
+ var _react = _interopRequireWildcard(React__default);
23661
+
23662
+
23663
+
23664
+ var _singlePlayer = _interopRequireDefault(singlePlayer);
23665
+
23666
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23667
+
23668
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23669
+
23670
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23671
+
23672
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23673
+
23674
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23675
+
23676
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23677
+
23678
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23679
+
23680
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23681
+
23682
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
23683
+
23684
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23685
+
23686
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
23687
+
23688
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
23689
+
23690
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23691
+
23692
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23693
+
23694
+ var IOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
23695
+ var AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
23696
+ var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i;
23697
+ var HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
23698
+ var HLS_SDK_URL = 'https://cdn.jsdelivr.net/npm/hls.js@VERSION';
23699
+ var HLS_GLOBAL = 'Hls';
23700
+ var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
23701
+ var DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js';
23702
+ var DASH_GLOBAL = 'dashjs';
23703
+ var MATCH_DROPBOX_URL = /www\.dropbox\.com\/.+/;
23704
+
23705
+ function canPlay(url) {
23706
+ if (url instanceof Array) {
23707
+ var _iteratorNormalCompletion = true;
23708
+ var _didIteratorError = false;
23709
+ var _iteratorError = undefined;
23710
+
23711
+ try {
23712
+ for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
23713
+ var item = _step.value;
23714
+
23715
+ if (typeof item === 'string' && canPlay(item)) {
23716
+ return true;
23717
+ }
23718
+
23719
+ if (canPlay(item.src)) {
23720
+ return true;
23721
+ }
23722
+ }
23723
+ } catch (err) {
23724
+ _didIteratorError = true;
23725
+ _iteratorError = err;
23726
+ } finally {
23727
+ try {
23728
+ if (!_iteratorNormalCompletion && _iterator["return"] != null) {
23729
+ _iterator["return"]();
23730
+ }
23731
+ } finally {
23732
+ if (_didIteratorError) {
23733
+ throw _iteratorError;
23734
+ }
23735
+ }
23736
+ }
23737
+
23738
+ return false;
23739
+ }
23740
+
23741
+ if ((0, utils$2.isMediaStream)(url)) {
23742
+ return true;
23743
+ }
23744
+
23745
+ return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url);
23746
+ }
23747
+
23748
+ function supportsWebKitPresentationMode(video) {
23749
+ if (!video) video = document.createElement('video'); // Check if Safari supports PiP, and is not on mobile (other than iPad)
23750
+ // iPhone safari appears to "support" PiP through the check, however PiP does not function
23751
+
23752
+ return video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' && !/iPhone|iPod/.test(navigator.userAgent);
23753
+ }
23754
+
23755
+ function canEnablePIP(url) {
23756
+ return canPlay(url) && (!!document.pictureInPictureEnabled || supportsWebKitPresentationMode()) && !AUDIO_EXTENSIONS.test(url);
23757
+ }
23758
+
23759
+ var FilePlayer =
23760
+ /*#__PURE__*/
23761
+ function (_Component) {
23762
+ _inherits(FilePlayer, _Component);
23763
+
23764
+ function FilePlayer() {
23765
+ var _getPrototypeOf2;
23766
+
23767
+ var _this;
23768
+
23769
+ _classCallCheck(this, FilePlayer);
23770
+
23771
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
23772
+ _args[_key] = arguments[_key];
23773
+ }
23774
+
23775
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(FilePlayer)).call.apply(_getPrototypeOf2, [this].concat(_args)));
23776
+
23777
+ _defineProperty(_assertThisInitialized(_this), "onReady", function () {
23778
+ var _this$props;
23779
+
23780
+ return (_this$props = _this.props).onReady.apply(_this$props, arguments);
23781
+ });
23782
+
23783
+ _defineProperty(_assertThisInitialized(_this), "onPlay", function () {
23784
+ var _this$props2;
23785
+
23786
+ return (_this$props2 = _this.props).onPlay.apply(_this$props2, arguments);
23787
+ });
23788
+
23789
+ _defineProperty(_assertThisInitialized(_this), "onBuffer", function () {
23790
+ var _this$props3;
23791
+
23792
+ return (_this$props3 = _this.props).onBuffer.apply(_this$props3, arguments);
23793
+ });
23794
+
23795
+ _defineProperty(_assertThisInitialized(_this), "onBufferEnd", function () {
23796
+ var _this$props4;
23797
+
23798
+ return (_this$props4 = _this.props).onBufferEnd.apply(_this$props4, arguments);
23799
+ });
23800
+
23801
+ _defineProperty(_assertThisInitialized(_this), "onPause", function () {
23802
+ var _this$props5;
23803
+
23804
+ return (_this$props5 = _this.props).onPause.apply(_this$props5, arguments);
23805
+ });
23806
+
23807
+ _defineProperty(_assertThisInitialized(_this), "onEnded", function () {
23808
+ var _this$props6;
23809
+
23810
+ return (_this$props6 = _this.props).onEnded.apply(_this$props6, arguments);
23811
+ });
23812
+
23813
+ _defineProperty(_assertThisInitialized(_this), "onError", function () {
23814
+ var _this$props7;
23815
+
23816
+ return (_this$props7 = _this.props).onError.apply(_this$props7, arguments);
23817
+ });
23818
+
23819
+ _defineProperty(_assertThisInitialized(_this), "onEnablePIP", function () {
23820
+ var _this$props8;
23821
+
23822
+ return (_this$props8 = _this.props).onEnablePIP.apply(_this$props8, arguments);
23823
+ });
23824
+
23825
+ _defineProperty(_assertThisInitialized(_this), "onDisablePIP", function (e) {
23826
+ var _this$props9 = _this.props,
23827
+ onDisablePIP = _this$props9.onDisablePIP,
23828
+ playing = _this$props9.playing;
23829
+ onDisablePIP(e);
23830
+
23831
+ if (playing) {
23832
+ _this.play();
23833
+ }
23834
+ });
23835
+
23836
+ _defineProperty(_assertThisInitialized(_this), "onPresentationModeChange", function (e) {
23837
+ if (_this.player && supportsWebKitPresentationMode(_this.player)) {
23838
+ var webkitPresentationMode = _this.player.webkitPresentationMode;
23839
+
23840
+ if (webkitPresentationMode === 'picture-in-picture') {
23841
+ _this.onEnablePIP(e);
23842
+ } else if (webkitPresentationMode === 'inline') {
23843
+ _this.onDisablePIP(e);
23844
+ }
23845
+ }
23846
+ });
23847
+
23848
+ _defineProperty(_assertThisInitialized(_this), "onSeek", function (e) {
23849
+ _this.props.onSeek(e.target.currentTime);
23850
+ });
23851
+
23852
+ _defineProperty(_assertThisInitialized(_this), "mute", function () {
23853
+ _this.player.muted = true;
23854
+ });
23855
+
23856
+ _defineProperty(_assertThisInitialized(_this), "unmute", function () {
23857
+ _this.player.muted = false;
23858
+ });
23859
+
23860
+ _defineProperty(_assertThisInitialized(_this), "renderSourceElement", function (source, index) {
23861
+ if (typeof source === 'string') {
23862
+ return _react["default"].createElement("source", {
23863
+ key: index,
23864
+ src: source
23865
+ });
23866
+ }
23867
+
23868
+ return _react["default"].createElement("source", _extends({
23869
+ key: index
23870
+ }, source));
23871
+ });
23872
+
23873
+ _defineProperty(_assertThisInitialized(_this), "renderTrack", function (track, index) {
23874
+ return _react["default"].createElement("track", _extends({
23875
+ key: index
23876
+ }, track));
23877
+ });
23878
+
23879
+ _defineProperty(_assertThisInitialized(_this), "ref", function (player) {
23880
+ if (_this.player) {
23881
+ // Store previous player to be used by removeListeners()
23882
+ _this.prevPlayer = _this.player;
23883
+ }
23884
+
23885
+ _this.player = player;
23886
+ });
23887
+
23888
+ return _this;
23889
+ }
23890
+
23891
+ _createClass(FilePlayer, [{
23892
+ key: "componentDidMount",
23893
+ value: function componentDidMount() {
23894
+ this.addListeners(this.player);
23895
+
23896
+ if (IOS) {
23897
+ this.player.load();
23898
+ }
23899
+ }
23900
+ }, {
23901
+ key: "componentDidUpdate",
23902
+ value: function componentDidUpdate(prevProps) {
23903
+ if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {
23904
+ this.removeListeners(this.prevPlayer);
23905
+ this.addListeners(this.player);
23906
+ }
23907
+ }
23908
+ }, {
23909
+ key: "componentWillUnmount",
23910
+ value: function componentWillUnmount() {
23911
+ this.removeListeners(this.player);
23912
+ }
23913
+ }, {
23914
+ key: "addListeners",
23915
+ value: function addListeners(player) {
23916
+ var playsinline = this.props.playsinline;
23917
+ player.addEventListener('canplay', this.onReady);
23918
+ player.addEventListener('play', this.onPlay);
23919
+ player.addEventListener('waiting', this.onBuffer);
23920
+ player.addEventListener('playing', this.onBufferEnd);
23921
+ player.addEventListener('pause', this.onPause);
23922
+ player.addEventListener('seeked', this.onSeek);
23923
+ player.addEventListener('ended', this.onEnded);
23924
+ player.addEventListener('error', this.onError);
23925
+ player.addEventListener('enterpictureinpicture', this.onEnablePIP);
23926
+ player.addEventListener('leavepictureinpicture', this.onDisablePIP);
23927
+ player.addEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);
23928
+
23929
+ if (playsinline) {
23930
+ player.setAttribute('playsinline', '');
23931
+ player.setAttribute('webkit-playsinline', '');
23932
+ player.setAttribute('x5-playsinline', '');
23933
+ }
23934
+ }
23935
+ }, {
23936
+ key: "removeListeners",
23937
+ value: function removeListeners(player) {
23938
+ player.removeEventListener('canplay', this.onReady);
23939
+ player.removeEventListener('play', this.onPlay);
23940
+ player.removeEventListener('waiting', this.onBuffer);
23941
+ player.removeEventListener('playing', this.onBufferEnd);
23942
+ player.removeEventListener('pause', this.onPause);
23943
+ player.removeEventListener('seeked', this.onSeek);
23944
+ player.removeEventListener('ended', this.onEnded);
23945
+ player.removeEventListener('error', this.onError);
23946
+ player.removeEventListener('enterpictureinpicture', this.onEnablePIP);
23947
+ player.removeEventListener('leavepictureinpicture', this.onDisablePIP);
23948
+ player.removeEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);
23949
+ } // Proxy methods to prevent listener leaks
23950
+
23951
+ }, {
23952
+ key: "shouldUseAudio",
23953
+ value: function shouldUseAudio(props) {
23954
+ if (props.config.file.forceVideo) {
23955
+ return false;
23956
+ }
23957
+
23958
+ if (props.config.file.attributes.poster) {
23959
+ return false; // Use <video> so that poster is shown
23960
+ }
23961
+
23962
+ return AUDIO_EXTENSIONS.test(props.url) || props.config.file.forceAudio;
23963
+ }
23964
+ }, {
23965
+ key: "shouldUseHLS",
23966
+ value: function shouldUseHLS(url) {
23967
+ return HLS_EXTENSIONS.test(url) && !IOS || this.props.config.file.forceHLS;
23968
+ }
23969
+ }, {
23970
+ key: "shouldUseDASH",
23971
+ value: function shouldUseDASH(url) {
23972
+ return DASH_EXTENSIONS.test(url) || this.props.config.file.forceDASH;
23973
+ }
23974
+ }, {
23975
+ key: "load",
23976
+ value: function load(url) {
23977
+ var _this2 = this;
23978
+
23979
+ var _this$props$config$fi = this.props.config.file,
23980
+ hlsVersion = _this$props$config$fi.hlsVersion,
23981
+ dashVersion = _this$props$config$fi.dashVersion;
23982
+
23983
+ if (this.shouldUseHLS(url)) {
23984
+ (0, utils$2.getSDK)(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(function (Hls) {
23985
+ _this2.hls = new Hls(_this2.props.config.file.hlsOptions);
23986
+
23987
+ _this2.hls.on(Hls.Events.ERROR, function (e, data) {
23988
+ _this2.props.onError(e, data, _this2.hls, Hls);
23989
+ });
23990
+
23991
+ _this2.hls.loadSource(url);
23992
+
23993
+ _this2.hls.attachMedia(_this2.player);
23994
+ });
23995
+ }
23996
+
23997
+ if (this.shouldUseDASH(url)) {
23998
+ (0, utils$2.getSDK)(DASH_SDK_URL.replace('VERSION', dashVersion), DASH_GLOBAL).then(function (dashjs) {
23999
+ _this2.dash = dashjs.MediaPlayer().create();
24000
+
24001
+ _this2.dash.initialize(_this2.player, url, _this2.props.playing);
24002
+
24003
+ _this2.dash.on('error', _this2.props.onError);
24004
+
24005
+ _this2.dash.getDebug().setLogToBrowserConsole(false);
24006
+ });
24007
+ }
24008
+
24009
+ if (url instanceof Array) {
24010
+ // When setting new urls (<source>) on an already loaded video,
24011
+ // HTMLMediaElement.load() is needed to reset the media element
24012
+ // and restart the media resource. Just replacing children source
24013
+ // dom nodes is not enough
24014
+ this.player.load();
24015
+ } else if ((0, utils$2.isMediaStream)(url)) {
24016
+ try {
24017
+ this.player.srcObject = url;
24018
+ } catch (e) {
24019
+ this.player.src = window.URL.createObjectURL(url);
24020
+ }
24021
+ }
24022
+ }
24023
+ }, {
24024
+ key: "play",
24025
+ value: function play() {
24026
+ var promise = this.player.play();
24027
+
24028
+ if (promise) {
24029
+ promise["catch"](this.props.onError);
24030
+ }
24031
+ }
24032
+ }, {
24033
+ key: "pause",
24034
+ value: function pause() {
24035
+ this.player.pause();
24036
+ }
24037
+ }, {
24038
+ key: "stop",
24039
+ value: function stop() {
24040
+ this.player.removeAttribute('src');
24041
+
24042
+ if (this.hls) {
24043
+ this.hls.destroy();
24044
+ }
24045
+
24046
+ if (this.dash) {
24047
+ this.dash.reset();
24048
+ }
24049
+ }
24050
+ }, {
24051
+ key: "seekTo",
24052
+ value: function seekTo(seconds) {
24053
+ this.player.currentTime = seconds;
24054
+ }
24055
+ }, {
24056
+ key: "setVolume",
24057
+ value: function setVolume(fraction) {
24058
+ this.player.volume = fraction;
24059
+ }
24060
+ }, {
24061
+ key: "enablePIP",
24062
+ value: function enablePIP() {
24063
+ if (this.player.requestPictureInPicture && document.pictureInPictureElement !== this.player) {
24064
+ this.player.requestPictureInPicture();
24065
+ } else if (supportsWebKitPresentationMode(this.player) && this.player.webkitPresentationMode !== 'picture-in-picture') {
24066
+ this.player.webkitSetPresentationMode('picture-in-picture');
24067
+ }
24068
+ }
24069
+ }, {
24070
+ key: "disablePIP",
24071
+ value: function disablePIP() {
24072
+ if (document.exitPictureInPicture && document.pictureInPictureElement === this.player) {
24073
+ document.exitPictureInPicture();
24074
+ } else if (supportsWebKitPresentationMode(this.player) && this.player.webkitPresentationMode !== 'inline') {
24075
+ this.player.webkitSetPresentationMode('inline');
24076
+ }
24077
+ }
24078
+ }, {
24079
+ key: "setPlaybackRate",
24080
+ value: function setPlaybackRate(rate) {
24081
+ this.player.playbackRate = rate;
24082
+ }
24083
+ }, {
24084
+ key: "getDuration",
24085
+ value: function getDuration() {
24086
+ if (!this.player) return null;
24087
+ var _this$player = this.player,
24088
+ duration = _this$player.duration,
24089
+ seekable = _this$player.seekable; // on iOS, live streams return Infinity for the duration
24090
+ // so instead we use the end of the seekable timerange
24091
+
24092
+ if (duration === Infinity && seekable.length > 0) {
24093
+ return seekable.end(seekable.length - 1);
24094
+ }
24095
+
24096
+ return duration;
24097
+ }
24098
+ }, {
24099
+ key: "getCurrentTime",
24100
+ value: function getCurrentTime() {
24101
+ if (!this.player) return null;
24102
+ return this.player.currentTime;
24103
+ }
24104
+ }, {
24105
+ key: "getSecondsLoaded",
24106
+ value: function getSecondsLoaded() {
24107
+ if (!this.player) return null;
24108
+ var buffered = this.player.buffered;
24109
+
24110
+ if (buffered.length === 0) {
24111
+ return 0;
24112
+ }
24113
+
24114
+ var end = buffered.end(buffered.length - 1);
24115
+ var duration = this.getDuration();
24116
+
24117
+ if (end > duration) {
24118
+ return duration;
24119
+ }
24120
+
24121
+ return end;
24122
+ }
24123
+ }, {
24124
+ key: "getSource",
24125
+ value: function getSource(url) {
24126
+ var useHLS = this.shouldUseHLS(url);
24127
+ var useDASH = this.shouldUseDASH(url);
24128
+
24129
+ if (url instanceof Array || (0, utils$2.isMediaStream)(url) || useHLS || useDASH) {
24130
+ return undefined;
24131
+ }
24132
+
24133
+ if (MATCH_DROPBOX_URL.test(url)) {
24134
+ return url.replace('www.dropbox.com', 'dl.dropboxusercontent.com');
24135
+ }
24136
+
24137
+ return url;
24138
+ }
24139
+ }, {
24140
+ key: "render",
24141
+ value: function render() {
24142
+ var _this$props10 = this.props,
24143
+ url = _this$props10.url,
24144
+ playing = _this$props10.playing,
24145
+ loop = _this$props10.loop,
24146
+ controls = _this$props10.controls,
24147
+ muted = _this$props10.muted,
24148
+ config = _this$props10.config,
24149
+ width = _this$props10.width,
24150
+ height = _this$props10.height;
24151
+ var useAudio = this.shouldUseAudio(this.props);
24152
+ var Element = useAudio ? 'audio' : 'video';
24153
+ var style = {
24154
+ width: width === 'auto' ? width : '100%',
24155
+ height: height === 'auto' ? height : '100%'
24156
+ };
24157
+ return _react["default"].createElement(Element, _extends({
24158
+ ref: this.ref,
24159
+ src: this.getSource(url),
24160
+ style: style,
24161
+ preload: "auto",
24162
+ autoPlay: playing || undefined,
24163
+ controls: controls,
24164
+ muted: muted,
24165
+ loop: loop
24166
+ }, config.file.attributes), url instanceof Array && url.map(this.renderSourceElement), config.file.tracks.map(this.renderTrack));
24167
+ }
24168
+ }]);
24169
+
24170
+ return FilePlayer;
24171
+ }(_react.Component);
24172
+
24173
+ exports.FilePlayer = FilePlayer;
24174
+
24175
+ _defineProperty(FilePlayer, "displayName", 'FilePlayer');
24176
+
24177
+ _defineProperty(FilePlayer, "canPlay", canPlay);
24178
+
24179
+ _defineProperty(FilePlayer, "canEnablePIP", canEnablePIP);
24180
+
24181
+ var _default = (0, _singlePlayer["default"])(FilePlayer);
24182
+
24183
+ exports["default"] = _default;
24184
+ });
24185
+
24186
+ unwrapExports(FilePlayer_1);
24187
+ var FilePlayer_2 = FilePlayer_1.FilePlayer;
24188
+
24189
+ var players = createCommonjsModule(function (module, exports) {
24190
+
24191
+ Object.defineProperty(exports, "__esModule", {
24192
+ value: true
24193
+ });
24194
+ exports["default"] = void 0;
24195
+
24196
+
24197
+
24198
+
24199
+
24200
+
24201
+
24202
+
24203
+
24204
+
24205
+
24206
+
24207
+
24208
+
24209
+
24210
+
24211
+
24212
+
24213
+
24214
+
24215
+
24216
+ var _default = [YouTube_1.YouTube, SoundCloud_1.SoundCloud, Vimeo_1.Vimeo, Facebook_1.Facebook, Streamable_1.Streamable, Wistia_1.Wistia, Twitch_1.Twitch, DailyMotion_1.DailyMotion, Mixcloud_1.Mixcloud, FilePlayer_1.FilePlayer];
24217
+ exports["default"] = _default;
24218
+ });
24219
+
24220
+ unwrapExports(players);
24221
+
24222
+ var Preview_1 = createCommonjsModule(function (module, exports) {
24223
+
24224
+ Object.defineProperty(exports, "__esModule", {
24225
+ value: true
24226
+ });
24227
+ exports["default"] = void 0;
24228
+
24229
+ var _react = _interopRequireWildcard(React__default);
24230
+
24231
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
24232
+
24233
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24234
+
24235
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
24236
+
24237
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
24238
+
24239
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24240
+
24241
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24242
+
24243
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
24244
+
24245
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
24246
+
24247
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
24248
+
24249
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24250
+
24251
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24252
+
24253
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24254
+
24255
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
24256
+
24257
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24258
+
24259
+ var ICON_SIZE = '64px';
24260
+
24261
+ var Preview =
24262
+ /*#__PURE__*/
24263
+ function (_Component) {
24264
+ _inherits(Preview, _Component);
24265
+
24266
+ function Preview() {
24267
+ var _getPrototypeOf2;
24268
+
24269
+ var _this;
24270
+
24271
+ _classCallCheck(this, Preview);
24272
+
24273
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24274
+ args[_key] = arguments[_key];
24275
+ }
24276
+
24277
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Preview)).call.apply(_getPrototypeOf2, [this].concat(args)));
24278
+
24279
+ _defineProperty(_assertThisInitialized(_this), "mounted", false);
24280
+
24281
+ _defineProperty(_assertThisInitialized(_this), "state", {
24282
+ image: null
24283
+ });
24284
+
24285
+ return _this;
24286
+ }
24287
+
24288
+ _createClass(Preview, [{
24289
+ key: "componentDidMount",
24290
+ value: function componentDidMount() {
24291
+ this.mounted = true;
24292
+ this.fetchImage(this.props);
24293
+ }
24294
+ }, {
24295
+ key: "componentDidUpdate",
24296
+ value: function componentDidUpdate(prevProps) {
24297
+ var _this$props = this.props,
24298
+ url = _this$props.url,
24299
+ light = _this$props.light;
24300
+
24301
+ if (prevProps.url !== url || prevProps.light !== light) {
24302
+ this.fetchImage(this.props);
24303
+ }
24304
+ }
24305
+ }, {
24306
+ key: "componentWillUnmount",
24307
+ value: function componentWillUnmount() {
24308
+ this.mounted = false;
24309
+ }
24310
+ }, {
24311
+ key: "fetchImage",
24312
+ value: function fetchImage(_ref) {
24313
+ var _this2 = this;
24314
+
24315
+ var url = _ref.url,
24316
+ light = _ref.light;
24317
+
24318
+ if (typeof light === 'string') {
24319
+ this.setState({
24320
+ image: light
24321
+ });
24322
+ return;
24323
+ }
24324
+
24325
+ this.setState({
24326
+ image: null
24327
+ });
24328
+ return window.fetch("https://noembed.com/embed?url=".concat(url)).then(function (response) {
24329
+ return response.json();
24330
+ }).then(function (data) {
24331
+ if (data.thumbnail_url && _this2.mounted) {
24332
+ var image = data.thumbnail_url.replace('height=100', 'height=480');
24333
+
24334
+ _this2.setState({
24335
+ image: image
24336
+ });
24337
+ }
24338
+ });
24339
+ }
24340
+ }, {
24341
+ key: "render",
24342
+ value: function render() {
24343
+ var _this$props2 = this.props,
24344
+ onClick = _this$props2.onClick,
24345
+ playIcon = _this$props2.playIcon;
24346
+ var image = this.state.image;
24347
+ var flexCenter = {
24348
+ display: 'flex',
24349
+ alignItems: 'center',
24350
+ justifyContent: 'center'
24351
+ };
24352
+ var styles = {
24353
+ preview: _objectSpread({
24354
+ width: '100%',
24355
+ height: '100%',
24356
+ backgroundImage: image ? "url(".concat(image, ")") : undefined,
24357
+ backgroundSize: 'cover',
24358
+ backgroundPosition: 'center',
24359
+ cursor: 'pointer'
24360
+ }, flexCenter),
24361
+ shadow: _objectSpread({
24362
+ background: 'radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)',
24363
+ borderRadius: ICON_SIZE,
24364
+ width: ICON_SIZE,
24365
+ height: ICON_SIZE
24366
+ }, flexCenter),
24367
+ playIcon: {
24368
+ borderStyle: 'solid',
24369
+ borderWidth: '16px 0 16px 26px',
24370
+ borderColor: 'transparent transparent transparent white',
24371
+ marginLeft: '7px'
24372
+ }
24373
+ };
24374
+
24375
+ var defaultPlayIcon = _react["default"].createElement("div", {
24376
+ style: styles.shadow,
24377
+ className: "react-player__shadow"
24378
+ }, _react["default"].createElement("div", {
24379
+ style: styles.playIcon,
24380
+ className: "react-player__play-icon"
24381
+ }));
24382
+
24383
+ return _react["default"].createElement("div", {
24384
+ style: styles.preview,
24385
+ className: "react-player__preview",
24386
+ onClick: onClick
24387
+ }, playIcon || defaultPlayIcon);
24388
+ }
24389
+ }]);
24390
+
24391
+ return Preview;
24392
+ }(_react.Component);
24393
+
24394
+ exports["default"] = Preview;
24395
+ });
24396
+
24397
+ unwrapExports(Preview_1);
24398
+
24399
+ var preload = createCommonjsModule(function (module, exports) {
24400
+
24401
+ Object.defineProperty(exports, "__esModule", {
24402
+ value: true
24403
+ });
24404
+ exports["default"] = renderPreloadPlayers;
24405
+
24406
+ var _react = _interopRequireDefault(React__default);
24407
+
24408
+ var _Player = _interopRequireDefault(Player_1);
24409
+
24410
+
24411
+
24412
+
24413
+
24414
+
24415
+
24416
+
24417
+
24418
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
24419
+
24420
+ var PRELOAD_PLAYERS = [{
24421
+ Player: YouTube_1.YouTube,
24422
+ configKey: 'youtube',
24423
+ url: 'https://www.youtube.com/watch?v=GlCmAC4MHek'
24424
+ }, {
24425
+ Player: SoundCloud_1.SoundCloud,
24426
+ configKey: 'soundcloud',
24427
+ url: 'https://soundcloud.com/seucheu/john-cage-433-8-bit-version'
24428
+ }, {
24429
+ Player: Vimeo_1.Vimeo,
24430
+ configKey: 'vimeo',
24431
+ url: 'https://vimeo.com/300970506'
24432
+ }, {
24433
+ Player: DailyMotion_1.DailyMotion,
24434
+ configKey: 'dailymotion',
24435
+ url: 'http://www.dailymotion.com/video/xqdpyk'
24436
+ }];
24437
+
24438
+ function renderPreloadPlayers(url, controls, config) {
24439
+ var players = [];
24440
+ var _iteratorNormalCompletion = true;
24441
+ var _didIteratorError = false;
24442
+ var _iteratorError = undefined;
24443
+
24444
+ try {
24445
+ for (var _iterator = PRELOAD_PLAYERS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
24446
+ var player = _step.value;
24447
+
24448
+ if (!player.Player.canPlay(url) && config[player.configKey].preload) {
24449
+ players.push(_react["default"].createElement(_Player["default"], {
24450
+ key: player.Player.displayName,
24451
+ activePlayer: player.Player,
24452
+ url: player.url,
24453
+ controls: controls,
24454
+ playing: true,
24455
+ muted: true,
24456
+ display: "none"
24457
+ }));
24458
+ }
24459
+ }
24460
+ } catch (err) {
24461
+ _didIteratorError = true;
24462
+ _iteratorError = err;
24463
+ } finally {
24464
+ try {
24465
+ if (!_iteratorNormalCompletion && _iterator["return"] != null) {
24466
+ _iterator["return"]();
24467
+ }
24468
+ } finally {
24469
+ if (_didIteratorError) {
24470
+ throw _iteratorError;
24471
+ }
24472
+ }
24473
+ }
24474
+
24475
+ return players;
24476
+ }
24477
+ });
24478
+
24479
+ unwrapExports(preload);
24480
+
24481
+ var ReactPlayer_1 = createCommonjsModule(function (module, exports) {
24482
+
24483
+ Object.defineProperty(exports, "__esModule", {
24484
+ value: true
24485
+ });
24486
+ Object.defineProperty(exports, "FilePlayer", {
24487
+ enumerable: true,
24488
+ get: function get() {
24489
+ return _FilePlayer["default"];
24490
+ }
24491
+ });
24492
+ Object.defineProperty(exports, "YouTube", {
24493
+ enumerable: true,
24494
+ get: function get() {
24495
+ return _YouTube["default"];
24496
+ }
24497
+ });
24498
+ Object.defineProperty(exports, "SoundCloud", {
24499
+ enumerable: true,
24500
+ get: function get() {
24501
+ return _SoundCloud["default"];
24502
+ }
24503
+ });
24504
+ Object.defineProperty(exports, "Vimeo", {
24505
+ enumerable: true,
24506
+ get: function get() {
24507
+ return _Vimeo["default"];
24508
+ }
24509
+ });
24510
+ Object.defineProperty(exports, "Facebook", {
24511
+ enumerable: true,
24512
+ get: function get() {
24513
+ return _Facebook["default"];
24514
+ }
24515
+ });
24516
+ Object.defineProperty(exports, "Streamable", {
24517
+ enumerable: true,
24518
+ get: function get() {
24519
+ return _Streamable["default"];
24520
+ }
24521
+ });
24522
+ Object.defineProperty(exports, "Wistia", {
24523
+ enumerable: true,
24524
+ get: function get() {
24525
+ return _Wistia["default"];
24526
+ }
24527
+ });
24528
+ Object.defineProperty(exports, "Twitch", {
24529
+ enumerable: true,
24530
+ get: function get() {
24531
+ return _Twitch["default"];
24532
+ }
24533
+ });
24534
+ Object.defineProperty(exports, "DailyMotion", {
24535
+ enumerable: true,
24536
+ get: function get() {
24537
+ return _DailyMotion["default"];
24538
+ }
24539
+ });
24540
+ Object.defineProperty(exports, "Mixcloud", {
24541
+ enumerable: true,
24542
+ get: function get() {
24543
+ return _Mixcloud["default"];
24544
+ }
24545
+ });
24546
+ exports["default"] = void 0;
24547
+
24548
+ var _react = _interopRequireWildcard(React__default);
24549
+
24550
+
24551
+
24552
+
24553
+
24554
+ var _players = _interopRequireDefault(players);
24555
+
24556
+ var _Player4 = _interopRequireDefault(Player_1);
24557
+
24558
+ var _Preview = _interopRequireDefault(Preview_1);
24559
+
24560
+ var _FilePlayer = _interopRequireWildcard(FilePlayer_1);
24561
+
24562
+ var _preload = _interopRequireDefault(preload);
24563
+
24564
+ var _YouTube = _interopRequireDefault(YouTube_1);
24565
+
24566
+ var _SoundCloud = _interopRequireDefault(SoundCloud_1);
24567
+
24568
+ var _Vimeo = _interopRequireDefault(Vimeo_1);
24569
+
24570
+ var _Facebook = _interopRequireDefault(Facebook_1);
24571
+
24572
+ var _Streamable = _interopRequireDefault(Streamable_1);
24573
+
24574
+ var _Wistia = _interopRequireDefault(Wistia_1);
24575
+
24576
+ var _Twitch = _interopRequireDefault(Twitch_1);
24577
+
24578
+ var _DailyMotion = _interopRequireDefault(DailyMotion_1);
24579
+
24580
+ var _Mixcloud = _interopRequireDefault(Mixcloud_1);
24581
+
24582
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
24583
+
24584
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
24585
+
24586
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24587
+
24588
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
24589
+
24590
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
24591
+
24592
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24593
+
24594
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24595
+
24596
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
24597
+
24598
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
24599
+
24600
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
24601
+
24602
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
24603
+
24604
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24605
+
24606
+ function _defineProperties(target, props$$1) { for (var i = 0; i < props$$1.length; i++) { var descriptor = props$$1[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
24607
+
24608
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
24609
+
24610
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
24611
+
24612
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24613
+
24614
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24615
+
24616
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24617
+
24618
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
24619
+
24620
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24621
+
24622
+ var SUPPORTED_PROPS = Object.keys(props.propTypes);
24623
+ var customPlayers = [];
24624
+
24625
+ var ReactPlayer =
24626
+ /*#__PURE__*/
24627
+ function (_Component) {
24628
+ _inherits(ReactPlayer, _Component);
24629
+
24630
+ function ReactPlayer() {
24631
+ var _getPrototypeOf2;
24632
+
24633
+ var _this;
24634
+
24635
+ _classCallCheck(this, ReactPlayer);
24636
+
24637
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24638
+ args[_key] = arguments[_key];
24639
+ }
24640
+
24641
+ _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ReactPlayer)).call.apply(_getPrototypeOf2, [this].concat(args)));
24642
+
24643
+ _defineProperty(_assertThisInitialized(_this), "config", (0, utils$2.getConfig)(_this.props, props.defaultProps, true));
24644
+
24645
+ _defineProperty(_assertThisInitialized(_this), "state", {
24646
+ showPreview: !!_this.props.light
24647
+ });
24648
+
24649
+ _defineProperty(_assertThisInitialized(_this), "handleClickPreview", function () {
24650
+ _this.setState({
24651
+ showPreview: false
24652
+ });
24653
+ });
24654
+
24655
+ _defineProperty(_assertThisInitialized(_this), "showPreview", function () {
24656
+ _this.setState({
24657
+ showPreview: true
24658
+ });
24659
+ });
24660
+
24661
+ _defineProperty(_assertThisInitialized(_this), "getDuration", function () {
24662
+ if (!_this.player) return null;
24663
+ return _this.player.getDuration();
24664
+ });
24665
+
24666
+ _defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
24667
+ if (!_this.player) return null;
24668
+ return _this.player.getCurrentTime();
24669
+ });
24670
+
24671
+ _defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
24672
+ if (!_this.player) return null;
24673
+ return _this.player.getSecondsLoaded();
24674
+ });
24675
+
24676
+ _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
24677
+ var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
24678
+ if (!_this.player) return null;
24679
+ return _this.player.getInternalPlayer(key);
24680
+ });
24681
+
24682
+ _defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type) {
24683
+ if (!_this.player) return null;
24684
+
24685
+ _this.player.seekTo(fraction, type);
24686
+ });
24687
+
24688
+ _defineProperty(_assertThisInitialized(_this), "handleReady", function () {
24689
+ _this.props.onReady(_assertThisInitialized(_this));
24690
+ });
24691
+
24692
+ _defineProperty(_assertThisInitialized(_this), "wrapperRef", function (wrapper) {
24693
+ _this.wrapper = wrapper;
24694
+ });
24695
+
24696
+ _defineProperty(_assertThisInitialized(_this), "activePlayerRef", function (player) {
24697
+ _this.player = player;
24698
+ });
24699
+
24700
+ return _this;
24701
+ }
24702
+
24703
+ _createClass(ReactPlayer, [{
24704
+ key: "componentDidMount",
24705
+ value: function componentDidMount() {
24706
+ if (this.props.progressFrequency) {
24707
+ var message = 'ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead';
24708
+ console.warn(message, 'font-weight: bold', '', 'font-weight: bold', '');
24709
+ }
24710
+ }
24711
+ }, {
24712
+ key: "shouldComponentUpdate",
24713
+ value: function shouldComponentUpdate(nextProps, nextState) {
24714
+ return !(0, utils$2.isEqual)(this.props, nextProps) || !(0, utils$2.isEqual)(this.state, nextState);
24715
+ }
24716
+ }, {
24717
+ key: "componentDidUpdate",
24718
+ value: function componentDidUpdate(prevProps) {
24719
+ var light = this.props.light;
24720
+ this.config = (0, utils$2.getConfig)(this.props, props.defaultProps);
24721
+
24722
+ if (!prevProps.light && light) {
24723
+ this.setState({
24724
+ showPreview: true
24725
+ });
24726
+ }
24727
+
24728
+ if (prevProps.light && !light) {
24729
+ this.setState({
24730
+ showPreview: false
24731
+ });
24732
+ }
24733
+ }
24734
+ }, {
24735
+ key: "getActivePlayer",
24736
+ value: function getActivePlayer(url) {
24737
+ for (var _i = 0, _arr = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i < _arr.length; _i++) {
24738
+ var _Player = _arr[_i];
24739
+
24740
+ if (_Player.canPlay(url)) {
24741
+ return _Player;
24742
+ }
24743
+ } // Fall back to FilePlayer if nothing else can play the URL
24744
+
24745
+
24746
+ return _FilePlayer.FilePlayer;
24747
+ }
24748
+ }, {
24749
+ key: "renderActivePlayer",
24750
+ value: function renderActivePlayer(url, activePlayer) {
24751
+ if (!url) return null;
24752
+ return _react["default"].createElement(_Player4["default"], _extends({}, this.props, {
24753
+ key: activePlayer.displayName,
24754
+ ref: this.activePlayerRef,
24755
+ config: this.config,
24756
+ activePlayer: activePlayer,
24757
+ onReady: this.handleReady
24758
+ }));
24759
+ }
24760
+ }, {
24761
+ key: "sortPlayers",
24762
+ value: function sortPlayers(a, b) {
24763
+ // Retain player order to prevent weird iframe behaviour when switching players
24764
+ if (a && b) {
24765
+ return a.key < b.key ? -1 : 1;
24766
+ }
24767
+
24768
+ return 0;
24769
+ }
24770
+ }, {
24771
+ key: "render",
24772
+ value: function render() {
24773
+ var _this$props = this.props,
24774
+ url = _this$props.url,
24775
+ controls = _this$props.controls,
24776
+ style = _this$props.style,
24777
+ width = _this$props.width,
24778
+ height = _this$props.height,
24779
+ light = _this$props.light,
24780
+ playIcon = _this$props.playIcon,
24781
+ Wrapper = _this$props.wrapper;
24782
+ var showPreview = this.state.showPreview && url;
24783
+ var otherProps = (0, utils$2.omit)(this.props, SUPPORTED_PROPS, props.DEPRECATED_CONFIG_PROPS);
24784
+ var activePlayer = this.getActivePlayer(url);
24785
+ var renderedActivePlayer = this.renderActivePlayer(url, activePlayer);
24786
+ var preloadPlayers = (0, _preload["default"])(url, controls, this.config);
24787
+ var players$$1 = [renderedActivePlayer].concat(_toConsumableArray(preloadPlayers)).sort(this.sortPlayers);
24788
+
24789
+ var preview = _react["default"].createElement(_Preview["default"], {
24790
+ url: url,
24791
+ light: light,
24792
+ playIcon: playIcon,
24793
+ onClick: this.handleClickPreview
24794
+ });
24795
+
24796
+ return _react["default"].createElement(Wrapper, _extends({
24797
+ ref: this.wrapperRef,
24798
+ style: _objectSpread({}, style, {
24799
+ width: width,
24800
+ height: height
24801
+ })
24802
+ }, otherProps), showPreview ? preview : players$$1);
24803
+ }
24804
+ }]);
24805
+
24806
+ return ReactPlayer;
24807
+ }(_react.Component);
24808
+
24809
+ exports["default"] = ReactPlayer;
24810
+
24811
+ _defineProperty(ReactPlayer, "addCustomPlayer", function (player) {
24812
+ customPlayers.push(player);
24813
+ });
24814
+
24815
+ _defineProperty(ReactPlayer, "removeCustomPlayers", function () {
24816
+ customPlayers = [];
24817
+ });
24818
+
24819
+ _defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
24820
+
24821
+ _defineProperty(ReactPlayer, "propTypes", props.propTypes);
24822
+
24823
+ _defineProperty(ReactPlayer, "defaultProps", props.defaultProps);
24824
+
24825
+ _defineProperty(ReactPlayer, "canPlay", function (url) {
24826
+ for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {
24827
+ var _Player2 = _arr2[_i2];
24828
+
24829
+ if (_Player2.canPlay(url)) {
24830
+ return true;
24831
+ }
24832
+ }
24833
+
24834
+ return false;
24835
+ });
24836
+
24837
+ _defineProperty(ReactPlayer, "canEnablePIP", function (url) {
24838
+ for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) {
24839
+ var _Player3 = _arr3[_i3];
24840
+
24841
+ if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
24842
+ return true;
24843
+ }
24844
+ }
24845
+
24846
+ return false;
24847
+ });
24848
+ });
24849
+
24850
+ var ReactPlayer = unwrapExports(ReactPlayer_1);
24851
+
20378
24852
  var Audio = function Audio(_ref) {
20379
24853
  var node = _ref.node;
20380
24854
 
@@ -20781,9 +25255,289 @@ var Leads = function Leads(_ref) {
20781
25255
  );
20782
25256
  };
20783
25257
 
25258
+ var html_map = {
25259
+ "'": "&apos;",
25260
+ "<": "&lt;",
25261
+ ">": "&gt;",
25262
+ " ": "&nbsp;",
25263
+ "¡": "&iexcl;",
25264
+ "¢": "&cent;",
25265
+ "£": "&pound;",
25266
+ "¤": "&curren;",
25267
+ "¥": "&yen;",
25268
+ "¦": "&brvbar;",
25269
+ "§": "&sect;",
25270
+ "¨": "&uml;",
25271
+ "©": "&copy;",
25272
+ "ª": "&ordf;",
25273
+ "«": "&laquo;",
25274
+ "¬": "&not;",
25275
+ "®": "&reg;",
25276
+ "¯": "&macr;",
25277
+ "°": "&deg;",
25278
+ "±": "&plusmn;",
25279
+ "²": "&sup2;",
25280
+ "³": "&sup3;",
25281
+ "´": "&acute;",
25282
+ "µ": "&micro;",
25283
+ "¶": "&para;",
25284
+ "·": "&middot;",
25285
+ "¸": "&cedil;",
25286
+ "¹": "&sup1;",
25287
+ "º": "&ordm;",
25288
+ "»": "&raquo;",
25289
+ "¼": "&frac14;",
25290
+ "½": "&frac12;",
25291
+ "¾": "&frac34;",
25292
+ "¿": "&iquest;",
25293
+ "À": "&Agrave;",
25294
+ "Á": "&Aacute;",
25295
+ "Â": "&Acirc;",
25296
+ "Ã": "&Atilde;",
25297
+ "Ä": "&Auml;",
25298
+ "Å": "&Aring;",
25299
+ "Æ": "&AElig;",
25300
+ "Ç": "&Ccedil;",
25301
+ "È": "&Egrave;",
25302
+ "É": "&Eacute;",
25303
+ "Ê": "&Ecirc;",
25304
+ "Ë": "&Euml;",
25305
+ "Ì": "&Igrave;",
25306
+ "Í": "&Iacute;",
25307
+ "Î": "&Icirc;",
25308
+ "Ï": "&Iuml;",
25309
+ "Ð": "&ETH;",
25310
+ "Ñ": "&Ntilde;",
25311
+ "Ò": "&Ograve;",
25312
+ "Ó": "&Oacute;",
25313
+ "Ô": "&Ocirc;",
25314
+ "Õ": "&Otilde;",
25315
+ "Ö": "&Ouml;",
25316
+ "×": "&times;",
25317
+ "Ø": "&Oslash;",
25318
+ "Ù": "&Ugrave;",
25319
+ "Ú": "&Uacute;",
25320
+ "Û": "&Ucirc;",
25321
+ "Ü": "&Uuml;",
25322
+ "Ý": "&Yacute;",
25323
+ "Þ": "&THORN;",
25324
+ "ß": "&szlig;",
25325
+ "à": "&agrave;",
25326
+ "á": "&aacute;",
25327
+ "â": "&acirc;",
25328
+ "ã": "&atilde;",
25329
+ "ä": "&auml;",
25330
+ "å": "&aring;",
25331
+ "æ": "&aelig;",
25332
+ "ç": "&ccedil;",
25333
+ "è": "&egrave;",
25334
+ "é": "&eacute;",
25335
+ "ê": "&ecirc;",
25336
+ "ë": "&euml;",
25337
+ "ì": "&igrave;",
25338
+ "í": "&iacute;",
25339
+ "î": "&icirc;",
25340
+ "ï": "&iuml;",
25341
+ "ð": "&eth;",
25342
+ "ñ": "&ntilde;",
25343
+ "ò": "&ograve;",
25344
+ "ó": "&oacute;",
25345
+ "ô": "&ocirc;",
25346
+ "õ": "&otilde;",
25347
+ "ö": "&ouml;",
25348
+ "÷": "&divide;",
25349
+ "ø": "&oslash;",
25350
+ "ù": "&ugrave;",
25351
+ "ú": "&uacute;",
25352
+ "û": "&ucirc;",
25353
+ "ü": "&uuml;",
25354
+ "ý": "&yacute;",
25355
+ "þ": "&thorn;",
25356
+ "ÿ": "&yuml;",
25357
+ "Œ": "&OElig;",
25358
+ "œ": "&oelig;",
25359
+ "Š": "&Scaron;",
25360
+ "š": "&scaron;",
25361
+ "Ÿ": "&Yuml;",
25362
+ "ƒ": "&fnof;",
25363
+ "ˆ": "&circ;",
25364
+ "˜": "&tilde;",
25365
+ "Α": "&Alpha;",
25366
+ "Β": "&Beta;",
25367
+ "Γ": "&Gamma;",
25368
+ "Δ": "&Delta;",
25369
+ "Ε": "&Epsilon;",
25370
+ "Ζ": "&Zeta;",
25371
+ "Η": "&Eta;",
25372
+ "Θ": "&Theta;",
25373
+ "Ι": "&Iota;",
25374
+ "Κ": "&Kappa;",
25375
+ "Λ": "&Lambda;",
25376
+ "Μ": "&Mu;",
25377
+ "Ν": "&Nu;",
25378
+ "Ξ": "&Xi;",
25379
+ "Ο": "&Omicron;",
25380
+ "Π": "&Pi;",
25381
+ "Ρ": "&Rho;",
25382
+ "Σ": "&Sigma;",
25383
+ "Τ": "&Tau;",
25384
+ "Υ": "&Upsilon;",
25385
+ "Φ": "&Phi;",
25386
+ "Χ": "&Chi;",
25387
+ "Ψ": "&Psi;",
25388
+ "Ω": "&Omega;",
25389
+ "α": "&alpha;",
25390
+ "β": "&beta;",
25391
+ "γ": "&gamma;",
25392
+ "δ": "&delta;",
25393
+ "ε": "&epsilon;",
25394
+ "ζ": "&zeta;",
25395
+ "η": "&eta;",
25396
+ "θ": "&theta;",
25397
+ "ι": "&iota;",
25398
+ "κ": "&kappa;",
25399
+ "λ": "&lambda;",
25400
+ "μ": "&mu;",
25401
+ "ν": "&nu;",
25402
+ "ξ": "&xi;",
25403
+ "ο": "&omicron;",
25404
+ "π": "&pi;",
25405
+ "ρ": "&rho;",
25406
+ "ς": "&sigmaf;",
25407
+ "σ": "&sigma;",
25408
+ "τ": "&tau;",
25409
+ "υ": "&upsilon;",
25410
+ "φ": "&phi;",
25411
+ "χ": "&chi;",
25412
+ "ψ": "&psi;",
25413
+ "ω": "&omega;",
25414
+ "ϑ": "&thetasym;",
25415
+ "ϒ": "&Upsih;",
25416
+ "ϖ": "&piv;",
25417
+ "–": "&ndash;",
25418
+ "—": "&mdash;",
25419
+ "‘": "&lsquo;",
25420
+ "’": "&rsquo;",
25421
+ "‚": "&sbquo;",
25422
+ "“": "&ldquo;",
25423
+ "”": "&rdquo;",
25424
+ "„": "&bdquo;",
25425
+ "†": "&dagger;",
25426
+ "‡": "&Dagger;",
25427
+ "•": "&bull;",
25428
+ "…": "&hellip;",
25429
+ "‰": "&permil;",
25430
+ "′": "&prime;",
25431
+ "″": "&Prime;",
25432
+ "‹": "&lsaquo;",
25433
+ "›": "&rsaquo;",
25434
+ "‾": "&oline;",
25435
+ "⁄": "&frasl;",
25436
+ "€": "&euro;",
25437
+ "ℑ": "&image;",
25438
+ "℘": "&weierp;",
25439
+ "ℜ": "&real;",
25440
+ "™": "&trade;",
25441
+ "ℵ": "&alefsym;",
25442
+ "←": "&larr;",
25443
+ "↑": "&uarr;",
25444
+ "→": "&rarr;",
25445
+ "↓": "&darr;",
25446
+ "↔": "&harr;",
25447
+ "↵": "&crarr;",
25448
+ "⇐": "&lArr;",
25449
+ "⇑": "&UArr;",
25450
+ "⇒": "&rArr;",
25451
+ "⇓": "&dArr;",
25452
+ "⇔": "&hArr;",
25453
+ "∀": "&forall;",
25454
+ "∂": "&part;",
25455
+ "∃": "&exist;",
25456
+ "∅": "&empty;",
25457
+ "∇": "&nabla;",
25458
+ "∈": "&isin;",
25459
+ "∉": "&notin;",
25460
+ "∋": "&ni;",
25461
+ "∏": "&prod;",
25462
+ "∑": "&sum;",
25463
+ "−": "&minus;",
25464
+ "∗": "&lowast;",
25465
+ "√": "&radic;",
25466
+ "∝": "&prop;",
25467
+ "∞": "&infin;",
25468
+ "∠": "&ang;",
25469
+ "∧": "&and;",
25470
+ "∨": "&or;",
25471
+ "∩": "&cap;",
25472
+ "∪": "&cup;",
25473
+ "∫": "&int;",
25474
+ "∴": "&there4;",
25475
+ "∼": "&sim;",
25476
+ "≅": "&cong;",
25477
+ "≈": "&asymp;",
25478
+ "≠": "&ne;",
25479
+ "≡": "&equiv;",
25480
+ "≤": "&le;",
25481
+ "≥": "&ge;",
25482
+ "⊂": "&sub;",
25483
+ "⊃": "&sup;",
25484
+ "⊄": "&nsub;",
25485
+ "⊆": "&sube;",
25486
+ "⊇": "&supe;",
25487
+ "⊕": "&oplus;",
25488
+ "⊗": "&otimes;",
25489
+ "⊥": "&perp;",
25490
+ "⋅": "&sdot;",
25491
+ "⌈": "&lceil;",
25492
+ "⌉": "&rceil;",
25493
+ "⌊": "&lfloor;",
25494
+ "⌋": "&rfloor;",
25495
+ "⟨": "&lang;",
25496
+ "⟩": "&rang;",
25497
+ "◊": "&loz;",
25498
+ "♠": "&spades;",
25499
+ "♣": "&clubs;",
25500
+ "♥": "&hearts;",
25501
+ "♦": "&diams;"
25502
+ };
25503
+
25504
+ var html_decode = function html_decode(string) {
25505
+ var entityMap = html_map;
25506
+ for (var key in entityMap) {
25507
+ var entity = entityMap[key];
25508
+ var regex = new RegExp(entity, 'g');
25509
+ string = string.replace(regex, key);
25510
+ }
25511
+ string = string.replace(/&quot;/g, '"');
25512
+ string = string.replace(/&amp;/g, '&');
25513
+ return string;
25514
+ };
25515
+ var html_decode_1 = html_decode;
25516
+
25517
+ var convertEntities = function convertEntities(props) {
25518
+
25519
+ if (typeof props === 'string' || props instanceof String) {
25520
+ props = html_decode_1(props);
25521
+ }
25522
+
25523
+ if (props.children) {
25524
+ for (var i = 0; i < props.children.length; i++) {
25525
+ var child = props.children[i];
25526
+ child = convertEntities(child);
25527
+ props.children[i] = child;
25528
+ }
25529
+ }
25530
+
25531
+ return props;
25532
+ };
25533
+
20784
25534
  var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings) {
20785
25535
  return {
20786
25536
  types: {
25537
+ block: function block(props) {
25538
+ props = convertEntities(props);
25539
+ return BlockContent.defaultSerializers.types.block(props);
25540
+ },
20787
25541
  youtube: function youtube(_ref) {
20788
25542
  var node = _ref.node;
20789
25543
  var url = node.url;
@@ -20931,9 +25685,14 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
20931
25685
  // feature_img { asset-> {url} }
20932
25686
  // }`
20933
25687
 
25688
+ //Update* Added control toggle for features. Will default to off -
25689
+ //<Feature controls dataset={props.features} /></div>
20934
25690
 
20935
25691
  var Feature = function Feature(props) {
20936
25692
  var dataset = props.dataset;
25693
+ var _props$controls = props.controls,
25694
+ controls = _props$controls === undefined ? false : _props$controls;
25695
+
20937
25696
 
20938
25697
  var checkUrlIsExternal = function checkUrlIsExternal(url) {
20939
25698
  if (/(http|https?)([^\s]+)/g.test(url)) {
@@ -20989,7 +25748,7 @@ var Feature = function Feature(props) {
20989
25748
  null,
20990
25749
  React__default.createElement(
20991
25750
  Carousel,
20992
- { touch: true },
25751
+ { touch: true, controls: controls },
20993
25752
  dataset.map(function (feature, index) {
20994
25753
  var feature_title = feature.feature_title,
20995
25754
  feature_body = feature.feature_body,