` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: _propTypes.default.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: _propTypes.default.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: _propTypes.default.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: _propTypes.default.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","var isarray = require('isarray');\n/**\n * Expose `pathToRegexp`.\n */\n\n\nmodule.exports = pathToRegexp;\nmodule.exports.parse = parse;\nmodule.exports.compile = compile;\nmodule.exports.tokensToFunction = tokensToFunction;\nmodule.exports.tokensToRegExp = tokensToRegExp;\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\n\nvar PATH_REGEXP = new RegExp([// Match escaped characters that would otherwise appear in future matches.\n// This allows the user to escape special characters that won't transform.\n'(\\\\\\\\.)', // Match Express-style parameters and un-named parameters with a prefix\n// and optional suffixes. Matches appear as:\n//\n// \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n// \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n// \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n'([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'].join('|'), 'g');\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\n\nfunction parse(str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length; // Ignore already escaped sequences.\n\n if (escaped) {\n path += escaped[1];\n continue;\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7]; // Push the current path onto the tokens.\n\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?'\n });\n } // Match any characters still remaining.\n\n\n if (index < str.length) {\n path += str.substr(index);\n } // If the path exists, push it onto the end.\n\n\n if (path) {\n tokens.push(path);\n }\n\n return tokens;\n}\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\n\n\nfunction compile(str, options) {\n return tokensToFunction(parse(str, options), options);\n}\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\n\n\nfunction encodeURIComponentPretty(str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\n\n\nfunction encodeAsterisk(str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n/**\n * Expose a method for transforming tokens into the path function.\n */\n\n\nfunction tokensToFunction(tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n }\n\n return path;\n };\n}\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\n\n\nfunction escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1');\n}\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\n\n\nfunction escapeGroup(group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1');\n}\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\n\n\nfunction attachKeys(re, keys) {\n re.keys = keys;\n return re;\n}\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\n\n\nfunction flags(options) {\n return options && options.sensitive ? '' : 'i';\n}\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\n\n\nfunction regexpToRegexp(path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys);\n}\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\n\n\nfunction arrayToRegexp(path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n return attachKeys(regexp, keys);\n}\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\n\n\nfunction stringToRegexp(path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options);\n}\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\n\n\nfunction tokensToRegExp(tokens, keys, options) {\n if (!isarray(keys)) {\n options =\n /** @type {!Object} */\n keys || options;\n keys = [];\n }\n\n options = options || {};\n var strict = options.strict;\n var end = options.end !== false;\n var route = ''; // Iterate over the tokens and create our regexp string.\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys);\n}\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\n\n\nfunction pathToRegexp(path, keys, options) {\n if (!isarray(keys)) {\n options =\n /** @type {!Object} */\n keys || options;\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path,\n /** @type {!Array} */\n keys);\n }\n\n if (isarray(path)) {\n return arrayToRegexp(\n /** @type {!Array} */\n path,\n /** @type {!Array} */\n keys, options);\n }\n\n return stringToRegexp(\n /** @type {string} */\n path,\n /** @type {!Array} */\n keys, options);\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport isEqual from 'fast-deep-equal';\nimport youTubePlayer from 'youtube-player';\n/**\n * Check whether a `props` change should result in the video being updated.\n *\n * @param {Object} prevProps\n * @param {Object} props\n */\n\nfunction shouldUpdateVideo(prevProps, props) {\n // A changing video should always trigger an update\n if (prevProps.videoId !== props.videoId) {\n return true;\n } // Otherwise, a change in the start/end time playerVars also requires a player\n // update.\n\n\n var prevVars = prevProps.opts.playerVars || {};\n var vars = props.opts.playerVars || {};\n return prevVars.start !== vars.start || prevVars.end !== vars.end;\n}\n/**\n * Neutralize API options that only require a video update, leaving only options\n * that require a player reset. The results can then be compared to see if a\n * player reset is necessary.\n *\n * @param {Object} opts\n */\n\n\nfunction filterResetOptions(opts) {\n return _objectSpread(_objectSpread({}, opts), {}, {\n height: 0,\n width: 0,\n playerVars: _objectSpread(_objectSpread({}, opts.playerVars), {}, {\n autoplay: 0,\n start: 0,\n end: 0\n })\n });\n}\n/**\n * Check whether a `props` change should result in the player being reset.\n * The player is reset when the `props.opts` change, except if the only change\n * is in the `start` and `end` playerVars, because a video update can deal with\n * those.\n *\n * @param {Object} prevProps\n * @param {Object} props\n */\n\n\nfunction shouldResetPlayer(prevProps, props) {\n return prevProps.videoId !== props.videoId || !isEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts));\n}\n/**\n * Check whether a props change should result in an id or className update.\n *\n * @param {Object} prevProps\n * @param {Object} props\n */\n\n\nfunction shouldUpdatePlayer(prevProps, props) {\n return prevProps.id !== props.id || prevProps.className !== props.className || prevProps.opts.width !== props.opts.width || prevProps.opts.height !== props.opts.height || prevProps.title !== props.title;\n}\n\nvar YouTube = /*#__PURE__*/function (_React$Component) {\n _inherits(YouTube, _React$Component);\n\n var _super = _createSuper(YouTube);\n /**\n * Expose PlayerState constants for convenience. These constants can also be\n * accessed through the global YT object after the YouTube IFrame API is instantiated.\n * https://developers.google.com/youtube/iframe_api_reference#onStateChange\n */\n\n\n function YouTube(props) {\n var _this;\n\n _classCallCheck(this, YouTube);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"onPlayerReady\", function (event) {\n return _this.props.onReady(event);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPlayerError\", function (event) {\n return _this.props.onError(event);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPlayerStateChange\", function (event) {\n _this.props.onStateChange(event);\n\n switch (event.data) {\n case YouTube.PlayerState.ENDED:\n _this.props.onEnd(event);\n\n break;\n\n case YouTube.PlayerState.PLAYING:\n _this.props.onPlay(event);\n\n break;\n\n case YouTube.PlayerState.PAUSED:\n _this.props.onPause(event);\n\n break;\n\n default:\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPlayerPlaybackRateChange\", function (event) {\n return _this.props.onPlaybackRateChange(event);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPlayerPlaybackQualityChange\", function (event) {\n return _this.props.onPlaybackQualityChange(event);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"createPlayer\", function () {\n // do not attempt to create a player server-side, it won't work\n if (typeof document === 'undefined') return; // create player\n\n var playerOpts = _objectSpread(_objectSpread({}, _this.props.opts), {}, {\n // preload the `videoId` video if one is already given\n videoId: _this.props.videoId\n });\n\n _this.internalPlayer = youTubePlayer(_this.container, playerOpts); // attach event handlers\n\n _this.internalPlayer.on('ready', _this.onPlayerReady);\n\n _this.internalPlayer.on('error', _this.onPlayerError);\n\n _this.internalPlayer.on('stateChange', _this.onPlayerStateChange);\n\n _this.internalPlayer.on('playbackRateChange', _this.onPlayerPlaybackRateChange);\n\n _this.internalPlayer.on('playbackQualityChange', _this.onPlayerPlaybackQualityChange);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"resetPlayer\", function () {\n return _this.internalPlayer.destroy().then(_this.createPlayer);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"updatePlayer\", function () {\n _this.internalPlayer.getIframe().then(function (iframe) {\n if (_this.props.id) iframe.setAttribute('id', _this.props.id);else iframe.removeAttribute('id');\n if (_this.props.className) iframe.setAttribute('class', _this.props.className);else iframe.removeAttribute('class');\n if (_this.props.opts && _this.props.opts.width) iframe.setAttribute('width', _this.props.opts.width);else iframe.removeAttribute('width');\n if (_this.props.opts && _this.props.opts.height) iframe.setAttribute('height', _this.props.opts.height);else iframe.removeAttribute('height');\n if (typeof _this.props.title === 'string') iframe.setAttribute('title', _this.props.title);else iframe.setAttribute('title', 'YouTube video player');\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getInternalPlayer\", function () {\n return _this.internalPlayer;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"updateVideo\", function () {\n if (typeof _this.props.videoId === 'undefined' || _this.props.videoId === null) {\n _this.internalPlayer.stopVideo();\n\n return;\n } // set queueing options\n\n\n var autoplay = false;\n var opts = {\n videoId: _this.props.videoId\n };\n\n if ('playerVars' in _this.props.opts) {\n autoplay = _this.props.opts.playerVars.autoplay === 1;\n\n if ('start' in _this.props.opts.playerVars) {\n opts.startSeconds = _this.props.opts.playerVars.start;\n }\n\n if ('end' in _this.props.opts.playerVars) {\n opts.endSeconds = _this.props.opts.playerVars.end;\n }\n } // if autoplay is enabled loadVideoById\n\n\n if (autoplay) {\n _this.internalPlayer.loadVideoById(opts);\n\n return;\n } // default behaviour just cues the video\n\n\n _this.internalPlayer.cueVideoById(opts);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"refContainer\", function (container) {\n _this.container = container;\n });\n\n _this.container = null;\n _this.internalPlayer = null;\n return _this;\n }\n\n _createClass(YouTube, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.createPlayer();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (shouldUpdatePlayer(prevProps, this.props)) {\n this.updatePlayer();\n }\n\n if (shouldResetPlayer(prevProps, this.props)) {\n this.resetPlayer();\n }\n\n if (shouldUpdateVideo(prevProps, this.props)) {\n this.updateVideo();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n /**\n * Note: The `youtube-player` package that is used promisifies all YouTube\n * Player API calls, which introduces a delay of a tick before it actually\n * gets destroyed. Since React attempts to remove the element instantly\n * this method isn't quick enough to reset the container element.\n */\n this.internalPlayer.destroy();\n }\n /**\n * https://developers.google.com/youtube/iframe_api_reference#onReady\n *\n * @param {Object} event\n * @param {Object} target - player object\n */\n\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: this.props.containerClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n id: this.props.id,\n className: this.props.className,\n ref: this.refContainer,\n loading: this.props.loading\n }));\n }\n }]);\n\n return YouTube;\n}(React.Component);\n\n_defineProperty(YouTube, \"PlayerState\", {\n UNSTARTED: -1,\n ENDED: 0,\n PLAYING: 1,\n PAUSED: 2,\n BUFFERING: 3,\n CUED: 5\n});\n\nYouTube.propTypes = {\n videoId: PropTypes.string,\n // custom ID for player element\n id: PropTypes.string,\n // custom class name for player element\n className: PropTypes.string,\n // custom class name for player container element\n containerClassName: PropTypes.string,\n // custom title for the iFrame, see https://www.w3.org/TR/WCAG20-TECHS/H64.html\n title: PropTypes.string,\n // custom loading for player element\n loading: PropTypes.oneOf(['lazy', 'eager', 'auto']),\n // https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player\n opts: PropTypes.objectOf(PropTypes.any),\n // event subscriptions\n onReady: PropTypes.func,\n onError: PropTypes.func,\n onPlay: PropTypes.func,\n onPause: PropTypes.func,\n onEnd: PropTypes.func,\n onStateChange: PropTypes.func,\n onPlaybackRateChange: PropTypes.func,\n onPlaybackQualityChange: PropTypes.func\n};\nYouTube.defaultProps = {\n videoId: null,\n id: null,\n className: null,\n loading: null,\n opts: {},\n containerClassName: '',\n onReady: function onReady() {},\n onError: function onError() {},\n onPlay: function onPlay() {},\n onPause: function onPause() {},\n onEnd: function onEnd() {},\n onStateChange: function onStateChange() {},\n onPlaybackRateChange: function onPlaybackRateChange() {},\n onPlaybackQualityChange: function onPlaybackQualityChange() {},\n title: null\n};\nexport default YouTube;","'use strict'; // do not edit .js files directly - edit src/index.jst\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n }\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n } // true if both NaN, false otherwise\n\n\n return a !== a && b !== b;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar _sister = require('sister');\n\nvar _sister2 = _interopRequireDefault(_sister);\n\nvar _loadYouTubeIframeApi = require('./loadYouTubeIframeApi');\n\nvar _loadYouTubeIframeApi2 = _interopRequireDefault(_loadYouTubeIframeApi);\n\nvar _YouTubePlayer = require('./YouTubePlayer');\n\nvar _YouTubePlayer2 = _interopRequireDefault(_YouTubePlayer);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n/**\n * @typedef YT.Player\n * @see https://developers.google.com/youtube/iframe_api_reference\n * */\n\n/**\n * @see https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player\n */\n\n\nvar youtubeIframeAPI = void 0;\n/**\n * A factory function used to produce an instance of YT.Player and queue function calls and proxy events of the resulting object.\n *\n * @param maybeElementId Either An existing YT.Player instance,\n * the DOM element or the id of the HTML element where the API will insert an