From c191b7c2bd8428a1dbbdd432c24b8012aedbb03d Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 20 Mar 2018 13:20:15 -0700 Subject: [PATCH] created dev build --- client/utils/dynamicImport.js | 6 +- index.js | 1486 ++++++++++-------- public/bundle/bundle.js | 2726 +++++++++++++++++---------------- 3 files changed, 2214 insertions(+), 2004 deletions(-) diff --git a/client/utils/dynamicImport.js b/client/utils/dynamicImport.js index afc9eb75..097a9e32 100644 --- a/client/utils/dynamicImport.js +++ b/client/utils/dynamicImport.js @@ -9,7 +9,7 @@ function getDeepestChildValue (parent, childrenKeys) { return child; } -const dynamicImport = (filePath) => { +export const dynamicImport = (filePath) => { // validate inputs if (!filePath) { throw new Error('no file path provided to dynamicImport()'); @@ -25,8 +25,6 @@ const dynamicImport = (filePath) => { if (customComponent) { return customComponent; // return custom component } else { - return require(filePath); // return default component + return require(`${filePath}`); } }; - -export default dynamicImport; diff --git a/index.js b/index.js index f55dc408..851fcded 100644 --- a/index.js +++ b/index.js @@ -61,7 +61,7 @@ module.exports = /******/ __webpack_require__.p = "/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 43); +/******/ return __webpack_require__(__webpack_require__.s = 51); /******/ }) /************************************************************************/ /******/ ([ @@ -159,12 +159,12 @@ module.exports = require("react-router-dom"); "use strict"; -var Sequelize = __webpack_require__(25); +var Sequelize = __webpack_require__(30); var logger = __webpack_require__(1); console.log('exporting sequelize models'); -var _require = __webpack_require__(22), +var _require = __webpack_require__(27), database = _require.database, username = _require.username, password = _require.password; @@ -192,12 +192,12 @@ sequelize.authenticate().then(function () { }); // manually add each model to the db object -var Certificate = __webpack_require__(59); -var Channel = __webpack_require__(60); -var Claim = __webpack_require__(61); -var File = __webpack_require__(62); -var Request = __webpack_require__(63); -var User = __webpack_require__(64); +var Certificate = __webpack_require__(67); +var Channel = __webpack_require__(68); +var Claim = __webpack_require__(69); +var File = __webpack_require__(70); +var Request = __webpack_require__(71); +var User = __webpack_require__(72); db['Certificate'] = sequelize.import('Certificate', Certificate); db['Channel'] = sequelize.import('Channel', Channel); db['Claim'] = sequelize.import('Claim', Claim); @@ -245,6 +245,75 @@ module.exports = db; "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +exports.default = request; + +__webpack_require__(90); + +/** + * Parses the JSON returned by a network request + * + * @param {object} response A response from a network request + * + * @return {object} The parsed JSON from the request + */ +function parseJSON(response) { + if (response.status === 204 || response.status === 205) { + return null; + } + return response.json(); +} + +/** + * Parses the status returned by a network request + * + * @param {object} response A response from a network request + * @param {object} response The parsed JSON from the network request + * + * @return {object | undefined} Returns object with status and statusText, or undefined + */ +function checkStatus(response, jsonResponse) { + if (response.status >= 200 && response.status < 300) { + return jsonResponse; + } + var error = new Error(jsonResponse.message); + error.response = response; + throw error; +} + +/** + * Requests a URL, returning a promise + * + * @param {string} url The URL we want to request + * @param {object} [options] The options we want to pass to "fetch" + * + * @return {object} The response data + */ + +function request(url, options) { + return fetch(url, options).then(function (response) { + return Promise.all([response, parseJSON(response)]); + }).then(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + response = _ref2[0], + jsonResponse = _ref2[1]; + + return checkStatus(response, jsonResponse); + }); +} + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); @@ -262,11 +331,11 @@ exports.fileRequested = fileRequested; exports.updateFileAvailability = updateFileAvailability; exports.updateDisplayAssetError = updateDisplayAssetError; -var _show_action_types = __webpack_require__(8); +var _show_action_types = __webpack_require__(9); var actions = _interopRequireWildcard(_show_action_types); -var _show_request_types = __webpack_require__(39); +var _show_request_types = __webpack_require__(47); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -387,7 +456,7 @@ function updateDisplayAssetError(error) { }; /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -399,11 +468,11 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _channel = __webpack_require__(17); +var _channel = __webpack_require__(22); -var _publish = __webpack_require__(18); +var _publish = __webpack_require__(23); -var _view = __webpack_require__(84); +var _view = __webpack_require__(92); var _view2 = _interopRequireDefault(_view); @@ -436,7 +505,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -467,75 +536,6 @@ var FILE_REQUESTED = exports.FILE_REQUESTED = 'FILE_REQUESTED'; var FILE_AVAILABILITY_UPDATE = exports.FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABILITY_UPDATE'; var DISPLAY_ASSET_ERROR = exports.DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR'; -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -exports.default = request; - -__webpack_require__(87); - -/** - * Parses the JSON returned by a network request - * - * @param {object} response A response from a network request - * - * @return {object} The parsed JSON from the request - */ -function parseJSON(response) { - if (response.status === 204 || response.status === 205) { - return null; - } - return response.json(); -} - -/** - * Parses the status returned by a network request - * - * @param {object} response A response from a network request - * @param {object} response The parsed JSON from the network request - * - * @return {object | undefined} Returns object with status and statusText, or undefined - */ -function checkStatus(response, jsonResponse) { - if (response.status >= 200 && response.status < 300) { - return jsonResponse; - } - var error = new Error(jsonResponse.message); - error.response = response; - throw error; -} - -/** - * Requests a URL, returning a promise - * - * @param {string} url The URL we want to request - * @param {object} [options] The options we want to pass to "fetch" - * - * @return {object} The response data - */ - -function request(url, options) { - return fetch(url, options).then(function (response) { - return Promise.all([response, parseJSON(response)]); - }).then(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - response = _ref2[0], - jsonResponse = _ref2[1]; - - return checkStatus(response, jsonResponse); - }); -} - /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { @@ -549,7 +549,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(88); +var _view = __webpack_require__(95); var _view2 = _interopRequireDefault(_view); @@ -615,10 +615,10 @@ module.exports = require("redux-saga/effects"); "use strict"; -var axios = __webpack_require__(56); +var axios = __webpack_require__(64); var logger = __webpack_require__(1); -var _require = __webpack_require__(57), +var _require = __webpack_require__(65), _require$api = _require.api, apiHost = _require$api.apiHost, apiPort = _require$api.apiPort; @@ -765,7 +765,7 @@ module.exports = { var logger = __webpack_require__(1); -var ua = __webpack_require__(58); +var ua = __webpack_require__(66); var _require = __webpack_require__(3), googleId = _require.analytics.googleId, @@ -841,12 +841,320 @@ module.exports = require("redux"); "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _require = __webpack_require__(3), + componentsConfig = _require.componentsConfig; + +function getDeepestChildValue(parent, childrenKeys) { + var childKey = childrenKeys.shift(); // .shift() retrieves the first element of array and removes it from array + var child = parent[childKey]; + if (childrenKeys.length >= 1) { + return getDeepestChildValue(child, childrenKeys); + } + return child; +} + +var dynamicImport = exports.dynamicImport = function dynamicImport(filePath) { + // validate inputs + if (!filePath) { + throw new Error('no file path provided to dynamicImport()'); + } + if (filePath.typeof !== 'string') { + throw new Error('file path provided to dynamicImport() must be a string'); + } + // split out the file folders // filter out any empty or white-space-only strings + var folders = filePath.split('/').filter(function (folderName) { + return folderName.replace(/\s/g, '').length; + }); + // check for the component corresponding to file path in the site config object + // i.e. componentsConfig[folders[0]][folders[2][...][folders[n]] + var customComponent = getDeepestChildValue(componentsConfig, folders); + if (customComponent) { + return customComponent; // return custom component + } else { + return __webpack_require__(89)("" + filePath); + } +}; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var createBasicCanonicalLink = function createBasicCanonicalLink(page, siteHost) { + return siteHost + "/" + page; +}; + +var createAssetCanonicalLink = function createAssetCanonicalLink(asset, siteHost) { + var channelName = void 0, + certificateId = void 0, + name = void 0, + claimId = void 0; + if (asset.claimData) { + var _asset$claimData = asset.claimData; + channelName = _asset$claimData.channelName; + certificateId = _asset$claimData.certificateId; + name = _asset$claimData.name; + claimId = _asset$claimData.claimId; + }; + if (channelName) { + return siteHost + "/" + channelName + ":" + certificateId + "/" + name; + }; + return siteHost + "/" + claimId + "/" + name; +}; + +var createChannelCanonicalLink = function createChannelCanonicalLink(channel, siteHost) { + var name = channel.name, + longId = channel.longId; + + return siteHost + "/" + name + ":" + longId; +}; + +var createCanonicalLink = exports.createCanonicalLink = function createCanonicalLink(asset, channel, page, siteHost) { + if (asset) { + return createAssetCanonicalLink(asset, siteHost); + } + if (channel) { + return createChannelCanonicalLink(channel, siteHost); + } + return createBasicCanonicalLink(page, siteHost); +}; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +module.exports = { + REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g, + REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g, + REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/, + CHANNEL_CHAR: '@', + parseIdentifier: function parseIdentifier(identifier) { + var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end) + '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end) + ); + + var _componentsRegex$exec = componentsRegex // eslint-disable-line no-unused-vars + .exec(identifier).map(function (match) { + return match || null; + }), + _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4), + proto = _componentsRegex$exec2[0], + value = _componentsRegex$exec2[1], + modifierSeperator = _componentsRegex$exec2[2], + modifier = _componentsRegex$exec2[3]; + + // Validate and process name + + + if (!value) { + throw new Error('Check your URL. No channel name provided before "' + modifierSeperator + '"'); + } + var isChannel = value.startsWith(module.exports.CHANNEL_CHAR); + var channelName = isChannel ? value : null; + var claimId = void 0; + if (isChannel) { + if (!channelName) { + throw new Error('Check your URL. No channel name after "@".'); + } + var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL); + if (nameBadChars) { + throw new Error('Check your URL. Invalid characters in channel name: "' + nameBadChars.join(', ') + '".'); + } + } else { + claimId = value; + } + + // Validate and process modifier + var channelClaimId = void 0; + if (modifierSeperator) { + if (!modifier) { + throw new Error('Check your URL. No modifier provided after separator "' + modifierSeperator + '"'); + } + + if (modifierSeperator === ':') { + channelClaimId = modifier; + } else { + throw new Error('Check your URL. The "' + modifierSeperator + '" modifier is not currently supported'); + } + } + return { + isChannel: isChannel, + channelName: channelName, + channelClaimId: channelClaimId || null, + claimId: claimId || null + }; + }, + parseClaim: function parseClaim(name) { + var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first extension) + '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end) + ); + + var _componentsRegex$exec3 = componentsRegex // eslint-disable-line no-unused-vars + .exec(name).map(function (match) { + return match || null; + }), + _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4), + proto = _componentsRegex$exec4[0], + claimName = _componentsRegex$exec4[1], + extensionSeperator = _componentsRegex$exec4[2], + extension = _componentsRegex$exec4[3]; + + // Validate and process name + + + if (!claimName) { + throw new Error('Check your URL. No claim name provided before "."'); + } + var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM); + if (nameBadChars) { + throw new Error('Check your URL. Invalid characters in claim name: "' + nameBadChars.join(', ') + '".'); + } + // Validate and process extension + if (extensionSeperator) { + if (!extension) { + throw new Error('Check your URL. No file extension provided after separator "' + extensionSeperator + '".'); + } + if (extensionSeperator !== '.') { + throw new Error('Check your URL. The "' + extensionSeperator + '" separator is not supported in the claim name.'); + } + } + return { + claimName: claimName, + extension: extension || null + }; + } +}; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var determineOgThumbnailContentType = function determineOgThumbnailContentType(thumbnail) { + if (thumbnail) { + var fileExt = thumbnail.substring(thumbnail.lastIndexOf('.')); + switch (fileExt) { + case 'jpeg': + case 'jpg': + return 'image/jpeg'; + case 'png': + return 'image/png'; + case 'gif': + return 'image/gif'; + case 'mp4': + return 'video/mp4'; + default: + return 'image/jpeg'; + } + } + return ''; +}; + +var createBasicMetaTags = function createBasicMetaTags(siteHost, siteDescription, siteTitle, siteTwitter) { + return [{ property: 'og:title', content: siteTitle }, { property: 'og:url', content: siteHost }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: siteDescription }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; +}; + +var createChannelMetaTags = function createChannelMetaTags(siteTitle, siteHost, siteTwitter, channel) { + var name = channel.name, + longId = channel.longId; + + return [{ property: 'og:title', content: name + ' on ' + siteTitle }, { property: 'og:url', content: siteHost + '/' + name + ':' + longId }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: name + ', a channel on ' + siteTitle }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; +}; + +var createAssetMetaTags = function createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail) { + var claimData = asset.claimData; + var contentType = claimData.contentType; + + var embedUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; + var showUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; + var source = siteHost + '/' + claimData.claimId + '/' + claimData.name + '.' + claimData.fileExt; + var ogTitle = claimData.title || claimData.name; + var ogDescription = claimData.description || defaultDescription; + var ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail); + var ogThumbnail = claimData.thumbnail || defaultThumbnail; + var metaTags = [{ property: 'og:title', content: ogTitle }, { property: 'og:url', content: showUrl }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: ogDescription }, { property: 'og:image:width', content: 600 }, { property: 'og:image:height', content: 315 }, { property: 'twitter:site', content: siteTwitter }]; + if (contentType === 'video/mp4' || contentType === 'video/webm') { + metaTags.push({ property: 'og:video', content: source }); + metaTags.push({ property: 'og:video:secure_url', content: source }); + metaTags.push({ property: 'og:video:type', content: contentType }); + metaTags.push({ property: 'og:image', content: ogThumbnail }); + metaTags.push({ property: 'og:image:type', content: ogThumbnailContentType }); + metaTags.push({ property: 'og:type', content: 'video' }); + metaTags.push({ property: 'twitter:card', content: 'player' }); + metaTags.push({ property: 'twitter:player', content: embedUrl }); + metaTags.push({ property: 'twitter:player:width', content: 600 }); + metaTags.push({ property: 'twitter:text:player_width', content: 600 }); + metaTags.push({ property: 'twitter:player:height', content: 337 }); + metaTags.push({ property: 'twitter:player:stream', content: source }); + metaTags.push({ property: 'twitter:player:stream:content_type', content: contentType }); + } else { + metaTags.push({ property: 'og:image', content: source }); + metaTags.push({ property: 'og:image:type', content: contentType }); + metaTags.push({ property: 'og:type', content: 'article' }); + metaTags.push({ property: 'twitter:card', content: 'summary_large_image' }); + } + return metaTags; +}; + +var createMetaTags = exports.createMetaTags = function createMetaTags(siteDescription, siteHost, siteTitle, siteTwitter, asset, channel, defaultDescription, defaultThumbnail) { + if (asset) { + return createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail); + }; + if (channel) { + return createChannelMetaTags(siteHost, siteTitle, siteTwitter, channel); + }; + return createBasicMetaTags(siteDescription, siteHost, siteTitle, siteTwitter); +}; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var createPageTitle = exports.createPageTitle = function createPageTitle(siteTitle, pageTitle) { + if (!pageTitle) { + return "" + siteTitle; + } + return siteTitle + " - " + pageTitle; +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); exports.updateLoggedInChannel = updateLoggedInChannel; -var _channel_action_types = __webpack_require__(34); +var _channel_action_types = __webpack_require__(39); var actions = _interopRequireWildcard(_channel_action_types); @@ -866,7 +1174,7 @@ function updateLoggedInChannel(name, shortId, longId) { }; /***/ }), -/* 18 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -887,7 +1195,7 @@ exports.toggleMetadataInputs = toggleMetadataInputs; exports.onNewThumbnail = onNewThumbnail; exports.startPublish = startPublish; -var _publish_action_types = __webpack_require__(33); +var _publish_action_types = __webpack_require__(38); var actions = _interopRequireWildcard(_publish_action_types); @@ -980,13 +1288,13 @@ function startPublish(history) { } /***/ }), -/* 19 */ +/* 24 */ /***/ (function(module, exports) { module.exports = require("prop-types"); /***/ }), -/* 20 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1002,11 +1310,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _propTypes = __webpack_require__(19); +var _propTypes = __webpack_require__(24); var _propTypes2 = _interopRequireDefault(_propTypes); -var _NavBar = __webpack_require__(7); +var _NavBar = __webpack_require__(8); var _NavBar2 = _interopRequireDefault(_NavBar); @@ -1061,13 +1369,13 @@ ErrorPage.propTypes = { exports.default = ErrorPage; /***/ }), -/* 21 */ +/* 26 */ /***/ (function(module, exports) { module.exports = require("passport"); /***/ }), -/* 22 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1096,7 +1404,7 @@ function MysqlConfig() { module.exports = new MysqlConfig(); /***/ }), -/* 23 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1125,19 +1433,19 @@ function SlackConfig() { module.exports = new SlackConfig(); /***/ }), -/* 24 */ +/* 29 */ /***/ (function(module, exports) { module.exports = require("passport-local"); /***/ }), -/* 25 */ +/* 30 */ /***/ (function(module, exports) { module.exports = require("sequelize"); /***/ }), -/* 26 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1170,14 +1478,14 @@ module.exports = { }; /***/ }), -/* 27 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var logger = __webpack_require__(1); -var fs = __webpack_require__(71); +var fs = __webpack_require__(79); var _require = __webpack_require__(3), details = _require.details, @@ -1374,7 +1682,7 @@ module.exports = { }; /***/ }), -/* 28 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1433,7 +1741,7 @@ module.exports = { }; /***/ }), -/* 29 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1444,7 +1752,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ var db = __webpack_require__(5); var logger = __webpack_require__(1); -var _require = __webpack_require__(73), +var _require = __webpack_require__(81), returnPaginatedChannelClaims = _require.returnPaginatedChannelClaims; var NO_CHANNEL = 'NO_CHANNEL'; @@ -1563,7 +1871,7 @@ module.exports = { }; /***/ }), -/* 30 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1573,11 +1881,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _server = __webpack_require__(31); +var _server = __webpack_require__(36); var _redux = __webpack_require__(16); -var _index = __webpack_require__(32); +var _index = __webpack_require__(37); var _index2 = _interopRequireDefault(_index); @@ -1585,15 +1893,15 @@ var _reactRedux = __webpack_require__(2); var _reactRouterDom = __webpack_require__(4); -var _index3 = __webpack_require__(36); +var _index3 = __webpack_require__(41); var _index4 = _interopRequireDefault(_index3); -var _app = __webpack_require__(37); +var _app = __webpack_require__(42); var _app2 = _interopRequireDefault(_app); -var _renderFullPage = __webpack_require__(41); +var _renderFullPage = __webpack_require__(49); var _renderFullPage2 = _interopRequireDefault(_renderFullPage); @@ -1643,13 +1951,13 @@ module.exports = function (req, res) { }; /***/ }), -/* 31 */ +/* 36 */ /***/ (function(module, exports) { module.exports = require("react-dom/server"); /***/ }), -/* 32 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1661,19 +1969,19 @@ Object.defineProperty(exports, "__esModule", { var _redux = __webpack_require__(16); -var _publish = __webpack_require__(75); +var _publish = __webpack_require__(83); var _publish2 = _interopRequireDefault(_publish); -var _channel = __webpack_require__(77); +var _channel = __webpack_require__(85); var _channel2 = _interopRequireDefault(_channel); -var _show = __webpack_require__(78); +var _show = __webpack_require__(86); var _show2 = _interopRequireDefault(_show); -var _site = __webpack_require__(79); +var _site = __webpack_require__(87); var _site2 = _interopRequireDefault(_site); @@ -1687,7 +1995,7 @@ exports.default = (0, _redux.combineReducers)({ }); /***/ }), -/* 33 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1709,7 +2017,7 @@ var THUMBNAIL_NEW = exports.THUMBNAIL_NEW = 'THUMBNAIL_NEW'; var PUBLISH_START = exports.PUBLISH_START = 'PUBLISH_START'; /***/ }), -/* 34 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1721,7 +2029,7 @@ Object.defineProperty(exports, "__esModule", { var CHANNEL_UPDATE = exports.CHANNEL_UPDATE = 'CHANNEL_UPDATE'; /***/ }), -/* 35 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1736,7 +2044,7 @@ var ERROR = exports.ERROR = 'ERROR'; var AVAILABLE = exports.AVAILABLE = 'AVAILABLE'; /***/ }), -/* 36 */ +/* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1752,7 +2060,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactGa = __webpack_require__(80); +var _reactGa = __webpack_require__(88); var _reactGa2 = _interopRequireDefault(_reactGa); @@ -1805,7 +2113,7 @@ var GAListener = function (_React$Component) { exports.default = (0, _reactRouterDom.withRouter)(GAListener); /***/ }), -/* 37 */ +/* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1821,21 +2129,21 @@ var _react2 = _interopRequireDefault(_react); var _reactRouterDom = __webpack_require__(4); -var _dynamicImport = __webpack_require__(81); +var _dynamicImport = __webpack_require__(17); -var _AboutPage = __webpack_require__(83); +var _AboutPage = __webpack_require__(91); var _AboutPage2 = _interopRequireDefault(_AboutPage); -var _LoginPage = __webpack_require__(92); +var _LoginPage = __webpack_require__(96); var _LoginPage2 = _interopRequireDefault(_LoginPage); -var _ShowPage = __webpack_require__(100); +var _ShowPage = __webpack_require__(104); var _ShowPage2 = _interopRequireDefault(_ShowPage); -var _FourOhFourPage = __webpack_require__(117); +var _FourOhFourPage = __webpack_require__(121); var _FourOhFourPage2 = _interopRequireDefault(_FourOhFourPage); @@ -1859,7 +2167,127 @@ var App = function App() { exports.default = App; /***/ }), -/* 38 */ +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + validateFile: function validateFile(file) { + if (!file) { + throw new Error('no file provided'); + } + if (/'/.test(file.name)) { + throw new Error('apostrophes are not allowed in the file name'); + } + // validate size and type + switch (file.type) { + case 'image/jpeg': + case 'image/jpg': + case 'image/png': + if (file.size > 10000000) { + throw new Error('Sorry, images are limited to 10 megabytes.'); + } + break; + case 'image/gif': + if (file.size > 50000000) { + throw new Error('Sorry, GIFs are limited to 50 megabytes.'); + } + break; + case 'video/mp4': + if (file.size > 50000000) { + throw new Error('Sorry, videos are limited to 50 megabytes.'); + } + break; + default: + throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.'); + } + } +}; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var createPublishMetadata = exports.createPublishMetadata = function createPublishMetadata(claim, _ref, _ref2, publishInChannel, selectedChannel) { + var type = _ref.type; + var title = _ref2.title, + description = _ref2.description, + license = _ref2.license, + nsfw = _ref2.nsfw; + + var metadata = { + name: claim, + title: title, + description: description, + license: license, + nsfw: nsfw, + type: type + }; + if (publishInChannel) { + metadata['channelName'] = selectedChannel; + } + return metadata; +}; + +var createPublishFormData = exports.createPublishFormData = function createPublishFormData(file, thumbnail, metadata) { + var fd = new FormData(); + // append file + fd.append('file', file); + // append thumbnail + if (thumbnail) { + fd.append('thumbnail', thumbnail); + } + // append metadata + for (var key in metadata) { + if (metadata.hasOwnProperty(key)) { + fd.append(key, metadata[key]); + } + } + return fd; +}; + +var createThumbnailUrl = exports.createThumbnailUrl = function createThumbnailUrl(channel, channelId, claim, host) { + return host + '/' + channel + ':' + channelId + '/' + claim + '-thumb.png'; +}; + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var validateChannelSelection = exports.validateChannelSelection = function validateChannelSelection(publishInChannel, selectedChannel, loggedInChannel) { + if (publishInChannel && selectedChannel !== loggedInChannel.name) { + throw new Error('Log in to a channel or select Anonymous'); + } +}; + +var validatePublishParams = exports.validatePublishParams = function validatePublishParams(file, claim, urlError) { + if (!file) { + throw new Error('Please choose a file'); + } + if (!claim) { + throw new Error('Please enter a URL'); + } + if (urlError) { + throw new Error('Fix the url'); + } +}; + +/***/ }), +/* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1875,15 +2303,15 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _propTypes = __webpack_require__(19); +var _propTypes = __webpack_require__(24); var _propTypes2 = _interopRequireDefault(_propTypes); -var _ActiveStatusBar = __webpack_require__(98); +var _ActiveStatusBar = __webpack_require__(102); var _ActiveStatusBar2 = _interopRequireDefault(_ActiveStatusBar); -var _InactiveStatusBar = __webpack_require__(99); +var _InactiveStatusBar = __webpack_require__(103); var _InactiveStatusBar2 = _interopRequireDefault(_InactiveStatusBar); @@ -1996,7 +2424,7 @@ ProgressBar.propTypes = { exports.default = ProgressBar; /***/ }), -/* 39 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2010,7 +2438,7 @@ var ASSET_LITE = exports.ASSET_LITE = 'ASSET_LITE'; var ASSET_DETAILS = exports.ASSET_DETAILS = 'ASSET_DETAILS'; /***/ }), -/* 40 */ +/* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2022,11 +2450,11 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(104); +var _view = __webpack_require__(108); var _view2 = _interopRequireDefault(_view); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); var _show2 = __webpack_require__(11); @@ -2059,7 +2487,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 41 */ +/* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2071,7 +2499,7 @@ module.exports = function (helmet, html, preloadedState) { }; /***/ }), -/* 42 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2089,47 +2517,47 @@ var selectSiteHost = exports.selectSiteHost = function selectSiteHost(state) { }; /***/ }), -/* 43 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(44); -__webpack_require__(45); -module.exports = __webpack_require__(46); +__webpack_require__(52); +__webpack_require__(53); +module.exports = __webpack_require__(54); /***/ }), -/* 44 */ +/* 52 */ /***/ (function(module, exports) { module.exports = require("babel-polyfill"); /***/ }), -/* 45 */ +/* 53 */ /***/ (function(module, exports) { module.exports = require("whatwg-fetch"); /***/ }), -/* 46 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // app dependencies -var express = __webpack_require__(47); -var bodyParser = __webpack_require__(48); -var expressHandlebars = __webpack_require__(49); -var Handlebars = __webpack_require__(50); -var helmet = __webpack_require__(51); -var passport = __webpack_require__(21); +var express = __webpack_require__(55); +var bodyParser = __webpack_require__(56); +var expressHandlebars = __webpack_require__(57); +var Handlebars = __webpack_require__(58); +var helmet = __webpack_require__(59); +var passport = __webpack_require__(26); -var _require = __webpack_require__(52), +var _require = __webpack_require__(60), serializeSpeechUser = _require.serializeSpeechUser, deserializeSpeechUser = _require.deserializeSpeechUser; -var cookieSession = __webpack_require__(53); -var http = __webpack_require__(54); +var cookieSession = __webpack_require__(61); +var http = __webpack_require__(62); // logging dependencies var logger = __webpack_require__(1); @@ -2137,7 +2565,7 @@ function SpeechServer() { var _this = this; this.configureMysql = function (mysqlConfig) { - __webpack_require__(22).configure(mysqlConfig); + __webpack_require__(27).configure(mysqlConfig); }; this.configureSite = function (siteConfig) { __webpack_require__(3).configure(siteConfig); @@ -2146,7 +2574,7 @@ function SpeechServer() { _this.PORT = siteConfig.details.port; }; this.configureSlack = function (slackConfig) { - __webpack_require__(23).configure(slackConfig); + __webpack_require__(28).configure(slackConfig); }; this.createApp = function () { // create an Express application @@ -2169,8 +2597,8 @@ function SpeechServer() { // configure passport passport.serializeUser(serializeSpeechUser); passport.deserializeUser(deserializeSpeechUser); - var localSignupStrategy = __webpack_require__(55); - var localLoginStrategy = __webpack_require__(66); + var localSignupStrategy = __webpack_require__(63); + var localLoginStrategy = __webpack_require__(74); passport.use('local-signup', localSignupStrategy); passport.use('local-login', localLoginStrategy); // initialize passport @@ -2191,17 +2619,17 @@ function SpeechServer() { app.set('view engine', 'handlebars'); // set the routes on the app - __webpack_require__(67)(app); - __webpack_require__(68)(app); - __webpack_require__(74)(app); - __webpack_require__(119)(app); - __webpack_require__(130)(app); + __webpack_require__(75)(app); + __webpack_require__(76)(app); + __webpack_require__(82)(app); + __webpack_require__(123)(app); + __webpack_require__(133)(app); _this.app = app; }; this.initialize = function () { - __webpack_require__(131)(logger); - __webpack_require__(133)(logger); + __webpack_require__(134)(logger); + __webpack_require__(136)(logger); _this.createApp(); _this.server = http.Server(_this.app); }; @@ -2223,37 +2651,37 @@ function SpeechServer() { module.exports = SpeechServer; /***/ }), -/* 47 */ +/* 55 */ /***/ (function(module, exports) { module.exports = require("express"); /***/ }), -/* 48 */ +/* 56 */ /***/ (function(module, exports) { module.exports = require("body-parser"); /***/ }), -/* 49 */ +/* 57 */ /***/ (function(module, exports) { module.exports = require("express-handlebars"); /***/ }), -/* 50 */ +/* 58 */ /***/ (function(module, exports) { module.exports = require("handlebars"); /***/ }), -/* 51 */ +/* 59 */ /***/ (function(module, exports) { module.exports = require("helmet"); /***/ }), -/* 52 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2275,19 +2703,19 @@ module.exports = { }; /***/ }), -/* 53 */ +/* 61 */ /***/ (function(module, exports) { module.exports = require("cookie-session"); /***/ }), -/* 54 */ +/* 62 */ /***/ (function(module, exports) { module.exports = require("http"); /***/ }), -/* 55 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2295,7 +2723,7 @@ module.exports = require("http"); var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -var PassportLocalStrategy = __webpack_require__(24).Strategy; +var PassportLocalStrategy = __webpack_require__(29).Strategy; var lbryApi = __webpack_require__(14); var logger = __webpack_require__(1); var db = __webpack_require__(5); @@ -2358,13 +2786,13 @@ module.exports = new PassportLocalStrategy({ }); /***/ }), -/* 56 */ +/* 64 */ /***/ (function(module, exports) { module.exports = require("axios"); /***/ }), -/* 57 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2380,13 +2808,13 @@ var lbryConfig = { module.exports = lbryConfig; /***/ }), -/* 58 */ +/* 66 */ /***/ (function(module, exports) { module.exports = require("universal-analytics"); /***/ }), -/* 59 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2394,7 +2822,7 @@ module.exports = require("universal-analytics"); var logger = __webpack_require__(1); -var _require = __webpack_require__(26), +var _require = __webpack_require__(31), returnShortId = _require.returnShortId; module.exports = function (sequelize, _ref) { @@ -2601,7 +3029,7 @@ module.exports = function (sequelize, _ref) { }; /***/ }), -/* 60 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2632,7 +3060,7 @@ module.exports = function (sequelize, _ref) { }; /***/ }), -/* 61 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2640,7 +3068,7 @@ module.exports = function (sequelize, _ref) { var logger = __webpack_require__(1); -var _require = __webpack_require__(26), +var _require = __webpack_require__(31), returnShortId = _require.returnShortId; var _require2 = __webpack_require__(3), @@ -3011,7 +3439,7 @@ module.exports = function (sequelize, _ref) { }; /***/ }), -/* 62 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3086,7 +3514,7 @@ module.exports = function (sequelize, _ref) { }; /***/ }), -/* 63 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3131,13 +3559,13 @@ module.exports = function (sequelize, _ref) { }; /***/ }), -/* 64 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bcrypt = __webpack_require__(65); +var bcrypt = __webpack_require__(73); var logger = __webpack_require__(1); module.exports = function (sequelize, _ref) { @@ -3225,19 +3653,19 @@ module.exports = function (sequelize, _ref) { }; /***/ }), -/* 65 */ +/* 73 */ /***/ (function(module, exports) { module.exports = require("bcrypt"); /***/ }), -/* 66 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var PassportLocalStrategy = __webpack_require__(24).Strategy; +var PassportLocalStrategy = __webpack_require__(29).Strategy; var logger = __webpack_require__(1); var db = __webpack_require__(5); @@ -3293,14 +3721,14 @@ module.exports = new PassportLocalStrategy({ }); /***/ }), -/* 67 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var logger = __webpack_require__(1); -var passport = __webpack_require__(21); +var passport = __webpack_require__(26); module.exports = function (app) { // route for sign up @@ -3355,7 +3783,7 @@ module.exports = function (app) { }; /***/ }), -/* 68 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3364,7 +3792,7 @@ module.exports = function (app) { var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var logger = __webpack_require__(1); -var multipart = __webpack_require__(69); +var multipart = __webpack_require__(77); var _require = __webpack_require__(3), uploadDirectory = _require.publishing.uploadDirectory, @@ -3373,7 +3801,7 @@ var _require = __webpack_require__(3), var multipartMiddleware = multipart({ uploadDir: uploadDirectory }); var db = __webpack_require__(5); -var _require2 = __webpack_require__(70), +var _require2 = __webpack_require__(78), claimNameIsAvailable = _require2.claimNameIsAvailable, checkChannelAvailability = _require2.checkChannelAvailability, publish = _require2.publish; @@ -3383,7 +3811,7 @@ var _require3 = __webpack_require__(14), resolveUri = _require3.resolveUri, getClaim = _require3.getClaim; -var _require4 = __webpack_require__(27), +var _require4 = __webpack_require__(32), addGetResultsToFileData = _require4.addGetResultsToFileData, createBasicPublishParams = _require4.createBasicPublishParams, createThumbnailPublishParams = _require4.createThumbnailPublishParams, @@ -3391,15 +3819,15 @@ var _require4 = __webpack_require__(27), parsePublishApiRequestFiles = _require4.parsePublishApiRequestFiles, createFileData = _require4.createFileData; -var errorHandlers = __webpack_require__(28); +var errorHandlers = __webpack_require__(33); var _require5 = __webpack_require__(15), sendGATimingEvent = _require5.sendGATimingEvent; -var _require6 = __webpack_require__(72), +var _require6 = __webpack_require__(80), authenticateUser = _require6.authenticateUser; -var _require7 = __webpack_require__(29), +var _require7 = __webpack_require__(34), getChannelData = _require7.getChannelData, getChannelClaims = _require7.getChannelClaims, getClaimId = _require7.getClaimId; @@ -3713,13 +4141,13 @@ module.exports = function (app) { }; /***/ }), -/* 69 */ +/* 77 */ /***/ (function(module, exports) { module.exports = require("connect-multiparty"); /***/ }), -/* 70 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3732,14 +4160,14 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope var logger = __webpack_require__(1); var db = __webpack_require__(5); var lbryApi = __webpack_require__(14); -var publishHelpers = __webpack_require__(27); +var publishHelpers = __webpack_require__(32); var _require = __webpack_require__(3), _require$publishing = _require.publishing, primaryClaimAddress = _require$publishing.primaryClaimAddress, additionalClaimAddresses = _require$publishing.additionalClaimAddresses; -var Sequelize = __webpack_require__(25); +var Sequelize = __webpack_require__(30); var Op = Sequelize.Op; module.exports = { @@ -3858,13 +4286,13 @@ module.exports = { }; /***/ }), -/* 71 */ +/* 79 */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), -/* 72 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3941,7 +4369,7 @@ module.exports = { }; /***/ }), -/* 73 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4019,7 +4447,7 @@ module.exports = { }; /***/ }), -/* 74 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4028,7 +4456,7 @@ module.exports = { var _require = __webpack_require__(3), host = _require.details; -var handlePageRender = __webpack_require__(30); +var handlePageRender = __webpack_require__(35); module.exports = function (app) { // route for the home page @@ -4066,7 +4494,7 @@ module.exports = function (app) { }; /***/ }), -/* 75 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4124,11 +4552,11 @@ exports.default = function () { } }; -var _publish_action_types = __webpack_require__(33); +var _publish_action_types = __webpack_require__(38); var actions = _interopRequireWildcard(_publish_action_types); -var _publish_channel_select_states = __webpack_require__(76); +var _publish_channel_select_states = __webpack_require__(84); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -4165,7 +4593,7 @@ var initialState = { }; /***/ }), -/* 76 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4178,7 +4606,7 @@ var LOGIN = exports.LOGIN = 'Existing'; var CREATE = exports.CREATE = 'New'; /***/ }), -/* 77 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4202,7 +4630,7 @@ exports.default = function () { } }; -var _channel_action_types = __webpack_require__(34); +var _channel_action_types = __webpack_require__(39); var actions = _interopRequireWildcard(_channel_action_types); @@ -4217,7 +4645,7 @@ var initialState = { }; /***/ }), -/* 78 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4300,11 +4728,11 @@ exports.default = function () { } }; -var _show_action_types = __webpack_require__(8); +var _show_action_types = __webpack_require__(9); var actions = _interopRequireWildcard(_show_action_types); -var _asset_display_states = __webpack_require__(35); +var _asset_display_states = __webpack_require__(40); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -4326,7 +4754,7 @@ var initialState = { }; /***/ }), -/* 79 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4370,72 +4798,59 @@ var initialState = { }; /***/ }), -/* 80 */ +/* 88 */ /***/ (function(module, exports) { module.exports = require("react-ga"); /***/ }), -/* 81 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _require = __webpack_require__(3), - componentsConfig = _require.componentsConfig; - -function getDeepestChildValue(parent, childrenKeys) { - var childKey = childrenKeys.shift(); // .shift() retrieves the first element of array and removes it from array - var child = parent[childKey]; - if (childrenKeys.length >= 1) { - return getDeepestChildValue(child, childrenKeys); - } - return child; -} - -var dynamicImport = function dynamicImport(filePath) { - // validate inputs - if (!filePath) { - throw new Error('no file path provided to dynamicImport()'); - } - if (filePath.typeof !== 'string') { - throw new Error('file path provided to dynamicImport() must be a string'); - } - // split out the file folders // filter out any empty or white-space-only strings - var folders = filePath.split('/').filter(function (folderName) { - return folderName.replace(/\s/g, '').length; - }); - // check for the component corresponding to file path in the site config object - // i.e. componentsConfig[folders[0]][folders[2][...][folders[n]] - var customComponent = getDeepestChildValue(componentsConfig, folders); - if (customComponent) { - return customComponent; // return custom component - } else { - return !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); // return default component - } +var map = { + "./canonicalLink": 18, + "./canonicalLink.js": 18, + "./dynamicImport": 17, + "./dynamicImport.js": 17, + "./file": 43, + "./file.js": 43, + "./lbryUri": 19, + "./lbryUri.js": 19, + "./metaTags": 20, + "./metaTags.js": 20, + "./pageTitle": 21, + "./pageTitle.js": 21, + "./publish": 44, + "./publish.js": 44, + "./request": 6, + "./request.js": 6, + "./validate": 45, + "./validate.js": 45 }; - -exports.default = dynamicImport; +function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); +}; +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) // check for number or string + throw new Error("Cannot find module '" + req + "'."); + return id; +}; +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = 89; /***/ }), -/* 82 */ +/* 90 */ /***/ (function(module, exports) { -function webpackEmptyContext(req) { - throw new Error("Cannot find module '" + req + "'."); -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = 82; +module.exports = require("cross-fetch/polyfill"); /***/ }), -/* 83 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4451,7 +4866,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _NavBar = __webpack_require__(7); +var _NavBar = __webpack_require__(8); var _NavBar2 = _interopRequireDefault(_NavBar); @@ -4612,7 +5027,7 @@ var AboutPage = function (_React$Component) { exports.default = AboutPage; /***/ }), -/* 84 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4630,15 +5045,15 @@ var _react2 = _interopRequireDefault(_react); var _reactRouterDom = __webpack_require__(4); -var _Logo = __webpack_require__(85); +var _Logo = __webpack_require__(93); var _Logo2 = _interopRequireDefault(_Logo); -var _NavBarChannelOptionsDropdown = __webpack_require__(86); +var _NavBarChannelOptionsDropdown = __webpack_require__(94); var _NavBarChannelOptionsDropdown2 = _interopRequireDefault(_NavBarChannelOptionsDropdown); -var _request = __webpack_require__(9); +var _request = __webpack_require__(6); var _request2 = _interopRequireDefault(_request); @@ -4772,7 +5187,7 @@ var NavBar = function (_React$Component) { exports.default = (0, _reactRouterDom.withRouter)(NavBar); /***/ }), -/* 85 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4840,7 +5255,7 @@ function Logo() { exports.default = Logo; /***/ }), -/* 86 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4887,13 +5302,7 @@ function NavBarChannelDropdown(_ref) { exports.default = NavBarChannelDropdown; /***/ }), -/* 87 */ -/***/ (function(module, exports) { - -module.exports = require("cross-fetch/polyfill"); - -/***/ }), -/* 88 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4913,15 +5322,15 @@ var _reactHelmet = __webpack_require__(12); var _reactHelmet2 = _interopRequireDefault(_reactHelmet); -var _propTypes = __webpack_require__(19); +var _propTypes = __webpack_require__(24); var _propTypes2 = _interopRequireDefault(_propTypes); -var _pageTitle = __webpack_require__(89); +var _pageTitle = __webpack_require__(21); -var _metaTags = __webpack_require__(90); +var _metaTags = __webpack_require__(20); -var _canonicalLink = __webpack_require__(91); +var _canonicalLink = __webpack_require__(18); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4987,159 +5396,7 @@ SEO.propTypes = { exports.default = SEO; /***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var createPageTitle = exports.createPageTitle = function createPageTitle(siteTitle, pageTitle) { - if (!pageTitle) { - return "" + siteTitle; - } - return siteTitle + " - " + pageTitle; -}; - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var determineOgThumbnailContentType = function determineOgThumbnailContentType(thumbnail) { - if (thumbnail) { - var fileExt = thumbnail.substring(thumbnail.lastIndexOf('.')); - switch (fileExt) { - case 'jpeg': - case 'jpg': - return 'image/jpeg'; - case 'png': - return 'image/png'; - case 'gif': - return 'image/gif'; - case 'mp4': - return 'video/mp4'; - default: - return 'image/jpeg'; - } - } - return ''; -}; - -var createBasicMetaTags = function createBasicMetaTags(siteHost, siteDescription, siteTitle, siteTwitter) { - return [{ property: 'og:title', content: siteTitle }, { property: 'og:url', content: siteHost }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: siteDescription }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; -}; - -var createChannelMetaTags = function createChannelMetaTags(siteTitle, siteHost, siteTwitter, channel) { - var name = channel.name, - longId = channel.longId; - - return [{ property: 'og:title', content: name + ' on ' + siteTitle }, { property: 'og:url', content: siteHost + '/' + name + ':' + longId }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: name + ', a channel on ' + siteTitle }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; -}; - -var createAssetMetaTags = function createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail) { - var claimData = asset.claimData; - var contentType = claimData.contentType; - - var embedUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; - var showUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; - var source = siteHost + '/' + claimData.claimId + '/' + claimData.name + '.' + claimData.fileExt; - var ogTitle = claimData.title || claimData.name; - var ogDescription = claimData.description || defaultDescription; - var ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail); - var ogThumbnail = claimData.thumbnail || defaultThumbnail; - var metaTags = [{ property: 'og:title', content: ogTitle }, { property: 'og:url', content: showUrl }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: ogDescription }, { property: 'og:image:width', content: 600 }, { property: 'og:image:height', content: 315 }, { property: 'twitter:site', content: siteTwitter }]; - if (contentType === 'video/mp4' || contentType === 'video/webm') { - metaTags.push({ property: 'og:video', content: source }); - metaTags.push({ property: 'og:video:secure_url', content: source }); - metaTags.push({ property: 'og:video:type', content: contentType }); - metaTags.push({ property: 'og:image', content: ogThumbnail }); - metaTags.push({ property: 'og:image:type', content: ogThumbnailContentType }); - metaTags.push({ property: 'og:type', content: 'video' }); - metaTags.push({ property: 'twitter:card', content: 'player' }); - metaTags.push({ property: 'twitter:player', content: embedUrl }); - metaTags.push({ property: 'twitter:player:width', content: 600 }); - metaTags.push({ property: 'twitter:text:player_width', content: 600 }); - metaTags.push({ property: 'twitter:player:height', content: 337 }); - metaTags.push({ property: 'twitter:player:stream', content: source }); - metaTags.push({ property: 'twitter:player:stream:content_type', content: contentType }); - } else { - metaTags.push({ property: 'og:image', content: source }); - metaTags.push({ property: 'og:image:type', content: contentType }); - metaTags.push({ property: 'og:type', content: 'article' }); - metaTags.push({ property: 'twitter:card', content: 'summary_large_image' }); - } - return metaTags; -}; - -var createMetaTags = exports.createMetaTags = function createMetaTags(siteDescription, siteHost, siteTitle, siteTwitter, asset, channel, defaultDescription, defaultThumbnail) { - if (asset) { - return createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail); - }; - if (channel) { - return createChannelMetaTags(siteHost, siteTitle, siteTwitter, channel); - }; - return createBasicMetaTags(siteDescription, siteHost, siteTitle, siteTwitter); -}; - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var createBasicCanonicalLink = function createBasicCanonicalLink(page, siteHost) { - return siteHost + "/" + page; -}; - -var createAssetCanonicalLink = function createAssetCanonicalLink(asset, siteHost) { - var channelName = void 0, - certificateId = void 0, - name = void 0, - claimId = void 0; - if (asset.claimData) { - var _asset$claimData = asset.claimData; - channelName = _asset$claimData.channelName; - certificateId = _asset$claimData.certificateId; - name = _asset$claimData.name; - claimId = _asset$claimData.claimId; - }; - if (channelName) { - return siteHost + "/" + channelName + ":" + certificateId + "/" + name; - }; - return siteHost + "/" + claimId + "/" + name; -}; - -var createChannelCanonicalLink = function createChannelCanonicalLink(channel, siteHost) { - var name = channel.name, - longId = channel.longId; - - return siteHost + "/" + name + ":" + longId; -}; - -var createCanonicalLink = exports.createCanonicalLink = function createCanonicalLink(asset, channel, page, siteHost) { - if (asset) { - return createAssetCanonicalLink(asset, siteHost); - } - if (channel) { - return createChannelCanonicalLink(channel, siteHost); - } - return createBasicCanonicalLink(page, siteHost); -}; - -/***/ }), -/* 92 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5151,7 +5408,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(93); +var _view = __webpack_require__(97); var _view2 = _interopRequireDefault(_view); @@ -5168,7 +5425,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 93 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5190,15 +5447,15 @@ var _SEO = __webpack_require__(10); var _SEO2 = _interopRequireDefault(_SEO); -var _NavBar = __webpack_require__(7); +var _NavBar = __webpack_require__(8); var _NavBar2 = _interopRequireDefault(_NavBar); -var _ChannelLoginForm = __webpack_require__(94); +var _ChannelLoginForm = __webpack_require__(98); var _ChannelLoginForm2 = _interopRequireDefault(_ChannelLoginForm); -var _ChannelCreateForm = __webpack_require__(96); +var _ChannelCreateForm = __webpack_require__(100); var _ChannelCreateForm2 = _interopRequireDefault(_ChannelCreateForm); @@ -5296,7 +5553,7 @@ var LoginPage = function (_React$Component) { exports.default = (0, _reactRouterDom.withRouter)(LoginPage); /***/ }), -/* 94 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5308,13 +5565,13 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _channel = __webpack_require__(17); +var _channel = __webpack_require__(22); -var _view = __webpack_require__(95); +var _view = __webpack_require__(99); var _view2 = _interopRequireDefault(_view); -var _publish = __webpack_require__(18); +var _publish = __webpack_require__(23); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5330,7 +5587,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view2.default); /***/ }), -/* 95 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5346,7 +5603,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _request = __webpack_require__(9); +var _request = __webpack_require__(6); var _request2 = _interopRequireDefault(_request); @@ -5502,7 +5759,7 @@ var ChannelLoginForm = function (_React$Component) { exports.default = ChannelLoginForm; /***/ }), -/* 96 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5514,13 +5771,13 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _channel = __webpack_require__(17); +var _channel = __webpack_require__(22); -var _view = __webpack_require__(97); +var _view = __webpack_require__(101); var _view2 = _interopRequireDefault(_view); -var _publish = __webpack_require__(18); +var _publish = __webpack_require__(23); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5536,7 +5793,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view2.default); /***/ }), -/* 97 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5552,11 +5809,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _ProgressBar = __webpack_require__(38); +var _ProgressBar = __webpack_require__(46); var _ProgressBar2 = _interopRequireDefault(_ProgressBar); -var _request = __webpack_require__(9); +var _request = __webpack_require__(6); var _request2 = _interopRequireDefault(_request); @@ -5791,7 +6048,7 @@ var ChannelCreateForm = function (_React$Component) { exports.default = ChannelCreateForm; /***/ }), -/* 98 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5818,7 +6075,7 @@ var ActiveStatusBar = function ActiveStatusBar() { exports.default = ActiveStatusBar; /***/ }), -/* 99 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5845,7 +6102,7 @@ var InactiveStatusBar = function InactiveStatusBar() { exports.default = InactiveStatusBar; /***/ }), -/* 100 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5857,9 +6114,9 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); -var _view = __webpack_require__(101); +var _view = __webpack_require__(105); var _view2 = _interopRequireDefault(_view); @@ -5881,7 +6138,7 @@ var mapDispatchToProps = { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 101 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5897,23 +6154,23 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _ErrorPage = __webpack_require__(20); +var _ErrorPage = __webpack_require__(25); var _ErrorPage2 = _interopRequireDefault(_ErrorPage); -var _ShowAssetLite = __webpack_require__(102); +var _ShowAssetLite = __webpack_require__(106); var _ShowAssetLite2 = _interopRequireDefault(_ShowAssetLite); -var _ShowAssetDetails = __webpack_require__(105); +var _ShowAssetDetails = __webpack_require__(109); var _ShowAssetDetails2 = _interopRequireDefault(_ShowAssetDetails); -var _ShowChannel = __webpack_require__(111); +var _ShowChannel = __webpack_require__(115); var _ShowChannel2 = _interopRequireDefault(_ShowChannel); -var _show_request_types = __webpack_require__(39); +var _show_request_types = __webpack_require__(47); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5979,7 +6236,7 @@ var ShowPage = function (_React$Component) { exports.default = ShowPage; /***/ }), -/* 102 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5991,7 +6248,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(103); +var _view = __webpack_require__(107); var _view2 = _interopRequireDefault(_view); @@ -6019,7 +6276,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 103 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6041,7 +6298,7 @@ var _SEO2 = _interopRequireDefault(_SEO); var _reactRouterDom = __webpack_require__(4); -var _AssetDisplay = __webpack_require__(40); +var _AssetDisplay = __webpack_require__(48); var _AssetDisplay2 = _interopRequireDefault(_AssetDisplay); @@ -6104,7 +6361,7 @@ var ShowLite = function (_React$Component) { exports.default = ShowLite; /***/ }), -/* 104 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6120,11 +6377,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _ProgressBar = __webpack_require__(38); +var _ProgressBar = __webpack_require__(46); var _ProgressBar2 = _interopRequireDefault(_ProgressBar); -var _asset_display_states = __webpack_require__(35); +var _asset_display_states = __webpack_require__(40); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6275,7 +6532,7 @@ var AssetDisplay = function (_React$Component) { exports.default = AssetDisplay; /***/ }), -/* 105 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6287,7 +6544,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(106); +var _view = __webpack_require__(110); var _view2 = _interopRequireDefault(_view); @@ -6315,7 +6572,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 106 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6335,23 +6592,23 @@ var _SEO = __webpack_require__(10); var _SEO2 = _interopRequireDefault(_SEO); -var _NavBar = __webpack_require__(7); +var _NavBar = __webpack_require__(8); var _NavBar2 = _interopRequireDefault(_NavBar); -var _ErrorPage = __webpack_require__(20); +var _ErrorPage = __webpack_require__(25); var _ErrorPage2 = _interopRequireDefault(_ErrorPage); -var _AssetTitle = __webpack_require__(107); +var _AssetTitle = __webpack_require__(111); var _AssetTitle2 = _interopRequireDefault(_AssetTitle); -var _AssetDisplay = __webpack_require__(40); +var _AssetDisplay = __webpack_require__(48); var _AssetDisplay2 = _interopRequireDefault(_AssetDisplay); -var _AssetInfo = __webpack_require__(109); +var _AssetInfo = __webpack_require__(113); var _AssetInfo2 = _interopRequireDefault(_AssetInfo); @@ -6426,7 +6683,7 @@ var ShowAssetDetails = function (_React$Component) { exports.default = ShowAssetDetails; /***/ }), -/* 107 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6438,7 +6695,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(108); +var _view = __webpack_require__(112); var _view2 = _interopRequireDefault(_view); @@ -6460,7 +6717,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 108 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6493,7 +6750,7 @@ var AssetTitle = function AssetTitle(_ref) { exports.default = AssetTitle; /***/ }), -/* 109 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6505,7 +6762,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(110); +var _view = __webpack_require__(114); var _view2 = _interopRequireDefault(_view); @@ -6527,7 +6784,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 110 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6809,7 +7066,7 @@ var AssetInfo = function (_React$Component) { exports.default = AssetInfo; /***/ }), -/* 111 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6821,7 +7078,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(112); +var _view = __webpack_require__(116); var _view2 = _interopRequireDefault(_view); @@ -6848,7 +7105,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 112 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6868,15 +7125,15 @@ var _SEO = __webpack_require__(10); var _SEO2 = _interopRequireDefault(_SEO); -var _ErrorPage = __webpack_require__(20); +var _ErrorPage = __webpack_require__(25); var _ErrorPage2 = _interopRequireDefault(_ErrorPage); -var _NavBar = __webpack_require__(7); +var _NavBar = __webpack_require__(8); var _NavBar2 = _interopRequireDefault(_NavBar); -var _ChannelClaimsDisplay = __webpack_require__(113); +var _ChannelClaimsDisplay = __webpack_require__(117); var _ChannelClaimsDisplay2 = _interopRequireDefault(_ChannelClaimsDisplay); @@ -6957,7 +7214,7 @@ var ShowChannel = function (_React$Component) { exports.default = ShowChannel; /***/ }), -/* 113 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6969,9 +7226,9 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); -var _view = __webpack_require__(114); +var _view = __webpack_require__(118); var _view2 = _interopRequireDefault(_view); @@ -6999,7 +7256,7 @@ var mapDispatchToProps = { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 114 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7015,7 +7272,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _AssetPreview = __webpack_require__(115); +var _AssetPreview = __webpack_require__(119); var _AssetPreview2 = _interopRequireDefault(_AssetPreview); @@ -7118,7 +7375,7 @@ var ChannelClaimsDisplay = function (_React$Component) { exports.default = ChannelClaimsDisplay; /***/ }), -/* 115 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7130,7 +7387,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(116); +var _view = __webpack_require__(120); var _view2 = _interopRequireDefault(_view); @@ -7147,7 +7404,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 116 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7214,7 +7471,7 @@ var AssetPreview = function AssetPreview(_ref) { exports.default = AssetPreview; /***/ }), -/* 117 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7226,7 +7483,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(2); -var _view = __webpack_require__(118); +var _view = __webpack_require__(122); var _view2 = _interopRequireDefault(_view); @@ -7246,7 +7503,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 118 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7262,7 +7519,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _NavBar = __webpack_require__(7); +var _NavBar = __webpack_require__(8); var _NavBar2 = _interopRequireDefault(_NavBar); @@ -7335,7 +7592,7 @@ var FourOhForPage = function (_React$Component) { exports.default = FourOhForPage; /***/ }), -/* 119 */ +/* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7346,14 +7603,14 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ var _require = __webpack_require__(15), sendGAServeEvent = _require.sendGAServeEvent; -var _require2 = __webpack_require__(120), +var _require2 = __webpack_require__(124), determineResponseType = _require2.determineResponseType, flipClaimNameAndIdForBackwardsCompatibility = _require2.flipClaimNameAndIdForBackwardsCompatibility, logRequestData = _require2.logRequestData, getClaimIdAndServeAsset = _require2.getClaimIdAndServeAsset; -var lbryUri = __webpack_require__(121); -var handleShowRender = __webpack_require__(122); +var lbryUri = __webpack_require__(125); +var handleShowRender = __webpack_require__(126); var SERVE = 'SERVE'; module.exports = function (app) { @@ -7457,7 +7714,7 @@ module.exports = function (app) { }; /***/ }), -/* 120 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7465,11 +7722,11 @@ module.exports = function (app) { var logger = __webpack_require__(1); -var _require = __webpack_require__(29), +var _require = __webpack_require__(34), getClaimId = _require.getClaimId, getLocalFileRecord = _require.getLocalFileRecord; -var _require2 = __webpack_require__(28), +var _require2 = __webpack_require__(33), handleErrorResponse = _require2.handleErrorResponse; var SERVE = 'SERVE'; @@ -7584,7 +7841,7 @@ module.exports = { }; /***/ }), -/* 121 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7722,7 +7979,7 @@ module.exports = { }; /***/ }), -/* 122 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7732,11 +7989,11 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _server = __webpack_require__(31); +var _server = __webpack_require__(36); var _redux = __webpack_require__(16); -var _index = __webpack_require__(32); +var _index = __webpack_require__(37); var _index2 = _interopRequireDefault(_index); @@ -7744,27 +8001,27 @@ var _reactRedux = __webpack_require__(2); var _reactRouterDom = __webpack_require__(4); -var _index3 = __webpack_require__(36); +var _index3 = __webpack_require__(41); var _index4 = _interopRequireDefault(_index3); -var _app = __webpack_require__(37); +var _app = __webpack_require__(42); var _app2 = _interopRequireDefault(_app); -var _renderFullPage = __webpack_require__(41); +var _renderFullPage = __webpack_require__(49); var _renderFullPage2 = _interopRequireDefault(_renderFullPage); -var _reduxSaga = __webpack_require__(123); +var _reduxSaga = __webpack_require__(127); var _reduxSaga2 = _interopRequireDefault(_reduxSaga); var _effects = __webpack_require__(13); -var _show_uri = __webpack_require__(124); +var _show_uri = __webpack_require__(128); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); var _reactHelmet = __webpack_require__(12); @@ -7839,13 +8096,13 @@ module.exports = function (req, res) { }; /***/ }), -/* 123 */ +/* 127 */ /***/ (function(module, exports) { module.exports = require("redux-saga"); /***/ }), -/* 124 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7859,17 +8116,17 @@ exports.watchHandleShowPageUri = watchHandleShowPageUri; var _effects = __webpack_require__(13); -var _show_action_types = __webpack_require__(8); +var _show_action_types = __webpack_require__(9); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); -var _show_asset = __webpack_require__(125); +var _show_asset = __webpack_require__(129); -var _show_channel = __webpack_require__(127); +var _show_channel = __webpack_require__(131); -var _lbryUri = __webpack_require__(129); +var _lbryUri = __webpack_require__(19); var _lbryUri2 = _interopRequireDefault(_lbryUri); @@ -8057,7 +8314,7 @@ function watchHandleShowPageUri() { }; /***/ }), -/* 125 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8071,17 +8328,17 @@ exports.watchNewAssetRequest = watchNewAssetRequest; var _effects = __webpack_require__(13); -var _show_action_types = __webpack_require__(8); +var _show_action_types = __webpack_require__(9); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); -var _assetApi = __webpack_require__(126); +var _assetApi = __webpack_require__(130); var _show2 = __webpack_require__(11); -var _site = __webpack_require__(42); +var _site = __webpack_require__(50); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -8232,7 +8489,7 @@ function watchNewAssetRequest() { }; /***/ }), -/* 126 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8245,7 +8502,7 @@ exports.getLongClaimId = getLongClaimId; exports.getShortId = getShortId; exports.getClaimData = getClaimData; -var _request = __webpack_require__(9); +var _request = __webpack_require__(6); var _request2 = _interopRequireDefault(_request); @@ -8285,7 +8542,7 @@ function getClaimData(host, name, claimId) { }; /***/ }), -/* 127 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8300,17 +8557,17 @@ exports.watchUpdateChannelClaims = watchUpdateChannelClaims; var _effects = __webpack_require__(13); -var _show_action_types = __webpack_require__(8); +var _show_action_types = __webpack_require__(9); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(6); +var _show = __webpack_require__(7); -var _channelApi = __webpack_require__(128); +var _channelApi = __webpack_require__(132); var _show2 = __webpack_require__(11); -var _site = __webpack_require__(42); +var _site = __webpack_require__(50); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -8505,7 +8762,7 @@ function watchUpdateChannelClaims() { } /***/ }), -/* 128 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8517,7 +8774,7 @@ Object.defineProperty(exports, "__esModule", { exports.getChannelData = getChannelData; exports.getChannelClaims = getChannelClaims; -var _request = __webpack_require__(9); +var _request = __webpack_require__(6); var _request2 = _interopRequireDefault(_request); @@ -8536,124 +8793,13 @@ function getChannelClaims(host, longId, name, page) { }; /***/ }), -/* 129 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -module.exports = { - REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g, - REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g, - REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/, - CHANNEL_CHAR: '@', - parseIdentifier: function parseIdentifier(identifier) { - var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end) - '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end) - ); - - var _componentsRegex$exec = componentsRegex // eslint-disable-line no-unused-vars - .exec(identifier).map(function (match) { - return match || null; - }), - _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4), - proto = _componentsRegex$exec2[0], - value = _componentsRegex$exec2[1], - modifierSeperator = _componentsRegex$exec2[2], - modifier = _componentsRegex$exec2[3]; - - // Validate and process name - - - if (!value) { - throw new Error('Check your URL. No channel name provided before "' + modifierSeperator + '"'); - } - var isChannel = value.startsWith(module.exports.CHANNEL_CHAR); - var channelName = isChannel ? value : null; - var claimId = void 0; - if (isChannel) { - if (!channelName) { - throw new Error('Check your URL. No channel name after "@".'); - } - var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL); - if (nameBadChars) { - throw new Error('Check your URL. Invalid characters in channel name: "' + nameBadChars.join(', ') + '".'); - } - } else { - claimId = value; - } - - // Validate and process modifier - var channelClaimId = void 0; - if (modifierSeperator) { - if (!modifier) { - throw new Error('Check your URL. No modifier provided after separator "' + modifierSeperator + '"'); - } - - if (modifierSeperator === ':') { - channelClaimId = modifier; - } else { - throw new Error('Check your URL. The "' + modifierSeperator + '" modifier is not currently supported'); - } - } - return { - isChannel: isChannel, - channelName: channelName, - channelClaimId: channelClaimId || null, - claimId: claimId || null - }; - }, - parseClaim: function parseClaim(name) { - var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first extension) - '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end) - ); - - var _componentsRegex$exec3 = componentsRegex // eslint-disable-line no-unused-vars - .exec(name).map(function (match) { - return match || null; - }), - _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4), - proto = _componentsRegex$exec4[0], - claimName = _componentsRegex$exec4[1], - extensionSeperator = _componentsRegex$exec4[2], - extension = _componentsRegex$exec4[3]; - - // Validate and process name - - - if (!claimName) { - throw new Error('Check your URL. No claim name provided before "."'); - } - var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM); - if (nameBadChars) { - throw new Error('Check your URL. Invalid characters in claim name: "' + nameBadChars.join(', ') + '".'); - } - // Validate and process extension - if (extensionSeperator) { - if (!extension) { - throw new Error('Check your URL. No file extension provided after separator "' + extensionSeperator + '".'); - } - if (extensionSeperator !== '.') { - throw new Error('Check your URL. The "' + extensionSeperator + '" separator is not supported in the claim name.'); - } - } - return { - claimName: claimName, - extension: extension || null - }; - } -}; - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var handlePageRender = __webpack_require__(30); +var handlePageRender = __webpack_require__(35); module.exports = function (app) { // a catch-all route if someone visits a page that does not exist @@ -8664,13 +8810,13 @@ module.exports = function (app) { }; /***/ }), -/* 131 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _require = __webpack_require__(132), +var _require = __webpack_require__(135), logLevel = _require.logLevel; module.exports = function (winston) { @@ -8695,7 +8841,7 @@ module.exports = function (winston) { }; /***/ }), -/* 132 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8708,14 +8854,14 @@ var loggerConfig = { module.exports = loggerConfig; /***/ }), -/* 133 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var winstonSlackWebHook = __webpack_require__(134).SlackWebHook; -var slackConfig = __webpack_require__(23); +var winstonSlackWebHook = __webpack_require__(137).SlackWebHook; +var slackConfig = __webpack_require__(28); module.exports = function (winston) { var slackWebHook = slackConfig.slackWebHook, @@ -8753,11 +8899,11 @@ module.exports = function (winston) { }; /***/ }), -/* 134 */ +/* 137 */ /***/ (function(module, exports) { module.exports = require("winston-slack-webhook"); /***/ }) /******/ ]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgNjkxMzAzOTlmOTVhZDBiYTBmNzgiLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIFwicmVhY3RcIiIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwgXCJ3aW5zdG9uXCIiLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIFwicmVhY3QtcmVkdXhcIiIsIndlYnBhY2s6Ly8vLi9jb25maWcvc2l0ZUNvbmZpZy5qcyIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwg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mxvYWREaXJlY3RvcnknLCAnU0VUVElOR1NfR0VUJywgZ2FTdGFydFRpbWUsIERhdGUubm93KCkpO1xuICAgICAgICAgIGlmIChkYXRhLnJlc3VsdCkge1xuICAgICAgICAgICAgcmVzb2x2ZShkYXRhLnJlc3VsdC5kb3dubG9hZF9kaXJlY3RvcnkpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEVycm9yKCdTdWNjZXNzZnVsbHkgY29ubmVjdGVkIHRvIGxicnkgZGFlbW9uLCBidXQgdW5hYmxlIHRvIHJldHJpZXZlIHRoZSBkb3dubG9hZCBkaXJlY3RvcnkuJyk7XG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgICAuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAgICAgIGxvZ2dlci5lcnJvcignTGJyeW5ldCBFcnJvcjonLCBlcnJvcik7XG4gICAgICAgICAgcmVzb2x2ZSgnL2hvbWUvbGJyeS9Eb3dubG9hZHMvJyk7XG4gICAgICAgIH0pO1xuICAgIH0pO1xuICB9LFxuICBjcmVhdGVDaGFubmVsIChuYW1lKSB7XG4gICAgbG9nZ2VyLmRlYnVnKGBsYnJ5QXBpID4+IENyZWF0aW5nIGNoYW5uZWwgZm9yICR7bmFtZX0uLi5gKTtcbiAgICBjb25zdCBnYVN0YXJ0VGltZSA9IERhdGUubm93KCk7XG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgIGF4aW9zXG4gICAgICAgIC5wb3N0KGxicnlBcGlVcmksIHtcbiAgICAgICAgICBtZXRob2Q6ICdjaGFubmVsX25ldycsXG4gICAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgICBjaGFubmVsX25hbWU6IG5hbWUsXG4gICAgICAgICAgICBhbW91bnQgICAgICA6IDAuMSxcbiAgICAgICAgICB9LFxuICAgICAgICB9KVxuICAgICAgICAudGhlbihyZXNwb25zZSA9PiB7X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MKDE5LCA4KSxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBoYXNTaWduYXR1cmU6IHtcbiAgICAgICAgdHlwZSAgIDogQk9PTEVBTixcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBoZWlnaHQ6IHtcbiAgICAgICAgdHlwZSAgIDogSU5URUdFUixcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBoZXg6IHtcbiAgICAgICAgdHlwZSAgIDogVEVYVCgnbG9uZycpLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIG5hbWU6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIG5vdXQ6IHtcbiAgICAgICAgdHlwZSAgIDogSU5URUdFUixcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICB0eGlkOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICB2YWxpZEF0SGVpZ2h0OiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgb3V0cG9pbnQ6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIHZhbHVlVmVyc2lvbjoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgY2xhaW1UeXBlOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBjZXJ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kOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBjbGFpbVNlcXVlbmNlOiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgZGVjb2RlZENsYWltOiB7XG4gICAgICAgIHR5cGUgICA6IEJPT0xFQU4sXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgZGVwdGg6IHtcbiAgICAgICAgdHlwZSAgIDogSU5URUdFUixcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBlZmZlY3RpdmVBbW91bnQ6IHtcbiAgICAgICAgdHlwZSAgIDogREVDSU1BTCgxOSwgOCksXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgaGFzU2lnbmF0dXJlOiB7XG4gICAgICAgIHR5cGUgICA6IEJPT0xFQU4sXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgaGVpZ2h0OiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgaGV4OiB7XG4gICAgICAgIHR5cGUgICA6IFRFWFQoJ2xvbmcnKSxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBuYW1lOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBub3V0OiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgdHhpZDoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgdmFsaWRBdEhlaWdodDoge1xuICAgICAgICB0eXBlICAgOiBJTlRFR0VSLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIG91dHBvaW50OiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBjbGFpbVR5cGU6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGNlcnRpZmljYXRlSWQ6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGF1dGhvcjoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgZGVzY3JpcHRpb246IHtcbiAgICAgICAgdHlwZSAgIDogVEVYVCgnbG9uZycpLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGxhbmd1YWdlOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBsaWNlbnNlOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBsaWNlbnNlVXJsOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBuc2Z3OiB7XG4gICAgICAgIHR5cGUgICA6IEJPT0xFQU4sXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgcHJldmlldzoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgdGh1bWJuYWlsOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICB0aXRsZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgbWV0YWRhdGFWZXJzaW9uOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBjb250ZW50VHlwZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgc291cmNlOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBzb3VyY2VUeXBlOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBzb3VyY2VWZXJzaW9uOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBzdHJlYW1WZXJzaW9uOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICB2YWx1ZVZlcnNpb246IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGNoYW5uZWxOYW1lOiB7XG4gICAgICAgIHR5cGUgICAgIDogU1RSSU5HLFxuICAgICAgICBhbGxvd051bGw6IHRydWUsXG4gICAgICAgIGRlZmF1bHQgIDogbnVsbCxcbiAgICAgIH0sXG4gICAgfSxcbiAgICB7XG4gICAgICBmcmVlemVUYWJsZU5hbWU6IHRydWUsXG4gICAgfVxuICApO1xuXG4gIENsYWltLmFzc29jaWF0ZSA9IGRiID0+IHtcbiAgICBDbGFpbS5iZWxvbmdzVG8oZGIuRmlsZSwge1xuICAgICAgZm9yZWlnbktleToge1xuICAgICAgICBhbGxvd051bGw6IHRydWUsXG4gICAgICB9LFxuICAgIH0pO1xuICB9O1xuXG4gIENsYWltLmdldFNob3J0Q2xhaW1JZEZyb21Mb25nQ2xhaW1JZCA9IGZ1bmN0aW9uIChjbGFpbUlkLCBjbGFpbU5hbWUpIHtcbiAgICBsb2dnZXIuZGVidWcoYENsYWltLmdldFNob3J0Q2xhaW1JZEZyb21Mb25nQ2xhaW1JZCBmb3IgJHtjbGFpbU5hbWV9IyR7Y2xhaW1JZH1gKTtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgdGhpc1xuICAgICAgICAuZmluZEFsbCh7XG4gICAgICAgICAgd2hlcmU6IHsgbmFtZTogY2xhaW1OYW1lIH0sXG4gICAgICAgICAgb3JkZXI6IFtbJ2hlaWdodCcsICdBU0MnXV0sXG4gICAgICAgIH0pXG4gICAgICAgIC50aGVuKHJlc3VsdCA9PiB7XG4gICAgICAgICAgc3dpdGNoIChyZXN1bHQubGVuZ3RoKSB7XG4gICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTm8gY2xhaW0ocykgZm91bmQgd2l0aCB0aGF0IGNsYWltIG5hbWUnKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgIHJlc29sdmUocmV0dXJuU2hvcnRJZChyZXN1bHQsIGNsYWltSWQpKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICAgIC5jYXRjaChlcnJvciA9PiB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AgICAgcmV0dXJuIHJlc29sdmUocmVzdWx0WzBdLmNsYWltSWQpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgbG9nZ2VyLmVycm9yKGAke3Jlc3VsdC5sZW5ndGh9IHJlY29yZHMgZm91bmQgZm9yIFwiJHtjbGFpbU5hbWV9XCIgaW4gY2hhbm5lbCBcIiR7Y2hhbm5lbENsYWltSWR9XCJgKTtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUocmVzdWx0WzBdLmNsYWltSWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgICAgLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbiAgfTtcblxuICBDbGFpbS5nZXRMb25nQ2xhaW1JZEZyb21TaG9ydENsYWltSWQgPSBmdW5jdGlvbiAobmFtZSwgc2hvcnRJZCkge1xuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICB0aGlzXG4gICAgICAgIC5maW5kQWxsKHtcbiAgICAgICAgICB3aGVyZToge1xuICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgIGNsYWltSWQ6IHtcbiAgICAgICAgICAgICAgJGxpa2U6IGAke3Nob3J0SWR9JWAsXG4gICAgICAgICAgICB9fSxcbiAgICAgICAgICBvcmRlcjogW1snaGVpZ2h0JywgJ0FTQyddXSxcbiAgICAgICAgfSlcbiAgICAgICAgLnRoZW4ocmVzdWx0ID0+IHtcbiAgICAgICAgICBzd2l0Y2ggKHJlc3VsdC5sZW5ndGgpIHtcbiAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUobnVsbCk7XG4gICAgICAgICAgICBkZWZhdWx0OiAvLyBub3RlIHJlc3VsdHMgbXVzdCBiZSBzb3J0ZWRcbiAgICAgICAgICAgICAgcmV0dX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uXG4gIHJldHVybiBDbGFpbTtcbn07XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9zZXJ2ZXIvbW9kZWxzL2NsYWltLmpzIiwibW9kdWxlLmV4cG9ydHMgPSAoc2VxdWVsaXplLCB7IFNUUklORywgQk9PTEVBTiwgSU5URUdFUiB9KSA9PiB7XG4gIGNvbnN0IEZpbGUgPSBzZXF1ZWxpemUuZGVmaW5lKFxuICAgICdGaWxlJyxcbiAgICB7XG4gICAgICBuYW1lOiB7XG4gICAgICAgIHR5cGUgICAgIDogU1RSSU5HLFxuICAgICAgICBhbGxvd051bGw6IGZhbHNlLFxuICAgICAgfSxcbiAgICAgIGNsYWltSWQ6IHtcbiAgICAgICAgdHlwZSAgICAgOiBTVFJJTkcsXG4gICAgICAgIGFsbG93TnVsbDogZmFsc2UsXG4gICAgICB9LFxuICAgICAgYWRkcmVzczoge1xuICAgICAgICB0eXBlICAgICA6IFNUUklORyxcbiAgICAgICAgYWxsb3dOdWxsOiBmYWxzZSxcbiAgICAgIH0sXG4gICAgICBvdXRwb2ludDoge1xuICAgICAgICB0eXBlICAgICA6IFNUUklORyxcbiAgICAgICAgYWxsb3dOdWxsOiBmYWxzZSxcbiAgICAgIH0sXG4gICAgICBoZWlnaHQ6IHtcbiAgICAgICAgdHlwZSAgICAgOiBJTlRFR0VSLFxuICAgICAgICBhbGxvd051bGw6IGZhbHNlLFxuICAgICAgICBkZWZhdWx0ICA6IDAsXG4gICAgICB9LFxuICAgICAgZmlsZU5hbWU6IHtcbiAgICAgICAgdHlwZSAgICAgOiBTVFJJTkcsXG4gICAgICAgIGFsbG93TnVsbDogZmFsc2UsXG4gICAgICB9LFxuICAgICAgZmlsZVBhdGg6IHtcbiAgICAgICAgdHlwZSAgICAgOiBTVFJJTkcsXG4gICAgICAgIGFsbG93TnVsbDogZmFsc2UsXG4gICAgICB9LFxuICAgICAgZmlsZVR5cGU6IHtcbiAgICAgICAgdHlwZTogU1RSSU5HLFx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mFtZSAgIDogcmVxLnVzZXIuY2hhbm5lbE5hbWUsXG4gICAgICBjaGFubmVsQ2xhaW1JZDogcmVxLnVzZXIuY2hhbm5lbENsYWltSWQsXG4gICAgICBzaG9ydENoYW5uZWxJZDogcmVxLnVzZXIuc2hvcnRDaGFubmVsSWQsXG4gICAgfSk7XG4gIH0pO1xuICAvLyByb3V0ZSBmb3IgbG9nIGluXG4gIGFwcC5wb3N0KCcvbG9naW4nLCAocmVxLCByZXMsIG5leHQpID0+IHtcbiAgICBwYXNzcG9ydC5hdXRoZW50aWNhdGUoJ2xvY2FsLWxvZ2luJywgKGVyciwgdXNlciwgaW5mbykgPT4ge1xuICAgICAgaWYgKGVycikge1xuICAgICAgICByZXR1cm4gbmV4dChlcnIpO1xuICAgICAgfVxuICAgICAgaWYgKCF1c2VyKSB7XG4gICAgICAgIHJldHVybiByZXMuc3RhdHVzKDQwMCkuanNvbih7XG4gICAgICAgICAgc3VjY2VzczogZmFsc2UsXG4gICAgICAgICAgbWVzc2FnZTogaW5mby5tZXNzYWdlLFxuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGxvZ2dlci5kZWJ1Zygnc3VjY2Vzc2Z1bCBsb2dpbicpO1xuICAgICAgcmVxLmxvZ0luKHVzZXIsIChlcnIpID0+IHtcbiAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgIHJldHVybiBuZXh0KGVycik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlcy5zdGF0dXMoMjAwKS5qc29uKHtcbiAgICAgICAgICBzdWNjZXNzICAgICAgIDogdHJ1ZSxcbiAgICAgICAgICBjaGFubmVsTmFtZSAgIDogcmVxLnVzZXIuY2hhbm5lbE5hbWUsXG4gICAgICAgICAgY2hhbm5lbENsYWltSWQ6IHJlcS51c2VyLmNoYW5uZWxDbGFpbUlkLFxuICAgICAgICAgIHNob3J0Q2hhbm5lbElkOiByZXEudXNlci5zaG9ydENoYW5uZWxJZCxcbiAgICAgICAgfSk7XG4g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gICAgICAgICAgICBuYW1lICAgICAgIDogcHVibGlzaFBhcmFtcy5uYW1lLFxuICAgICAgICAgICAgY2xhaW1JZCAgICA6IHB1Ymxpc2hSZXN1bHRzLmNsYWltX2lkLFxuICAgICAgICAgICAgdGl0bGUgICAgICA6IHB1Ymxpc2hQYXJhbXMubWV0YWRhdGEudGl0bGUsXG4gICAgICAgICAgICBkZXNjcmlwdGlvbjogcHVibGlzaFBhcmFtcy5tZXRhZGF0YS5kZXNjcmlwdGlvbixcbiAgICAgICAgICAgIGFkZHJlc3MgICAgOiBwdWJsaXNoUGFyYW1zLmNsYWltX2FkZHJlc3MsXG4gICAgICAgICAgICB0aHVtYm5haWwgIDogcHVibGlzaFBhcmFtcy5tZXRhZGF0YS50aHVtYm5haWwsXG4gICAgICAgICAgICBvdXRwb2ludCAgIDogYCR7cHVibGlzaFJlc3VsdHMudHhpZH06JHtwdWJsaXNoUmVzdWx0cy5ub3V0fWAsXG4gICAgICAgICAgICBoZWlnaHQgICAgIDogMCxcbiAgICAgICAgICAgIGNvbnRlbnRUeXBlOiBmaWxlVHlwZSxcbiAgICAgICAgICAgIG5zZncgICAgICAgOiBwdWJsaXNoUGFyYW1zLm1ldGFkYXRhLm5zZncsXG4gICAgICAgICAgICBhbW91bnQgICAgIDogcHVibGlzaFBhcmFtcy5iaWQsXG4gICAgICAgICAgICBjZXJ0aWZpY2F0ZUlkLFxuICAgICAgICAgICAgY2hhbm5lbE5hbWUsXG4gICAgICAgICAgfTtcbiAgICAgICAgICAvLyB1cHNlcnQgY3JpdGVyaWFcbiAgICAgICAgICBjb25zdCB1cHNlcnRDcml0ZXJpYSA9IHtcbiAgICAgICAgICAgIG5hbWUgICA6IHB1Ymxpc2hQYXJhbXMubmFtZSxcbiAgICAgICAgICAgIGNsYWltSWQ6IHB1Ymxpc2hSZXN1bHRzLmNsYWltX2lkLFxuICAgICAgICAgIH07XG4gICAgICAgICAgLy8gdXBzZXJ0IHRoZSByZWNvcmRzXG4gICAgICAgIC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iAgICAvLyBzdG9yZSByZXF1ZXN0c1xuICAgIGNhc2UgYWN0aW9ucy5SRVFVRVNUX0xJU1RfQUREOlxuICAgICAgcmV0dXJuIE9iamVjdC5hc3NpZ24oe30sIHN0YXRlLCB7XG4gICAgICAgIHJlcXVlc3RMaXN0OiBPYmplY3QuYXNzaWduKHt9LCBzdGF0ZS5yZXF1ZXN0TGlzdCwge1xuICAgICAgICAgIFthY3Rpb24uZGF0YS5pZF06IHtcbiAgICAgICAgICAgIGVycm9yOiBhY3Rpb24uZGF0YS5lcnJvcixcbiAgICAgICAgICAgIGtleSAgOiBhY3Rpb24uZGF0YS5rZXksXG4gICAgICAgICAgfSxcbiAgICAgICAgfSksXG4gICAgICB9KTtcbiAgICAvLyBhc3NldCBkYXRhXG4gICAgY2FzZSBhY3Rpb25zLkFTU0VUX0FERDpcbiAgICAgIHJldHVybiBPYmplY3QuYXNzaWduKHt9LCBzdGF0ZSwge1xuICAgICAgICBhc3NldExpc3Q6IE9iamVjdC5hc3NpZ24oe30sIHN0YXRlLmFzc2V0TGlzdCwge1xuICAgICAgICAgIFthY3Rpb24uZGF0YS5pZF06IHtcbiAgICAgICAgICAgIGVycm9yICAgIDogYWN0aW9uLmRhdGEuZXJyb3IsXG4gICAgICAgICAgICBuYW1lICAgICA6IGFjdGlvbi5kYXRhLm5hbWUsXG4gICAgICAgICAgICBjbGFpbUlkICA6IGFjdGlvbi5kYXRhLmNsYWltSWQsXG4gICAgICAgICAgICBzaG9ydElkICA6IGFjdGlvbi5kYXRhLnNob3J0SWQsXG4gICAgICAgICAgICBjbGFpbURhdGE6IGFjdGlvbi5kYXRhLmNsYWltRGF0YSxcbiAgICAgICAgICB9LFxuICAgICAgICB9KSxcbiAgICAgIH0pO1xuICAgIC8vIGNoYW5uZWwgZGF0YVxuICAgIGNhc2UgYWN0aW9ucy5DSEFOTkVMX0FERDpcbiAgICAgIHJldHVybiBPYmplY3QuYXNzaWduKHt9LCBzdGF0ZSwge1xuICAgICAgICBj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vWWpZYndoUycgdGFyZ2V0PSdfYmxhbmsnPkxCUlkgZGlzY29yZDwvYT4uPC9wPlxuICAgICAgICAgIDxpPjxwIGlkPSdlcnJvci1tZXNzYWdlJz57ZXJyb3J9PC9wPjwvaT5cbiAgICAgICAgPC9kaXY+XG4gICAgICAgIH1cbiAgICAgICAgeyhzdGF0dXMgPT09IEFWQUlMQUJMRSkgJiZcbiAgICAgICAgKCgpID0+IHtcbiAgICAgICAgICBzd2l0Y2ggKGNvbnRlbnRUeXBlKSB7XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9qcGVnJzpcbiAgICAgICAgICAgIGNhc2UgJ2ltYWdlL2pwZyc6XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9wbmcnOlxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxpbWdcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT0nYXNzZXQnXG4gICAgICAgICAgICAgICAgICBzcmM9e2AvJHtjbGFpbUlkfS8ke25hbWV9LiR7ZmlsZUV4dH1gfVxuICAgICAgICAgICAgICAgICAgYWx0PXtuYW1lfSAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvZ2lmJzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8aW1nXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWU9J2Fzc2V0J1xuICAgICAgICAgICAgICAgICAgc3JjPXtgLyR7Y2xhaW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH1cbiAgICAgICAgICAgICAgICAgIGFsdD17bmFtZX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgY2FzZSAndmlkZW8vbXA0JzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8dmlkZW8gY2xhc3NOYW1lPSdhc3NldCB2aWRlbycgY29udHJvbHMgcG9zdGVyP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7XG4gICAgICByZXR1cm4gKFxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIDxTRU8gcGFnZVRpdGxlPXtgJHtuYW1lfSAtIGRldGFpbHNgfSBhc3NldD17YXNzZXR9IC8+XG4gICAgICAgICAgPE5hdkJhciAvPlxuICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdyb3cgcm93LS10YWxsIHJvdy0tcGFkZGVkJz5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0xMCc+XG4gICAgICAgICAgICAgIDxBc3NldFRpdGxlIC8+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS01IGNvbHVtbi0tc21sLTEwIGFsaWduLWNvbnRlbnQtdG9wJz5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9J3JvdyByb3ctLXBhZGRlZCBzaG93LWRldGFpbHMtY29udGFpbmVyJz5cbiAgICAgICAgICAgICAgICA8QXNzZXREaXNwbGF5IC8+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+PGRpdiBjbGFzc05hbWU9J2NvbHVtbiBjb2x1bW4tLTUgY29sdW1uLS1zbWwtMTAgYWxpZ24tY29udGVudC10b3AnPlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT0ncm93IHJvdy0tcGFkZGVkJz5cbiAgICAgICAgICAgICAgICA8QXNzZXRJbmZvIC8+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuICAgICAgKTtcbiAgICB9O1xuICAgIHJldHVybiAoXG4gICAgICA8RXJyb3JQYWdlIGVycm9yPXsnbG9hZGluZyBhc3NldCBkYXRhLi4uJ30gLz5cbiAgICApO1xuICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBTaG93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dXQtZXJyb3ItY29weS1zaG9ydC1saW5rJyBoaWRkZW49J3RydWUnPmVycm9yIGhlcmU8L2Rpdj5cbiAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSd0ZXh0JyBpZD0nc2hvcnQtbGluaycgY2xhc3NOYW1lPSdpbnB1dC1kaXNhYmxlZCBpbnB1dC10ZXh0LS1mdWxsLXdpZHRoJyByZWFkT25seVxuICAgICAgICAgICAgICAgICAgICBzcGVsbENoZWNrPSdmYWxzZSdcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU9e2Ake2hvc3R9LyR7c2hvcnRJZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH1cbiAgICAgICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5zZWxlY3R9IC8+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9J2NvbHVtbiBjb2x1bW4tLTEnIC8+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9J2NvbHVtbiBjb2x1bW4tLTInPlxuICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzc05hbWU9J2J1dHRvbi0tcHJpbWFyeSBidXR0b24tLXdpZGUnIGRhdGEtZWxlbWVudHRvY29weT0nc2hvcnQtbGluaydcbiAgICAgICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5jb3B5VG9DbGlwYm9hcmR9PmNvcHlcbiAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgPGRpdiBpZD0nc2hvdy1lbWJlZC1jb2RlJz5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0yIGNvbHVtbi0tbWVkLTEwJz5cbiAgICAgICAgICAgICAgPHNwYW4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Z1bGwtd2lkdGgnIHJlYWRPbmx5XG4gICAgICAgICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5zZWxlY3R9IHNwZWxsQ2hlY2s9J2ZhbHNlJ1xuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPXtgPGltZyBzcmM9XCIke2hvc3R9LyR7Y2xhaW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9XCIvPmB9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0xJyAvPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0yJz5cbiAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3NOYW1lPSdidXR0b24tLXByaW1hcnkgYnV0dG9uLS13aWRlJyBkYXRhLWVsZW1lbnR0b2NvcHk9J2VtYmVkLXRleHQnXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9e3RoaXMuY29weVRvQ2xpcGJvYXJkfT5jb3B5XG4gICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgPGRpdiBjbGFzc05hbWU9J2ZsZXgtY29udGFpbmVyLS1yb3cgZmxleC1jb250YWluZXItLXNwYWNlLWJldHdlZW4tYm90dG9tJz5cbiAgICAgICAgICA8TGluayBjbGFzc05hbWU9J2xpbmstLXByaW1hcnknIHRvPXtgLyR7c2hvcnRJZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH0+PHNwYW5cbiAgICAgICAgICAgIGNsYXNzTmFtZT0ndGV4dCc+RGlyZWN0IExpbms8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3ZpZGVvL21wNCc6XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGltZ1xuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPXsnYXNzZXQtcHJldmlldyB2aWRlbyd9XG4gICAgICAgICAgICAgICAgICBzcmM9e3RodW1ibmFpbCB8fCBkZWZhdWx0VGh1bWJuYWlsfVxuICAgICAgICAgICAgICAgICAgYWx0PXtuYW1lfVxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxwPnVuc3VwcG9ydGVkIGZpbGUgdHlwZTwvcD5cbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pKCl9XG4gICAgICA8L0xpbms+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBBc3NldFByZXZpZXc7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9jbGllbnQvY29tcG9uZW50cy9Bc3NldFByZXZpZXcvdmlldy5qc3giLCJpbXBvcnQgeyBjb25uZWN0IH0gZnJvbSAncmVhY3QtcmVkdXgnO1xuaW1wb3J0IFZpZXcgZnJvbSAnLi92aWV3JztcblxuY29uc3QgbWFwU3RhdGVUb1Byb3BzID0gKHsgc2l0ZTogeyBob3N0LCB0aXRsZSB9IH0pID0+IHtcbiAgcmV0dXJuIHtcbiAgICBob3N0LFxuICAgIHRpdGxlLFxuICB9O1xufTtcblxuZXhwb3J0IGRlZmF1bHQgY29ubmVjdChtYXBTdGF0ZVRvUHJvcHMsIG51bGwpKFZpZXcpO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vY2xpZW50L2NvbnRhaW5lcnMvRm91ck9oRm91clBhZ2UvaW5kZXguanN4IiwiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN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gICAgIH0sXG4gICAgICBjbGFpbVNlcXVlbmNlOiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgZGVjb2RlZENsYWltOiB7XG4gICAgICAgIHR5cGUgICA6IEJPT0xFQU4sXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgZGVwdGg6IHtcbiAgICAgICAgdHlwZSAgIDogSU5URUdFUixcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBlZmZlY3RpdmVBbW91bnQ6IHtcbiAgICAgICAgdHlwZSAgIDogREVDSU1BTCgxOSwgOCksXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgaGFzU2lnbmF0dXJlOiB7XG4gICAgICAgIHR5cGUgICA6IEJPT0xFQU4sXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgaGVpZ2h0OiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgaGV4OiB7XG4gICAgICAgIHR5cGUgICA6IFRFWFQoJ2xvbmcnKSxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBuYW1lOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBub3V0OiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgdHhpZDoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgdmFsaWRBdEhlaWdodDoge1xuICAgICAgICB0e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lOiBjaGFubmVsTmFtZSB9LFxuICAgICAgICAgIG9yZGVyOiBbWydlZmZlY3RpdmVBbW91bnQnLCAnREVTQyddLCBbJ2hlaWdodCcsICdBU0MnXV0sXG4gICAgICAgIH0pXG4gICAgICAgIC50aGVuKHJlc3VsdCA9PiB7XG4gICAgICAgICAgc3dpdGNoIChyZXN1bHQubGVuZ3RoKSB7XG4gICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKG51bGwpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUocmVzdWx0WzBdLmNsYWltSWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgICAgLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbiAgfTtcblxuICBDZXJ0aWZpY2F0ZS52YWxpZGF0ZUxvbmdDaGFubmVsSWQgPSBmdW5jdGlvbiAobmFtZSwgY2xhaW1JZCkge1xuICAgIGxvZ2dlci5kZWJ1ZyhgdmFsaWRhdGVMb25nQ2hhbm5lbElkKCR7bmFtZX0sICR7Y2xhaW1JZH0pYCk7XG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgIHRoaXMuZmluZE9uZSh7XG4gICAgICAgIHdoZXJlOiB7bmFtZSwgY2xhaW1JZH0sXG4gICAgICB9KVxuICAgICAgICAudGhlbihyZXN1bHQgPT4ge1xuICAgICAgICAgIGlmICghcmVzdWx0KSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzb2x2ZShudWxsKTtcbiAgICAgICAgICB9O1xuICAgICAgICAgIHJlc29sdmUoY2xhaW1JZCk7XG4gICAgICAgIH0pXG4gICAgICAgIC5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgfSk7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0xFQU4sIElOVEVHRVIsIFRFWFQsIERFQ0lNQUwgfSkgPT4ge1xuICBjb25zdCBDbGFpbSA9IHNlcXVlbGl6ZS5kZWZpbmUoXG4gICAgJ0NsYWltJyxcbiAgICB7XG4gICAgICBhZGRyZXNzOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBhbW91bnQ6IHtcbiAgICAgICAgdHlwZSAgIDogREVDSU1BTCgxOSwgOCksXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgY2xhaW1JZDoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgY2xhaW1TZXF1ZW5jZToge1xuICAgICAgICB0eXBlICAgOiBJTlRFR0VSLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGRlY29kZWRDbGFpbToge1xuICAgICAgICB0eXBlICAgOiBCT09MRUFOLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGRlcHRoOiB7XG4gICAgICAgIHR5cGUgICA6IElOVEVHRVIsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgZWZmZWN0aXZlQW1vdW50OiB7XG4gICAgICAgIHR5cGUgICA6IERFQ0lNQUwoMTksIDgpLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGhhc1NpZ25hdHVyZToge1xuICAgICAgICB0eXBlICAgOiBCT09MRUFOLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGhlaWdodDoge1xuICAgICAgICB0eXBlICAgOiBJTlRFR0VSLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGhleDoge1xuICAgICAgICB0eXBlICAgOiBURVhUKCdsb25nJyksXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgbmFtZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgbm91dDoge1xuICAgICAgICB0eXBlICAgOiBJTlRFR0VSLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIHR4aWQ6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIHZhbGlkQXRIZWlnaHQ6IHtcbiAgICAgICAgdHlwZSAgIDogSU5URUdFUixcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBvdXRwb2ludDoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgY2xhaW1UeXBlOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBjZXJ0aWZpY2F0ZUlkOiB7XG4gICAgICAgIHR5cGUgICA6IFNUUklORyxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBhdXRob3I6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIGRlc2NyaXB0aW9uOiB7XG4gICAgICAgIHR5cGUgICA6IFRFWFQoJ2xvbmcnKSxcbiAgICAgICAgZGVmYXVsdDogbnVsbCxcbiAgICAgIH0sXG4gICAgICBsYW5ndWFnZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgbGljZW5zZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgbGljZW5zZVVybDoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgbnNmdzoge1xuICAgICAgICB0eXBlICAgOiBCT09MRUFOLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIHByZXZpZXc6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIHRodW1ibmFpbDoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgdGl0bGU6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIG1ldGFkYXRhVmVyc2lvbjoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgY29udGVudFR5cGU6IHtcbiAgICAgICAgdHlwZSAgIDogU1RSSU5HLFxuICAgICAgICBkZWZhdWx0OiBudWxsLFxuICAgICAgfSxcbiAgICAgIHNvdXJjZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgc291cmNlVHlwZToge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51bGwsXG4gICAgICB9LFxuICAgICAgc291cmNlVmVyc2lvbjoge1xuICAgICAgICB0eXBlICAgOiBTVFJJTkcsXG4gICAgICAgIGRlZmF1bHQ6IG51b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biAgICAgICAgICBzd2l0Y2ggKGNoYW5uZWxDbGFpbXNBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUobnVsbCk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICBjaGFubmVsQ2xhaW1zQXJyYXkuZm9yRWFjaChjbGFpbSA9PiB7XG4gICAgICAgICAgICAgICAgY2xhaW1bJ2ZpbGVFeHQnXSA9IGRldGVybWluZUZpbGVFeHRlbnNpb25Gcm9tQ29udGVudFR5cGUoY2xhaW0uY29udGVudFR5cGUpO1xuICAgICAgICAgICAgICAgIGNsYWltWyd0aHVtYm5haWwnXSA9IGRldGVybWluZVRodW1ibmFpbChjbGFpbS50aHVtYm5haWwsIGRlZmF1bHRUaHVtYm5haWwpO1xuICAgICAgICAgICAgICAgIHJldHVybiBjbGFpbTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKGNoYW5uZWxDbGFpbXNBcnJheSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgICAuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgIH0pO1xuICAgIH0pO1xuICB9O1xuXG4gIENsYWltLmdldENsYWltSWRCeUxvbmdDaGFubmVsSWQgPSBmdW5jdGlvbiAoY2hhbm5lbENsYWltSWQsIGNsYWltTmFtZSkge1xuICAgIGxvZ2dlci5kZWJ1ZyhgZmluZGluZyBjbGFpbSBpZCBmb3IgY2xhaW0gJHtjbGFpbU5hbWV9IGZyb20gY2hhbm5lbCAke2NoYW5uZWxDbGFpbUlkfWApO1xuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICB0aGlzXG4gICAgICAgIC5maW5kQWxsKHtcbiAgICAgICAgICB3aGVyZTogeyBuYW1lOiBj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m9yKGBtb3JlIHRoYW4gb25lIHJlY29yZCBtYXRjaGVzICR7bmFtZX0jJHtjbGFpbUlkfSBpbiBkYi5DbGFpbWApO1xuICAgICAgICAgICAgICByZXR1cm4gcmVzb2x2ZShwcmVwYXJlQ2xhaW1EYXRhKGNsYWltQXJyYXlbMF0uZGF0YVZhbHVlcykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgICAgLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbiAgfTtcblxuICByZXR1cm4gQ2xhaW07XG59O1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vc2VydmVyL21vZGVscy9jbGFpbS5qcyIsIm1vZHVsZS5leHBvcnRzID0gKHNlcXVlbGl6ZSwgeyBTVFJJTkcsIEJPT0xFQU4sIElOVEVHRVIgfSkgPT4ge1xuICBjb25zdCBGaWxlID0gc2VxdWVsaXplLmRlZmluZShcbiAgICAnRmlsZScsXG4gICAge1xuICAgICAgbmFtZToge1xuICAgICAgICB0eXBlICAgICA6IFNUUklORyxcbiAgICAgICAgYWxsb3dOdWxsOiBmYWxzZSxcbiAgICAgIH0sXG4gICAgICBjbGFpbUlkOiB7XG4gICAgICAgIHR5cGUgICAgIDogU1RSSU5HLFxuICAgICAgICBhbGxvd051bGw6IGZhbHNlLFxuICAgICAgfSxcbiAgICAgIGFkZHJlc3M6IHtcbiAgICAgICAgdHlwZSAgICAgOiBTVFJJTkcsXG4gICAgICAgIGFsbG93TnVsbDogZmFsc2UsXG4gICAgICB9LFxuICAgICAgb3V0cG9pbnQ6IHtcbiAgICAgICAgdHlwZSAgICAgOiBTVFJJTkcsXG4gICAgICAgIGFsbG93TnVsbDogZmFsc2UsXG4gICAgICB9LFxuICAgICAgaGVpZ2h0OiB7XG4gICAgICAgIHR5cGUgICAgIDogSU5URUdFUixcbiAgICAgICAgYWxsb3dOdWxsOiBmYWxz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A9PiB7XG4gICAgICAgIGlmIChzYWx0RXJyb3IpIHtcbiAgICAgICAgICBsb2dnZXIuZXJyb3IoJ3NhbHQgZXJyb3InLCBzYWx0RXJyb3IpO1xuICAgICAgICAgIHJlamVjdChzYWx0RXJyb3IpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICAvLyBnZW5lcmF0ZSBhIGhhc2hlZCB2ZXJzaW9uIG9mIHRoZSB1c2VyJ3MgcGFzc3dvcmRcbiAgICAgICAgYmNyeXB0Lmhhc2gobmV3UGFzc3dvcmQsIHNhbHQsIChoYXNoRXJyb3IsIGhhc2gpID0+IHtcbiAgICAgICAgICAvLyBpZiB0aGVyZSBpcyBhbiBlcnJvciB3aXRoIHRoZSBoYXNoIGdlbmVyYXRpb24gcmV0dXJuIHRoZSBlcnJvclxuICAgICAgICAgIGlmIChoYXNoRXJyb3IpIHtcbiAgICAgICAgICAgIGxvZ2dlci5lcnJvcignaGFzaCBlcnJvcicsIGhhc2hFcnJvcik7XG4gICAgICAgICAgICByZWplY3QoaGFzaEVycm9yKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gcmVwbGFjZSB0aGUgY3VycmVudCBwYXNzd29yZCB3aXRoIHRoZSBuZXcgaGFzaFxuICAgICAgICAgIHRoaXNcbiAgICAgICAgICAgIC51cGRhdGUoe3Bhc3N3b3JkOiBoYXNofSlcbiAgICAgICAgICAgIC50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfTtcblxuICAvLyBwcmUtc2F2ZSBob29rIG1ldGhvZCB0byBoYXNoIHRoZSB1c2VyJ3MgcGFzc3dvc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VyLmNvbXBhcmVQYXNzd29yZChwYXNzd29yZClcbiAgICAgICAgICAudGhlbihpc01hdGNoID0+IHtcbiAgICAgICAgICAgIGlmICghaXNNYXRjaCkge1xuICAgICAgICAgICAgICBsb2dnZXIuZGVidWcoJ2luY29ycmVjdCBwYXNzd29yZCcpO1xuICAgICAgICAgICAgICByZXR1cm4gZG9uZShudWxsLCBmYWxzZSwge21lc3NhZ2U6ICdJbmNvcnJlY3QgdXNlcm5hbWUgb3IgcGFzc3dvcmQnfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsb2dnZXIuZGVidWcoJ1Bhc3N3b3JkIHdhcyBhIG1hdGNoLCByZXR1cm5pbmcgVXNlcicpO1xuICAgICAgICAgICAgcmV0dXJuIHJldHVyblVzZXJBbmRDaGFubmVsSW5mbyh1c2VyKVxuICAgICAgICAgICAgICAudGhlbih1c2VySW5mbyA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGRvbmUobnVsbCwgdXNlckluZm8pO1xuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBlcnJvcjtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSlcbiAgICAgICAgICAuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIGVycm9yO1xuICAgICAgICAgIH0pO1xuICAgICAgfSlcbiAgICAgIC5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgIHJldHVybiBkb25lKGVycm9yKTtcbiAgICAgIH0pO1xuICB9LFxuKTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL3NlcnZlci9wYXNzcG9ydC9sb2NhbC1sb2dpbi5qcyIsImNvbnN0IGxvZ2dlciA9IHJlcXVpcmUoJ3dpbnN0b24nKTtcbmNvbnN0IHBhc3Nwb3J0ID0gcmVxdWlyZSgncGFzc3BvcnQnKTtcblxubW9k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ICAgIG91dHBvaW50ICAgOiBgJHtwdWJsaXNoUmVzdWx0cy50eGlkfToke3B1Ymxpc2hSZXN1bHRzLm5vdXR9YCxcbiAgICAgICAgICAgIGhlaWdodCAgICAgOiAwLFxuICAgICAgICAgICAgZmlsZU5hbWUsXG4gICAgICAgICAgICBmaWxlUGF0aCAgIDogcHVibGlzaFBhcmFtcy5maWxlX3BhdGgsXG4gICAgICAgICAgICBmaWxlVHlwZSxcbiAgICAgICAgICAgIG5zZncgICAgICAgOiBwdWJsaXNoUGFyYW1zLm1ldGFkYXRhLm5zZncsXG4gICAgICAgICAgfTtcbiAgICAgICAgICAvLyBjcmVhdGUgdGhlIENsYWltIHJlY29yZFxuICAgICAgICAgIGNvbnN0IGNsYWltUmVjb3JkID0ge1xuICAgICAgICAgICAgbmFtZSAgICAgICA6IHB1Ymxpc2hQYXJhbXMubmFtZSxcbiAgICAgICAgICAgIGNsYWltSWQgICAgOiBwdWJsaXNoUmVzdWx0cy5jbGFpbV9pZCxcbiAgICAgICAgICAgIHRpdGxlICAgICAgOiBwdWJsaXNoUGFyYW1zLm1ldGFkYXRhLnRpdGxlLFxuICAgICAgICAgICAgZGVzY3JpcHRpb246IHB1Ymxpc2hQYXJhbXMubWV0YWRhdGEuZGVzY3JpcHRpb24sXG4gICAgICAgICAgICBhZGRyZXNzICAgIDogcHVibGlzaFBhcmFtcy5jbGFpbV9hZGRyZXNzLFxuICAgICAgICAgICAgdGh1bWJuYWlsICA6IHB1Ymxpc2hQYXJhbXMubWV0YWRhdGEudGh1bWJuYWlsLFxuICAgICAgICAgICAgb3V0cG9pbnQgICA6IGAke3B1Ymxpc2hSZXN1bHRzLnR4aWR9OiR7cHVibGlzaFJlc3VsdHMubm91dH1gLFxuICAgICAgICAgICAgaGVpZ2h0ICAgICA6IDAsXG4gICAgICAgICAgICBjb250ZW50VHlwZTogZmlsZVR5cGUsXG4gICAgICAgICAgICBuc2Z3ICAgICAgIDogcHVibGlzaFBhcmFtcy5tZXRhZGF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Cc+XG4gICAgICAgICAgICA8TmF2TGluayBjbGFzc05hbWU9J25hdi1iYXItbGluayBsaW5rLS1uYXYnIGFjdGl2ZUNsYXNzTmFtZT0nbGluay0tbmF2LWFjdGl2ZScgdG89Jy8nIGV4YWN0PlB1Ymxpc2g8L05hdkxpbms+XG4gICAgICAgICAgICA8TmF2TGluayBjbGFzc05hbWU9J25hdi1iYXItbGluayBsaW5rLS1uYXYnICBhY3RpdmVDbGFzc05hbWU9J2xpbmstLW5hdi1hY3RpdmUnIHRvPScvYWJvdXQnPkFib3V0PC9OYXZMaW5rPlxuICAgICAgICAgICAgeyB0aGlzLnByb3BzLmNoYW5uZWxOYW1lID8gKFxuICAgICAgICAgICAgICA8TmF2QmFyQ2hhbm5lbERyb3Bkb3duXG4gICAgICAgICAgICAgICAgY2hhbm5lbE5hbWU9e3RoaXMucHJvcHMuY2hhbm5lbE5hbWV9XG4gICAgICAgICAgICAgICAgaGFuZGxlU2VsZWN0aW9uPXt0aGlzLmhhbmRsZVNlbGVjdGlvbn1cbiAgICAgICAgICAgICAgICBkZWZhdWx0U2VsZWN0aW9uPXt0aGlzLnByb3BzLmNoYW5uZWxOYW1lfVxuICAgICAgICAgICAgICAgIFZJRVc9e1ZJRVd9XG4gICAgICAgICAgICAgICAgTE9HT1VUPXtMT0dPVVR9XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICApIDogKFxuICAgICAgICAgICAgICA8TmF2TGluayBpZD0nbmF2LWJhci1sb2dpbi1saW5rJyBjbGFzc05hbWU9J25hdi1iYXItbGluayBsaW5rLS1uYXYnIGFjdGl2ZUNsYXNzTmFtZT0nbGluay0tbmF2LWFjdGl2ZScgdG89Jy9sb2dpbic+Q2hhbm5lbDwvTmF2TGluaz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCB3aXRoUm91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zdGF0dXMgPT09IEFWQUlMQUJMRSkgJiZcbiAgICAgICAgKCgpID0+IHtcbiAgICAgICAgICBzd2l0Y2ggKGNvbnRlbnRUeXBlKSB7XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9qcGVnJzpcbiAgICAgICAgICAgIGNhc2UgJ2ltYWdlL2pwZyc6XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9wbmcnOlxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxpbWdcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT0nYXNzZXQnXG4gICAgICAgICAgICAgICAgICBzcmM9e2AvJHtjbGFpbUlkfS8ke25hbWV9LiR7ZmlsZUV4dH1gfVxuICAgICAgICAgICAgICAgICAgYWx0PXtuYW1lfSAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvZ2lmJzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8aW1nXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWU9J2Fzc2V0J1xuICAgICAgICAgICAgICAgICAgc3JjPXtgLyR7Y2xhaW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH1cbiAgICAgICAgICAgICAgICAgIGFsdD17bmFtZX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgY2FzZSAndmlkZW8vbXA0JzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8dmlkZW8gY2xhc3NOYW1lPSdhc3NldCB2aWRlbycgY29udHJvbHMgcG9zdGVyPXt0aHVtYm5haWx9PlxuICAgICAgICAgICAgICAgICAgPHNvdXJjZVxuICAgICAgICAgICAgICAgICAgICBzcmM9e2AvJHtjbGFpbUlkfS8ke25hbWV9LiR7ZmlsZUV4dH1gfVxuICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgIDxwPllvdXI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pbnB1dC10ZXh0LS1mdWxsLXdpZHRoJyByZWFkT25seVxuICAgICAgICAgICAgICAgICAgICBzcGVsbENoZWNrPSdmYWxzZSdcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU9e2Ake2hvc3R9LyR7c2hvcnRJZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH1cbiAgICAgICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5zZWxlY3R9IC8+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9J2NvbHVtbiBjb2x1bW4tLTEnIC8+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9J2NvbHVtbiBjb2x1bW4tLTInPlxuICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzc05hbWU9J2J1dHRvbi0tcHJpbWFyeSBidXR0b24tLXdpZGUnIGRhdGEtZWxlbWVudHRvY29weT0nc2hvcnQtbGluaydcbiAgICAgICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5jb3B5VG9DbGlwYm9hcmR9PmNvcHlcbiAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgPGRpdiBpZD0nc2hvdy1lbWJlZC1jb2RlJz5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0yIGNvbHVtbi0tbWVkLTEwJz5cbiAgICAgICAgICAgICAgPHNwYW4gY2xhc3NOYW1lPSd0ZXh0Jz5FbWJlZDo8L3NwYW4+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS04IGNvbHVtbi0tbWVkLTEwJz5cbiAgICAgICAgICAgICAgPGRpdiBjb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aW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9XCIvPmB9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0xJyAvPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPSdjb2x1bW4gY29sdW1uLS0yJz5cbiAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3NOYW1lPSdidXR0b24tLXByaW1hcnkgYnV0dG9uLS13aWRlJyBkYXRhLWVsZW1lbnR0b2NvcHk9J2VtYmVkLXRleHQnXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9e3RoaXMuY29weVRvQ2xpcGJvYXJkfT5jb3B5XG4gICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgPGRpdiBjbGFzc05hbWU9J2ZsZXgtY29udGFpbmVyLS1yb3cgZmxleC1jb250YWluZXItLXNwYWNlLWJldHdlZW4tYm90dG9tJz5cbiAgICAgICAgICA8TGluayBjbGFzc05hbWU9J2xpbmstLXByaW1hcnknIHRvPXtgLyR7c2hvcnRJZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH0+PHNwYW5cbiAgICAgICAgICAgIGNsYXNzTmFtZT0ndGV4dCc+RGlyZWN0IExpbms8L3NwYW4+PC9MaW5rPlxuICAgICAgICAgIDxhIGNsYXNzTmFtZT0nbGluay0tcHJpbWFyeScgaHJlZj17YCR7aG9zdH0vJHtjbGFpbUlkfS8ke25hbWV9LiR7ZmlsZUV4dH1gfSBkb3dubG9hZD17bmFtZX0+RG93bmxvYWQ8L2E+XG4gICAgICA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Sc7XG5cbmNvbnN0IEFzc2V0UHJldmlldyA9ICh7IGRlZmF1bHRUaHVtYm5haWwsIGNsYWltRGF0YTogeyBuYW1lLCBjbGFpbUlkLCBmaWxlRXh0LCBjb250ZW50VHlwZSwgdGh1bWJuYWlsIH0gfSkgPT4ge1xuICBjb25zdCBkaXJlY3RTb3VyY2VMaW5rID0gYCR7Y2xhaW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YDtcbiAgY29uc3Qgc2hvd1VybExpbmsgPSBgLyR7Y2xhaW1JZH0vJHtuYW1lfWA7XG4gIHJldHVybiAoXG4gICAgPGRpdiBjbGFzc05hbWU9J2Fzc2V0LWhvbGRlcic+XG4gICAgICA8TGluayB0bz17c2hvd1VybExpbmt9ID5cbiAgICAgICAgeygoKSA9PiB7XG4gICAgICAgICAgc3dpdGNoIChjb250ZW50VHlwZSkge1xuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvanBlZyc6XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9qcGcnOlxuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvcG5nJzpcbiAgICAgICAgICAgIGNhc2UgJ2ltYWdlL2dpZic6XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGltZ1xuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPXsnYXNzZXQtcHJldmlldyd9XG4gICAgICAgICAgICAgICAgICBzcmM9e2RpcmVjdFNvdXJjZUxpbmt9XG4gICAgICAgICAgICAgICAgICBhbHQ9e25hbWV9XG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGNhc2UgJ3ZpZGVvL21wNCc6XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGltZ1xuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPXsnYXNzZXQtcHJldmlldyB2aWRlbyd9XG4gICAgICAgICAgICAgICAgICBzcmM9e3RodW1ibmFpbCB8fC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yA9IDAiXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/public/bundle/bundle.js b/public/bundle/bundle.js index def24e64..c0032ee0 100644 --- a/public/bundle/bundle.js +++ b/public/bundle/bundle.js @@ -60,7 +60,7 @@ /******/ __webpack_require__.p = "public/bundle/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 205); +/******/ return __webpack_require__(__webpack_require__.s = 213); /******/ }) /************************************************************************/ /******/ ([ @@ -120,9 +120,9 @@ module.exports = $export; /* WEBPACK VAR INJECTION */(function(process) { if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(410); + module.exports = __webpack_require__(418); } else { - module.exports = __webpack_require__(411); + module.exports = __webpack_require__(419); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) @@ -177,7 +177,7 @@ module.exports = function (it) { /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(72)('wks'); -var uid = __webpack_require__(41); +var uid = __webpack_require__(42); var Symbol = __webpack_require__(3).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; @@ -394,7 +394,7 @@ module.exports = !__webpack_require__(4)(function () { /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(2); -var IE8_DOM_DEFINE = __webpack_require__(136); +var IE8_DOM_DEFINE = __webpack_require__(143); var toPrimitive = __webpack_require__(29); var dP = Object.defineProperty; @@ -449,11 +449,11 @@ if (process.env.NODE_ENV !== 'production') { // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; - module.exports = __webpack_require__(422)(isValidElement, throwOnDirectAccess); + module.exports = __webpack_require__(430)(isValidElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(423)(); + module.exports = __webpack_require__(431)(); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) @@ -475,9 +475,9 @@ module.exports = function (it) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(421); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(177); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(425); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(429); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(184); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(433); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; }); @@ -581,7 +581,7 @@ module.exports = function (it, key) { /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(9); -var createDesc = __webpack_require__(40); +var createDesc = __webpack_require__(41); module.exports = __webpack_require__(8) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { @@ -597,7 +597,7 @@ module.exports = __webpack_require__(8) ? function (object, key, value) { var global = __webpack_require__(3); var hide = __webpack_require__(17); var has = __webpack_require__(16); -var SRC = __webpack_require__(41)('src'); +var SRC = __webpack_require__(42)('src'); var TO_STRING = 'toString'; var $toString = Function[TO_STRING]; var TPL = ('' + $toString).split(TO_STRING); @@ -669,11 +669,11 @@ module.exports = function (it) { /***/ (function(module, exports, __webpack_require__) { var pIE = __webpack_require__(65); -var createDesc = __webpack_require__(40); +var createDesc = __webpack_require__(41); var toIObject = __webpack_require__(20); var toPrimitive = __webpack_require__(29); var has = __webpack_require__(16); -var IE8_DOM_DEFINE = __webpack_require__(136); +var IE8_DOM_DEFINE = __webpack_require__(143); var gOPD = Object.getOwnPropertyDescriptor; exports.f = __webpack_require__(8) ? gOPD : function getOwnPropertyDescriptor(O, P) { @@ -1258,42 +1258,42 @@ module.exports = function (TYPE, $create) { "use strict"; if (__webpack_require__(8)) { - var LIBRARY = __webpack_require__(42); + var LIBRARY = __webpack_require__(43); var global = __webpack_require__(3); var fails = __webpack_require__(4); var $export = __webpack_require__(0); var $typed = __webpack_require__(82); var $buffer = __webpack_require__(118); var ctx = __webpack_require__(25); - var anInstance = __webpack_require__(48); - var propertyDesc = __webpack_require__(40); + var anInstance = __webpack_require__(49); + var propertyDesc = __webpack_require__(41); var hide = __webpack_require__(17); - var redefineAll = __webpack_require__(50); + var redefineAll = __webpack_require__(51); var toInteger = __webpack_require__(31); var toLength = __webpack_require__(10); - var toIndex = __webpack_require__(162); - var toAbsoluteIndex = __webpack_require__(44); + var toIndex = __webpack_require__(169); + var toAbsoluteIndex = __webpack_require__(45); var toPrimitive = __webpack_require__(29); var has = __webpack_require__(16); var classof = __webpack_require__(66); var isObject = __webpack_require__(5); var toObject = __webpack_require__(12); var isArrayIter = __webpack_require__(109); - var create = __webpack_require__(45); + var create = __webpack_require__(46); var getPrototypeOf = __webpack_require__(22); - var gOPN = __webpack_require__(46).f; + var gOPN = __webpack_require__(47).f; var getIterFn = __webpack_require__(111); - var uid = __webpack_require__(41); + var uid = __webpack_require__(42); var wks = __webpack_require__(6); var createArrayMethod = __webpack_require__(33); var createArrayIncludes = __webpack_require__(73); var speciesConstructor = __webpack_require__(80); var ArrayIterators = __webpack_require__(114); - var Iterators = __webpack_require__(56); + var Iterators = __webpack_require__(57); var $iterDetect = __webpack_require__(77); - var setSpecies = __webpack_require__(47); + var setSpecies = __webpack_require__(48); var arrayFill = __webpack_require__(113); - var arrayCopyWithin = __webpack_require__(152); + var arrayCopyWithin = __webpack_require__(159); var $DP = __webpack_require__(9); var $GOPD = __webpack_require__(21); var dP = $DP.f; @@ -1742,10 +1742,10 @@ if (__webpack_require__(8)) { /* 35 */ /***/ (function(module, exports, __webpack_require__) { -var Map = __webpack_require__(157); +var Map = __webpack_require__(164); var $export = __webpack_require__(0); var shared = __webpack_require__(72)('metadata'); -var store = shared.store || (shared.store = new (__webpack_require__(160))()); +var store = shared.store || (shared.store = new (__webpack_require__(167))()); var getOrCreateMetadataMap = function (target, targetKey, create) { var targetMetadata = store.get(target); @@ -1801,31 +1801,31 @@ module.exports = { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__(446); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__(454); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserRouter", function() { return __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__(448); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__(456); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "HashRouter", function() { return __WEBPACK_IMPORTED_MODULE_1__HashRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__(188); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__(195); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return __WEBPACK_IMPORTED_MODULE_2__Link__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__(450); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__(458); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__(453); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__(461); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return __WEBPACK_IMPORTED_MODULE_4__NavLink__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__(456); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__(464); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_5__Prompt__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(458); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(466); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_6__Redirect__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(196); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_7__Route__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Router__ = __webpack_require__(127); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_8__Router__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__(464); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__(472); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_9__StaticRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__(466); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__(474); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_10__Switch__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__(468); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__(476); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_11__matchPath__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__(469); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__(477); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_12__withRouter__["a"]; }); @@ -1858,7 +1858,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* 37 */ /***/ (function(module, exports, __webpack_require__) { -var META = __webpack_require__(41)('meta'); +var META = __webpack_require__(42)('meta'); var isObject = __webpack_require__(5); var has = __webpack_require__(16); var setDesc = __webpack_require__(9).f; @@ -1970,6 +1970,75 @@ module.exports = emptyFunction; /***/ }), /* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +exports.default = request; + +__webpack_require__(493); + +/** + * Parses the JSON returned by a network request + * + * @param {object} response A response from a network request + * + * @return {object} The parsed JSON from the request + */ +function parseJSON(response) { + if (response.status === 204 || response.status === 205) { + return null; + } + return response.json(); +} + +/** + * Parses the status returned by a network request + * + * @param {object} response A response from a network request + * @param {object} response The parsed JSON from the network request + * + * @return {object | undefined} Returns object with status and statusText, or undefined + */ +function checkStatus(response, jsonResponse) { + if (response.status >= 200 && response.status < 300) { + return jsonResponse; + } + var error = new Error(jsonResponse.message); + error.response = response; + throw error; +} + +/** + * Requests a URL, returning a promise + * + * @param {string} url The URL we want to request + * @param {object} [options] The options we want to pass to "fetch" + * + * @return {object} The response data + */ + +function request(url, options) { + return fetch(url, options).then(function (response) { + return Promise.all([response, parseJSON(response)]); + }).then(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + response = _ref2[0], + jsonResponse = _ref2[1]; + + return checkStatus(response, jsonResponse); + }); +} + +/***/ }), +/* 41 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { @@ -1983,7 +2052,7 @@ module.exports = function (bitmap, value) { /***/ }), -/* 41 */ +/* 42 */ /***/ (function(module, exports) { var id = 0; @@ -1994,18 +2063,18 @@ module.exports = function (key) { /***/ }), -/* 42 */ +/* 43 */ /***/ (function(module, exports) { module.exports = false; /***/ }), -/* 43 */ +/* 44 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(138); +var $keys = __webpack_require__(145); var enumBugKeys = __webpack_require__(96); module.exports = Object.keys || function keys(O) { @@ -2014,7 +2083,7 @@ module.exports = Object.keys || function keys(O) { /***/ }), -/* 44 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(31); @@ -2027,12 +2096,12 @@ module.exports = function (index, length) { /***/ }), -/* 45 */ +/* 46 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = __webpack_require__(2); -var dPs = __webpack_require__(139); +var dPs = __webpack_require__(146); var enumBugKeys = __webpack_require__(96); var IE_PROTO = __webpack_require__(95)('IE_PROTO'); var Empty = function () { /* empty */ }; @@ -2074,11 +2143,11 @@ module.exports = Object.create || function create(O, Properties) { /***/ }), -/* 46 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(138); +var $keys = __webpack_require__(145); var hiddenKeys = __webpack_require__(96).concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { @@ -2087,7 +2156,7 @@ exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { /***/ }), -/* 47 */ +/* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2107,7 +2176,7 @@ module.exports = function (KEY) { /***/ }), -/* 48 */ +/* 49 */ /***/ (function(module, exports) { module.exports = function (it, Constructor, name, forbiddenField) { @@ -2118,11 +2187,11 @@ module.exports = function (it, Constructor, name, forbiddenField) { /***/ }), -/* 49 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(25); -var call = __webpack_require__(150); +var call = __webpack_require__(157); var isArrayIter = __webpack_require__(109); var anObject = __webpack_require__(2); var toLength = __webpack_require__(10); @@ -2149,7 +2218,7 @@ exports.RETURN = RETURN; /***/ }), -/* 50 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { var redefine = __webpack_require__(18); @@ -2160,7 +2229,7 @@ module.exports = function (target, src, safe) { /***/ }), -/* 51 */ +/* 52 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2188,7 +2257,7 @@ module.exports = function (target, src, safe) { /* harmony export (immutable) */ __webpack_exports__["w"] = throttle; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return asEffect; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sagaHelpers__ = __webpack_require__(197); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sagaHelpers__ = __webpack_require__(204); @@ -2462,12 +2531,12 @@ var asEffect = { }; /***/ }), -/* 52 */ +/* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_io__ = __webpack_require__(51); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_io__ = __webpack_require__(52); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["s"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takem", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["v"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "put", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["n"]; }); @@ -2492,7 +2561,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /***/ }), -/* 53 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2515,11 +2584,11 @@ exports.fileRequested = fileRequested; exports.updateFileAvailability = updateFileAvailability; exports.updateDisplayAssetError = updateDisplayAssetError; -var _show_action_types = __webpack_require__(59); +var _show_action_types = __webpack_require__(60); var actions = _interopRequireWildcard(_show_action_types); -var _show_request_types = __webpack_require__(198); +var _show_request_types = __webpack_require__(205); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -2640,7 +2709,7 @@ function updateDisplayAssetError(error) { }; /***/ }), -/* 54 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { var def = __webpack_require__(9).f; @@ -2653,7 +2722,7 @@ module.exports = function (it, tag, stat) { /***/ }), -/* 55 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); @@ -2689,14 +2758,14 @@ module.exports = exporter; /***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(5); @@ -2707,7 +2776,7 @@ module.exports = function (it, TYPE) { /***/ }), -/* 58 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2804,7 +2873,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2836,7 +2905,7 @@ var FILE_AVAILABILITY_UPDATE = exports.FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABI var DISPLAY_ASSET_ERROR = exports.DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR'; /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2850,7 +2919,7 @@ var DISPLAY_ASSET_ERROR = exports.DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR'; /* harmony export (immutable) */ __webpack_exports__["f"] = stdChannel; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__buffers__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler__ = __webpack_require__(194); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler__ = __webpack_require__(201); var _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; }; @@ -3053,75 +3122,6 @@ function stdChannel(subscribe) { } /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -exports.default = request; - -__webpack_require__(485); - -/** - * Parses the JSON returned by a network request - * - * @param {object} response A response from a network request - * - * @return {object} The parsed JSON from the request - */ -function parseJSON(response) { - if (response.status === 204 || response.status === 205) { - return null; - } - return response.json(); -} - -/** - * Parses the status returned by a network request - * - * @param {object} response A response from a network request - * @param {object} response The parsed JSON from the network request - * - * @return {object | undefined} Returns object with status and statusText, or undefined - */ -function checkStatus(response, jsonResponse) { - if (response.status >= 200 && response.status < 300) { - return jsonResponse; - } - var error = new Error(jsonResponse.message); - error.response = response; - throw error; -} - -/** - * Requests a URL, returning a promise - * - * @param {string} url The URL we want to request - * @param {object} [options] The options we want to pass to "fetch" - * - * @return {object} The response data - */ - -function request(url, options) { - return fetch(url, options).then(function (response) { - return Promise.all([response, parseJSON(response)]); - }).then(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - response = _ref2[0], - jsonResponse = _ref2[1]; - - return checkStatus(response, jsonResponse); - }); -} - /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { @@ -3135,11 +3135,11 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _channel = __webpack_require__(134); +var _channel = __webpack_require__(141); var _publish = __webpack_require__(92); -var _view = __webpack_require__(503); +var _view = __webpack_require__(507); var _view2 = _interopRequireDefault(_view); @@ -3477,7 +3477,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(506); +var _view = __webpack_require__(510); var _view2 = _interopRequireDefault(_view); @@ -3524,7 +3524,7 @@ module.exports = function (key) { // true -> Array#includes var toIObject = __webpack_require__(20); var toLength = __webpack_require__(10); -var toAbsoluteIndex = __webpack_require__(44); +var toAbsoluteIndex = __webpack_require__(45); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); @@ -3684,14 +3684,14 @@ module.exports = function (O, D) { var global = __webpack_require__(3); var $export = __webpack_require__(0); var redefine = __webpack_require__(18); -var redefineAll = __webpack_require__(50); +var redefineAll = __webpack_require__(51); var meta = __webpack_require__(37); -var forOf = __webpack_require__(49); -var anInstance = __webpack_require__(48); +var forOf = __webpack_require__(50); +var anInstance = __webpack_require__(49); var isObject = __webpack_require__(5); var fails = __webpack_require__(4); var $iterDetect = __webpack_require__(77); -var setToStringTag = __webpack_require__(54); +var setToStringTag = __webpack_require__(55); var inheritIfRequired = __webpack_require__(100); module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { @@ -3773,7 +3773,7 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { var global = __webpack_require__(3); var hide = __webpack_require__(17); -var uid = __webpack_require__(41); +var uid = __webpack_require__(42); var TYPED = uid('typed_array'); var VIEW = uid('view'); var ABV = !!(global.ArrayBuffer && global.DataView); @@ -3808,7 +3808,7 @@ module.exports = { "use strict"; // Forced replacement prototype accessors methods -module.exports = __webpack_require__(42) || !__webpack_require__(4)(function () { +module.exports = __webpack_require__(43) || !__webpack_require__(4)(function () { var K = Math.random(); // In FF throws only define methods // eslint-disable-next-line no-undef, no-useless-call @@ -3846,7 +3846,7 @@ module.exports = function (COLLECTION) { var $export = __webpack_require__(0); var aFunction = __webpack_require__(15); var ctx = __webpack_require__(25); -var forOf = __webpack_require__(49); +var forOf = __webpack_require__(50); module.exports = function (COLLECTION) { $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { @@ -3971,8 +3971,8 @@ module.exports = warning; "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createLocation; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return locationsAreEqual; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_resolve_pathname__ = __webpack_require__(185); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_value_equal__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_resolve_pathname__ = __webpack_require__(192); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_value_equal__ = __webpack_require__(193); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__PathUtils__ = __webpack_require__(69); var _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; }; @@ -4366,8 +4366,8 @@ module.exports = function (it) { var global = __webpack_require__(3); var core = __webpack_require__(28); -var LIBRARY = __webpack_require__(42); -var wksExt = __webpack_require__(137); +var LIBRARY = __webpack_require__(43); +var wksExt = __webpack_require__(144); var defineProperty = __webpack_require__(9).f; module.exports = function (name) { var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); @@ -4380,7 +4380,7 @@ module.exports = function (name) { /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(72)('keys'); -var uid = __webpack_require__(41); +var uid = __webpack_require__(42); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; @@ -4533,14 +4533,14 @@ module.exports = function (TO_STRING) { "use strict"; -var LIBRARY = __webpack_require__(42); +var LIBRARY = __webpack_require__(43); var $export = __webpack_require__(0); var redefine = __webpack_require__(18); var hide = __webpack_require__(17); var has = __webpack_require__(16); -var Iterators = __webpack_require__(56); +var Iterators = __webpack_require__(57); var $iterCreate = __webpack_require__(106); -var setToStringTag = __webpack_require__(54); +var setToStringTag = __webpack_require__(55); var getPrototypeOf = __webpack_require__(22); var ITERATOR = __webpack_require__(6)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` @@ -4610,9 +4610,9 @@ module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE "use strict"; -var create = __webpack_require__(45); -var descriptor = __webpack_require__(40); -var setToStringTag = __webpack_require__(54); +var create = __webpack_require__(46); +var descriptor = __webpack_require__(41); +var setToStringTag = __webpack_require__(55); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() @@ -4661,7 +4661,7 @@ module.exports = function (KEY) { /***/ (function(module, exports, __webpack_require__) { // check on default Array iterator -var Iterators = __webpack_require__(56); +var Iterators = __webpack_require__(57); var ITERATOR = __webpack_require__(6)('iterator'); var ArrayProto = Array.prototype; @@ -4677,7 +4677,7 @@ module.exports = function (it) { "use strict"; var $defineProperty = __webpack_require__(9); -var createDesc = __webpack_require__(40); +var createDesc = __webpack_require__(41); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); @@ -4691,7 +4691,7 @@ module.exports = function (object, index, value) { var classof = __webpack_require__(66); var ITERATOR = __webpack_require__(6)('iterator'); -var Iterators = __webpack_require__(56); +var Iterators = __webpack_require__(57); module.exports = __webpack_require__(28).getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] @@ -4704,7 +4704,7 @@ module.exports = __webpack_require__(28).getIteratorMethod = function (it) { /***/ (function(module, exports, __webpack_require__) { // 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __webpack_require__(298); +var speciesConstructor = __webpack_require__(306); module.exports = function (original, length) { return new (speciesConstructor(original))(length); @@ -4719,7 +4719,7 @@ module.exports = function (original, length) { // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var toObject = __webpack_require__(12); -var toAbsoluteIndex = __webpack_require__(44); +var toAbsoluteIndex = __webpack_require__(45); var toLength = __webpack_require__(10); module.exports = function fill(value /* , start = 0, end = @length */) { var O = toObject(this); @@ -4740,8 +4740,8 @@ module.exports = function fill(value /* , start = 0, end = @length */) { "use strict"; var addToUnscopables = __webpack_require__(38); -var step = __webpack_require__(153); -var Iterators = __webpack_require__(56); +var step = __webpack_require__(160); +var Iterators = __webpack_require__(57); var toIObject = __webpack_require__(20); // 22.1.3.4 Array.prototype.entries() @@ -4779,7 +4779,7 @@ addToUnscopables('entries'); /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(25); -var invoke = __webpack_require__(143); +var invoke = __webpack_require__(150); var html = __webpack_require__(97); var cel = __webpack_require__(93); var global = __webpack_require__(3); @@ -4971,19 +4971,19 @@ module.exports.f = function (C) { var global = __webpack_require__(3); var DESCRIPTORS = __webpack_require__(8); -var LIBRARY = __webpack_require__(42); +var LIBRARY = __webpack_require__(43); var $typed = __webpack_require__(82); var hide = __webpack_require__(17); -var redefineAll = __webpack_require__(50); +var redefineAll = __webpack_require__(51); var fails = __webpack_require__(4); -var anInstance = __webpack_require__(48); +var anInstance = __webpack_require__(49); var toInteger = __webpack_require__(31); var toLength = __webpack_require__(10); -var toIndex = __webpack_require__(162); -var gOPN = __webpack_require__(46).f; +var toIndex = __webpack_require__(169); +var gOPN = __webpack_require__(47).f; var dP = __webpack_require__(9).f; var arrayFill = __webpack_require__(113); -var setToStringTag = __webpack_require__(54); +var setToStringTag = __webpack_require__(55); var ARRAY_BUFFER = 'ArrayBuffer'; var DATA_VIEW = 'DataView'; var PROTOTYPE = 'prototype'; @@ -5376,12 +5376,12 @@ function warning(message) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(179); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(439); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(440); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(441); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(182); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(181); +/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(447); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(448); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(449); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(188); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); @@ -5412,9 +5412,9 @@ if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(428); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(433); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(435); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(436); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(441); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(443); @@ -5491,11 +5491,11 @@ exports.locationsAreEqual = exports.createLocation = undefined; var _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; }; -var _resolvePathname = __webpack_require__(185); +var _resolvePathname = __webpack_require__(192); var _resolvePathname2 = _interopRequireDefault(_resolvePathname); -var _valueEqual = __webpack_require__(186); +var _valueEqual = __webpack_require__(193); var _valueEqual2 = _interopRequireDefault(_valueEqual); @@ -5789,7 +5789,7 @@ Router.childContextTypes = { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(454); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(462); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__); @@ -6049,12 +6049,400 @@ function fsmIterator(fsm, q0) { "use strict"; +var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +module.exports = { + REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g, + REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g, + REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/, + CHANNEL_CHAR: '@', + parseIdentifier: function parseIdentifier(identifier) { + var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end) + '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end) + ); + + var _componentsRegex$exec = componentsRegex // eslint-disable-line no-unused-vars + .exec(identifier).map(function (match) { + return match || null; + }), + _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4), + proto = _componentsRegex$exec2[0], + value = _componentsRegex$exec2[1], + modifierSeperator = _componentsRegex$exec2[2], + modifier = _componentsRegex$exec2[3]; + + // Validate and process name + + + if (!value) { + throw new Error('Check your URL. No channel name provided before "' + modifierSeperator + '"'); + } + var isChannel = value.startsWith(module.exports.CHANNEL_CHAR); + var channelName = isChannel ? value : null; + var claimId = void 0; + if (isChannel) { + if (!channelName) { + throw new Error('Check your URL. No channel name after "@".'); + } + var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL); + if (nameBadChars) { + throw new Error('Check your URL. Invalid characters in channel name: "' + nameBadChars.join(', ') + '".'); + } + } else { + claimId = value; + } + + // Validate and process modifier + var channelClaimId = void 0; + if (modifierSeperator) { + if (!modifier) { + throw new Error('Check your URL. No modifier provided after separator "' + modifierSeperator + '"'); + } + + if (modifierSeperator === ':') { + channelClaimId = modifier; + } else { + throw new Error('Check your URL. The "' + modifierSeperator + '" modifier is not currently supported'); + } + } + return { + isChannel: isChannel, + channelName: channelName, + channelClaimId: channelClaimId || null, + claimId: claimId || null + }; + }, + parseClaim: function parseClaim(name) { + var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first extension) + '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end) + ); + + var _componentsRegex$exec3 = componentsRegex // eslint-disable-line no-unused-vars + .exec(name).map(function (match) { + return match || null; + }), + _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4), + proto = _componentsRegex$exec4[0], + claimName = _componentsRegex$exec4[1], + extensionSeperator = _componentsRegex$exec4[2], + extension = _componentsRegex$exec4[3]; + + // Validate and process name + + + if (!claimName) { + throw new Error('Check your URL. No claim name provided before "."'); + } + var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM); + if (nameBadChars) { + throw new Error('Check your URL. Invalid characters in claim name: "' + nameBadChars.join(', ') + '".'); + } + // Validate and process extension + if (extensionSeperator) { + if (!extension) { + throw new Error('Check your URL. No file extension provided after separator "' + extensionSeperator + '".'); + } + if (extensionSeperator !== '.') { + throw new Error('Check your URL. The "' + extensionSeperator + '" separator is not supported in the claim name.'); + } + } + return { + claimName: claimName, + extension: extension || null + }; + } +}; + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var validateChannelSelection = exports.validateChannelSelection = function validateChannelSelection(publishInChannel, selectedChannel, loggedInChannel) { + if (publishInChannel && selectedChannel !== loggedInChannel.name) { + throw new Error('Log in to a channel or select Anonymous'); + } +}; + +var validatePublishParams = exports.validatePublishParams = function validatePublishParams(file, claim, urlError) { + if (!file) { + throw new Error('Please choose a file'); + } + if (!claim) { + throw new Error('Please enter a URL'); + } + if (urlError) { + throw new Error('Fix the url'); + } +}; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var createPublishMetadata = exports.createPublishMetadata = function createPublishMetadata(claim, _ref, _ref2, publishInChannel, selectedChannel) { + var type = _ref.type; + var title = _ref2.title, + description = _ref2.description, + license = _ref2.license, + nsfw = _ref2.nsfw; + + var metadata = { + name: claim, + title: title, + description: description, + license: license, + nsfw: nsfw, + type: type + }; + if (publishInChannel) { + metadata['channelName'] = selectedChannel; + } + return metadata; +}; + +var createPublishFormData = exports.createPublishFormData = function createPublishFormData(file, thumbnail, metadata) { + var fd = new FormData(); + // append file + fd.append('file', file); + // append thumbnail + if (thumbnail) { + fd.append('thumbnail', thumbnail); + } + // append metadata + for (var key in metadata) { + if (metadata.hasOwnProperty(key)) { + fd.append(key, metadata[key]); + } + } + return fd; +}; + +var createThumbnailUrl = exports.createThumbnailUrl = function createThumbnailUrl(channel, channelId, claim, host) { + return host + '/' + channel + ':' + channelId + '/' + claim + '-thumb.png'; +}; + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _require = __webpack_require__(89), + componentsConfig = _require.componentsConfig; + +function getDeepestChildValue(parent, childrenKeys) { + var childKey = childrenKeys.shift(); // .shift() retrieves the first element of array and removes it from array + var child = parent[childKey]; + if (childrenKeys.length >= 1) { + return getDeepestChildValue(child, childrenKeys); + } + return child; +} + +var dynamicImport = exports.dynamicImport = function dynamicImport(filePath) { + // validate inputs + if (!filePath) { + throw new Error('no file path provided to dynamicImport()'); + } + if (filePath.typeof !== 'string') { + throw new Error('file path provided to dynamicImport() must be a string'); + } + // split out the file folders // filter out any empty or white-space-only strings + var folders = filePath.split('/').filter(function (folderName) { + return folderName.replace(/\s/g, '').length; + }); + // check for the component corresponding to file path in the site config object + // i.e. componentsConfig[folders[0]][folders[2][...][folders[n]] + var customComponent = getDeepestChildValue(componentsConfig, folders); + if (customComponent) { + return customComponent; // return custom component + } else { + return __webpack_require__(505)("" + filePath); + } +}; + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var createBasicCanonicalLink = function createBasicCanonicalLink(page, siteHost) { + return siteHost + "/" + page; +}; + +var createAssetCanonicalLink = function createAssetCanonicalLink(asset, siteHost) { + var channelName = void 0, + certificateId = void 0, + name = void 0, + claimId = void 0; + if (asset.claimData) { + var _asset$claimData = asset.claimData; + channelName = _asset$claimData.channelName; + certificateId = _asset$claimData.certificateId; + name = _asset$claimData.name; + claimId = _asset$claimData.claimId; + }; + if (channelName) { + return siteHost + "/" + channelName + ":" + certificateId + "/" + name; + }; + return siteHost + "/" + claimId + "/" + name; +}; + +var createChannelCanonicalLink = function createChannelCanonicalLink(channel, siteHost) { + var name = channel.name, + longId = channel.longId; + + return siteHost + "/" + name + ":" + longId; +}; + +var createCanonicalLink = exports.createCanonicalLink = function createCanonicalLink(asset, channel, page, siteHost) { + if (asset) { + return createAssetCanonicalLink(asset, siteHost); + } + if (channel) { + return createChannelCanonicalLink(channel, siteHost); + } + return createBasicCanonicalLink(page, siteHost); +}; + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var determineOgThumbnailContentType = function determineOgThumbnailContentType(thumbnail) { + if (thumbnail) { + var fileExt = thumbnail.substring(thumbnail.lastIndexOf('.')); + switch (fileExt) { + case 'jpeg': + case 'jpg': + return 'image/jpeg'; + case 'png': + return 'image/png'; + case 'gif': + return 'image/gif'; + case 'mp4': + return 'video/mp4'; + default: + return 'image/jpeg'; + } + } + return ''; +}; + +var createBasicMetaTags = function createBasicMetaTags(siteHost, siteDescription, siteTitle, siteTwitter) { + return [{ property: 'og:title', content: siteTitle }, { property: 'og:url', content: siteHost }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: siteDescription }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; +}; + +var createChannelMetaTags = function createChannelMetaTags(siteTitle, siteHost, siteTwitter, channel) { + var name = channel.name, + longId = channel.longId; + + return [{ property: 'og:title', content: name + ' on ' + siteTitle }, { property: 'og:url', content: siteHost + '/' + name + ':' + longId }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: name + ', a channel on ' + siteTitle }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; +}; + +var createAssetMetaTags = function createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail) { + var claimData = asset.claimData; + var contentType = claimData.contentType; + + var embedUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; + var showUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; + var source = siteHost + '/' + claimData.claimId + '/' + claimData.name + '.' + claimData.fileExt; + var ogTitle = claimData.title || claimData.name; + var ogDescription = claimData.description || defaultDescription; + var ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail); + var ogThumbnail = claimData.thumbnail || defaultThumbnail; + var metaTags = [{ property: 'og:title', content: ogTitle }, { property: 'og:url', content: showUrl }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: ogDescription }, { property: 'og:image:width', content: 600 }, { property: 'og:image:height', content: 315 }, { property: 'twitter:site', content: siteTwitter }]; + if (contentType === 'video/mp4' || contentType === 'video/webm') { + metaTags.push({ property: 'og:video', content: source }); + metaTags.push({ property: 'og:video:secure_url', content: source }); + metaTags.push({ property: 'og:video:type', content: contentType }); + metaTags.push({ property: 'og:image', content: ogThumbnail }); + metaTags.push({ property: 'og:image:type', content: ogThumbnailContentType }); + metaTags.push({ property: 'og:type', content: 'video' }); + metaTags.push({ property: 'twitter:card', content: 'player' }); + metaTags.push({ property: 'twitter:player', content: embedUrl }); + metaTags.push({ property: 'twitter:player:width', content: 600 }); + metaTags.push({ property: 'twitter:text:player_width', content: 600 }); + metaTags.push({ property: 'twitter:player:height', content: 337 }); + metaTags.push({ property: 'twitter:player:stream', content: source }); + metaTags.push({ property: 'twitter:player:stream:content_type', content: contentType }); + } else { + metaTags.push({ property: 'og:image', content: source }); + metaTags.push({ property: 'og:image:type', content: contentType }); + metaTags.push({ property: 'og:type', content: 'article' }); + metaTags.push({ property: 'twitter:card', content: 'summary_large_image' }); + } + return metaTags; +}; + +var createMetaTags = exports.createMetaTags = function createMetaTags(siteDescription, siteHost, siteTitle, siteTwitter, asset, channel, defaultDescription, defaultThumbnail) { + if (asset) { + return createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail); + }; + if (channel) { + return createChannelMetaTags(siteHost, siteTitle, siteTwitter, channel); + }; + return createBasicMetaTags(siteDescription, siteHost, siteTitle, siteTwitter); +}; + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var createPageTitle = exports.createPageTitle = function createPageTitle(siteTitle, pageTitle) { + if (!pageTitle) { + return "" + siteTitle; + } + return siteTitle + " - " + pageTitle; +}; + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); exports.updateLoggedInChannel = updateLoggedInChannel; -var _channel_action_types = __webpack_require__(192); +var _channel_action_types = __webpack_require__(199); var actions = _interopRequireWildcard(_channel_action_types); @@ -6074,7 +6462,7 @@ function updateLoggedInChannel(name, shortId, longId) { }; /***/ }), -/* 135 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6149,7 +6537,7 @@ ErrorPage.propTypes = { exports.default = ErrorPage; /***/ }), -/* 136 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(8) && !__webpack_require__(4)(function () { @@ -6158,14 +6546,14 @@ module.exports = !__webpack_require__(8) && !__webpack_require__(4)(function () /***/ }), -/* 137 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { exports.f = __webpack_require__(6); /***/ }), -/* 138 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(16); @@ -6188,12 +6576,12 @@ module.exports = function (object, names) { /***/ }), -/* 139 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(9); var anObject = __webpack_require__(2); -var getKeys = __webpack_require__(43); +var getKeys = __webpack_require__(44); module.exports = __webpack_require__(8) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); @@ -6207,12 +6595,12 @@ module.exports = __webpack_require__(8) ? Object.defineProperties : function def /***/ }), -/* 140 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = __webpack_require__(20); -var gOPN = __webpack_require__(46).f; +var gOPN = __webpack_require__(47).f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames @@ -6232,13 +6620,13 @@ module.exports.f = function getOwnPropertyNames(it) { /***/ }), -/* 141 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(43); +var getKeys = __webpack_require__(44); var gOPS = __webpack_require__(74); var pIE = __webpack_require__(65); var toObject = __webpack_require__(12); @@ -6273,14 +6661,14 @@ module.exports = !$assign || __webpack_require__(4)(function () { /***/ }), -/* 142 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var aFunction = __webpack_require__(15); var isObject = __webpack_require__(5); -var invoke = __webpack_require__(143); +var invoke = __webpack_require__(150); var arraySlice = [].slice; var factories = {}; @@ -6305,7 +6693,7 @@ module.exports = Function.bind || function bind(that /* , ...args */) { /***/ }), -/* 143 */ +/* 150 */ /***/ (function(module, exports) { // fast apply, http://jsperf.lnkit.com/fast-apply/5 @@ -6327,11 +6715,11 @@ module.exports = function (fn, args, that) { /***/ }), -/* 144 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { var $parseInt = __webpack_require__(3).parseInt; -var $trim = __webpack_require__(55).trim; +var $trim = __webpack_require__(56).trim; var ws = __webpack_require__(99); var hex = /^[-+]?0[xX]/; @@ -6342,11 +6730,11 @@ module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? f /***/ }), -/* 145 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { var $parseFloat = __webpack_require__(3).parseFloat; -var $trim = __webpack_require__(55).trim; +var $trim = __webpack_require__(56).trim; module.exports = 1 / $parseFloat(__webpack_require__(99) + '-0') !== -Infinity ? function parseFloat(str) { var string = $trim(String(str), 3); @@ -6356,7 +6744,7 @@ module.exports = 1 / $parseFloat(__webpack_require__(99) + '-0') !== -Infinity ? /***/ }), -/* 146 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { var cof = __webpack_require__(26); @@ -6367,7 +6755,7 @@ module.exports = function (it, msg) { /***/ }), -/* 147 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.3 Number.isInteger(number) @@ -6379,7 +6767,7 @@ module.exports = function isInteger(it) { /***/ }), -/* 148 */ +/* 155 */ /***/ (function(module, exports) { // 20.2.2.20 Math.log1p(x) @@ -6389,7 +6777,7 @@ module.exports = Math.log1p || function log1p(x) { /***/ }), -/* 149 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.16 Math.fround(x) @@ -6418,7 +6806,7 @@ module.exports = Math.fround || function fround(x) { /***/ }), -/* 150 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error @@ -6436,7 +6824,7 @@ module.exports = function (iterator, fn, value, entries) { /***/ }), -/* 151 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { var aFunction = __webpack_require__(15); @@ -6470,14 +6858,14 @@ module.exports = function (that, callbackfn, aLen, memo, isRight) { /***/ }), -/* 152 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var toObject = __webpack_require__(12); -var toAbsoluteIndex = __webpack_require__(44); +var toAbsoluteIndex = __webpack_require__(45); var toLength = __webpack_require__(10); module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { @@ -6503,7 +6891,7 @@ module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* /***/ }), -/* 153 */ +/* 160 */ /***/ (function(module, exports) { module.exports = function (done, value) { @@ -6512,7 +6900,7 @@ module.exports = function (done, value) { /***/ }), -/* 154 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { // 21.2.5.3 get RegExp.prototype.flags() @@ -6523,7 +6911,7 @@ if (__webpack_require__(8) && /./g.flags != 'g') __webpack_require__(9).f(RegExp /***/ }), -/* 155 */ +/* 162 */ /***/ (function(module, exports) { module.exports = function (exec) { @@ -6536,7 +6924,7 @@ module.exports = function (exec) { /***/ }), -/* 156 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(2); @@ -6554,13 +6942,13 @@ module.exports = function (C, x) { /***/ }), -/* 157 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var strong = __webpack_require__(158); -var validate = __webpack_require__(57); +var strong = __webpack_require__(165); +var validate = __webpack_require__(58); var MAP = 'Map'; // 23.1 Map Objects @@ -6580,23 +6968,23 @@ module.exports = __webpack_require__(81)(MAP, function (get) { /***/ }), -/* 158 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var dP = __webpack_require__(9).f; -var create = __webpack_require__(45); -var redefineAll = __webpack_require__(50); +var create = __webpack_require__(46); +var redefineAll = __webpack_require__(51); var ctx = __webpack_require__(25); -var anInstance = __webpack_require__(48); -var forOf = __webpack_require__(49); +var anInstance = __webpack_require__(49); +var forOf = __webpack_require__(50); var $iterDefine = __webpack_require__(105); -var step = __webpack_require__(153); -var setSpecies = __webpack_require__(47); +var step = __webpack_require__(160); +var setSpecies = __webpack_require__(48); var DESCRIPTORS = __webpack_require__(8); var fastKey = __webpack_require__(37).fastKey; -var validate = __webpack_require__(57); +var validate = __webpack_require__(58); var SIZE = DESCRIPTORS ? '_s' : 'size'; var getEntry = function (that, key) { @@ -6731,13 +7119,13 @@ module.exports = { /***/ }), -/* 159 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var strong = __webpack_require__(158); -var validate = __webpack_require__(57); +var strong = __webpack_require__(165); +var validate = __webpack_require__(58); var SET = 'Set'; // 23.2 Set Objects @@ -6752,7 +7140,7 @@ module.exports = __webpack_require__(81)(SET, function (get) { /***/ }), -/* 160 */ +/* 167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6760,11 +7148,11 @@ module.exports = __webpack_require__(81)(SET, function (get) { var each = __webpack_require__(33)(0); var redefine = __webpack_require__(18); var meta = __webpack_require__(37); -var assign = __webpack_require__(141); -var weak = __webpack_require__(161); +var assign = __webpack_require__(148); +var weak = __webpack_require__(168); var isObject = __webpack_require__(5); var fails = __webpack_require__(4); -var validate = __webpack_require__(57); +var validate = __webpack_require__(58); var WEAK_MAP = 'WeakMap'; var getWeak = meta.getWeak; var isExtensible = Object.isExtensible; @@ -6818,20 +7206,20 @@ if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp) /***/ }), -/* 161 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var redefineAll = __webpack_require__(50); +var redefineAll = __webpack_require__(51); var getWeak = __webpack_require__(37).getWeak; var anObject = __webpack_require__(2); var isObject = __webpack_require__(5); -var anInstance = __webpack_require__(48); -var forOf = __webpack_require__(49); +var anInstance = __webpack_require__(49); +var forOf = __webpack_require__(50); var createArrayMethod = __webpack_require__(33); var $has = __webpack_require__(16); -var validate = __webpack_require__(57); +var validate = __webpack_require__(58); var arrayFind = createArrayMethod(5); var arrayFindIndex = createArrayMethod(6); var id = 0; @@ -6910,7 +7298,7 @@ module.exports = { /***/ }), -/* 162 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/ecma262/#sec-toindex @@ -6926,11 +7314,11 @@ module.exports = function (it) { /***/ }), -/* 163 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { // all object keys, includes non-enumerable and symbols -var gOPN = __webpack_require__(46); +var gOPN = __webpack_require__(47); var gOPS = __webpack_require__(74); var anObject = __webpack_require__(2); var Reflect = __webpack_require__(3).Reflect; @@ -6942,7 +7330,7 @@ module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { /***/ }), -/* 164 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6988,7 +7376,7 @@ module.exports = flattenIntoArray; /***/ }), -/* 165 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-string-pad-start-end @@ -7010,10 +7398,10 @@ module.exports = function (that, maxLength, fillString, left) { /***/ }), -/* 166 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { -var getKeys = __webpack_require__(43); +var getKeys = __webpack_require__(44); var toIObject = __webpack_require__(20); var isEnum = __webpack_require__(65).f; module.exports = function (isEntries) { @@ -7032,12 +7420,12 @@ module.exports = function (isEntries) { /***/ }), -/* 167 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = __webpack_require__(66); -var from = __webpack_require__(168); +var from = __webpack_require__(175); module.exports = function (NAME) { return function toJSON() { if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); @@ -7047,10 +7435,10 @@ module.exports = function (NAME) { /***/ }), -/* 168 */ +/* 175 */ /***/ (function(module, exports, __webpack_require__) { -var forOf = __webpack_require__(49); +var forOf = __webpack_require__(50); module.exports = function (iter, ITERATOR) { var result = []; @@ -7060,7 +7448,7 @@ module.exports = function (iter, ITERATOR) { /***/ }), -/* 169 */ +/* 176 */ /***/ (function(module, exports) { // https://rwaldron.github.io/proposal-math-extensions/ @@ -7084,7 +7472,7 @@ module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) /***/ }), -/* 170 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7123,7 +7511,7 @@ var ExecutionEnvironment = { module.exports = ExecutionEnvironment; /***/ }), -/* 171 */ +/* 178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7204,7 +7592,7 @@ module.exports = EventListener; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) /***/ }), -/* 172 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7246,7 +7634,7 @@ function getActiveElement(doc) /*?DOMElement*/{ module.exports = getActiveElement; /***/ }), -/* 173 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7317,7 +7705,7 @@ function shallowEqual(objA, objB) { module.exports = shallowEqual; /***/ }), -/* 174 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7332,7 +7720,7 @@ module.exports = shallowEqual; * */ -var isTextNode = __webpack_require__(414); +var isTextNode = __webpack_require__(422); /*eslint-disable no-bitwise */ @@ -7360,7 +7748,7 @@ function containsNode(outerNode, innerNode) { module.exports = containsNode; /***/ }), -/* 175 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7390,7 +7778,7 @@ function focusNode(node) { module.exports = focusNode; /***/ }), -/* 176 */ +/* 183 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -7414,19 +7802,19 @@ var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ }); /***/ }), -/* 177 */ +/* 184 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(178); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(185); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(23); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(424); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(176); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(432); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(183); var _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; }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -7719,7 +8107,7 @@ selectorFactory) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 178 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7797,14 +8185,14 @@ selectorFactory) { /***/ }), -/* 179 */ +/* 186 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); /* harmony export (immutable) */ __webpack_exports__["b"] = createStore; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(124); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(436); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(444); @@ -8055,11 +8443,11 @@ var ActionTypes = { } /***/ }), -/* 180 */ +/* 187 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(429); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(437); /** Built-in value references. */ @@ -8069,7 +8457,7 @@ var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; /***/ }), -/* 181 */ +/* 188 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8097,7 +8485,7 @@ function warning(message) { } /***/ }), -/* 182 */ +/* 189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8136,14 +8524,14 @@ function compose() { } /***/ }), -/* 183 */ +/* 190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant; /* unused harmony export getDependsOnOwnProps */ /* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(184); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(191); function wrapMapToPropsConstant(getConstant) { @@ -8214,7 +8602,7 @@ function wrapMapToPropsFunc(mapToProps, methodName) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 184 */ +/* 191 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8231,7 +8619,7 @@ function verifyPlainObject(value, displayName, methodName) { } /***/ }), -/* 185 */ +/* 192 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8308,7 +8696,7 @@ function resolvePathname(to) { /* harmony default export */ __webpack_exports__["default"] = (resolvePathname); /***/ }), -/* 186 */ +/* 193 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8353,7 +8741,7 @@ function valueEqual(a, b) { /* harmony default export */ __webpack_exports__["default"] = (valueEqual); /***/ }), -/* 187 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8414,7 +8802,7 @@ var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isE }; /***/ }), -/* 188 */ +/* 195 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8524,18 +8912,18 @@ Link.contextTypes = { /* harmony default export */ __webpack_exports__["a"] = (Link); /***/ }), -/* 189 */ +/* 196 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__ = __webpack_require__(190); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__ = __webpack_require__(197); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__["a" /* default */]); /***/ }), -/* 190 */ +/* 197 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8684,7 +9072,7 @@ Route.childContextTypes = { /* harmony default export */ __webpack_exports__["a"] = (Route); /***/ }), -/* 191 */ +/* 198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8750,7 +9138,7 @@ var isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { }; /***/ }), -/* 192 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8762,31 +9150,31 @@ Object.defineProperty(exports, "__esModule", { var CHANNEL_UPDATE = exports.CHANNEL_UPDATE = 'CHANNEL_UPDATE'; /***/ }), -/* 193 */ +/* 200 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_middleware__ = __webpack_require__(477); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_runSaga__ = __webpack_require__(195); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_middleware__ = __webpack_require__(485); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_runSaga__ = __webpack_require__(202); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "runSaga", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_runSaga__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_channel__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_channel__ = __webpack_require__(61); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "END", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_channel__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "eventChannel", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_channel__["d"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "channel", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_channel__["b"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_buffers__ = __webpack_require__(90); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "buffers", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_buffers__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__ = __webpack_require__(197); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__ = __webpack_require__(204); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeEvery", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeLatest", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__["c"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__["e"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_utils__ = __webpack_require__(24); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_utils__["m"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CANCEL", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_utils__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_io__ = __webpack_require__(51); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_io__ = __webpack_require__(52); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detach", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_io__["i"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__effects__ = __webpack_require__(52); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils__ = __webpack_require__(481); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__effects__ = __webpack_require__(53); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils__ = __webpack_require__(489); /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "effects", function() { return __WEBPACK_IMPORTED_MODULE_7__effects__; }); /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "utils", function() { return __WEBPACK_IMPORTED_MODULE_8__utils__; }); @@ -8805,7 +9193,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /***/ }), -/* 194 */ +/* 201 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8876,13 +9264,13 @@ function flush() { } /***/ }), -/* 195 */ +/* 202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = runSaga; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__proc__ = __webpack_require__(196); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__proc__ = __webpack_require__(203); @@ -8942,7 +9330,7 @@ function runSaga(storeInterface, saga) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 196 */ +/* 203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8951,9 +9339,9 @@ function runSaga(storeInterface, saga) { /* unused harmony export TASK_CANCEL */ /* harmony export (immutable) */ __webpack_exports__["b"] = proc; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler__ = __webpack_require__(194); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__io__ = __webpack_require__(51); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__channel__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler__ = __webpack_require__(201); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__io__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__channel__ = __webpack_require__(61); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__buffers__ = __webpack_require__(90); var _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; }; @@ -9718,16 +10106,16 @@ function proc(iterator) { } /***/ }), -/* 197 */ +/* 204 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return takeEvery; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return takeLatest; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return throttle; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__takeEvery__ = __webpack_require__(478); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__takeLatest__ = __webpack_require__(479); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__throttle__ = __webpack_require__(480); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__takeEvery__ = __webpack_require__(486); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__takeLatest__ = __webpack_require__(487); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__throttle__ = __webpack_require__(488); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(24); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__takeEvery__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__takeLatest__["a"]; }); @@ -9749,7 +10137,7 @@ var throttle = /*#__PURE__*/Object(__WEBPACK_IMPORTED_MODULE_3__utils__["n" /* d /***/ }), -/* 198 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9763,7 +10151,7 @@ var ASSET_LITE = exports.ASSET_LITE = 'ASSET_LITE'; var ASSET_DETAILS = exports.ASSET_DETAILS = 'ASSET_DETAILS'; /***/ }), -/* 199 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9775,15 +10163,15 @@ Object.defineProperty(exports, "__esModule", { exports.newAssetRequest = newAssetRequest; exports.watchNewAssetRequest = watchNewAssetRequest; -var _effects = __webpack_require__(52); +var _effects = __webpack_require__(53); -var _show_action_types = __webpack_require__(59); +var _show_action_types = __webpack_require__(60); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); -var _assetApi = __webpack_require__(484); +var _assetApi = __webpack_require__(492); var _show2 = __webpack_require__(70); @@ -9938,7 +10326,7 @@ function watchNewAssetRequest() { }; /***/ }), -/* 200 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9951,15 +10339,15 @@ exports.newChannelRequest = newChannelRequest; exports.watchNewChannelRequest = watchNewChannelRequest; exports.watchUpdateChannelClaims = watchUpdateChannelClaims; -var _effects = __webpack_require__(52); +var _effects = __webpack_require__(53); -var _show_action_types = __webpack_require__(59); +var _show_action_types = __webpack_require__(60); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); -var _channelApi = __webpack_require__(486); +var _channelApi = __webpack_require__(494); var _show2 = __webpack_require__(70); @@ -10158,7 +10546,47 @@ function watchUpdateChannelClaims() { } /***/ }), -/* 201 */ +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + validateFile: function validateFile(file) { + if (!file) { + throw new Error('no file provided'); + } + if (/'/.test(file.name)) { + throw new Error('apostrophes are not allowed in the file name'); + } + // validate size and type + switch (file.type) { + case 'image/jpeg': + case 'image/jpg': + case 'image/png': + if (file.size > 10000000) { + throw new Error('Sorry, images are limited to 10 megabytes.'); + } + break; + case 'image/gif': + if (file.size > 50000000) { + throw new Error('Sorry, GIFs are limited to 50 megabytes.'); + } + break; + case 'video/mp4': + if (file.size > 50000000) { + throw new Error('Sorry, videos are limited to 50 megabytes.'); + } + break; + default: + throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.'); + } + } +}; + +/***/ }), +/* 209 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {exports.__esModule = true; @@ -10176,17 +10604,17 @@ var _propTypes = __webpack_require__(11); var _propTypes2 = _interopRequireDefault(_propTypes); -var _reactSideEffect = __webpack_require__(507); +var _reactSideEffect = __webpack_require__(511); var _reactSideEffect2 = _interopRequireDefault(_reactSideEffect); -var _deepEqual = __webpack_require__(510); +var _deepEqual = __webpack_require__(514); var _deepEqual2 = _interopRequireDefault(_deepEqual); -var _HelmetUtils = __webpack_require__(513); +var _HelmetUtils = __webpack_require__(517); -var _HelmetConstants = __webpack_require__(202); +var _HelmetConstants = __webpack_require__(210); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -10456,7 +10884,7 @@ exports.default = HelmetExport; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) /***/ }), -/* 202 */ +/* 210 */ /***/ (function(module, exports) { exports.__esModule = true; @@ -10525,7 +10953,7 @@ var SELF_CLOSING_TAGS = exports.SELF_CLOSING_TAGS = [TAG_NAMES.NOSCRIPT, TAG_NAM var HELMET_ATTRIBUTE = exports.HELMET_ATTRIBUTE = "data-react-helmet"; /***/ }), -/* 203 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10545,11 +10973,11 @@ var _propTypes = __webpack_require__(11); var _propTypes2 = _interopRequireDefault(_propTypes); -var _ActiveStatusBar = __webpack_require__(523); +var _ActiveStatusBar = __webpack_require__(524); var _ActiveStatusBar2 = _interopRequireDefault(_ActiveStatusBar); -var _InactiveStatusBar = __webpack_require__(524); +var _InactiveStatusBar = __webpack_require__(525); var _InactiveStatusBar2 = _interopRequireDefault(_InactiveStatusBar); @@ -10662,7 +11090,7 @@ ProgressBar.propTypes = { exports.default = ProgressBar; /***/ }), -/* 204 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10674,11 +11102,11 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(529); +var _view = __webpack_require__(530); var _view2 = _interopRequireDefault(_view); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); var _show2 = __webpack_require__(70); @@ -10711,26 +11139,26 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 205 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(206); -__webpack_require__(408); -module.exports = __webpack_require__(409); +__webpack_require__(214); +__webpack_require__(416); +module.exports = __webpack_require__(417); /***/ }), -/* 206 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) { -__webpack_require__(207); +__webpack_require__(215); -__webpack_require__(404); +__webpack_require__(412); -__webpack_require__(405); +__webpack_require__(413); if (global._babelPolyfill) { throw new Error("only one instance of babel-polyfill is allowed"); @@ -10755,18 +11183,10 @@ define(String.prototype, "padRight", "".padEnd); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(63))) /***/ }), -/* 207 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(208); -__webpack_require__(210); -__webpack_require__(211); -__webpack_require__(212); -__webpack_require__(213); -__webpack_require__(214); -__webpack_require__(215); __webpack_require__(216); -__webpack_require__(217); __webpack_require__(218); __webpack_require__(219); __webpack_require__(220); @@ -10774,6 +11194,7 @@ __webpack_require__(221); __webpack_require__(222); __webpack_require__(223); __webpack_require__(224); +__webpack_require__(225); __webpack_require__(226); __webpack_require__(227); __webpack_require__(228); @@ -10781,7 +11202,6 @@ __webpack_require__(229); __webpack_require__(230); __webpack_require__(231); __webpack_require__(232); -__webpack_require__(233); __webpack_require__(234); __webpack_require__(235); __webpack_require__(236); @@ -10835,13 +11255,14 @@ __webpack_require__(283); __webpack_require__(284); __webpack_require__(285); __webpack_require__(286); +__webpack_require__(287); __webpack_require__(288); __webpack_require__(289); +__webpack_require__(290); __webpack_require__(291); __webpack_require__(292); __webpack_require__(293); __webpack_require__(294); -__webpack_require__(295); __webpack_require__(296); __webpack_require__(297); __webpack_require__(299); @@ -10851,32 +11272,31 @@ __webpack_require__(302); __webpack_require__(303); __webpack_require__(304); __webpack_require__(305); -__webpack_require__(306); __webpack_require__(307); __webpack_require__(308); __webpack_require__(309); __webpack_require__(310); __webpack_require__(311); -__webpack_require__(114); __webpack_require__(312); __webpack_require__(313); -__webpack_require__(154); __webpack_require__(314); __webpack_require__(315); __webpack_require__(316); __webpack_require__(317); __webpack_require__(318); -__webpack_require__(157); -__webpack_require__(159); -__webpack_require__(160); __webpack_require__(319); +__webpack_require__(114); __webpack_require__(320); __webpack_require__(321); +__webpack_require__(161); __webpack_require__(322); __webpack_require__(323); __webpack_require__(324); __webpack_require__(325); __webpack_require__(326); +__webpack_require__(164); +__webpack_require__(166); +__webpack_require__(167); __webpack_require__(327); __webpack_require__(328); __webpack_require__(329); @@ -10954,11 +11374,19 @@ __webpack_require__(400); __webpack_require__(401); __webpack_require__(402); __webpack_require__(403); +__webpack_require__(404); +__webpack_require__(405); +__webpack_require__(406); +__webpack_require__(407); +__webpack_require__(408); +__webpack_require__(409); +__webpack_require__(410); +__webpack_require__(411); module.exports = __webpack_require__(28); /***/ }), -/* 208 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10972,23 +11400,23 @@ var redefine = __webpack_require__(18); var META = __webpack_require__(37).KEY; var $fails = __webpack_require__(4); var shared = __webpack_require__(72); -var setToStringTag = __webpack_require__(54); -var uid = __webpack_require__(41); +var setToStringTag = __webpack_require__(55); +var uid = __webpack_require__(42); var wks = __webpack_require__(6); -var wksExt = __webpack_require__(137); +var wksExt = __webpack_require__(144); var wksDefine = __webpack_require__(94); -var enumKeys = __webpack_require__(209); +var enumKeys = __webpack_require__(217); var isArray = __webpack_require__(75); var anObject = __webpack_require__(2); var isObject = __webpack_require__(5); var toIObject = __webpack_require__(20); var toPrimitive = __webpack_require__(29); -var createDesc = __webpack_require__(40); -var _create = __webpack_require__(45); -var gOPNExt = __webpack_require__(140); +var createDesc = __webpack_require__(41); +var _create = __webpack_require__(46); +var gOPNExt = __webpack_require__(147); var $GOPD = __webpack_require__(21); var $DP = __webpack_require__(9); -var $keys = __webpack_require__(43); +var $keys = __webpack_require__(44); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; @@ -11111,11 +11539,11 @@ if (!USE_NATIVE) { $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; - __webpack_require__(46).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(47).f = gOPNExt.f = $getOwnPropertyNames; __webpack_require__(65).f = $propertyIsEnumerable; __webpack_require__(74).f = $getOwnPropertySymbols; - if (DESCRIPTORS && !__webpack_require__(42)) { + if (DESCRIPTORS && !__webpack_require__(43)) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } @@ -11199,11 +11627,11 @@ setToStringTag(global.JSON, 'JSON', true); /***/ }), -/* 209 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { // all enumerable object keys, includes symbols -var getKeys = __webpack_require__(43); +var getKeys = __webpack_require__(44); var gOPS = __webpack_require__(74); var pIE = __webpack_require__(65); module.exports = function (it) { @@ -11220,16 +11648,16 @@ module.exports = function (it) { /***/ }), -/* 210 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(45) }); +$export($export.S, 'Object', { create: __webpack_require__(46) }); /***/ }), -/* 211 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); @@ -11238,16 +11666,16 @@ $export($export.S + $export.F * !__webpack_require__(8), 'Object', { definePrope /***/ }), -/* 212 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperties: __webpack_require__(139) }); +$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperties: __webpack_require__(146) }); /***/ }), -/* 213 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) @@ -11262,7 +11690,7 @@ __webpack_require__(32)('getOwnPropertyDescriptor', function () { /***/ }), -/* 214 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 Object.getPrototypeOf(O) @@ -11277,12 +11705,12 @@ __webpack_require__(32)('getPrototypeOf', function () { /***/ }), -/* 215 */ +/* 223 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 Object.keys(O) var toObject = __webpack_require__(12); -var $keys = __webpack_require__(43); +var $keys = __webpack_require__(44); __webpack_require__(32)('keys', function () { return function keys(it) { @@ -11292,17 +11720,17 @@ __webpack_require__(32)('keys', function () { /***/ }), -/* 216 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 Object.getOwnPropertyNames(O) __webpack_require__(32)('getOwnPropertyNames', function () { - return __webpack_require__(140).f; + return __webpack_require__(147).f; }); /***/ }), -/* 217 */ +/* 225 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.5 Object.freeze(O) @@ -11317,7 +11745,7 @@ __webpack_require__(32)('freeze', function ($freeze) { /***/ }), -/* 218 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.17 Object.seal(O) @@ -11332,7 +11760,7 @@ __webpack_require__(32)('seal', function ($seal) { /***/ }), -/* 219 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.15 Object.preventExtensions(O) @@ -11347,7 +11775,7 @@ __webpack_require__(32)('preventExtensions', function ($preventExtensions) { /***/ }), -/* 220 */ +/* 228 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.12 Object.isFrozen(O) @@ -11361,7 +11789,7 @@ __webpack_require__(32)('isFrozen', function ($isFrozen) { /***/ }), -/* 221 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.13 Object.isSealed(O) @@ -11375,7 +11803,7 @@ __webpack_require__(32)('isSealed', function ($isSealed) { /***/ }), -/* 222 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.11 Object.isExtensible(O) @@ -11389,26 +11817,26 @@ __webpack_require__(32)('isExtensible', function ($isExtensible) { /***/ }), -/* 223 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $export = __webpack_require__(0); -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(141) }); +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(148) }); /***/ }), -/* 224 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.10 Object.is(value1, value2) var $export = __webpack_require__(0); -$export($export.S, 'Object', { is: __webpack_require__(225) }); +$export($export.S, 'Object', { is: __webpack_require__(233) }); /***/ }), -/* 225 */ +/* 233 */ /***/ (function(module, exports) { // 7.2.9 SameValue(x, y) @@ -11419,7 +11847,7 @@ module.exports = Object.is || function is(x, y) { /***/ }), -/* 226 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) @@ -11428,7 +11856,7 @@ $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(98).set }); /***/ }), -/* 227 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11445,17 +11873,17 @@ if (test + '' != '[object z]') { /***/ }), -/* 228 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = __webpack_require__(0); -$export($export.P, 'Function', { bind: __webpack_require__(142) }); +$export($export.P, 'Function', { bind: __webpack_require__(149) }); /***/ }), -/* 229 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(9).f; @@ -11477,7 +11905,7 @@ NAME in FProto || __webpack_require__(8) && dP(FProto, NAME, { /***/ }), -/* 230 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11497,27 +11925,27 @@ if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(9).f(FunctionProto, HA /***/ }), -/* 231 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(144); +var $parseInt = __webpack_require__(151); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); /***/ }), -/* 232 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(145); +var $parseFloat = __webpack_require__(152); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); /***/ }), -/* 233 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11528,16 +11956,16 @@ var cof = __webpack_require__(26); var inheritIfRequired = __webpack_require__(100); var toPrimitive = __webpack_require__(29); var fails = __webpack_require__(4); -var gOPN = __webpack_require__(46).f; +var gOPN = __webpack_require__(47).f; var gOPD = __webpack_require__(21).f; var dP = __webpack_require__(9).f; -var $trim = __webpack_require__(55).trim; +var $trim = __webpack_require__(56).trim; var NUMBER = 'Number'; var $Number = global[NUMBER]; var Base = $Number; var proto = $Number.prototype; // Opera ~12 has broken Object#toString -var BROKEN_COF = cof(__webpack_require__(45)(proto)) == NUMBER; +var BROKEN_COF = cof(__webpack_require__(46)(proto)) == NUMBER; var TRIM = 'trim' in String.prototype; // 7.1.3 ToNumber(argument) @@ -11593,14 +12021,14 @@ if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { /***/ }), -/* 234 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__(0); var toInteger = __webpack_require__(31); -var aNumberValue = __webpack_require__(146); +var aNumberValue = __webpack_require__(153); var repeat = __webpack_require__(101); var $toFixed = 1.0.toFixed; var floor = Math.floor; @@ -11714,14 +12142,14 @@ $export($export.P + $export.F * (!!$toFixed && ( /***/ }), -/* 235 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__(0); var $fails = __webpack_require__(4); -var aNumberValue = __webpack_require__(146); +var aNumberValue = __webpack_require__(153); var $toPrecision = 1.0.toPrecision; $export($export.P + $export.F * ($fails(function () { @@ -11739,7 +12167,7 @@ $export($export.P + $export.F * ($fails(function () { /***/ }), -/* 236 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.1 Number.EPSILON @@ -11749,7 +12177,7 @@ $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); /***/ }), -/* 237 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.2 Number.isFinite(number) @@ -11764,17 +12192,17 @@ $export($export.S, 'Number', { /***/ }), -/* 238 */ +/* 246 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.3 Number.isInteger(number) var $export = __webpack_require__(0); -$export($export.S, 'Number', { isInteger: __webpack_require__(147) }); +$export($export.S, 'Number', { isInteger: __webpack_require__(154) }); /***/ }), -/* 239 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.4 Number.isNaN(number) @@ -11789,12 +12217,12 @@ $export($export.S, 'Number', { /***/ }), -/* 240 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.5 Number.isSafeInteger(number) var $export = __webpack_require__(0); -var isInteger = __webpack_require__(147); +var isInteger = __webpack_require__(154); var abs = Math.abs; $export($export.S, 'Number', { @@ -11805,7 +12233,7 @@ $export($export.S, 'Number', { /***/ }), -/* 241 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.6 Number.MAX_SAFE_INTEGER @@ -11815,7 +12243,7 @@ $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); /***/ }), -/* 242 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.10 Number.MIN_SAFE_INTEGER @@ -11825,32 +12253,32 @@ $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); /***/ }), -/* 243 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(145); +var $parseFloat = __webpack_require__(152); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); /***/ }), -/* 244 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(144); +var $parseInt = __webpack_require__(151); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); /***/ }), -/* 245 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.3 Math.acosh(x) var $export = __webpack_require__(0); -var log1p = __webpack_require__(148); +var log1p = __webpack_require__(155); var sqrt = Math.sqrt; var $acosh = Math.acosh; @@ -11869,7 +12297,7 @@ $export($export.S + $export.F * !($acosh /***/ }), -/* 246 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.5 Math.asinh(x) @@ -11885,7 +12313,7 @@ $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: /***/ }), -/* 247 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.7 Math.atanh(x) @@ -11901,7 +12329,7 @@ $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { /***/ }), -/* 248 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.9 Math.cbrt(x) @@ -11916,7 +12344,7 @@ $export($export.S, 'Math', { /***/ }), -/* 249 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.11 Math.clz32(x) @@ -11930,7 +12358,7 @@ $export($export.S, 'Math', { /***/ }), -/* 250 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.12 Math.cosh(x) @@ -11945,7 +12373,7 @@ $export($export.S, 'Math', { /***/ }), -/* 251 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.14 Math.expm1(x) @@ -11956,17 +12384,17 @@ $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 /***/ }), -/* 252 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.16 Math.fround(x) var $export = __webpack_require__(0); -$export($export.S, 'Math', { fround: __webpack_require__(149) }); +$export($export.S, 'Math', { fround: __webpack_require__(156) }); /***/ }), -/* 253 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) @@ -11997,7 +12425,7 @@ $export($export.S, 'Math', { /***/ }), -/* 254 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.18 Math.imul(x, y) @@ -12020,7 +12448,7 @@ $export($export.S + $export.F * __webpack_require__(4)(function () { /***/ }), -/* 255 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.21 Math.log10(x) @@ -12034,17 +12462,17 @@ $export($export.S, 'Math', { /***/ }), -/* 256 */ +/* 264 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.20 Math.log1p(x) var $export = __webpack_require__(0); -$export($export.S, 'Math', { log1p: __webpack_require__(148) }); +$export($export.S, 'Math', { log1p: __webpack_require__(155) }); /***/ }), -/* 257 */ +/* 265 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.22 Math.log2(x) @@ -12058,7 +12486,7 @@ $export($export.S, 'Math', { /***/ }), -/* 258 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.28 Math.sign(x) @@ -12068,7 +12496,7 @@ $export($export.S, 'Math', { sign: __webpack_require__(102) }); /***/ }), -/* 259 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.30 Math.sinh(x) @@ -12089,7 +12517,7 @@ $export($export.S + $export.F * __webpack_require__(4)(function () { /***/ }), -/* 260 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.33 Math.tanh(x) @@ -12107,7 +12535,7 @@ $export($export.S, 'Math', { /***/ }), -/* 261 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { // 20.2.2.34 Math.trunc(x) @@ -12121,11 +12549,11 @@ $export($export.S, 'Math', { /***/ }), -/* 262 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); -var toAbsoluteIndex = __webpack_require__(44); +var toAbsoluteIndex = __webpack_require__(45); var fromCharCode = String.fromCharCode; var $fromCodePoint = String.fromCodePoint; @@ -12150,7 +12578,7 @@ $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1) /***/ }), -/* 263 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); @@ -12174,13 +12602,13 @@ $export($export.S, 'String', { /***/ }), -/* 264 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.1.3.25 String.prototype.trim() -__webpack_require__(55)('trim', function ($trim) { +__webpack_require__(56)('trim', function ($trim) { return function trim() { return $trim(this, 3); }; @@ -12188,7 +12616,7 @@ __webpack_require__(55)('trim', function ($trim) { /***/ }), -/* 265 */ +/* 273 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12212,7 +12640,7 @@ __webpack_require__(105)(String, 'String', function (iterated) { /***/ }), -/* 266 */ +/* 274 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12228,7 +12656,7 @@ $export($export.P, 'String', { /***/ }), -/* 267 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12255,7 +12683,7 @@ $export($export.P + $export.F * __webpack_require__(108)(ENDS_WITH), 'String', { /***/ }), -/* 268 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12274,7 +12702,7 @@ $export($export.P + $export.F * __webpack_require__(108)(INCLUDES), 'String', { /***/ }), -/* 269 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); @@ -12286,7 +12714,7 @@ $export($export.P, 'String', { /***/ }), -/* 270 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12311,7 +12739,7 @@ $export($export.P + $export.F * __webpack_require__(108)(STARTS_WITH), 'String', /***/ }), -/* 271 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12325,7 +12753,7 @@ __webpack_require__(19)('anchor', function (createHTML) { /***/ }), -/* 272 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12339,7 +12767,7 @@ __webpack_require__(19)('big', function (createHTML) { /***/ }), -/* 273 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12353,7 +12781,7 @@ __webpack_require__(19)('blink', function (createHTML) { /***/ }), -/* 274 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12367,7 +12795,7 @@ __webpack_require__(19)('bold', function (createHTML) { /***/ }), -/* 275 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12381,7 +12809,7 @@ __webpack_require__(19)('fixed', function (createHTML) { /***/ }), -/* 276 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12395,7 +12823,7 @@ __webpack_require__(19)('fontcolor', function (createHTML) { /***/ }), -/* 277 */ +/* 285 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12409,7 +12837,7 @@ __webpack_require__(19)('fontsize', function (createHTML) { /***/ }), -/* 278 */ +/* 286 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12423,7 +12851,7 @@ __webpack_require__(19)('italics', function (createHTML) { /***/ }), -/* 279 */ +/* 287 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12437,7 +12865,7 @@ __webpack_require__(19)('link', function (createHTML) { /***/ }), -/* 280 */ +/* 288 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12451,7 +12879,7 @@ __webpack_require__(19)('small', function (createHTML) { /***/ }), -/* 281 */ +/* 289 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12465,7 +12893,7 @@ __webpack_require__(19)('strike', function (createHTML) { /***/ }), -/* 282 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12479,7 +12907,7 @@ __webpack_require__(19)('sub', function (createHTML) { /***/ }), -/* 283 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12493,7 +12921,7 @@ __webpack_require__(19)('sup', function (createHTML) { /***/ }), -/* 284 */ +/* 292 */ /***/ (function(module, exports, __webpack_require__) { // 20.3.3.1 / 15.9.4.4 Date.now() @@ -12503,7 +12931,7 @@ $export($export.S, 'Date', { now: function () { return new Date().getTime(); } } /***/ }), -/* 285 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12526,12 +12954,12 @@ $export($export.P + $export.F * __webpack_require__(4)(function () { /***/ }), -/* 286 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = __webpack_require__(0); -var toISOString = __webpack_require__(287); +var toISOString = __webpack_require__(295); // PhantomJS / old WebKit has a broken implementations $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { @@ -12540,7 +12968,7 @@ $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'D /***/ }), -/* 287 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12573,7 +13001,7 @@ module.exports = (fails(function () { /***/ }), -/* 288 */ +/* 296 */ /***/ (function(module, exports, __webpack_require__) { var DateProto = Date.prototype; @@ -12591,17 +13019,17 @@ if (new Date(NaN) + '' != INVALID_DATE) { /***/ }), -/* 289 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { var TO_PRIMITIVE = __webpack_require__(6)('toPrimitive'); var proto = Date.prototype; -if (!(TO_PRIMITIVE in proto)) __webpack_require__(17)(proto, TO_PRIMITIVE, __webpack_require__(290)); +if (!(TO_PRIMITIVE in proto)) __webpack_require__(17)(proto, TO_PRIMITIVE, __webpack_require__(298)); /***/ }), -/* 290 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12617,7 +13045,7 @@ module.exports = function (hint) { /***/ }), -/* 291 */ +/* 299 */ /***/ (function(module, exports, __webpack_require__) { // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) @@ -12627,7 +13055,7 @@ $export($export.S, 'Array', { isArray: __webpack_require__(75) }); /***/ }), -/* 292 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12635,7 +13063,7 @@ $export($export.S, 'Array', { isArray: __webpack_require__(75) }); var ctx = __webpack_require__(25); var $export = __webpack_require__(0); var toObject = __webpack_require__(12); -var call = __webpack_require__(150); +var call = __webpack_require__(157); var isArrayIter = __webpack_require__(109); var toLength = __webpack_require__(10); var createProperty = __webpack_require__(110); @@ -12671,7 +13099,7 @@ $export($export.S + $export.F * !__webpack_require__(77)(function (iter) { Array /***/ }), -/* 293 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12697,7 +13125,7 @@ $export($export.S + $export.F * __webpack_require__(4)(function () { /***/ }), -/* 294 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12716,7 +13144,7 @@ $export($export.P + $export.F * (__webpack_require__(64) != Object || !__webpack /***/ }), -/* 295 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12724,7 +13152,7 @@ $export($export.P + $export.F * (__webpack_require__(64) != Object || !__webpack var $export = __webpack_require__(0); var html = __webpack_require__(97); var cof = __webpack_require__(26); -var toAbsoluteIndex = __webpack_require__(44); +var toAbsoluteIndex = __webpack_require__(45); var toLength = __webpack_require__(10); var arraySlice = [].slice; @@ -12751,7 +13179,7 @@ $export($export.P + $export.F * __webpack_require__(4)(function () { /***/ }), -/* 296 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12781,7 +13209,7 @@ $export($export.P + $export.F * (fails(function () { /***/ }), -/* 297 */ +/* 305 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12799,7 +13227,7 @@ $export($export.P + $export.F * !STRICT, 'Array', { /***/ }), -/* 298 */ +/* 306 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(5); @@ -12821,7 +13249,7 @@ module.exports = function (original) { /***/ }), -/* 299 */ +/* 307 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12838,7 +13266,7 @@ $export($export.P + $export.F * !__webpack_require__(27)([].map, true), 'Array', /***/ }), -/* 300 */ +/* 308 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12855,7 +13283,7 @@ $export($export.P + $export.F * !__webpack_require__(27)([].filter, true), 'Arra /***/ }), -/* 301 */ +/* 309 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12872,7 +13300,7 @@ $export($export.P + $export.F * !__webpack_require__(27)([].some, true), 'Array' /***/ }), -/* 302 */ +/* 310 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12889,13 +13317,13 @@ $export($export.P + $export.F * !__webpack_require__(27)([].every, true), 'Array /***/ }), -/* 303 */ +/* 311 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__(0); -var $reduce = __webpack_require__(151); +var $reduce = __webpack_require__(158); $export($export.P + $export.F * !__webpack_require__(27)([].reduce, true), 'Array', { // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) @@ -12906,13 +13334,13 @@ $export($export.P + $export.F * !__webpack_require__(27)([].reduce, true), 'Arra /***/ }), -/* 304 */ +/* 312 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $export = __webpack_require__(0); -var $reduce = __webpack_require__(151); +var $reduce = __webpack_require__(158); $export($export.P + $export.F * !__webpack_require__(27)([].reduceRight, true), 'Array', { // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) @@ -12923,7 +13351,7 @@ $export($export.P + $export.F * !__webpack_require__(27)([].reduceRight, true), /***/ }), -/* 305 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12945,7 +13373,7 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(27)($nati /***/ }), -/* 306 */ +/* 314 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12974,19 +13402,19 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(27)($nati /***/ }), -/* 307 */ +/* 315 */ /***/ (function(module, exports, __webpack_require__) { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = __webpack_require__(0); -$export($export.P, 'Array', { copyWithin: __webpack_require__(152) }); +$export($export.P, 'Array', { copyWithin: __webpack_require__(159) }); __webpack_require__(38)('copyWithin'); /***/ }), -/* 308 */ +/* 316 */ /***/ (function(module, exports, __webpack_require__) { // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) @@ -12998,7 +13426,7 @@ __webpack_require__(38)('fill'); /***/ }), -/* 309 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13019,7 +13447,7 @@ __webpack_require__(38)(KEY); /***/ }), -/* 310 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13040,20 +13468,20 @@ __webpack_require__(38)(KEY); /***/ }), -/* 311 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(47)('Array'); +__webpack_require__(48)('Array'); /***/ }), -/* 312 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(3); var inheritIfRequired = __webpack_require__(100); var dP = __webpack_require__(9).f; -var gOPN = __webpack_require__(46).f; +var gOPN = __webpack_require__(47).f; var isRegExp = __webpack_require__(76); var $flags = __webpack_require__(78); var $RegExp = global.RegExp; @@ -13092,16 +13520,16 @@ if (__webpack_require__(8) && (!CORRECT_NEW || __webpack_require__(4)(function ( __webpack_require__(18)(global, 'RegExp', $RegExp); } -__webpack_require__(47)('RegExp'); +__webpack_require__(48)('RegExp'); /***/ }), -/* 313 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -__webpack_require__(154); +__webpack_require__(161); var anObject = __webpack_require__(2); var $flags = __webpack_require__(78); var DESCRIPTORS = __webpack_require__(8); @@ -13128,7 +13556,7 @@ if (__webpack_require__(4)(function () { return $toString.call({ source: 'a', fl /***/ }), -/* 314 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { // @@match logic @@ -13144,7 +13572,7 @@ __webpack_require__(79)('match', 1, function (defined, MATCH, $match) { /***/ }), -/* 315 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { // @@replace logic @@ -13162,7 +13590,7 @@ __webpack_require__(79)('replace', 2, function (defined, REPLACE, $replace) { /***/ }), -/* 316 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { // @@search logic @@ -13178,7 +13606,7 @@ __webpack_require__(79)('search', 1, function (defined, SEARCH, $search) { /***/ }), -/* 317 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { // @@split logic @@ -13255,26 +13683,26 @@ __webpack_require__(79)('split', 2, function (defined, SPLIT, $split) { /***/ }), -/* 318 */ +/* 326 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var LIBRARY = __webpack_require__(42); +var LIBRARY = __webpack_require__(43); var global = __webpack_require__(3); var ctx = __webpack_require__(25); var classof = __webpack_require__(66); var $export = __webpack_require__(0); var isObject = __webpack_require__(5); var aFunction = __webpack_require__(15); -var anInstance = __webpack_require__(48); -var forOf = __webpack_require__(49); +var anInstance = __webpack_require__(49); +var forOf = __webpack_require__(50); var speciesConstructor = __webpack_require__(80); var task = __webpack_require__(115).set; var microtask = __webpack_require__(116)(); var newPromiseCapabilityModule = __webpack_require__(117); -var perform = __webpack_require__(155); -var promiseResolve = __webpack_require__(156); +var perform = __webpack_require__(162); +var promiseResolve = __webpack_require__(163); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; @@ -13437,7 +13865,7 @@ if (!USE_NATIVE) { this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; - Internal.prototype = __webpack_require__(50)($Promise.prototype, { + Internal.prototype = __webpack_require__(51)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); @@ -13468,8 +13896,8 @@ if (!USE_NATIVE) { } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__webpack_require__(54)($Promise, PROMISE); -__webpack_require__(47)(PROMISE); +__webpack_require__(55)($Promise, PROMISE); +__webpack_require__(48)(PROMISE); Wrapper = __webpack_require__(28)[PROMISE]; // statics @@ -13535,13 +13963,13 @@ $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(77)(function /***/ }), -/* 319 */ +/* 327 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var weak = __webpack_require__(161); -var validate = __webpack_require__(57); +var weak = __webpack_require__(168); +var validate = __webpack_require__(58); var WEAK_SET = 'WeakSet'; // 23.4 WeakSet Objects @@ -13556,7 +13984,7 @@ __webpack_require__(81)(WEAK_SET, function (get) { /***/ }), -/* 320 */ +/* 328 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13565,7 +13993,7 @@ var $export = __webpack_require__(0); var $typed = __webpack_require__(82); var buffer = __webpack_require__(118); var anObject = __webpack_require__(2); -var toAbsoluteIndex = __webpack_require__(44); +var toAbsoluteIndex = __webpack_require__(45); var toLength = __webpack_require__(10); var isObject = __webpack_require__(5); var ArrayBuffer = __webpack_require__(3).ArrayBuffer; @@ -13605,11 +14033,11 @@ $export($export.P + $export.U + $export.F * __webpack_require__(4)(function () { } }); -__webpack_require__(47)(ARRAY_BUFFER); +__webpack_require__(48)(ARRAY_BUFFER); /***/ }), -/* 321 */ +/* 329 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); @@ -13619,7 +14047,7 @@ $export($export.G + $export.W + $export.F * !__webpack_require__(82).ABV, { /***/ }), -/* 322 */ +/* 330 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Int8', 1, function (init) { @@ -13630,7 +14058,7 @@ __webpack_require__(34)('Int8', 1, function (init) { /***/ }), -/* 323 */ +/* 331 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Uint8', 1, function (init) { @@ -13641,7 +14069,7 @@ __webpack_require__(34)('Uint8', 1, function (init) { /***/ }), -/* 324 */ +/* 332 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Uint8', 1, function (init) { @@ -13652,7 +14080,7 @@ __webpack_require__(34)('Uint8', 1, function (init) { /***/ }), -/* 325 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Int16', 2, function (init) { @@ -13663,7 +14091,7 @@ __webpack_require__(34)('Int16', 2, function (init) { /***/ }), -/* 326 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Uint16', 2, function (init) { @@ -13674,7 +14102,7 @@ __webpack_require__(34)('Uint16', 2, function (init) { /***/ }), -/* 327 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Int32', 4, function (init) { @@ -13685,7 +14113,7 @@ __webpack_require__(34)('Int32', 4, function (init) { /***/ }), -/* 328 */ +/* 336 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Uint32', 4, function (init) { @@ -13696,7 +14124,7 @@ __webpack_require__(34)('Uint32', 4, function (init) { /***/ }), -/* 329 */ +/* 337 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Float32', 4, function (init) { @@ -13707,7 +14135,7 @@ __webpack_require__(34)('Float32', 4, function (init) { /***/ }), -/* 330 */ +/* 338 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(34)('Float64', 8, function (init) { @@ -13718,7 +14146,7 @@ __webpack_require__(34)('Float64', 8, function (init) { /***/ }), -/* 331 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) @@ -13740,17 +14168,17 @@ $export($export.S + $export.F * !__webpack_require__(4)(function () { /***/ }), -/* 332 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = __webpack_require__(0); -var create = __webpack_require__(45); +var create = __webpack_require__(46); var aFunction = __webpack_require__(15); var anObject = __webpack_require__(2); var isObject = __webpack_require__(5); var fails = __webpack_require__(4); -var bind = __webpack_require__(142); +var bind = __webpack_require__(149); var rConstruct = (__webpack_require__(3).Reflect || {}).construct; // MS Edge supports only 2 arguments and argumentsList argument is optional @@ -13793,7 +14221,7 @@ $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { /***/ }), -/* 333 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) @@ -13822,7 +14250,7 @@ $export($export.S + $export.F * __webpack_require__(4)(function () { /***/ }), -/* 334 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.4 Reflect.deleteProperty(target, propertyKey) @@ -13839,7 +14267,7 @@ $export($export.S, 'Reflect', { /***/ }), -/* 335 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13872,7 +14300,7 @@ $export($export.S, 'Reflect', { /***/ }), -/* 336 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.6 Reflect.get(target, propertyKey [, receiver]) @@ -13899,7 +14327,7 @@ $export($export.S, 'Reflect', { get: get }); /***/ }), -/* 337 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) @@ -13915,7 +14343,7 @@ $export($export.S, 'Reflect', { /***/ }), -/* 338 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.8 Reflect.getPrototypeOf(target) @@ -13931,7 +14359,7 @@ $export($export.S, 'Reflect', { /***/ }), -/* 339 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.9 Reflect.has(target, propertyKey) @@ -13945,7 +14373,7 @@ $export($export.S, 'Reflect', { /***/ }), -/* 340 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.10 Reflect.isExtensible(target) @@ -13962,17 +14390,17 @@ $export($export.S, 'Reflect', { /***/ }), -/* 341 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.11 Reflect.ownKeys(target) var $export = __webpack_require__(0); -$export($export.S, 'Reflect', { ownKeys: __webpack_require__(163) }); +$export($export.S, 'Reflect', { ownKeys: __webpack_require__(170) }); /***/ }), -/* 342 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.12 Reflect.preventExtensions(target) @@ -13994,7 +14422,7 @@ $export($export.S, 'Reflect', { /***/ }), -/* 343 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) @@ -14003,7 +14431,7 @@ var gOPD = __webpack_require__(21); var getPrototypeOf = __webpack_require__(22); var has = __webpack_require__(16); var $export = __webpack_require__(0); -var createDesc = __webpack_require__(40); +var createDesc = __webpack_require__(41); var anObject = __webpack_require__(2); var isObject = __webpack_require__(5); @@ -14031,7 +14459,7 @@ $export($export.S, 'Reflect', { set: set }); /***/ }), -/* 344 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { // 26.1.14 Reflect.setPrototypeOf(target, proto) @@ -14052,7 +14480,7 @@ if (setProto) $export($export.S, 'Reflect', { /***/ }), -/* 345 */ +/* 353 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14071,14 +14499,14 @@ __webpack_require__(38)('includes'); /***/ }), -/* 346 */ +/* 354 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(164); +var flattenIntoArray = __webpack_require__(171); var toObject = __webpack_require__(12); var toLength = __webpack_require__(10); var aFunction = __webpack_require__(15); @@ -14100,14 +14528,14 @@ __webpack_require__(38)('flatMap'); /***/ }), -/* 347 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(164); +var flattenIntoArray = __webpack_require__(171); var toObject = __webpack_require__(12); var toLength = __webpack_require__(10); var toInteger = __webpack_require__(31); @@ -14128,7 +14556,7 @@ __webpack_require__(38)('flatten'); /***/ }), -/* 348 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14145,14 +14573,14 @@ $export($export.P, 'String', { /***/ }), -/* 349 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-string-pad-start-end var $export = __webpack_require__(0); -var $pad = __webpack_require__(165); +var $pad = __webpack_require__(172); var userAgent = __webpack_require__(119); // https://github.com/zloirock/core-js/issues/280 @@ -14164,14 +14592,14 @@ $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAge /***/ }), -/* 350 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-string-pad-start-end var $export = __webpack_require__(0); -var $pad = __webpack_require__(165); +var $pad = __webpack_require__(172); var userAgent = __webpack_require__(119); // https://github.com/zloirock/core-js/issues/280 @@ -14183,13 +14611,13 @@ $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAge /***/ }), -/* 351 */ +/* 359 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(55)('trimLeft', function ($trim) { +__webpack_require__(56)('trimLeft', function ($trim) { return function trimLeft() { return $trim(this, 1); }; @@ -14197,13 +14625,13 @@ __webpack_require__(55)('trimLeft', function ($trim) { /***/ }), -/* 352 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(55)('trimRight', function ($trim) { +__webpack_require__(56)('trimRight', function ($trim) { return function trimRight() { return $trim(this, 2); }; @@ -14211,7 +14639,7 @@ __webpack_require__(55)('trimRight', function ($trim) { /***/ }), -/* 353 */ +/* 361 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14248,26 +14676,26 @@ $export($export.P, 'String', { /***/ }), -/* 354 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(94)('asyncIterator'); /***/ }), -/* 355 */ +/* 363 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(94)('observable'); /***/ }), -/* 356 */ +/* 364 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = __webpack_require__(0); -var ownKeys = __webpack_require__(163); +var ownKeys = __webpack_require__(170); var toIObject = __webpack_require__(20); var gOPD = __webpack_require__(21); var createProperty = __webpack_require__(110); @@ -14290,12 +14718,12 @@ $export($export.S, 'Object', { /***/ }), -/* 357 */ +/* 365 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries var $export = __webpack_require__(0); -var $values = __webpack_require__(166)(false); +var $values = __webpack_require__(173)(false); $export($export.S, 'Object', { values: function values(it) { @@ -14305,12 +14733,12 @@ $export($export.S, 'Object', { /***/ }), -/* 358 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries var $export = __webpack_require__(0); -var $entries = __webpack_require__(166)(true); +var $entries = __webpack_require__(173)(true); $export($export.S, 'Object', { entries: function entries(it) { @@ -14320,7 +14748,7 @@ $export($export.S, 'Object', { /***/ }), -/* 359 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14339,7 +14767,7 @@ __webpack_require__(8) && $export($export.P + __webpack_require__(83), 'Object', /***/ }), -/* 360 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14358,7 +14786,7 @@ __webpack_require__(8) && $export($export.P + __webpack_require__(83), 'Object', /***/ }), -/* 361 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14383,7 +14811,7 @@ __webpack_require__(8) && $export($export.P + __webpack_require__(83), 'Object', /***/ }), -/* 362 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14408,27 +14836,27 @@ __webpack_require__(8) && $export($export.P + __webpack_require__(83), 'Object', /***/ }), -/* 363 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = __webpack_require__(0); -$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(167)('Map') }); +$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(174)('Map') }); /***/ }), -/* 364 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = __webpack_require__(0); -$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(167)('Set') }); +$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(174)('Set') }); /***/ }), -/* 365 */ +/* 373 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of @@ -14436,7 +14864,7 @@ __webpack_require__(84)('Map'); /***/ }), -/* 366 */ +/* 374 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of @@ -14444,7 +14872,7 @@ __webpack_require__(84)('Set'); /***/ }), -/* 367 */ +/* 375 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of @@ -14452,7 +14880,7 @@ __webpack_require__(84)('WeakMap'); /***/ }), -/* 368 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of @@ -14460,7 +14888,7 @@ __webpack_require__(84)('WeakSet'); /***/ }), -/* 369 */ +/* 377 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from @@ -14468,7 +14896,7 @@ __webpack_require__(85)('Map'); /***/ }), -/* 370 */ +/* 378 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from @@ -14476,7 +14904,7 @@ __webpack_require__(85)('Set'); /***/ }), -/* 371 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from @@ -14484,7 +14912,7 @@ __webpack_require__(85)('WeakMap'); /***/ }), -/* 372 */ +/* 380 */ /***/ (function(module, exports, __webpack_require__) { // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from @@ -14492,7 +14920,7 @@ __webpack_require__(85)('WeakSet'); /***/ }), -/* 373 */ +/* 381 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-global @@ -14502,7 +14930,7 @@ $export($export.G, { global: __webpack_require__(3) }); /***/ }), -/* 374 */ +/* 382 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-global @@ -14512,7 +14940,7 @@ $export($export.S, 'System', { global: __webpack_require__(3) }); /***/ }), -/* 375 */ +/* 383 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/ljharb/proposal-is-error @@ -14527,7 +14955,7 @@ $export($export.S, 'Error', { /***/ }), -/* 376 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ @@ -14541,7 +14969,7 @@ $export($export.S, 'Math', { /***/ }), -/* 377 */ +/* 385 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ @@ -14551,7 +14979,7 @@ $export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); /***/ }), -/* 378 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ @@ -14566,13 +14994,13 @@ $export($export.S, 'Math', { /***/ }), -/* 379 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ var $export = __webpack_require__(0); -var scale = __webpack_require__(169); -var fround = __webpack_require__(149); +var scale = __webpack_require__(176); +var fround = __webpack_require__(156); $export($export.S, 'Math', { fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { @@ -14582,7 +15010,7 @@ $export($export.S, 'Math', { /***/ }), -/* 380 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 @@ -14599,7 +15027,7 @@ $export($export.S, 'Math', { /***/ }), -/* 381 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 @@ -14616,7 +15044,7 @@ $export($export.S, 'Math', { /***/ }), -/* 382 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 @@ -14638,7 +15066,7 @@ $export($export.S, 'Math', { /***/ }), -/* 383 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ @@ -14648,7 +15076,7 @@ $export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); /***/ }), -/* 384 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ @@ -14663,17 +15091,17 @@ $export($export.S, 'Math', { /***/ }), -/* 385 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { // https://rwaldron.github.io/proposal-math-extensions/ var $export = __webpack_require__(0); -$export($export.S, 'Math', { scale: __webpack_require__(169) }); +$export($export.S, 'Math', { scale: __webpack_require__(176) }); /***/ }), -/* 386 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 @@ -14695,7 +15123,7 @@ $export($export.S, 'Math', { /***/ }), -/* 387 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { // http://jfbastien.github.io/papers/Math.signbit.html @@ -14708,7 +15136,7 @@ $export($export.S, 'Math', { signbit: function signbit(x) { /***/ }), -/* 388 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14718,7 +15146,7 @@ var $export = __webpack_require__(0); var core = __webpack_require__(28); var global = __webpack_require__(3); var speciesConstructor = __webpack_require__(80); -var promiseResolve = __webpack_require__(156); +var promiseResolve = __webpack_require__(163); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); @@ -14735,7 +15163,7 @@ $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { /***/ }), -/* 389 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14743,7 +15171,7 @@ $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { // https://github.com/tc39/proposal-promise-try var $export = __webpack_require__(0); var newPromiseCapability = __webpack_require__(117); -var perform = __webpack_require__(155); +var perform = __webpack_require__(162); $export($export.S, 'Promise', { 'try': function (callbackfn) { var promiseCapability = newPromiseCapability.f(this); @@ -14754,7 +15182,7 @@ $export($export.S, 'Promise', { 'try': function (callbackfn) { /***/ }), -/* 390 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14768,7 +15196,7 @@ metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValu /***/ }), -/* 391 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14789,7 +15217,7 @@ metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , /***/ }), -/* 392 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14812,11 +15240,11 @@ metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , target /***/ }), -/* 393 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { -var Set = __webpack_require__(159); -var from = __webpack_require__(168); +var Set = __webpack_require__(166); +var from = __webpack_require__(175); var metadata = __webpack_require__(35); var anObject = __webpack_require__(2); var getPrototypeOf = __webpack_require__(22); @@ -14837,7 +15265,7 @@ metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey * /***/ }), -/* 394 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14852,7 +15280,7 @@ metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , /***/ }), -/* 395 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14866,7 +15294,7 @@ metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targe /***/ }), -/* 396 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14888,7 +15316,7 @@ metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , target /***/ }), -/* 397 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { var metadata = __webpack_require__(35); @@ -14903,7 +15331,7 @@ metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , /***/ }), -/* 398 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { var $metadata = __webpack_require__(35); @@ -14924,7 +15352,7 @@ $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { /***/ }), -/* 399 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask @@ -14942,7 +15370,7 @@ $export($export.G, { /***/ }), -/* 400 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14955,10 +15383,10 @@ var microtask = __webpack_require__(116)(); var OBSERVABLE = __webpack_require__(6)('observable'); var aFunction = __webpack_require__(15); var anObject = __webpack_require__(2); -var anInstance = __webpack_require__(48); -var redefineAll = __webpack_require__(50); +var anInstance = __webpack_require__(49); +var redefineAll = __webpack_require__(51); var hide = __webpack_require__(17); -var forOf = __webpack_require__(49); +var forOf = __webpack_require__(50); var RETURN = forOf.RETURN; var getMethod = function (fn) { @@ -15144,11 +15572,11 @@ hide($Observable.prototype, OBSERVABLE, function () { return this; }); $export($export.G, { Observable: $Observable }); -__webpack_require__(47)('Observable'); +__webpack_require__(48)('Observable'); /***/ }), -/* 401 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { // ie9- setTimeout & setInterval additional parameters fix @@ -15174,7 +15602,7 @@ $export($export.G + $export.B + $export.F * MSIE, { /***/ }), -/* 402 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(0); @@ -15186,15 +15614,15 @@ $export($export.G + $export.B, { /***/ }), -/* 403 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { var $iterators = __webpack_require__(114); -var getKeys = __webpack_require__(43); +var getKeys = __webpack_require__(44); var redefine = __webpack_require__(18); var global = __webpack_require__(3); var hide = __webpack_require__(17); -var Iterators = __webpack_require__(56); +var Iterators = __webpack_require__(57); var wks = __webpack_require__(6); var ITERATOR = wks('iterator'); var TO_STRING_TAG = wks('toStringTag'); @@ -15250,7 +15678,7 @@ for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++ /***/ }), -/* 404 */ +/* 412 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -15993,26 +16421,26 @@ for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(63))) /***/ }), -/* 405 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(406); +__webpack_require__(414); module.exports = __webpack_require__(28).RegExp.escape; /***/ }), -/* 406 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/benjamingr/RexExp.escape var $export = __webpack_require__(0); -var $re = __webpack_require__(407)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); +var $re = __webpack_require__(415)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); /***/ }), -/* 407 */ +/* 415 */ /***/ (function(module, exports) { module.exports = function (regExp, replace) { @@ -16026,7 +16454,7 @@ module.exports = function (regExp, replace) { /***/ }), -/* 408 */ +/* 416 */ /***/ (function(module, exports) { (function(self) { @@ -16493,7 +16921,7 @@ module.exports = function (regExp, replace) { /***/ }), -/* 409 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16503,7 +16931,7 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(412); +var _reactDom = __webpack_require__(420); var _reactRedux = __webpack_require__(13); @@ -16511,23 +16939,23 @@ var _redux = __webpack_require__(123); var _reactRouterDom = __webpack_require__(36); -var _reducers = __webpack_require__(471); +var _reducers = __webpack_require__(479); var _reducers2 = _interopRequireDefault(_reducers); -var _reduxSaga = __webpack_require__(193); +var _reduxSaga = __webpack_require__(200); var _reduxSaga2 = _interopRequireDefault(_reduxSaga); -var _sagas = __webpack_require__(482); +var _sagas = __webpack_require__(490); var _sagas2 = _interopRequireDefault(_sagas); -var _GAListener = __webpack_require__(497); +var _GAListener = __webpack_require__(502); var _GAListener2 = _interopRequireDefault(_GAListener); -var _app = __webpack_require__(499); +var _app = __webpack_require__(504); var _app2 = _interopRequireDefault(_app); @@ -16571,7 +16999,7 @@ sagaMiddleware.run(_sagas2.default); ), document.getElementById('react-app')); /***/ }), -/* 410 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16584,7 +17012,7 @@ sagaMiddleware.run(_sagas2.default); * LICENSE file in the root directory of this source tree. */ -var m=__webpack_require__(58),n=__webpack_require__(86),p=__webpack_require__(39),q="function"===typeof Symbol&&Symbol["for"],r=q?Symbol["for"]("react.element"):60103,t=q?Symbol["for"]("react.call"):60104,u=q?Symbol["for"]("react.return"):60105,v=q?Symbol["for"]("react.portal"):60106,w=q?Symbol["for"]("react.fragment"):60107,x="function"===typeof Symbol&&Symbol.iterator; +var m=__webpack_require__(59),n=__webpack_require__(86),p=__webpack_require__(39),q="function"===typeof Symbol&&Symbol["for"],r=q?Symbol["for"]("react.element"):60103,t=q?Symbol["for"]("react.call"):60104,u=q?Symbol["for"]("react.return"):60105,v=q?Symbol["for"]("react.portal"):60106,w=q?Symbol["for"]("react.fragment"):60107,x="function"===typeof Symbol&&Symbol.iterator; function y(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;c= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } @@ -34776,7 +35204,7 @@ function createConnect() { /* harmony default export */ __webpack_exports__["a"] = (createConnect()); /***/ }), -/* 426 */ +/* 434 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -34813,7 +35241,7 @@ function shallowEqual(objA, objB) { } /***/ }), -/* 427 */ +/* 435 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -34821,7 +35249,7 @@ function shallowEqual(objA, objB) { /* unused harmony export whenMapDispatchToPropsIsMissing */ /* unused harmony export whenMapDispatchToPropsIsObject */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(123); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(190); @@ -34844,13 +35272,13 @@ function whenMapDispatchToPropsIsObject(mapDispatchToProps) { /* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]); /***/ }), -/* 428 */ +/* 436 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(180); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(431); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(432); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(187); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(439); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(440); @@ -34882,11 +35310,11 @@ function baseGetTag(value) { /***/ }), -/* 429 */ +/* 437 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(430); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(438); /** Detect free variable `self`. */ @@ -34899,7 +35327,7 @@ var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || fr /***/ }), -/* 430 */ +/* 438 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -34911,11 +35339,11 @@ var freeGlobal = typeof global == 'object' && global && global.Object === Object /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(63))) /***/ }), -/* 431 */ +/* 439 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(180); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(187); /** Used for built-in method references. */ @@ -34965,7 +35393,7 @@ function getRawTag(value) { /***/ }), -/* 432 */ +/* 440 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -34994,11 +35422,11 @@ function objectToString(value) { /***/ }), -/* 433 */ +/* 441 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(434); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(442); /** Built-in value references. */ @@ -35008,7 +35436,7 @@ var getPrototype = Object(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* defau /***/ }), -/* 434 */ +/* 442 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35030,7 +35458,7 @@ function overArg(func, transform) { /***/ }), -/* 435 */ +/* 443 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35066,11 +35494,11 @@ function isObjectLike(value) { /***/ }), -/* 436 */ +/* 444 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(438); +/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(446); /* global window */ @@ -35091,10 +35519,10 @@ if (typeof self !== 'undefined') { var result = Object(__WEBPACK_IMPORTED_MODULE_0__ponyfill_js__["a" /* default */])(root); /* harmony default export */ __webpack_exports__["a"] = (result); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(63), __webpack_require__(437)(module))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(63), __webpack_require__(445)(module))) /***/ }), -/* 437 */ +/* 445 */ /***/ (function(module, exports) { module.exports = function(originalModule) { @@ -35124,7 +35552,7 @@ module.exports = function(originalModule) { /***/ }), -/* 438 */ +/* 446 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35149,14 +35577,14 @@ function symbolObservablePonyfill(root) { /***/ }), -/* 439 */ +/* 447 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(179); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(186); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(124); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(181); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(188); @@ -35290,7 +35718,7 @@ function combineReducers(reducers) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 440 */ +/* 448 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35344,12 +35772,12 @@ function bindActionCreators(actionCreators, dispatch) { } /***/ }), -/* 441 */ +/* 449 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(182); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(189); var _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; }; @@ -35400,13 +35828,13 @@ function applyMiddleware() { } /***/ }), -/* 442 */ +/* 450 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export whenMapStateToPropsIsFunction */ /* unused harmony export whenMapStateToPropsIsMissing */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(190); function whenMapStateToPropsIsFunction(mapStateToProps) { @@ -35422,7 +35850,7 @@ function whenMapStateToPropsIsMissing(mapStateToProps) { /* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]); /***/ }), -/* 443 */ +/* 451 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35430,7 +35858,7 @@ function whenMapStateToPropsIsMissing(mapStateToProps) { /* unused harmony export wrapMergePropsFunc */ /* unused harmony export whenMergePropsIsFunction */ /* unused harmony export whenMergePropsIsOmitted */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(184); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(191); var _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; }; @@ -35479,14 +35907,14 @@ function whenMergePropsIsOmitted(mergeProps) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 444 */ +/* 452 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export impureFinalPropsSelectorFactory */ /* unused harmony export pureFinalPropsSelectorFactory */ /* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(445); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(453); function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } @@ -35592,7 +36020,7 @@ function finalPropsSelectorFactory(dispatch, _ref2) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 445 */ +/* 453 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35617,7 +36045,7 @@ function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, dis } /***/ }), -/* 446 */ +/* 454 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -35627,7 +36055,7 @@ function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, dis /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory__ = __webpack_require__(447); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory__ = __webpack_require__(455); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(127); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -35684,7 +36112,7 @@ BrowserRouter.propTypes = { /* harmony default export */ __webpack_exports__["a"] = (BrowserRouter); /***/ }), -/* 447 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35712,7 +36140,7 @@ var _createTransitionManager = __webpack_require__(126); var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); -var _DOMUtils = __webpack_require__(187); +var _DOMUtils = __webpack_require__(194); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -35997,7 +36425,7 @@ var createBrowserHistory = function createBrowserHistory() { exports.default = createBrowserHistory; /***/ }), -/* 448 */ +/* 456 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -36007,7 +36435,7 @@ exports.default = createBrowserHistory; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createHashHistory__ = __webpack_require__(449); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createHashHistory__ = __webpack_require__(457); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_createHashHistory__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(127); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -36063,7 +36491,7 @@ HashRouter.propTypes = { /* harmony default export */ __webpack_exports__["a"] = (HashRouter); /***/ }), -/* 449 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36089,7 +36517,7 @@ var _createTransitionManager = __webpack_require__(126); var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); -var _DOMUtils = __webpack_require__(187); +var _DOMUtils = __webpack_require__(194); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -36393,18 +36821,18 @@ var createHashHistory = function createHashHistory() { exports.default = createHashHistory; /***/ }), -/* 450 */ +/* 458 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__ = __webpack_require__(451); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__ = __webpack_require__(459); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__["a" /* default */]); /***/ }), -/* 451 */ +/* 459 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -36414,7 +36842,7 @@ exports.default = createHashHistory; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory__ = __webpack_require__(452); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory__ = __webpack_require__(460); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(128); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -36471,7 +36899,7 @@ MemoryRouter.propTypes = { /* harmony default export */ __webpack_exports__["a"] = (MemoryRouter); /***/ }), -/* 452 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36647,7 +37075,7 @@ var createMemoryHistory = function createMemoryHistory() { exports.default = createMemoryHistory; /***/ }), -/* 453 */ +/* 461 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -36655,8 +37083,8 @@ exports.default = createMemoryHistory; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Route__ = __webpack_require__(189); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(188); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Route__ = __webpack_require__(196); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(195); var _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; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -36728,10 +37156,10 @@ NavLink.defaultProps = { /* harmony default export */ __webpack_exports__["a"] = (NavLink); /***/ }), -/* 454 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { -var isarray = __webpack_require__(455) +var isarray = __webpack_require__(463) /** * Expose `pathToRegexp`. @@ -37160,7 +37588,7 @@ function pathToRegexp (path, keys, options) { /***/ }), -/* 455 */ +/* 463 */ /***/ (function(module, exports) { module.exports = Array.isArray || function (arr) { @@ -37169,18 +37597,18 @@ module.exports = Array.isArray || function (arr) { /***/ }), -/* 456 */ +/* 464 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__ = __webpack_require__(457); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__ = __webpack_require__(465); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__["a" /* default */]); /***/ }), -/* 457 */ +/* 465 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37271,18 +37699,18 @@ Prompt.contextTypes = { /* harmony default export */ __webpack_exports__["a"] = (Prompt); /***/ }), -/* 458 */ +/* 466 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__ = __webpack_require__(459); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__ = __webpack_require__(467); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__["a" /* default */]); /***/ }), -/* 459 */ +/* 467 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37294,7 +37722,7 @@ Prompt.contextTypes = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(23); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(460); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(468); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -37390,15 +37818,15 @@ Redirect.contextTypes = { /* harmony default export */ __webpack_exports__["a"] = (Redirect); /***/ }), -/* 460 */ +/* 468 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createBrowserHistory__ = __webpack_require__(461); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createBrowserHistory__ = __webpack_require__(469); /* unused harmony reexport createBrowserHistory */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createHashHistory__ = __webpack_require__(462); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createHashHistory__ = __webpack_require__(470); /* unused harmony reexport createHashHistory */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createMemoryHistory__ = __webpack_require__(463); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createMemoryHistory__ = __webpack_require__(471); /* unused harmony reexport createMemoryHistory */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__LocationUtils__ = __webpack_require__(88); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__LocationUtils__["a"]; }); @@ -37417,7 +37845,7 @@ Redirect.contextTypes = { /***/ }), -/* 461 */ +/* 469 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37428,7 +37856,7 @@ Redirect.contextTypes = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__PathUtils__ = __webpack_require__(69); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__createTransitionManager__ = __webpack_require__(130); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(191); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(198); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _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; }; @@ -37721,7 +38149,7 @@ var createBrowserHistory = function createBrowserHistory() { /* unused harmony default export */ var _unused_webpack_default_export = (createBrowserHistory); /***/ }), -/* 462 */ +/* 470 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37732,7 +38160,7 @@ var createBrowserHistory = function createBrowserHistory() { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__PathUtils__ = __webpack_require__(69); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__createTransitionManager__ = __webpack_require__(130); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(191); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(198); var _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; }; @@ -38042,7 +38470,7 @@ var createHashHistory = function createHashHistory() { /* unused harmony default export */ var _unused_webpack_default_export = (createHashHistory); /***/ }), -/* 463 */ +/* 471 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -38210,18 +38638,18 @@ var createMemoryHistory = function createMemoryHistory() { /* unused harmony default export */ var _unused_webpack_default_export = (createMemoryHistory); /***/ }), -/* 464 */ +/* 472 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__ = __webpack_require__(465); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__ = __webpack_require__(473); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__["a" /* default */]); /***/ }), -/* 465 */ +/* 473 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -38404,18 +38832,18 @@ StaticRouter.childContextTypes = { /* harmony default export */ __webpack_exports__["a"] = (StaticRouter); /***/ }), -/* 466 */ +/* 474 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__ = __webpack_require__(467); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__ = __webpack_require__(475); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__["a" /* default */]); /***/ }), -/* 467 */ +/* 475 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -38509,7 +38937,7 @@ Switch.propTypes = { /* harmony default export */ __webpack_exports__["a"] = (Switch); /***/ }), -/* 468 */ +/* 476 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -38520,18 +38948,18 @@ Switch.propTypes = { /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_matchPath__["a" /* default */]); /***/ }), -/* 469 */ +/* 477 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__ = __webpack_require__(470); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__ = __webpack_require__(478); // Written in this round about way for babel-transform-imports /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__["a" /* default */]); /***/ }), -/* 470 */ +/* 478 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -38539,9 +38967,9 @@ Switch.propTypes = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(178); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(185); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(190); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(197); var _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; }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } @@ -38576,7 +39004,7 @@ var withRouter = function withRouter(Component) { /* harmony default export */ __webpack_exports__["a"] = (withRouter); /***/ }), -/* 471 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38588,19 +39016,19 @@ Object.defineProperty(exports, "__esModule", { var _redux = __webpack_require__(123); -var _publish = __webpack_require__(472); +var _publish = __webpack_require__(480); var _publish2 = _interopRequireDefault(_publish); -var _channel = __webpack_require__(474); +var _channel = __webpack_require__(482); var _channel2 = _interopRequireDefault(_channel); -var _show = __webpack_require__(475); +var _show = __webpack_require__(483); var _show2 = _interopRequireDefault(_show); -var _site = __webpack_require__(476); +var _site = __webpack_require__(484); var _site2 = _interopRequireDefault(_site); @@ -38614,7 +39042,7 @@ exports.default = (0, _redux.combineReducers)({ }); /***/ }), -/* 472 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38676,7 +39104,7 @@ var _publish_action_types = __webpack_require__(131); var actions = _interopRequireWildcard(_publish_action_types); -var _publish_channel_select_states = __webpack_require__(473); +var _publish_channel_select_states = __webpack_require__(481); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -38713,7 +39141,7 @@ var initialState = { }; /***/ }), -/* 473 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38726,7 +39154,7 @@ var LOGIN = exports.LOGIN = 'Existing'; var CREATE = exports.CREATE = 'New'; /***/ }), -/* 474 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38750,7 +39178,7 @@ exports.default = function () { } }; -var _channel_action_types = __webpack_require__(192); +var _channel_action_types = __webpack_require__(199); var actions = _interopRequireWildcard(_channel_action_types); @@ -38765,7 +39193,7 @@ var initialState = { }; /***/ }), -/* 475 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38848,7 +39276,7 @@ exports.default = function () { } }; -var _show_action_types = __webpack_require__(59); +var _show_action_types = __webpack_require__(60); var actions = _interopRequireWildcard(_show_action_types); @@ -38874,7 +39302,7 @@ var initialState = { }; /***/ }), -/* 476 */ +/* 484 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38918,14 +39346,14 @@ var initialState = { }; /***/ }), -/* 477 */ +/* 485 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = sagaMiddlewareFactory; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__channel__ = __webpack_require__(60); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__runSaga__ = __webpack_require__(195); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__channel__ = __webpack_require__(61); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__runSaga__ = __webpack_require__(202); function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } @@ -39012,14 +39440,14 @@ function sagaMiddlewareFactory() { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(7))) /***/ }), -/* 478 */ +/* 486 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = takeEvery; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fsmIterator__ = __webpack_require__(133); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__io__ = __webpack_require__(51); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__io__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(61); @@ -39050,14 +39478,14 @@ function takeEvery(patternOrChannel, worker) { } /***/ }), -/* 479 */ +/* 487 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = takeLatest; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fsmIterator__ = __webpack_require__(133); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__io__ = __webpack_require__(51); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__io__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(61); @@ -39098,14 +39526,14 @@ function takeLatest(patternOrChannel, worker) { } /***/ }), -/* 480 */ +/* 488 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = throttle; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fsmIterator__ = __webpack_require__(133); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__io__ = __webpack_require__(51); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__io__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel__ = __webpack_require__(61); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__buffers__ = __webpack_require__(90); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(24); @@ -39155,7 +39583,7 @@ function throttle(delayLength, pattern, worker) { } /***/ }), -/* 481 */ +/* 489 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -39169,16 +39597,16 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "arrayOfDeffered", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["g"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createMockTask", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["j"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "cloneableGenerator", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["i"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_io__ = __webpack_require__(51); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_io__ = __webpack_require__(52); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asEffect", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_io__["d"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_proc__ = __webpack_require__(196); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_proc__ = __webpack_require__(203); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CHANNEL_END", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_proc__["a"]; }); /***/ }), -/* 482 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39189,17 +39617,17 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = rootSaga; -var _effects = __webpack_require__(52); +var _effects = __webpack_require__(53); -var _show_uri = __webpack_require__(483); +var _show_uri = __webpack_require__(491); -var _show_asset = __webpack_require__(199); +var _show_asset = __webpack_require__(206); -var _show_channel = __webpack_require__(200); +var _show_channel = __webpack_require__(207); -var _file = __webpack_require__(488); +var _file = __webpack_require__(495); -var _publish = __webpack_require__(490); +var _publish = __webpack_require__(497); var _marked = /*#__PURE__*/regeneratorRuntime.mark(rootSaga); @@ -39220,7 +39648,7 @@ function rootSaga() { } /***/ }), -/* 483 */ +/* 491 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39232,19 +39660,19 @@ Object.defineProperty(exports, "__esModule", { exports.handleShowPageUri = handleShowPageUri; exports.watchHandleShowPageUri = watchHandleShowPageUri; -var _effects = __webpack_require__(52); +var _effects = __webpack_require__(53); -var _show_action_types = __webpack_require__(59); +var _show_action_types = __webpack_require__(60); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); -var _show_asset = __webpack_require__(199); +var _show_asset = __webpack_require__(206); -var _show_channel = __webpack_require__(200); +var _show_channel = __webpack_require__(207); -var _lbryUri = __webpack_require__(487); +var _lbryUri = __webpack_require__(134); var _lbryUri2 = _interopRequireDefault(_lbryUri); @@ -39432,7 +39860,7 @@ function watchHandleShowPageUri() { }; /***/ }), -/* 484 */ +/* 492 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39445,7 +39873,7 @@ exports.getLongClaimId = getLongClaimId; exports.getShortId = getShortId; exports.getClaimData = getClaimData; -var _request = __webpack_require__(61); +var _request = __webpack_require__(40); var _request2 = _interopRequireDefault(_request); @@ -39485,7 +39913,7 @@ function getClaimData(host, name, claimId) { }; /***/ }), -/* 485 */ +/* 493 */ /***/ (function(module, exports) { (function(self) { @@ -39957,7 +40385,7 @@ function getClaimData(host, name, claimId) { /***/ }), -/* 486 */ +/* 494 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39969,7 +40397,7 @@ Object.defineProperty(exports, "__esModule", { exports.getChannelData = getChannelData; exports.getChannelClaims = getChannelClaims; -var _request = __webpack_require__(61); +var _request = __webpack_require__(40); var _request2 = _interopRequireDefault(_request); @@ -39988,118 +40416,7 @@ function getChannelClaims(host, longId, name, page) { }; /***/ }), -/* 487 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(arr, i) { 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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -module.exports = { - REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g, - REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g, - REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/, - CHANNEL_CHAR: '@', - parseIdentifier: function parseIdentifier(identifier) { - var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end) - '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end) - ); - - var _componentsRegex$exec = componentsRegex // eslint-disable-line no-unused-vars - .exec(identifier).map(function (match) { - return match || null; - }), - _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4), - proto = _componentsRegex$exec2[0], - value = _componentsRegex$exec2[1], - modifierSeperator = _componentsRegex$exec2[2], - modifier = _componentsRegex$exec2[3]; - - // Validate and process name - - - if (!value) { - throw new Error('Check your URL. No channel name provided before "' + modifierSeperator + '"'); - } - var isChannel = value.startsWith(module.exports.CHANNEL_CHAR); - var channelName = isChannel ? value : null; - var claimId = void 0; - if (isChannel) { - if (!channelName) { - throw new Error('Check your URL. No channel name after "@".'); - } - var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL); - if (nameBadChars) { - throw new Error('Check your URL. Invalid characters in channel name: "' + nameBadChars.join(', ') + '".'); - } - } else { - claimId = value; - } - - // Validate and process modifier - var channelClaimId = void 0; - if (modifierSeperator) { - if (!modifier) { - throw new Error('Check your URL. No modifier provided after separator "' + modifierSeperator + '"'); - } - - if (modifierSeperator === ':') { - channelClaimId = modifier; - } else { - throw new Error('Check your URL. The "' + modifierSeperator + '" modifier is not currently supported'); - } - } - return { - isChannel: isChannel, - channelName: channelName, - channelClaimId: channelClaimId || null, - claimId: claimId || null - }; - }, - parseClaim: function parseClaim(name) { - var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first extension) - '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end) - ); - - var _componentsRegex$exec3 = componentsRegex // eslint-disable-line no-unused-vars - .exec(name).map(function (match) { - return match || null; - }), - _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4), - proto = _componentsRegex$exec4[0], - claimName = _componentsRegex$exec4[1], - extensionSeperator = _componentsRegex$exec4[2], - extension = _componentsRegex$exec4[3]; - - // Validate and process name - - - if (!claimName) { - throw new Error('Check your URL. No claim name provided before "."'); - } - var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM); - if (nameBadChars) { - throw new Error('Check your URL. Invalid characters in claim name: "' + nameBadChars.join(', ') + '".'); - } - // Validate and process extension - if (extensionSeperator) { - if (!extension) { - throw new Error('Check your URL. No file extension provided after separator "' + extensionSeperator + '".'); - } - if (extensionSeperator !== '.') { - throw new Error('Check your URL. The "' + extensionSeperator + '" separator is not supported in the claim name.'); - } - } - return { - claimName: claimName, - extension: extension || null - }; - } -}; - -/***/ }), -/* 488 */ +/* 495 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40110,17 +40427,17 @@ Object.defineProperty(exports, "__esModule", { }); exports.watchFileIsRequested = watchFileIsRequested; -var _effects = __webpack_require__(52); +var _effects = __webpack_require__(53); -var _show_action_types = __webpack_require__(59); +var _show_action_types = __webpack_require__(60); var actions = _interopRequireWildcard(_show_action_types); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); var _asset_display_states = __webpack_require__(132); -var _fileApi = __webpack_require__(489); +var _fileApi = __webpack_require__(496); var _site = __webpack_require__(91); @@ -40235,7 +40552,7 @@ function watchFileIsRequested() { }; /***/ }), -/* 489 */ +/* 496 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40247,7 +40564,7 @@ Object.defineProperty(exports, "__esModule", { exports.checkFileAvailability = checkFileAvailability; exports.triggerClaimGet = triggerClaimGet; -var _request = __webpack_require__(61); +var _request = __webpack_require__(40); var _request2 = _interopRequireDefault(_request); @@ -40264,7 +40581,7 @@ function triggerClaimGet(claimId, host, name) { } /***/ }), -/* 490 */ +/* 497 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40275,29 +40592,29 @@ Object.defineProperty(exports, "__esModule", { }); exports.watchPublishStart = watchPublishStart; -var _effects = __webpack_require__(52); +var _effects = __webpack_require__(53); var _publish_action_types = __webpack_require__(131); var actions = _interopRequireWildcard(_publish_action_types); -var _publish_claim_states = __webpack_require__(491); +var _publish_claim_states = __webpack_require__(498); var publishStates = _interopRequireWildcard(_publish_claim_states); var _publish = __webpack_require__(92); -var _publish2 = __webpack_require__(492); +var _publish2 = __webpack_require__(499); -var _channel = __webpack_require__(493); +var _channel = __webpack_require__(500); var _site = __webpack_require__(91); -var _validate = __webpack_require__(494); +var _validate = __webpack_require__(135); -var _publish3 = __webpack_require__(495); +var _publish3 = __webpack_require__(136); -var _publish4 = __webpack_require__(496); +var _publish4 = __webpack_require__(501); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -40485,7 +40802,7 @@ function watchPublishStart() { }; /***/ }), -/* 491 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40501,7 +40818,7 @@ var SUCCESS = exports.SUCCESS = 'SUCCESS'; var FAILED = exports.FAILED = 'FAILED'; /***/ }), -/* 492 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40515,7 +40832,7 @@ var selectPublishState = exports.selectPublishState = function selectPublishStat }; /***/ }), -/* 493 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40529,87 +40846,7 @@ var selectChannelState = exports.selectChannelState = function selectChannelStat }; /***/ }), -/* 494 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var validateChannelSelection = exports.validateChannelSelection = function validateChannelSelection(publishInChannel, selectedChannel, loggedInChannel) { - if (publishInChannel && selectedChannel !== loggedInChannel.name) { - throw new Error('Log in to a channel or select Anonymous'); - } -}; - -var validatePublishParams = exports.validatePublishParams = function validatePublishParams(file, claim, urlError) { - if (!file) { - throw new Error('Please choose a file'); - } - if (!claim) { - throw new Error('Please enter a URL'); - } - if (urlError) { - throw new Error('Fix the url'); - } -}; - -/***/ }), -/* 495 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var createPublishMetadata = exports.createPublishMetadata = function createPublishMetadata(claim, _ref, _ref2, publishInChannel, selectedChannel) { - var type = _ref.type; - var title = _ref2.title, - description = _ref2.description, - license = _ref2.license, - nsfw = _ref2.nsfw; - - var metadata = { - name: claim, - title: title, - description: description, - license: license, - nsfw: nsfw, - type: type - }; - if (publishInChannel) { - metadata['channelName'] = selectedChannel; - } - return metadata; -}; - -var createPublishFormData = exports.createPublishFormData = function createPublishFormData(file, thumbnail, metadata) { - var fd = new FormData(); - // append file - fd.append('file', file); - // append thumbnail - if (thumbnail) { - fd.append('thumbnail', thumbnail); - } - // append metadata - for (var key in metadata) { - if (metadata.hasOwnProperty(key)) { - fd.append(key, metadata[key]); - } - } - return fd; -}; - -var createThumbnailUrl = exports.createThumbnailUrl = function createThumbnailUrl(channel, channelId, claim, host) { - return host + '/' + channel + ':' + channelId + '/' + claim + '-thumb.png'; -}; - -/***/ }), -/* 496 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40620,7 +40857,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.makePublishRequestChannel = undefined; -var _reduxSaga = __webpack_require__(193); +var _reduxSaga = __webpack_require__(200); var makePublishRequestChannel = exports.makePublishRequestChannel = function makePublishRequestChannel(fd) { return (0, _reduxSaga.eventChannel)(function (emitter) { @@ -40670,7 +40907,7 @@ var makePublishRequestChannel = exports.makePublishRequestChannel = function mak }; /***/ }), -/* 497 */ +/* 502 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40686,7 +40923,7 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _reactGa = __webpack_require__(498); +var _reactGa = __webpack_require__(503); var _reactGa2 = _interopRequireDefault(_reactGa); @@ -40739,7 +40976,7 @@ var GAListener = function (_React$Component) { exports.default = (0, _reactRouterDom.withRouter)(GAListener); /***/ }), -/* 498 */ +/* 503 */ /***/ (function(module, exports, __webpack_require__) { (function webpackUniversalModuleDefinition(root, factory) { @@ -41801,7 +42038,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_12__; }); /***/ }), -/* 499 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41817,21 +42054,21 @@ var _react2 = _interopRequireDefault(_react); var _reactRouterDom = __webpack_require__(36); -var _dynamicImport = __webpack_require__(500); +var _dynamicImport = __webpack_require__(137); -var _AboutPage = __webpack_require__(502); +var _AboutPage = __webpack_require__(506); var _AboutPage2 = _interopRequireDefault(_AboutPage); -var _LoginPage = __webpack_require__(517); +var _LoginPage = __webpack_require__(518); var _LoginPage2 = _interopRequireDefault(_LoginPage); -var _ShowPage = __webpack_require__(525); +var _ShowPage = __webpack_require__(526); var _ShowPage2 = _interopRequireDefault(_ShowPage); -var _FourOhFourPage = __webpack_require__(542); +var _FourOhFourPage = __webpack_require__(543); var _FourOhFourPage2 = _interopRequireDefault(_FourOhFourPage); @@ -41855,66 +42092,47 @@ var App = function App() { exports.default = App; /***/ }), -/* 500 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _require = __webpack_require__(89), - componentsConfig = _require.componentsConfig; - -function getDeepestChildValue(parent, childrenKeys) { - var childKey = childrenKeys.shift(); // .shift() retrieves the first element of array and removes it from array - var child = parent[childKey]; - if (childrenKeys.length >= 1) { - return getDeepestChildValue(child, childrenKeys); - } - return child; -} - -var dynamicImport = function dynamicImport(filePath) { - // validate inputs - if (!filePath) { - throw new Error('no file path provided to dynamicImport()'); - } - if (filePath.typeof !== 'string') { - throw new Error('file path provided to dynamicImport() must be a string'); - } - // split out the file folders // filter out any empty or white-space-only strings - var folders = filePath.split('/').filter(function (folderName) { - return folderName.replace(/\s/g, '').length; - }); - // check for the component corresponding to file path in the site config object - // i.e. componentsConfig[folders[0]][folders[2][...][folders[n]] - var customComponent = getDeepestChildValue(componentsConfig, folders); - if (customComponent) { - return customComponent; // return custom component - } else { - return !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); // return default component - } +var map = { + "./canonicalLink": 138, + "./canonicalLink.js": 138, + "./dynamicImport": 137, + "./dynamicImport.js": 137, + "./file": 208, + "./file.js": 208, + "./lbryUri": 134, + "./lbryUri.js": 134, + "./metaTags": 139, + "./metaTags.js": 139, + "./pageTitle": 140, + "./pageTitle.js": 140, + "./publish": 136, + "./publish.js": 136, + "./request": 40, + "./request.js": 40, + "./validate": 135, + "./validate.js": 135 }; - -exports.default = dynamicImport; +function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); +}; +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) // check for number or string + throw new Error("Cannot find module '" + req + "'."); + return id; +}; +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = 505; /***/ }), -/* 501 */ -/***/ (function(module, exports) { - -function webpackEmptyContext(req) { - throw new Error("Cannot find module '" + req + "'."); -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = 501; - -/***/ }), -/* 502 */ +/* 506 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42091,7 +42309,7 @@ var AboutPage = function (_React$Component) { exports.default = AboutPage; /***/ }), -/* 503 */ +/* 507 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42109,15 +42327,15 @@ var _react2 = _interopRequireDefault(_react); var _reactRouterDom = __webpack_require__(36); -var _Logo = __webpack_require__(504); +var _Logo = __webpack_require__(508); var _Logo2 = _interopRequireDefault(_Logo); -var _NavBarChannelOptionsDropdown = __webpack_require__(505); +var _NavBarChannelOptionsDropdown = __webpack_require__(509); var _NavBarChannelOptionsDropdown2 = _interopRequireDefault(_NavBarChannelOptionsDropdown); -var _request = __webpack_require__(61); +var _request = __webpack_require__(40); var _request2 = _interopRequireDefault(_request); @@ -42251,7 +42469,7 @@ var NavBar = function (_React$Component) { exports.default = (0, _reactRouterDom.withRouter)(NavBar); /***/ }), -/* 504 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42319,7 +42537,7 @@ function Logo() { exports.default = Logo; /***/ }), -/* 505 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42366,7 +42584,7 @@ function NavBarChannelDropdown(_ref) { exports.default = NavBarChannelDropdown; /***/ }), -/* 506 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42382,7 +42600,7 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _reactHelmet = __webpack_require__(201); +var _reactHelmet = __webpack_require__(209); var _reactHelmet2 = _interopRequireDefault(_reactHelmet); @@ -42390,11 +42608,11 @@ var _propTypes = __webpack_require__(11); var _propTypes2 = _interopRequireDefault(_propTypes); -var _pageTitle = __webpack_require__(514); +var _pageTitle = __webpack_require__(140); -var _metaTags = __webpack_require__(515); +var _metaTags = __webpack_require__(139); -var _canonicalLink = __webpack_require__(516); +var _canonicalLink = __webpack_require__(138); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -42460,7 +42678,7 @@ SEO.propTypes = { exports.default = SEO; /***/ }), -/* 507 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42470,8 +42688,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var React = __webpack_require__(1); var React__default = _interopDefault(React); -var ExecutionEnvironment = _interopDefault(__webpack_require__(508)); -var shallowEqual = _interopDefault(__webpack_require__(509)); +var ExecutionEnvironment = _interopDefault(__webpack_require__(512)); +var shallowEqual = _interopDefault(__webpack_require__(513)); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -42580,7 +42798,7 @@ module.exports = withSideEffect; /***/ }), -/* 508 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -42627,7 +42845,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*! /***/ }), -/* 509 */ +/* 513 */ /***/ (function(module, exports) { module.exports = function shallowEqual(objA, objB, compare, compareContext) { @@ -42683,12 +42901,12 @@ module.exports = function shallowEqual(objA, objB, compare, compareContext) { /***/ }), -/* 510 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { var pSlice = Array.prototype.slice; -var objectKeys = __webpack_require__(511); -var isArguments = __webpack_require__(512); +var objectKeys = __webpack_require__(515); +var isArguments = __webpack_require__(516); var deepEqual = module.exports = function (actual, expected, opts) { if (!opts) opts = {}; @@ -42783,7 +43001,7 @@ function objEquiv(a, b, opts) { /***/ }), -/* 511 */ +/* 515 */ /***/ (function(module, exports) { exports = module.exports = typeof Object.keys === 'function' @@ -42798,7 +43016,7 @@ function shim (obj) { /***/ }), -/* 512 */ +/* 516 */ /***/ (function(module, exports) { var supportsArgumentsClass = (function(){ @@ -42824,7 +43042,7 @@ function unsupported(object){ /***/ }), -/* 513 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {exports.__esModule = true; @@ -42838,11 +43056,11 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _objectAssign = __webpack_require__(58); +var _objectAssign = __webpack_require__(59); var _objectAssign2 = _interopRequireDefault(_objectAssign); -var _HelmetConstants = __webpack_require__(202); +var _HelmetConstants = __webpack_require__(210); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -43366,159 +43584,7 @@ exports.warn = warn; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(63))) /***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var createPageTitle = exports.createPageTitle = function createPageTitle(siteTitle, pageTitle) { - if (!pageTitle) { - return "" + siteTitle; - } - return siteTitle + " - " + pageTitle; -}; - -/***/ }), -/* 515 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var determineOgThumbnailContentType = function determineOgThumbnailContentType(thumbnail) { - if (thumbnail) { - var fileExt = thumbnail.substring(thumbnail.lastIndexOf('.')); - switch (fileExt) { - case 'jpeg': - case 'jpg': - return 'image/jpeg'; - case 'png': - return 'image/png'; - case 'gif': - return 'image/gif'; - case 'mp4': - return 'video/mp4'; - default: - return 'image/jpeg'; - } - } - return ''; -}; - -var createBasicMetaTags = function createBasicMetaTags(siteHost, siteDescription, siteTitle, siteTwitter) { - return [{ property: 'og:title', content: siteTitle }, { property: 'og:url', content: siteHost }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: siteDescription }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; -}; - -var createChannelMetaTags = function createChannelMetaTags(siteTitle, siteHost, siteTwitter, channel) { - var name = channel.name, - longId = channel.longId; - - return [{ property: 'og:title', content: name + ' on ' + siteTitle }, { property: 'og:url', content: siteHost + '/' + name + ':' + longId }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: name + ', a channel on ' + siteTitle }, { property: 'twitter:site', content: siteTwitter }, { property: 'twitter:card', content: 'summary' }]; -}; - -var createAssetMetaTags = function createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail) { - var claimData = asset.claimData; - var contentType = claimData.contentType; - - var embedUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; - var showUrl = siteHost + '/' + claimData.claimId + '/' + claimData.name; - var source = siteHost + '/' + claimData.claimId + '/' + claimData.name + '.' + claimData.fileExt; - var ogTitle = claimData.title || claimData.name; - var ogDescription = claimData.description || defaultDescription; - var ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail); - var ogThumbnail = claimData.thumbnail || defaultThumbnail; - var metaTags = [{ property: 'og:title', content: ogTitle }, { property: 'og:url', content: showUrl }, { property: 'og:site_name', content: siteTitle }, { property: 'og:description', content: ogDescription }, { property: 'og:image:width', content: 600 }, { property: 'og:image:height', content: 315 }, { property: 'twitter:site', content: siteTwitter }]; - if (contentType === 'video/mp4' || contentType === 'video/webm') { - metaTags.push({ property: 'og:video', content: source }); - metaTags.push({ property: 'og:video:secure_url', content: source }); - metaTags.push({ property: 'og:video:type', content: contentType }); - metaTags.push({ property: 'og:image', content: ogThumbnail }); - metaTags.push({ property: 'og:image:type', content: ogThumbnailContentType }); - metaTags.push({ property: 'og:type', content: 'video' }); - metaTags.push({ property: 'twitter:card', content: 'player' }); - metaTags.push({ property: 'twitter:player', content: embedUrl }); - metaTags.push({ property: 'twitter:player:width', content: 600 }); - metaTags.push({ property: 'twitter:text:player_width', content: 600 }); - metaTags.push({ property: 'twitter:player:height', content: 337 }); - metaTags.push({ property: 'twitter:player:stream', content: source }); - metaTags.push({ property: 'twitter:player:stream:content_type', content: contentType }); - } else { - metaTags.push({ property: 'og:image', content: source }); - metaTags.push({ property: 'og:image:type', content: contentType }); - metaTags.push({ property: 'og:type', content: 'article' }); - metaTags.push({ property: 'twitter:card', content: 'summary_large_image' }); - } - return metaTags; -}; - -var createMetaTags = exports.createMetaTags = function createMetaTags(siteDescription, siteHost, siteTitle, siteTwitter, asset, channel, defaultDescription, defaultThumbnail) { - if (asset) { - return createAssetMetaTags(siteHost, siteTitle, siteTwitter, asset, defaultDescription, defaultThumbnail); - }; - if (channel) { - return createChannelMetaTags(siteHost, siteTitle, siteTwitter, channel); - }; - return createBasicMetaTags(siteDescription, siteHost, siteTitle, siteTwitter); -}; - -/***/ }), -/* 516 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var createBasicCanonicalLink = function createBasicCanonicalLink(page, siteHost) { - return siteHost + "/" + page; -}; - -var createAssetCanonicalLink = function createAssetCanonicalLink(asset, siteHost) { - var channelName = void 0, - certificateId = void 0, - name = void 0, - claimId = void 0; - if (asset.claimData) { - var _asset$claimData = asset.claimData; - channelName = _asset$claimData.channelName; - certificateId = _asset$claimData.certificateId; - name = _asset$claimData.name; - claimId = _asset$claimData.claimId; - }; - if (channelName) { - return siteHost + "/" + channelName + ":" + certificateId + "/" + name; - }; - return siteHost + "/" + claimId + "/" + name; -}; - -var createChannelCanonicalLink = function createChannelCanonicalLink(channel, siteHost) { - var name = channel.name, - longId = channel.longId; - - return siteHost + "/" + name + ":" + longId; -}; - -var createCanonicalLink = exports.createCanonicalLink = function createCanonicalLink(asset, channel, page, siteHost) { - if (asset) { - return createAssetCanonicalLink(asset, siteHost); - } - if (channel) { - return createChannelCanonicalLink(channel, siteHost); - } - return createBasicCanonicalLink(page, siteHost); -}; - -/***/ }), -/* 517 */ +/* 518 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43530,7 +43596,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(518); +var _view = __webpack_require__(519); var _view2 = _interopRequireDefault(_view); @@ -43547,7 +43613,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 518 */ +/* 519 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43573,11 +43639,11 @@ var _NavBar = __webpack_require__(62); var _NavBar2 = _interopRequireDefault(_NavBar); -var _ChannelLoginForm = __webpack_require__(519); +var _ChannelLoginForm = __webpack_require__(520); var _ChannelLoginForm2 = _interopRequireDefault(_ChannelLoginForm); -var _ChannelCreateForm = __webpack_require__(521); +var _ChannelCreateForm = __webpack_require__(522); var _ChannelCreateForm2 = _interopRequireDefault(_ChannelCreateForm); @@ -43675,7 +43741,7 @@ var LoginPage = function (_React$Component) { exports.default = (0, _reactRouterDom.withRouter)(LoginPage); /***/ }), -/* 519 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43687,9 +43753,9 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _channel = __webpack_require__(134); +var _channel = __webpack_require__(141); -var _view = __webpack_require__(520); +var _view = __webpack_require__(521); var _view2 = _interopRequireDefault(_view); @@ -43709,7 +43775,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view2.default); /***/ }), -/* 520 */ +/* 521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43725,7 +43791,7 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _request = __webpack_require__(61); +var _request = __webpack_require__(40); var _request2 = _interopRequireDefault(_request); @@ -43881,7 +43947,7 @@ var ChannelLoginForm = function (_React$Component) { exports.default = ChannelLoginForm; /***/ }), -/* 521 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43893,9 +43959,9 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _channel = __webpack_require__(134); +var _channel = __webpack_require__(141); -var _view = __webpack_require__(522); +var _view = __webpack_require__(523); var _view2 = _interopRequireDefault(_view); @@ -43915,7 +43981,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) { exports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view2.default); /***/ }), -/* 522 */ +/* 523 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43931,11 +43997,11 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _ProgressBar = __webpack_require__(203); +var _ProgressBar = __webpack_require__(211); var _ProgressBar2 = _interopRequireDefault(_ProgressBar); -var _request = __webpack_require__(61); +var _request = __webpack_require__(40); var _request2 = _interopRequireDefault(_request); @@ -44170,7 +44236,7 @@ var ChannelCreateForm = function (_React$Component) { exports.default = ChannelCreateForm; /***/ }), -/* 523 */ +/* 524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44197,7 +44263,7 @@ var ActiveStatusBar = function ActiveStatusBar() { exports.default = ActiveStatusBar; /***/ }), -/* 524 */ +/* 525 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44224,7 +44290,7 @@ var InactiveStatusBar = function InactiveStatusBar() { exports.default = InactiveStatusBar; /***/ }), -/* 525 */ +/* 526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44236,9 +44302,9 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); -var _view = __webpack_require__(526); +var _view = __webpack_require__(527); var _view2 = _interopRequireDefault(_view); @@ -44260,7 +44326,7 @@ var mapDispatchToProps = { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 526 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44276,23 +44342,23 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _ErrorPage = __webpack_require__(135); +var _ErrorPage = __webpack_require__(142); var _ErrorPage2 = _interopRequireDefault(_ErrorPage); -var _ShowAssetLite = __webpack_require__(527); +var _ShowAssetLite = __webpack_require__(528); var _ShowAssetLite2 = _interopRequireDefault(_ShowAssetLite); -var _ShowAssetDetails = __webpack_require__(530); +var _ShowAssetDetails = __webpack_require__(531); var _ShowAssetDetails2 = _interopRequireDefault(_ShowAssetDetails); -var _ShowChannel = __webpack_require__(536); +var _ShowChannel = __webpack_require__(537); var _ShowChannel2 = _interopRequireDefault(_ShowChannel); -var _show_request_types = __webpack_require__(198); +var _show_request_types = __webpack_require__(205); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -44358,7 +44424,7 @@ var ShowPage = function (_React$Component) { exports.default = ShowPage; /***/ }), -/* 527 */ +/* 528 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44370,7 +44436,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(528); +var _view = __webpack_require__(529); var _view2 = _interopRequireDefault(_view); @@ -44398,7 +44464,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 528 */ +/* 529 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44420,7 +44486,7 @@ var _SEO2 = _interopRequireDefault(_SEO); var _reactRouterDom = __webpack_require__(36); -var _AssetDisplay = __webpack_require__(204); +var _AssetDisplay = __webpack_require__(212); var _AssetDisplay2 = _interopRequireDefault(_AssetDisplay); @@ -44483,7 +44549,7 @@ var ShowLite = function (_React$Component) { exports.default = ShowLite; /***/ }), -/* 529 */ +/* 530 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44499,7 +44565,7 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _ProgressBar = __webpack_require__(203); +var _ProgressBar = __webpack_require__(211); var _ProgressBar2 = _interopRequireDefault(_ProgressBar); @@ -44654,7 +44720,7 @@ var AssetDisplay = function (_React$Component) { exports.default = AssetDisplay; /***/ }), -/* 530 */ +/* 531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44666,7 +44732,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(531); +var _view = __webpack_require__(532); var _view2 = _interopRequireDefault(_view); @@ -44694,7 +44760,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 531 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44718,19 +44784,19 @@ var _NavBar = __webpack_require__(62); var _NavBar2 = _interopRequireDefault(_NavBar); -var _ErrorPage = __webpack_require__(135); +var _ErrorPage = __webpack_require__(142); var _ErrorPage2 = _interopRequireDefault(_ErrorPage); -var _AssetTitle = __webpack_require__(532); +var _AssetTitle = __webpack_require__(533); var _AssetTitle2 = _interopRequireDefault(_AssetTitle); -var _AssetDisplay = __webpack_require__(204); +var _AssetDisplay = __webpack_require__(212); var _AssetDisplay2 = _interopRequireDefault(_AssetDisplay); -var _AssetInfo = __webpack_require__(534); +var _AssetInfo = __webpack_require__(535); var _AssetInfo2 = _interopRequireDefault(_AssetInfo); @@ -44805,7 +44871,7 @@ var ShowAssetDetails = function (_React$Component) { exports.default = ShowAssetDetails; /***/ }), -/* 532 */ +/* 533 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44817,7 +44883,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(533); +var _view = __webpack_require__(534); var _view2 = _interopRequireDefault(_view); @@ -44839,7 +44905,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 533 */ +/* 534 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44872,7 +44938,7 @@ var AssetTitle = function AssetTitle(_ref) { exports.default = AssetTitle; /***/ }), -/* 534 */ +/* 535 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44884,7 +44950,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(535); +var _view = __webpack_require__(536); var _view2 = _interopRequireDefault(_view); @@ -44906,7 +44972,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 535 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45188,7 +45254,7 @@ var AssetInfo = function (_React$Component) { exports.default = AssetInfo; /***/ }), -/* 536 */ +/* 537 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45200,7 +45266,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(537); +var _view = __webpack_require__(538); var _view2 = _interopRequireDefault(_view); @@ -45227,7 +45293,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 537 */ +/* 538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45247,7 +45313,7 @@ var _SEO = __webpack_require__(71); var _SEO2 = _interopRequireDefault(_SEO); -var _ErrorPage = __webpack_require__(135); +var _ErrorPage = __webpack_require__(142); var _ErrorPage2 = _interopRequireDefault(_ErrorPage); @@ -45255,7 +45321,7 @@ var _NavBar = __webpack_require__(62); var _NavBar2 = _interopRequireDefault(_NavBar); -var _ChannelClaimsDisplay = __webpack_require__(538); +var _ChannelClaimsDisplay = __webpack_require__(539); var _ChannelClaimsDisplay2 = _interopRequireDefault(_ChannelClaimsDisplay); @@ -45336,7 +45402,7 @@ var ShowChannel = function (_React$Component) { exports.default = ShowChannel; /***/ }), -/* 538 */ +/* 539 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45348,9 +45414,9 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _show = __webpack_require__(53); +var _show = __webpack_require__(54); -var _view = __webpack_require__(539); +var _view = __webpack_require__(540); var _view2 = _interopRequireDefault(_view); @@ -45378,7 +45444,7 @@ var mapDispatchToProps = { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default); /***/ }), -/* 539 */ +/* 540 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45394,7 +45460,7 @@ var _react = __webpack_require__(1); var _react2 = _interopRequireDefault(_react); -var _AssetPreview = __webpack_require__(540); +var _AssetPreview = __webpack_require__(541); var _AssetPreview2 = _interopRequireDefault(_AssetPreview); @@ -45497,7 +45563,7 @@ var ChannelClaimsDisplay = function (_React$Component) { exports.default = ChannelClaimsDisplay; /***/ }), -/* 540 */ +/* 541 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45509,7 +45575,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(541); +var _view = __webpack_require__(542); var _view2 = _interopRequireDefault(_view); @@ -45526,7 +45592,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 541 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45593,7 +45659,7 @@ var AssetPreview = function AssetPreview(_ref) { exports.default = AssetPreview; /***/ }), -/* 542 */ +/* 543 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45605,7 +45671,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(13); -var _view = __webpack_require__(543); +var _view = __webpack_require__(544); var _view2 = _interopRequireDefault(_view); @@ -45625,7 +45691,7 @@ var mapStateToProps = function mapStateToProps(_ref) { exports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default); /***/ }), -/* 543 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45645,7 +45711,7 @@ var _NavBar = __webpack_require__(62); var _NavBar2 = _interopRequireDefault(_NavBar); -var _reactHelmet = __webpack_require__(201); +var _reactHelmet = __webpack_require__(209); var _reactHelmet2 = _interopRequireDefault(_reactHelmet); @@ -45715,4 +45781,4 @@ exports.default = FourOhForPage; /***/ }) /******/ ]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgZDBjOGUyNWFjZjA5ZWJlMWMzMGYiLCJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXBvbHlmaWxsL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2V4cG9ydC5qcyIsIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvcmVhY3QvaW5kZXguanMiLCJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXBvbHlmaWxsL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2FuLW9iamVjdC5qcyIsIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcG9seWZpbGwvbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZ2xvYmFsLmpzIiwid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1wb2x5ZmlsbC9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mYWlscy5qcyIsIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcG9seWZpbGwvbm9kZV9tb2R1bGVzL2Nvcm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gICAgIHJldHVybjtcbiAgICB9XG4gICAgdmFyIHRpbWVvdXQgPSBydW5UaW1lb3V0KGNsZWFuVXBOZXh0VGljayk7XG4gICAgZHJhaW5pbmcgPSB0cnVlO1xuXG4gICAgdmFyIGxlbiA9IHF1ZXVlLmxlbmd0aDtcbiAgICB3aGlsZShsZW4pIHtcbiAgICAgICAgY3VycmVudFF1ZXVlID0gcXVldWU7XG4gICAgICAgIHF1ZXVlID0gW107XG4gICAgICAgIHdoaWxlICgrK3F1ZXVlSW5kZXggPCBsZW4pIHtcbiAgICAgICAgICAgIGlmIChjdXJyZW50UXVldWUpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50UXVldWVbcXVldWVJbmRleF0ucnVuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcXVldWVJbmRleCA9IC0xO1xuICAgICAgICBsZW4gPSBxdWV1ZS5sZW5ndGg7XG4gICAgfVxuICAgIGN1cnJlbnRRdWV1ZSA9IG51bGw7XG4gICAgZHJhaW5pbmcgPSBmYWxzZTtcbiAgICBydW5DbGVhclRpbWVvdXQodGltZW91dCk7XG59XG5cbnByb2Nlc3MubmV4dFRpY2sgPSBmdW5jdGlvbiAoZnVuKSB7XG4gICAgdmFyIGFyZ3MgPSBuZXcgQXJyYXkoYXJndW1lbnRzLmxlbmd0aCAtIDEpO1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMSkge1xuICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgYXJnc1tpIC0gMV0gPSBhcmd1bWVudHNbaV07XG4gICAgICAgIH1cbiAgICB9XG4gICAgcXVldWUucHVzaChuZXcgSXRlbShmdW4sIGFyZ3MpKTtcbiAgICBpZiAocXVldWUubGVuZ3RoID09PSAxICYmICFkcmFpbmluZykge1xuICAgICAgICBydW5UaW1lb3V0KGRyYWluUXVldWUpO1xuICAgIH1cbn07XG5cbi8v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cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFxuICAgICAgICAgICAgdmFyIGtleXMgPSBnZXRPd25Qcm9wZXJ0eU5hbWVzKHNvdXJjZUNvbXBvbmVudCk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGlmIChnZXRPd25Qcm9wZXJ0eVN5bWJvbHMpIHtcbiAgICAgICAgICAgICAgICBrZXlzID0ga2V5cy5jb25jYXQoZ2V0T3duUHJvcGVydHlTeW1ib2xzKHNvdXJjZUNvbXBvbmVudCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICB2YXIga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgICAgICBpZiAoIVJFQUNUX1NUQVRJQ1Nba2V5XSAmJiAhS05PV05fU1RBVElDU1trZXldICYmICghYmxhY2tsaXN0IHx8ICFibGFja2xpc3Rba2V5XSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlc2NyaXB0b3IgPSBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3Ioc291cmNlQ29tcG9uZW50LCBrZXkpO1xuICAgICAgICAgICAgICAgICAgICB0cnkgeyAvLyBBdm9pZCBmYWlsdXJlcyBmcm9tIHJlYWQtb25seSBwcm9wZXJ0aWVzXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZpbmVQcm9wZXJ0eSh0YXJnZXRDb21wb25lbnQsIGtleSwgZGVzY3JpcHRvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICByZXR1cm4gdGFyZ2V0Q29tcG9uZW50O1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICByZXR1cm4gdGFyZ2V0Q29tcG9uZW50O1xuICAgIH07XG59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FfdGhpcy5wcm9wcy50YXJnZXQgJiYgLy8gbGV0IGJyb3dzZXIgaGFuZGxlIFwidGFyZ2V0PV9ibGFua1wiIGV0Yy5cbiAgICAgICFpc01vZGlmaWVkRXZlbnQoZXZlbnQpIC8vIGlnbm9yZSBjbGlja3Mgd2l0aCBtb2RpZmllciBrZXlzXG4gICAgICApIHtcbiAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuXG4gICAgICAgICAgdmFyIGhpc3RvcnkgPSBfdGhpcy5jb250ZXh0LnJvdXRlci5oaXN0b3J5O1xuICAgICAgICAgIHZhciBfdGhpcyRwcm9wcyA9IF90aGlzLnByb3BzLFxuICAgICAgICAgICAgICByZXBsYWNlID0gX3RoaXMkcHJvcHMucmVwbGFjZSxcbiAgICAgICAgICAgICAgdG8gPSBfdGhpcyRwcm9wcy50bztcblxuXG4gICAgICAgICAgaWYgKHJlcGxhY2UpIHtcbiAgICAgICAgICAgIGhpc3RvcnkucmVwbGFjZSh0byk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGhpc3RvcnkucHVzaCh0byk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSwgX3RlbXApLCBfcG9zc2libGVDb25zdHJ1Y3RvclJldHVybihfdGhpcywgX3JldCk7XG4gIH1cblxuICBMaW5rLnByb3RvdHlwZS5yZW5kZXIgPSBmdW5jdGlvbiByZW5kZXIoKSB7XG4gICAgdmFyIF9wcm9wcyA9IHRoaXMucHJvcHMsXG4gICAgICAgIHJlcGxhY2UgPSBfcHJvcHMucmVwbGFjZSxcbiAgICAgICAgdG8gPSBfcHJvcHMudG8sXG4gICAgICAgIGlubmVyUmVmID0gX3Byb3BzLmlubmVyUmVmLFxuICAgICAgICBwcm9wcyA9IF9vYmplY3RXaXRob3V0UHJvcGVydGllcyhfcHJvcHMsIFsncmVwbGFjZScsICd0bycsICdpbm5lclJlZiddKTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11b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hcHBlcik7XG5cbiAgICAgICAgICAgIHJldHVybiBfcG9zc2libGVDb25zdHJ1Y3RvclJldHVybih0aGlzLCBfUmVhY3QkQ29tcG9uZW50LmFwcGx5KHRoaXMsIGFyZ3VtZW50cykpO1xuICAgICAgICB9XG5cbiAgICAgICAgSGVsbWV0V3JhcHBlci5wcm90b3R5cGUuc2hvdWxkQ29tcG9uZW50VXBkYXRlID0gZnVuY3Rpb24gc2hvdWxkQ29tcG9uZW50VXBkYXRlKG5leHRQcm9wcykge1xuICAgICAgICAgICAgcmV0dXJuICEoMCwgX2RlZXBFcXVhbDIuZGVmYXVsdCkodGhpcy5wcm9wcywgbmV4dFByb3BzKTtcbiAgICAgICAgfTtcblxuICAgICAgICBIZWxtZXRXcmFwcGVyLnByb3RvdHlwZS5tYXBOZXN0ZWRDaGlsZHJlblRvUHJvcHMgPSBmdW5jdGlvbiBtYXBOZXN0ZWRDaGlsZHJlblRvUHJvcHMoY2hpbGQsIG5lc3RlZENoaWxkcmVuKSB7XG4gICAgICAgICAgICBpZiAoIW5lc3RlZENoaWxkcmVuKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHN3aXRjaCAoY2hpbGQudHlwZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuU0NSSVBUOlxuICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuTk9TQ1JJUFQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbm5lckhUTUw6IG5lc3RlZENoaWxkcmVuXG4gICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuVEFHX05BTUVTLlNUWUxFOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAg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pKTtcbiAgICAgICAgfTtcblxuICAgICAgICBIZWxtZXRXcmFwcGVyLnByb3RvdHlwZS5tYXBPYmplY3RUeXBlQ2hpbGRyZW4gPSBmdW5jdGlvbiBtYXBPYmplY3RUeXBlQ2hpbGRyZW4oX3JlZjIpIHtcbiAgICAgICAgICAgIHZhciBfZXh0ZW5kczMsIF9leHRlbmRzNDtcblxuICAgICAgICAgICAgdmFyIGNoaWxkID0gX3JlZjIuY2hpbGQsXG4gICAgICAgICAgICAgICAgbmV3UHJvcHMgPSBfcmVmMi5uZXdQcm9wcyxcbiAgICAgICAgICAgICAgICBuZXdDaGlsZFByb3BzID0gX3JlZjIubmV3Q2hpbGRQcm9wcyxcbiAgICAgICAgICAgICAgICBuZXN0ZWRDaGlsZHJlbiA9IF9yZWYyLm5lc3RlZENoaWxkcmVuO1xuXG4gICAgICAgICAgICBzd2l0Y2ggKGNoaWxkLnR5cGUpIHtcbiAgICAgICAgICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuVEFHX05BTUVTLlRJVExFOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX2V4dGVuZHMoe30sIG5ld1Byb3BzLCAoX2V4dGVuZHMzID0ge30sIF9leHRlbmRzM1tjaGlsZC50eXBlXSA9IG5lc3RlZENoaWxkcmVuLCBfZXh0ZW5kczMudGl0bGVBdHRyaWJ1dGVzID0gX2V4dGVuZHMoe30sIG5ld0NoaWxkUHJvcHMpLCBfZXh0ZW5kczMpKTtcblxuICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuQk9EWTpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9leHRlbmRzKHt9LCBuZXdQcm9wcywge1xuICAgICAgICAgICAgICAgICAgICAgICAgYm9keUF0dHJpYnV0ZXM6IF9leHRlbmRzKHt9LCBuZXdDaGlsZFByb3BzKVxuICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGNhc2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1xuXG4gICAgICAgICAgICByZXR1cm4gbmV3RmxhdHRlbmVkUHJvcHM7XG4gICAgICAgIH07XG5cbiAgICAgICAgSGVsbWV0V3JhcHBlci5wcm90b3R5cGUud2Fybk9uSW52YWxpZENoaWxkcmVuID0gZnVuY3Rpb24gd2Fybk9uSW52YWxpZENoaWxkcmVuKGNoaWxkLCBuZXN0ZWRDaGlsZHJlbikge1xuICAgICAgICAgICAgaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSBcInByb2R1Y3Rpb25cIikge1xuICAgICAgICAgICAgICAgIGlmICghX0hlbG1ldENvbnN0YW50cy5WQUxJRF9UQUdfTkFNRVMuc29tZShmdW5jdGlvbiAobmFtZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2hpbGQudHlwZSA9PT0gbmFtZTtcbiAgICAgICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNoaWxkLnR5cGUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgwLCBfSGVsbWV0VXRpbHMud2FybikoXCJZb3UgbWF5IGJlIGF0dGVtcHRpbmcgdG8gbmVzdCA8SGVsbWV0PiBjb21wb25lbnRzIHdpdGhpbiBlYWNoIG90aGVyLCB3aGljaCBpcyBub3QgYWxsb3dlZC4gUmVmZXIgdG8gb3VyIEFQSSBmb3IgbW9yZSBpbmZvcm1hdGlvbi5cIik7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKDAsIF9IZWxtZXRVdGlscy53YXJuKShcIk9ubHkgZWxlbWVudHMgdHlwZXMgXCIgKyBfSGVsbWV0Q29uc3RhbnRzLlZBTElEX1RBR19OQU1FUy5qb2luKFwiLCBcIikgKyBcIiBhcmUgYWxsb3dlZC4gSGVsbWV0IGRvZXMgbm90IHN1cHBvcnQgcmVuZGVyaW5nIDxcIiArIGNoaWxkLnR5cGU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AgICAgICBfcmVhY3QyLmRlZmF1bHQuQ2hpbGRyZW4uZm9yRWFjaChjaGlsZHJlbiwgZnVuY3Rpb24gKGNoaWxkKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFjaGlsZCB8fCAhY2hpbGQucHJvcHMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBfY2hpbGQkcHJvcHMgPSBjaGlsZC5wcm9wcyxcbiAgICAgICAgICAgICAgICAgICAgbmVzdGVkQ2hpbGRyZW4gPSBfY2hpbGQkcHJvcHMuY2hpbGRyZW4sXG4gICAgICAgICAgICAgICAgICAgIGNoaWxkUHJvcHMgPSBfb2JqZWN0V2l0aG91dFByb3BlcnRpZXMoX2NoaWxkJHByb3BzLCBbXCJjaGlsZHJlblwiXSk7XG5cbiAgICAgICAgICAgICAgICB2YXIgbmV3Q2hpbGRQcm9wcyA9ICgwLCBfSGVsbWV0VXRpbHMuY29udmVydFJlYWN0UHJvcHN0b0h0bWxBdHRyaWJ1dGVzKShjaGlsZFByb3BzKTtcblxuICAgICAgICAgICAgICAgIF90aGlzMi53YXJuT25JbnZhbGlkQ2hpbGRyZW4oY2hpbGQsIG5lc3RlZENoaWxkcmVuKTtcblxuICAgICAgICAgICAgICAgIHN3aXRjaCAoY2hpbGQudHlwZSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuVEFHX05BTUVTLkxJTks6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuTUVUQTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5OT1NDUklQVDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5TQ1JJUFQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuU1RZTEU6XG4gICAgICAgICAgICAgICAgICAgICAgICBhcnJheVR5cGVDaGlsZHJlbiA9IF90aGlzMi5mbGF0dGVuQXJyYXlUeXBlQ2hpbGRyZW4oe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkOiBjaGlsZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnJheVR5cGVDaGlsZHJlbjogYXJyYXlUeXBlQ2hpbGRyZW4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q2hpbGRQcm9wczogbmV3Q2hpbGRQcm9wcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXN0ZWRDaGlsZHJlbjogbmVzdGVkQ2hpbGRyZW5cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld1Byb3BzID0gX3RoaXMyLm1hcE9iamVjdFR5cGVDaGlsZHJlbih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQ6IGNoaWxkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1Byb3BzOiBuZXdQcm9wcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdDaGlsZFByb3BzOiBuZXdDaGlsZFByb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lc3RlZENoaWxkcmVuOiBuZXN0ZWRDaGlsZHJlblxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbmV3UHJvcHMgPSB0aGlzLm1hcEFycmF5VHlwZUNoaWxkcmVuVG9Qcm9wcyhhcnJheVR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KHRoaXMsIEVSUk9SKTtcbiAgICB2YXIgZiA9IHRvSW50ZWdlcihmcmFjdGlvbkRpZ2l0cyk7XG4gICAgdmFyIHMgPSAnJztcbiAgICB2YXIgbSA9IFpFUk87XG4gICAgdmFyIGUsIHosIGosIGs7XG4gICAgaWYgKGYgPCAwIHx8IGYgPiAyMCkgdGhyb3cgUmFuZ2VFcnJvcihFUlJPUik7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgIGlmICh4ICE9IHgpIHJldHVybiAnTmFOJztcbiAgICBpZiAoeCA8PSAtMWUyMSB8fCB4ID49IDFlMjEpIHJldHVybiBTdHJpbmcoeCk7XG4gICAgaWYgKHggPCAwKSB7XG4gICAgICBzID0gJy0nO1xuICAgICAgeCA9IC14O1xuICAgIH1cbiAgICBpZiAoeCA+IDFlLTIxKSB7XG4gICAgICBlID0gbG9nKHggKiBwb3coMiwgNjksIDEpKSAtIDY5O1xuICAgICAgeiA9IGUgPCAwID8geCAqIHBvdygyLCAtZSwgMSkgOiB4IC8gcG93KDIsIGUsIDEpO1xuICAgICAgeiAqPSAweDEwMDAwMDAwMDAwMDAwO1xuICAgICAgZSA9IDUyIC0gZTtcbiAgICAgIGlmIChlID4gMCkge1xuICAgICAgICBtdWx0aXBseSgwLCB6KTtcbiAgICAgICAgaiA9IGY7XG4gICAgICAgIHdoaWxlIChqID49IDcpIHtcbiAgICAgICAgICBtdWx0aXBseSgxZTcsIDApO1xuICAgICAgICAgIGogLT0gNztcbiAgICAgICAgfVxuICAgICAgICBtdWx0aXBseShwb3coMTAsIGosIDEpLCAwKTtcbiAgICAgICAgaiA9IGUgLSAxO1xuICAgICAgICB3aGlsZSAoaiA+PSAyMykge1xuICAgICAgICAgIGRpdmlkZSgxIDw8IDIzKTtcbiAgICAgICAgICBqIC09IDIzO1xuICAgICAgICB9XG4gICAgICAgIGRpdmlkZSgxIDw8IGopO1xuICAgICAgICBtdWx0aXBse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GVVbmhhbmRsZWQocHJvbWlzZSk7XG4gICAgICAgICAgICBwcm9taXNlLl9oID0gMTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGhhbmRsZXIgPT09IHRydWUpIHJlc3VsdCA9IHZhbHVlO1xuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKGRvbWFpbikgZG9tYWluLmVudGVyKCk7XG4gICAgICAgICAgICByZXN1bHQgPSBoYW5kbGVyKHZhbHVlKTtcbiAgICAgICAgICAgIGlmIChkb21haW4pIGRvbWFpbi5leGl0KCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyZXN1bHQgPT09IHJlYWN0aW9uLnByb21pc2UpIHtcbiAgICAgICAgICAgIHJlamVjdChUeXBlRXJyb3IoJ1Byb21pc2UtY2hhaW4gY3ljbGUnKSk7XG4gICAgICAgICAgfSBlbHNlIGlmICh0aGVuID0gaXNUaGVuYWJsZShyZXN1bHQpKSB7XG4gICAgICAgICAgICB0aGVuLmNhbGwocmVzdWx0LCByZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgIH0gZWxzZSByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH0gZWxzZSByZWplY3QodmFsdWUpO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICByZWplY3QoZSk7XG4gICAgICB9XG4gICAgfTtcbiAgICB3aGlsZSAoY2hhaW4ubGVuZ3RoID4gaSkgcnVuKGNoYWluW2krK10pOyAvLyB2YXJpYWJsZSBsZW5ndGggLSBjYW4ndCB1c2UgZm9yRWFjaFxuICAgIHByb21pc2UuX2MgPSBbXTtcbiAgICBwcm9taXNlLl9uID0gZmFsc2U7XG4gICAgaWYgKGlzUmVqZWN0ICYmICFwcm9taXNlLl9oKSBvblVuaGFuZGxlZChwcm9taXNlKTtcbiAgfSk7XG59O1xudmFyIG9uVW5oYW5kbGVkID0gZnVuY3Rpb24gKHByb21pc2UpIHtcbiAgdGFzay5jYWxsKGdsb2JhbCwgZn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CB2YWx1ZSBpc1xuICAvLyBtZWFudCB0byBiZSBhd2FpdGVkLlxuICBydW50aW1lLmF3cmFwID0gZnVuY3Rpb24oYXJnKSB7XG4gICAgcmV0dXJuIHsgX19hd2FpdDogYXJnIH07XG4gIH07XG5cbiAgZnVuY3Rpb24gQXN5bmNJdGVyYXRvcihnZW5lcmF0b3IpIHtcbiAgICBmdW5jdGlvbiBpbnZva2UobWV0aG9kLCBhcmcsIHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgdmFyIHJlY29yZCA9IHRyeUNhdGNoKGdlbmVyYXRvclttZXRob2RdLCBnZW5lcmF0b3IsIGFyZyk7XG4gICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICByZWplY3QocmVjb3JkLmFyZyk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgcmVzdWx0ID0gcmVjb3JkLmFyZztcbiAgICAgICAgdmFyIHZhbHVlID0gcmVzdWx0LnZhbHVlO1xuICAgICAgICBpZiAodmFsdWUgJiZcbiAgICAgICAgICAgIHR5cGVvZiB2YWx1ZSA9PT0gXCJvYmplY3RcIiAmJlxuICAgICAgICAgICAgaGFzT3duLmNhbGwodmFsdWUsIFwiX19hd2FpdFwiKSkge1xuICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodmFsdWUuX19hd2FpdCkudGhlbihmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgaW52b2tlKFwibmV4dFwiLCB2YWx1ZSwgcmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICB9LCBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgIGludm9rZShcInRocm93XCIsIGVyciwgcmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodmFsdWUpLnRoZW4oZnVuY3Rpb24odW53cmFwcGVkKSB7XG4gICAgICA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GVkU3RhcnQpIHtcbiAgICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgICB0aHJvdyBjb250ZXh0LmFyZztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKTtcblxuICAgICAgICB9IGVsc2UgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInJldHVyblwiKSB7XG4gICAgICAgICAgY29udGV4dC5hYnJ1cHQoXCJyZXR1cm5cIiwgY29udGV4dC5hcmcpO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUV4ZWN1dGluZztcblxuICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goaW5uZXJGbiwgc2VsZiwgY29udGV4dCk7XG4gICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIikge1xuICAgICAgICAgIC8vIElmIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24gZnJvbSBpbm5lckZuLCB3ZSBsZWF2ZSBzdGF0ZSA9PT1cbiAgICAgICAgICAvLyBHZW5TdGF0ZUV4ZWN1dGluZyBhbmQgbG9vcCBiYWNrIGZvciBhbm90aGVyIGludm9jYXRpb24uXG4gICAgICAgICAgc3RhdGUgPSBjb250ZXh0LmRvbmVcbiAgICAgICAgICAgID8gR2VuU3RhdGVDb21wbGV0ZWRcbiAgICAgICAgICAgIDogR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcblxuICAgICAgICAgIGlmIChyZWNvcmQuYXJnID09PSBDb250aW51ZVNlbnRpbmVsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdmFsdWU6IHJlY29yZC5hcmcsXG4gICAgICAgICAgICBkb25lOiBjb250ZXh0LmRvbmVcbiAgICAgICAgICB9O1xuXG4gICAgICA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gICAgIC8vIG1ldGhvZCBhbHdheXMgdGVybWluYXRlcyB0aGUgeWllbGQqIGxvb3AuXG4gICAgICBjb250ZXh0LmRlbGVnYXRlID0gbnVsbDtcblxuICAgICAgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInRocm93XCIpIHtcbiAgICAgICAgaWYgKGRlbGVnYXRlLml0ZXJhdG9yLnJldHVybikge1xuICAgICAgICAgIC8vIElmIHRoZSBkZWxlZ2F0ZSBpdGVyYXRvciBoYXMgYSByZXR1cm4gbWV0aG9kLCBnaXZlIGl0IGFcbiAgICAgICAgICAvLyBjaGFuY2UgdG8gY2xlYW4gdXAuXG4gICAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICAgIGNvbnRleHQuYXJnID0gdW5kZWZpbmVkO1xuICAgICAgICAgIG1heWJlSW52b2tlRGVsZWdhdGUoZGVsZWdhdGUsIGNvbnRleHQpO1xuXG4gICAgICAgICAgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICAgIC8vIElmIG1heWJlSW52b2tlRGVsZWdhdGUoY29udGV4dCkgY2hhbmdlZCBjb250ZXh0Lm1ldGhvZCBmcm9tXG4gICAgICAgICAgICAvLyBcInJldHVyblwiIHRvIFwidGhyb3dcIiwgbGV0IHRoYXQgb3ZlcnJpZGUgdGhlIFR5cGVFcnJvciBiZWxvdy5cbiAgICAgICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgICBjb250ZXh0LmFyZyA9IG5ldyBUeXBlRXJyb3IoXG4gICAgICAgICAgXCJUaGUgaXRlcmF0b3IgZG9lcyBub3QgcHJvdmlkZSBhICd0aHJvdycgbWV0aG9kXCIpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAg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iAgICAgIHZhciByb290UmVjb3JkID0gcm9vdEVudHJ5LmNvbXBsZXRpb247XG4gICAgICBpZiAocm9vdFJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcm9vdFJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLnJ2YWw7XG4gICAgfSxcblxuICAgIGRpc3BhdGNoRXhjZXB0aW9uOiBmdW5jdGlvbihleGNlcHRpb24pIHtcbiAgICAgIGlmICh0aGlzLmRvbmUpIHtcbiAgICAgICAgdGhyb3cgZXhjZXB0aW9uO1xuICAgICAgfVxuXG4gICAgICB2YXIgY29udGV4dCA9IHRoaXM7XG4gICAgICBmdW5jdGlvbiBoYW5kbGUobG9jLCBjYXVnaHQpIHtcbiAgICAgICAgcmVjb3JkLnR5cGUgPSBcInRocm93XCI7XG4gICAgICAgIHJlY29yZC5hcmcgPSBleGNlcHRpb247XG4gICAgICAgIGNvbnRleHQubmV4dCA9IGxvYztcblxuICAgICAgICBpZiAoY2F1Z2h0KSB7XG4gICAgICAgICAgLy8gSWYgdGhlIGRpc3BhdGNoZWQgZXhjZXB0aW9uIHdhcyBjYXVnaHQgYnkgYSBjYXRjaCBibG9jayxcbiAgICAgICAgICAvLyB0aGVuIGxldCB0aGF0IGNhdGNoIGJsb2NrIGhhbmRsZSB0aGUgZXhjZXB0aW9uIG5vcm1hbGx5LlxuICAgICAgICAgIGNvbnRleHQubWV0aG9kID0gXCJuZXh0XCI7XG4gICAgICAgICAgY29udGV4dC5hcmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gISEgY2F1Z2h0O1xuICAgICAgfVxuXG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgdmFyIHJlY29yZCA9IGVudHJ5LmNvbXBsZXRpb247XG5cbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA9PT0gXCJyb290XCIpIHtcbiAgICAgICAgICAvLyBFeGNlcHRpb24gdGhyb3duIG91dHNpZGUgb2YgYW55IHRyeSBibG9jayB0aGF0IGNvdWxkIGhhbmRsZVxuICAgICAgICAgIC8vIGl0LCBzbyBzZXQgdGhlIGNvbXBsZXRpb24gdmFsdWUgb2YgdGhlIGVudGlyZSBmdW5jdGlvbiB0b1xuICAgICAgICAgIC8vIHRocm93IHRoZSBleGNlcHRpb24uXG4gICAgICAgICAgcmV0dXJuIGhhbmRsZShcImVuZFwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2KSB7XG4gICAgICAgICAgdmFyIGhhc0NhdGNoID0gaGFzT3duLmNhbGwoZW50cnksIFwiY2F0Y2hMb2NcIik7XG4gICAgICAgICAgdmFyIGhhc0ZpbmFsbHkgPSBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpO1xuXG4gICAgICAgICAgaWYgKGhhc0NhdGNoICYmIGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNDYXRjaCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRyeSBzdGF0ZW1lbnQgd2l0aG91dCBjYXRjaCBvciBmaW5hbGx5XCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBhYnJ1cHQ6IGZ1bmN0aW9uKHR5cGUsIGFyZykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2ICYmXG4gICAgICAgICAgICBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpICYmXG4gICAgICAgICAgICB0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgdmFyIGZpbmFsbHlFbnRyeSA9IGVudHJ5O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkgJiZcbiAgICAgICAgICAodHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgIHR5cGUgPT09IFwiY29udGludWVcIikgJiZcbiAgICAgICAgICBmaW5hbGx5RW50cnkudHJ5TG9jIDw9IGFyZyAmJlxuICAgICAgICAgIGFyZyA8PSBmaW5hbGx5RW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAvLyBJZ25vcmUgdGhlIGZpbmFsbHkgZW50cnkgaWYgY29udHJvbCBpcyBub3QganVtcGluZyB0byBhXG4gICAgICAgIC8vIGxvY2F0aW9uIG91dHNpZGUgdGhlIHRyeS9jYXRjaCBibG9jay5cbiAgICAgICAgZmluYWxseUVudHJ5ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHJlY29yZCA9IGZpbmFsbHlFbnRyeSA/IGZpbmFsbHlFbnRyeS5jb21wbGV0aW9uIDoge307XG4gICAgICByZWNvcmQudHlwZSA9IHR5cGU7XG4gICAgICByZWNvcmQuYXJnID0gYXJnO1xuXG4gICAgICBpZiAoZmluYWxseUVudHJ5KSB7XG4gICAgICAgIHRoaXMubWV0aG9kID0gXCJuZXh0XCI7XG4gICAgICAgIHRoaXMubmV4dCA9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jO1xuICAgICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHRoaXMuY29tcGxldGUocmVjb3JkKTtcbiAgICB9LFxuXG4gICAgY29tcGxldGU6IGZ1bmN0aW9uKHJlY29yZCwgYWZ0ZXJMb2MpIHtcbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJ0aHJvd1wiKSB7XG4gICAgICAgIHRocm93IHJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgcmVjb3JkLnR5cGUgPT09IFwiY29udGludWVcIikge1xuICAgICAgICB0aGlzLm5leHQgPSByZWNvcmQuYXJnO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICB0aGlzLnJ2YWwgPSB0aGlzLmFyZyA9IHJlY29yZC5hcmc7XG4gICAgICAgIHRoaXMubWV0aG9kID0gXCJyZXR1cm5cIjtcbiAgICAgICAgdGhp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OCcpXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoc3VwcG9ydC5ibG9iKSB7XG4gICAgICB0aGlzLmJsb2IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHJlamVjdGVkID0gY29uc3VtZWQodGhpcylcbiAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgcmV0dXJuIHJlamVjdGVkXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX2JvZHlBcnJheUJ1ZmZlcikge1xuICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlBcnJheUJ1ZmZlcl0pKVxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX2JvZHlGb3JtRGF0YSkge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyBibG9iJylcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKG5ldyBCbG9iKFt0aGlzLl9ib2R5VGV4dF0pKVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHRoaXMuYXJyYXlCdWZmZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgaWYgKHRoaXMuX2JvZHlBcnJheUJ1ZmZlcikge1xuICAgICAgICAgIHJldHVybiBjb25zdW1lZCh0aGlzKSB8fCBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUFycmF5QnVmZmVyKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJldHVybiB0aGlzLmJsb2IoKS50aGVuKHJlYWRCbG9iQXNBcnJheUJ1ZmZlcilcbiAgICAgICAgfVxuICAgICA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ICB8ICAgICAgICAgICAuICAgICAgICAgICAgICAgfCAgICAgICAgIHxQbHVnaW4gICAgIHxcbiAqICstLS0tLXwtLS0tLS0rICAgIC4gICAgICAgICAgICAgICB2ICAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogfCAgICAgfCAgICAgIHwgICAgLiAgICArLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tK1xuICogfCAgICAgKy0tLS0tLS0tLS0tLi0tLT58RXZlbnRQbHVnaW5IdWJ8ICAgICAgICAgICAgICAgICAgICB8ICAgIEV2ZW50ICAgfFxuICogfCAgICAgICAgICAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICArLS0tLS0tLS0tLS0rICB8IFByb3BhZ2F0b3JzfFxuICogfCBSZWFjdEV2ZW50IHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICB8VGFwRXZlbnQgICB8ICB8LS0tLS0tLS0tLS0tfFxuICogfCAgRW1pdHRlciAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8PC0tLSt8UGx1Z2luICAgICB8ICB8b3RoZXIgcGx1Z2lufFxuICogfCAgICAgICAgICAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICArLS0tLS0tLS0tLS0rICB8ICB1dGlsaXRpZXMgfFxuICogfCAgICAgKy0tLS0tLS0tLS0tLi0tLT58ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tK1xuICogfCAgICAgfCAgICAgIHwgICAgLiAgICArLS0tLS0tLS0tLS0tLS0rXG4gKiArLS0tLS18LS0tLS0tKyAgICAuICAgICAgICAgICAgICAgIF4gICAgICAgICstLS0tLS0tLS0tLStcbiAqICAgICAgIHwgICAgICAgICAgIC4gICAgICAgICAgICAgICAgfCAgICAgICAgfEVudGVyL0xlYXZlfFxuICogICAgICAgKyAgICAgICAgICAgLiAgICAgICAgICAgICAgICArLS0tLS0tLSt8UGx1Z2lu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udGludWUgdG8gcmVwbGFjZSBpdCB3aXRob3V0IGFib3J0aW5nIGV2ZW4gaWYgaXQgaXMgbm90IGEgdGV4dFxuICAgICAgLy8gbm9kZS5cbiAgICAgIGlmIChrZXkgIT09IG51bGwpIHtcbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9XG4gICAgICByZXR1cm4gdXBkYXRlVGV4dE5vZGUocmV0dXJuRmliZXIsIG9sZEZpYmVyLCAnJyArIG5ld0NoaWxkLCBleHBpcmF0aW9uVGltZSk7XG4gICAgfVxuXG4gICAgaWYgKHR5cGVvZiBuZXdDaGlsZCA9PT0gJ29iamVjdCcgJiYgbmV3Q2hpbGQgIT09IG51bGwpIHtcbiAgICAgIHN3aXRjaCAobmV3Q2hpbGQuJCR0eXBlb2YpIHtcbiAgICAgICAgY2FzZSBSRUFDVF9FTEVNRU5UX1RZUEU6XG4gICAgICAgICAge1xuICAgICAgICAgICAgaWYgKG5ld0NoaWxkLmtleSA9PT0ga2V5KSB7XG4gICAgICAgICAgICAgIGlmIChuZXdDaGlsZC50eXBlID09PSBSRUFDVF9GUkFHTUVOVF9UWVBFKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZUZyYWdtZW50KHJldHVybkZpYmVyLCBvbGRGaWJlciwgbmV3Q2hpbGQucHJvcHMuY2hpbGRyZW4sIGV4cGlyYXRpb25UaW1lLCBrZXkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiB1cGRhdGVFbGVtZW50KHJldHVybkZpYmVyLCBvbGRGaWJlciwgbmV3Q2hpbGQsIGV4cGlyYXRpb25UaW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICBjYXNlIFJFQUNUX0NBTExfVFlQRTpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBpZiAobmV3Q2hpbGQua2V5ID09PSBrZXkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZUNhbGwocmV0dXJuRmliZXIsIG9sZEZpYmVyLCBuZXdDaGlsZCwgZXhwaXJhdGlvblRpbWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgIGNhc2UgUkVBQ1RfUkVUVVJOX1RZUEU6XG4gICAgICAgICAge1xuICAgICAgICAgICAgLy8gUmV0dXJucyBkb24ndCBoYXZlIGtleXMuIElmIHRoZSBwcmV2aW91cyBub2RlIGlzIGltcGxpY2l0bHkga2V5ZWRcbiAgICAgICAgICAgIC8vIHdlIGNhbiBjb250aW51ZSB0byByZXBsYWNlIGl0IHdpdGhvdXQgYWJvcnRpbmcgZXZlbiBpZiBpdCBpcyBub3QgYVxuICAgICAgICAgICAgLy8geWllbGQuXG4gICAgICAgICAgICBpZiAoa2V5ID09PSBudWxsKSB7XG4gICAgICAgICAgICAgIHJldHVybiB1cGRhdGVSZXR1cm4ocmV0dXJuRmliZXIsIG9sZEZpYmVyLCBuZXdDaGlsZCwgZXhwaXJhdGlvblRpbWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgIGNhc2UgUkVBQ1RfUE9SVEFMX1RZUEU6XG4gICAgICAgICAge1xuICAgICAgICAgICAgaWYgKG5ld0NoaWxkLmtleSA9PT0ga2V5KSB7XG4gICAgICAgICAgICAgIHJldHVybiB1cGRhdGVQb3J0YWwocmV0dXJuRmliZXIsIG9sZEZpYmVyLCBuZXdDaGlsZCwgZXhwaXJhdGlvblRpbWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAg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1cGRhdGVGcmFnbWVudChyZXR1cm5GaWJlciwgX21hdGNoZWRGaWJlcjUsIG5ld0NoaWxkLCBleHBpcmF0aW9uVGltZSwgbnVsbCk7XG4gICAgICB9XG5cbiAgICAgIHRocm93T25JbnZhbGlkT2JqZWN0VHlwZShyZXR1cm5GaWJlciwgbmV3Q2hpbGQpO1xuICAgIH1cblxuICAgIHtcbiAgICAgIGlmICh0eXBlb2YgbmV3Q2hpbGQgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgd2Fybk9uRnVuY3Rpb25UeXBlKCk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG51bGw7XG4gIH1cblxuICAvKipcbiAgICogV2FybnMgaWYgdGhlcmUgaXMgYSBkdXBsaWNhdGUgb3IgbWlzc2luZyBrZXlcbiAgICovXG4gIGZ1bmN0aW9uIHdhcm5PbkludmFsaWRLZXkoY2hpbGQsIGtub3duS2V5cykge1xuICAgIHtcbiAgICAgIGlmICh0eXBlb2YgY2hpbGQgIT09ICdvYmplY3QnIHx8IGNoaWxkID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiBrbm93bktleXM7XG4gICAgICB9XG4gICAgICBzd2l0Y2ggKGNoaWxkLiQkdHlwZW9mKSB7XG4gICAgICAgIGNhc2UgUkVBQ1RfRUxFTUVOVF9UWVBFOlxuICAgICAgICBjYXNlIFJFQUNUX0NBTExfVFlQRTpcbiAgICAgICAgY2FzZSBSRUFDVF9QT1JUQUxfVFlQRTpcbiAgICAgICAgICB3YXJuRm9yTWlzc2luZ0tleShjaGlsZCk7XG4gICAgICAgICAgdmFyIGtleSA9IGNoaWxkLmtleTtcbiAgICAgICAgICBpZiAodHlwZW9mIGtleSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoa25vd25LZXlzID09PSBudWxsKSB7XG4gICAgICAgICAgICBrbm93bktleXMgPSBuZXcgU2V0KCk7XG4gIC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G51bGwpIHtcbiAgICAgICAgICAgIG5vZGUuY2hpbGRbJ3JldHVybiddID0gbm9kZTtcbiAgICAgICAgICAgIG5vZGUgPSBub2RlLmNoaWxkO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChub2RlID09PSB3b3JrSW5Qcm9ncmVzcykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICB3aGlsZSAobm9kZS5zaWJsaW5nID09PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAobm9kZVsncmV0dXJuJ10gPT09IG51bGwgfHwgbm9kZVsncmV0dXJuJ10gPT09IHdvcmtJblByb2dyZXNzKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5vZGUgPSBub2RlWydyZXR1cm4nXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgbm9kZS5zaWJsaW5nWydyZXR1cm4nXSA9IG5vZGVbJ3JldHVybiddO1xuICAgICAgICAgIG5vZGUgPSBub2RlLnNpYmxpbmc7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICB1cGRhdGVIb3N0Q29udGFpbmVyID0gZnVuY3Rpb24gKHdvcmtJblByb2dyZXNzKSB7XG4gICAgICAgIHZhciBwb3J0YWxPclJvb3QgPSB3b3JrSW5Qcm9ncmVzcy5zdGF0ZU5vZGU7XG4gICAgICAgIHZhciBjaGlsZHJlblVuY2hhbmdlZCA9IHdvcmtJblByb2dyZXNzLmZpcnN0RWZmZWN0ID09PSBudWxsO1xuICAgICAgICBpZiAoY2hpbGRyZW5VbmNoYW5nZWQpIHtcbiAgICAgICAgICAvLyBObyBjaGFuZ2VzLCBqdXN0IHJldXNlIHRoZSBleGlzdGluZyBpbnN0YW5jZS5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgY29udGFpbmVyID0gcG9ydGFsT3JSb290LmNvbnRhaW5lckluZm87XG4gICA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XMgY2FuIGhhcHBlbiB3aGVuIHdlIGFib3J0IHdvcmsuXG4gICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIF9yb290Q29udGFpbmVySW5zdGFuY2UgPSBnZXRSb290SG9zdENvbnRhaW5lcigpO1xuICAgICAgICAgICAgdmFyIF9jdXJyZW50SG9zdENvbnRleHQyID0gZ2V0SG9zdENvbnRleHQoKTtcbiAgICAgICAgICAgIHZhciBfd2FzSHlkcmF0ZWQgPSBwb3BIeWRyYXRpb25TdGF0ZSh3b3JrSW5Qcm9ncmVzcyk7XG4gICAgICAgICAgICBpZiAoX3dhc0h5ZHJhdGVkKSB7XG4gICAgICAgICAgICAgIGlmIChwcmVwYXJlVG9IeWRyYXRlSG9zdFRleHRJbnN0YW5jZSh3b3JrSW5Qcm9ncmVzcykpIHtcbiAgICAgICAgICAgICAgICBtYXJrVXBkYXRlKHdvcmtJblByb2dyZXNzKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgd29ya0luUHJvZ3Jlc3Muc3RhdGVOb2RlID0gY3JlYXRlVGV4dEluc3RhbmNlKG5ld1RleHQsIF9yb290Q29udGFpbmVySW5zdGFuY2UsIF9jdXJyZW50SG9zdENvbnRleHQyLCB3b3JrSW5Qcm9ncmVzcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICBjYXNlIENhbGxDb21wb25lbnQ6XG4gICAgICAgIHJldHVybiBtb3ZlQ2FsbFRvSGFuZGxlclBoYXNlKGN1cnJlbnQsIHdvcmtJblByb2dyZXNzLCByZW5kZXJFeHBpcmF0aW9uVGltZSk7XG4gICAgICBjYXNlIENhbGxIYW5kbGVyUGhhc2U6XG4gICAgICAgIC8vIFJlc2V0IHRoZSB0YWcgdG8gbm93IGJlIGEgZmlyc3QgcGhhc2UgY2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pbWVyKGZpbmlzaGVkV29yaywgJ2NvbXBvbmVudERpZE1vdW50Jyk7XG4gICAgICAgICAgICAgIGluc3RhbmNlLnByb3BzID0gZmluaXNoZWRXb3JrLm1lbW9pemVkUHJvcHM7XG4gICAgICAgICAgICAgIGluc3RhbmNlLnN0YXRlID0gZmluaXNoZWRXb3JrLm1lbW9pemVkU3RhdGU7XG4gICAgICAgICAgICAgIGluc3RhbmNlLmNvbXBvbmVudERpZE1vdW50KCk7XG4gICAgICAgICAgICAgIHN0b3BQaGFzZVRpbWVyKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgcHJldlByb3BzID0gY3VycmVudC5tZW1vaXplZFByb3BzO1xuICAgICAgICAgICAgICB2YXIgcHJldlN0YXRlID0gY3VycmVudC5tZW1vaXplZFN0YXRlO1xuICAgICAgICAgICAgICBzdGFydFBoYXNlVGltZXIoZmluaXNoZWRXb3JrLCAnY29tcG9uZW50RGlkVXBkYXRlJyk7XG4gICAgICAgICAgICAgIGluc3RhbmNlLnByb3BzID0gZmluaXNoZWRXb3JrLm1lbW9pemVkUHJvcHM7XG4gICAgICAgICAgICAgIGluc3RhbmNlLnN0YXRlID0gZmluaXNoZWRXb3JrLm1lbW9pemVkU3RhdGU7XG4gICAgICAgICAgICAgIGluc3RhbmNlLmNvbXBvbmVudERpZFVwZGF0ZShwcmV2UHJvcHMsIHByZXZTdGF0ZSk7XG4gICAgICAgICAgICAgIHN0b3BQaGFzZVRpbWVyKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciB1cGRhdGVRdWV1ZSA9IGZpbmlzaGVkV29yay51cGRhdGVRdWV1ZTtcbiAgICAgICAgICBpZiAodXBkYXRlUXVldWUgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbW1pdENhbGxiYWNrcyh1cGRhdGVRdWV1ZSwgaW5zdGFuY2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm47X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gICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICAgICAgcmVmKGdldFB1YmxpY0luc3RhbmNlKGluc3RhbmNlKSk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgcmVmKGluc3RhbmNlKTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBjb21taXREZXRhY2hSZWYoY3VycmVudCkge1xuICAgIHZhciBjdXJyZW50UmVmID0gY3VycmVudC5yZWY7XG4gICAgaWYgKGN1cnJlbnRSZWYgIT09IG51bGwpIHtcbiAgICAgIGN1cnJlbnRSZWYobnVsbCk7XG4gICAgfVxuICB9XG5cbiAgLy8gVXNlci1vcmlnaW5hdGluZyBlcnJvcnMgKGxpZmVjeWNsZXMgYW5kIHJlZnMpIHNob3VsZCBub3QgaW50ZXJydXB0XG4gIC8vIGRlbGV0aW9uLCBzbyBkb24ndCBsZXQgdGhlbSB0aHJvdy4gSG9zdC1vcmlnaW5hdGluZyBlcnJvcnMgc2hvdWxkXG4gIC8vIGludGVycnVwdCBkZWxldGlvbiwgc28gaXQncyBva2F5XG4gIGZ1bmN0aW9uIGNvbW1pdFVubW91bnQoY3VycmVudCkge1xuICAgIGlmICh0eXBlb2Ygb25Db21taXRVbm1vdW50ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICBvbkNvbW1pdFVubW91bnQoY3VycmVudCk7XG4gICAgfVxuXG4gICAgc3dpdGNoIChjdXJyZW50LnRhZykge1xuICAgICAgY2FzZSBDbGFzc0NvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIHNhZmVseURldGFjaFJlZihjdXJyZW50KTtcbiAgICAgICAgICB2YXIgaW5zdGFuY2UgPSBjdXJyZW50LnN0YXRlTm9kZTtcbiAgICAgICAgICBpZiAodHlwZW9mIGluc3RhbmNlLmNvbXBvbmVudFdpbGxVbm1vdW50ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICBzYWZlbHlDYWxsQ29tcG9uZW50V2lsbFVubW91bnQoY3VycmVudCwgaW5zdGFuY2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIHNhZmVseURldGFjaFJlZihjdXJyZW50KTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIGNhc2UgQ2FsbENvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIGNvbW1pdE5lc3RlZFVubW91bnRzKGN1cnJlbnQuc3RhdGVOb2RlKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIGNhc2UgSG9zdFBvcnRhbDpcbiAgICAgICAge1xuICAgICAgICAgIC8vIFRPRE86IHRoaXMgaXMgcmVjdXJzaXZlLlxuICAgICAgICAgIC8vIFdlIGFyZSBhbHNvIG5vdCB1c2luZyB0aGlzIHBhcmVudCBiZWNhdXNlXG4gICAgICAgICAgLy8gdGhlIHBvcnRhbCB3aWxsIGdldCBwdXNoZWQgaW1tZWRpYXRlbHkuXG4gICAgICAgICAgaWYgKGVuYWJsZU11dGF0aW5nUmVjb25jaWxlciAmJiBtdXRhdGlvbikge1xuICAgICAgICAgICAgdW5tb3VudEhvc3RDb21wb25lbnRzKGN1cnJlbnQpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoZW5hYmxlUGVyc2lzdGVudFJlY29uY2lsZXIgJiYgcGVyc2lzdGVuY2UpIHtcbiAgICAgICAgICAgIGVtcHR5UG9ydGFsQ29udGFpbmVyKGN1cnJlbnQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBjb21taXROZXN0ZWRVbm1vdW50cyhyb290KSB7XG4gICAgLy8gV2hpbGUgd2UncmUgaW5zaWRlIGEgcmVtb3ZlZCBob3N0IG5vZG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AgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgY2FzZSBIb3N0VGV4dDpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGNhc2UgSG9zdFJvb3Q6XG4gICAgICAgICAgY2FzZSBIb3N0UG9ydGFsOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB2YXIgcG9ydGFsT3JSb290ID0gZmluaXNoZWRXb3JrLnN0YXRlTm9kZTtcbiAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lckluZm8gPSBwb3J0YWxPclJvb3QuY29udGFpbmVySW5mbyxcbiAgICAgICAgICAgICAgICAgIF9wZW5kaW5nQ2hpbGRyZW4gPSBwb3J0YWxPclJvb3QucGVuZGluZ0NoaWxkcmVuO1xuXG4gICAgICAgICAgICAgIHJlcGxhY2VDb250YWluZXJDaGlsZHJlbihjb250YWluZXJJbmZvLCBfcGVuZGluZ0NoaWxkcmVuKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGludmFyaWFudChmYWxzZSwgJ1RoaXMgdW5pdCBvZiB3b3JrIHRhZyBzaG91bGQgbm90IGhhdmUgc2lkZS1lZmZlY3RzLiBUaGlzIGVycm9yIGlzIGxpa2VseSBjYXVzZWQgYnkgYSBidWcgaW4gUmVhY3QuIFBsZWFzZSBmaWxlIGFuIGlzc3VlLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9O1xuICAgIH0gZWxzZSB7XG4gICAgICBjb21taXRDb250YWluZXIgPSBmdW5jdGlvbiAoZmluaXNoZWRXb3JrKSB7XG4gICAgICAgIC8vIE5vb3BcbiAgICAgIH07XG4gICAgfVxuICAgIGlmIChlbmFibGVQZXJzaXN0ZW50UmVjb25jaWxlciB8fCBlbmFibGVOb29wUmVjb25jaWxlcikge1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgY29tbWl0UmVzZXRUZXh0Q29udGVudDogZnVuY3Rpb24gKGZpbmlzaGVkV29yaykge30sXG4gICAgICAgIGNvbW1pdFBsYWNlbWVudDogZnVuY3Rpb24gKGZpbmlzaGVkV29yaykge30sXG4gICAgICAgIGNvbW1pdERlbGV0aW9uOiBmdW5jdGlvbiAoY3VycmVudCkge1xuICAgICAgICAgIC8vIERldGFjaCByZWZzIGFuZCBjYWxsIGNvbXBvbmVudFdpbGxVbm1vdW50KCkgb24gdGhlIHdob2xlIHN1YnRyZWUuXG4gICAgICAgICAgY29tbWl0TmVzdGVkVW5tb3VudHMoY3VycmVudCk7XG4gICAgICAgICAgZGV0YWNoRmliZXIoY3VycmVudCk7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbW1pdFdvcms6IGZ1bmN0aW9uIChjdXJyZW50LCBmaW5pc2hlZFdvcmspIHtcbiAgICAgICAgICBjb21taXRDb250YWluZXIoZmluaXNoZWRXb3JrKTtcbiAgICAgICAgfSxcblxuICAgICAgICBjb21taXRMaWZlQ3ljbGVzOiBjb21taXRMaWZlQ3ljbGVzLFxuICAgICAgICBjb21taXRBdHRhY2hSZWY6IGNvbW1pdEF0dGFjaFJlZixcbiAgICAgICAgY29tbWl0RGV0YWNoUmVmOiBjb21taXREZXRhY2hSZWZcbiAgICAgIH07XG4gICAgfSBlbHNlIGlmIChwZXJzaXN0ZW5jZSkge1xuICAgICAgaW52YXJpYW50KGZhbHNlLCAnUGVyc2lzdGVudCByZWNvbmNpbGVyIGlzIGRpc2FibGVkLicpO1xuICAgIH0gZWxzZSB7XG4gICAgICBpbnZhcmlhbnQoZmFsc2UsICdOb29wIHJlY29uY2lsZXIgaXMgZGlzYWJsZWQuJyk7XG4gICAgfVxuICB9XG4gIHZhciBjb21taXRNb3VudCA9IG11dGF0aW9uLmNvbW1pdE1vdW50LFxuICAgICAgY29tbWl0VXBkYXRlID0gbXV0YX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aXNDb250YWluZXIpIHtcbiAgICAgICAgICAgIGFwcGVuZENoaWxkVG9Db250YWluZXIocGFyZW50LCBub2RlLnN0YXRlTm9kZSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGFwcGVuZENoaWxkKHBhcmVudCwgbm9kZS5zdGF0ZU5vZGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmIChub2RlLnRhZyA9PT0gSG9zdFBvcnRhbCkge1xuICAgICAgICAvLyBJZiB0aGUgaW5zZXJ0aW9uIGl0c2VsZiBpcyBhIHBvcnRhbCwgdGhlbiB3ZSBkb24ndCB3YW50IHRvIHRyYXZlcnNlXG4gICAgICAgIC8vIGRvd24gaXRzIGNoaWxkcmVuLiBJbnN0ZWFkLCB3ZSdsbCBnZXQgaW5zZXJ0aW9ucyBmcm9tIGVhY2ggY2hpbGQgaW5cbiAgICAgICAgLy8gdGhlIHBvcnRhbCBkaXJlY3RseS5cbiAgICAgIH0gZWxzZSBpZiAobm9kZS5jaGlsZCAhPT0gbnVsbCkge1xuICAgICAgICBub2RlLmNoaWxkWydyZXR1cm4nXSA9IG5vZGU7XG4gICAgICAgIG5vZGUgPSBub2RlLmNoaWxkO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cbiAgICAgIGlmIChub2RlID09PSBmaW5pc2hlZFdvcmspIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgd2hpbGUgKG5vZGUuc2libGluZyA9PT0gbnVsbCkge1xuICAgICAgICBpZiAobm9kZVsncmV0dXJuJ10gPT09IG51bGwgfHwgbm9kZVsncmV0dXJuJ10gPT09IGZpbmlzaGVkV29yaykge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBub2RlID0gbm9kZVsncmV0dXJuJ107XG4gICAgICB9XG4gICAgICBub2RlLnNpYmxpbmdbJ3JldHVybiddID0gbm9kZVsncmV0dXJuJ107XG4gICAgICBub2Rl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AgIGN1cnJlbnRQYXJlbnRJc0NvbnRhaW5lciA9IGZhbHNlO1xuICAgICAgICAgICAgICBicmVhayBmaW5kUGFyZW50O1xuICAgICAgICAgICAgY2FzZSBIb3N0Um9vdDpcbiAgICAgICAgICAgICAgY3VycmVudFBhcmVudCA9IHBhcmVudC5zdGF0ZU5vZGUuY29udGFpbmVySW5mbztcbiAgICAgICAgICAgICAgY3VycmVudFBhcmVudElzQ29udGFpbmVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgYnJlYWsgZmluZFBhcmVudDtcbiAgICAgICAgICAgIGNhc2UgSG9zdFBvcnRhbDpcbiAgICAgICAgICAgICAgY3VycmVudFBhcmVudCA9IHBhcmVudC5zdGF0ZU5vZGUuY29udGFpbmVySW5mbztcbiAgICAgICAgICAgICAgY3VycmVudFBhcmVudElzQ29udGFpbmVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgYnJlYWsgZmluZFBhcmVudDtcbiAgICAgICAgICB9XG4gICAgICAgICAgcGFyZW50ID0gcGFyZW50WydyZXR1cm4nXTtcbiAgICAgICAgfVxuICAgICAgICBjdXJyZW50UGFyZW50SXNWYWxpZCA9IHRydWU7XG4gICAgICB9XG5cbiAgICAgIGlmIChub2RlLnRhZyA9PT0gSG9zdENvbXBvbmVudCB8fCBub2RlLnRhZyA9PT0gSG9zdFRleHQpIHtcbiAgICAgICAgY29tbWl0TmVzdGVkVW5tb3VudHMobm9kZSk7XG4gICAgICAgIC8vIEFmdGVyIGFsbCB0aGUgY2hpbGRyZW4gaGF2ZSB1bm1vdW50ZWQsIGl0IGlzIG5vdyBzYWZlIHRvIHJlbW92ZSB0aGVcbiAgICAgICAgLy8gbm9kZSBmcm9tIHRoZSB0cmVlLlxuICAgICAgICBpZiAoY3VycmVudFBhcmVudElzQ29udGFpbmVyKSB7XG4gICAgICAgICAgcmVtb3ZlQ2hpbGRGcm9tQ29udGFpbmVyKGN1cnJlbnRQYXJlbnQsIG5vZGUuc3RhdGVOb2RlKTtc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3VycmVudC5tZW1vaXplZFByb3BzIDogbmV3VGV4dDtcbiAgICAgICAgICBjb21taXRUZXh0VXBkYXRlKHRleHRJbnN0YW5jZSwgb2xkVGV4dCwgbmV3VGV4dCk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICBjYXNlIEhvc3RSb290OlxuICAgICAgICB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICBkZWZhdWx0OlxuICAgICAgICB7XG4gICAgICAgICAgaW52YXJpYW50KGZhbHNlLCAnVGhpcyB1bml0IG9mIHdvcmsgdGFnIHNob3VsZCBub3QgaGF2ZSBzaWRlLWVmZmVjdHMuIFRoaXMgZXJyb3IgaXMgbGlrZWx5IGNhdXNlZCBieSBhIGJ1ZyBpbiBSZWFjdC4gUGxlYXNlIGZpbGUgYW4gaXNzdWUuJyk7XG4gICAgICAgIH1cbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBjb21taXRSZXNldFRleHRDb250ZW50KGN1cnJlbnQpIHtcbiAgICByZXNldFRleHRDb250ZW50KGN1cnJlbnQuc3RhdGVOb2RlKTtcbiAgfVxuXG4gIGlmIChlbmFibGVNdXRhdGluZ1JlY29uY2lsZXIpIHtcbiAgICByZXR1cm4ge1xuICAgICAgY29tbWl0UmVzZXRUZXh0Q29udGVudDogY29tbWl0UmVzZXRUZXh0Q29udGVudCxcbiAgICAgIGNvbW1pdFBsYWNlbWVudDogY29tbWl0UGxhY2VtZW50LFxuICAgICAgY29tbWl0RGVsZXRpb246IGNvbW1pdERlbGV0aW9uLFxuICAgICAgY29tbWl0V29yazogY29tbWl0V29yayxcbiAgICAgIGNvbW1pdExpZmVDeWNsZXM6IGNvbW1pdExpZmVDeWNsZXMsXG4gICAgICBjb21taXRBdHRhY2hSZWY6IGNvbW1pdEF0dGFjaFJlZixcbiAgICAgIGNvbW1pdERldGFjaFJlZjogY29tbWl0RGV0YWNoUmVmXG4gICAgfTtcbiAgfSBlbHNlIHtcbiA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udWxsKSB7XG4gICAgICByZXR1cm5GaWJlci5sYXN0RWZmZWN0Lm5leHRFZmZlY3QgPSBjaGlsZFRvRGVsZXRlO1xuICAgICAgcmV0dXJuRmliZXIubGFzdEVmZmVjdCA9IGNoaWxkVG9EZWxldGU7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybkZpYmVyLmZpcnN0RWZmZWN0ID0gcmV0dXJuRmliZXIubGFzdEVmZmVjdCA9IGNoaWxkVG9EZWxldGU7XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gaW5zZXJ0Tm9uSHlkcmF0ZWRJbnN0YW5jZShyZXR1cm5GaWJlciwgZmliZXIpIHtcbiAgICBmaWJlci5lZmZlY3RUYWcgfD0gUGxhY2VtZW50O1xuICAgIHtcbiAgICAgIHN3aXRjaCAocmV0dXJuRmliZXIudGFnKSB7XG4gICAgICAgIGNhc2UgSG9zdFJvb3Q6XG4gICAgICAgICAge1xuICAgICAgICAgICAgdmFyIHBhcmVudENvbnRhaW5lciA9IHJldHVybkZpYmVyLnN0YXRlTm9kZS5jb250YWluZXJJbmZvO1xuICAgICAgICAgICAgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgICAgICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICAgICAgICAgIHZhciB0eXBlID0gZmliZXIudHlwZTtcbiAgICAgICAgICAgICAgICB2YXIgcHJvcHMgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG4gICAgICAgICAgICAgICAgZGlkTm90RmluZEh5ZHJhdGFibGVDb250YWluZXJJbnN0YW5jZShwYXJlbnRDb250YWluZXIsIHR5cGUsIHByb3BzKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSBIb3N0VGV4dDpcbiAgICAgICAgICAgICAgICB2YXIgdGV4dCA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICAgICAgICBkaWROb3RGaW5kSHlkcmF0YWJsZUNvbnRhaW5lclRleHRJbnN0YW5jZShwYXJlbnRDb250YWluZXIsIHRleHQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICAgICAge1xuICAgICAgICAgICAgdmFyIHBhcmVudFR5cGUgPSByZXR1cm5GaWJlci50eXBlO1xuICAgICAgICAgICAgdmFyIHBhcmVudFByb3BzID0gcmV0dXJuRmliZXIubWVtb2l6ZWRQcm9wcztcbiAgICAgICAgICAgIHZhciBwYXJlbnRJbnN0YW5jZSA9IHJldHVybkZpYmVyLnN0YXRlTm9kZTtcbiAgICAgICAgICAgIHN3aXRjaCAoZmliZXIudGFnKSB7XG4gICAgICAgICAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAgICAgICAgICB2YXIgX3R5cGUgPSBmaWJlci50eXBlO1xuICAgICAgICAgICAgICAgIHZhciBfcHJvcHMgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG4gICAgICAgICAgICAgICAgZGlkTm90RmluZEh5ZHJhdGFibGVJbnN0YW5jZShwYXJlbnRUeXBlLCBwYXJlbnRQcm9wcywgcGFyZW50SW5zdGFuY2UsIF90eXBlLCBfcHJvcHMpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAgICAgICAgICAgIHZhciBfdGV4dCA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICAgICAgICBkaWROb3RGaW5kSHlkcmF0YWJsZVRleHRJbnN0YW5jZShwYXJlbnRUeXBlLCBwYXJlbnRQcm9wcywgcGFyZW50SW5zdGFuY2UsIF90ZXh0KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gdHJ5SHlkcmF0ZShmaWJlciwgbmV4dEluc3RhbmNlKSB7XG4gICAgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAge1xuICAgICAgICAgIHZhciB0eXBlID0gZmliZXIudHlwZTtcbiAgICAgICAgICB2YXIgcHJvcHMgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG4gICAgICAgICAgdmFyIGluc3RhbmNlID0gY2FuSHlkcmF0ZUluc3RhbmNlKG5leHRJbnN0YW5jZSwgdHlwZSwgcHJvcHMpO1xuICAgICAgICAgIGlmIChpbnN0YW5jZSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgZmliZXIuc3RhdGVOb2RlID0gaW5zdGFuY2U7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIHRleHQgPSBmaWJlci5wZW5kaW5nUHJvcHM7XG4gICAgICAgICAgdmFyIHRleHRJbnN0YW5jZSA9IGNhbkh5ZHJhdGVUZXh0SW5zdGFuY2UobmV4dEluc3RhbmNlLCB0ZXh0KTtcbiAgICAgICAgICBpZiAodGV4dEluc3RhbmNlICE9PSBudWxsKSB7XG4gICAgICAgICAgICBmaWJlci5zdGF0ZU5vZGUgPSB0ZXh0SW5zdGFuY2U7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICBkZWZhdWx0OlxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gdHJ5VG9DbGFpbU5leHRIeWR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ICAgICAgaWYgKHJldHVybkZpYmVyICE9PSBudWxsKSB7XG4gICAgICAgICAgc3dpdGNoIChyZXR1cm5GaWJlci50YWcpIHtcbiAgICAgICAgICAgIGNhc2UgSG9zdFJvb3Q6XG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50Q29udGFpbmVyID0gcmV0dXJuRmliZXIuc3RhdGVOb2RlLmNvbnRhaW5lckluZm87XG4gICAgICAgICAgICAgICAgZGlkTm90TWF0Y2hIeWRyYXRlZENvbnRhaW5lclRleHRJbnN0YW5jZShwYXJlbnRDb250YWluZXIsIHRleHRJbnN0YW5jZSwgdGV4dENvbnRlbnQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50VHlwZSA9IHJldHVybkZpYmVyLnR5cGU7XG4gICAgICAgICAgICAgICAgdmFyIHBhcmVudFByb3BzID0gcmV0dXJuRmliZXIubWVtb2l6ZWRQcm9wcztcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50SW5zdGFuY2UgPSByZXR1cm5GaWJlci5zdGF0ZU5vZGU7XG4gICAgICAgICAgICAgICAgZGlkTm90TWF0Y2hIeWRyYXRlZFRleHRJbnN0YW5jZShwYXJlbnRUeXBlLCBwYXJlbnRQcm9wcywgcGFyZW50SW5zdGFuY2UsIHRleHRJbnN0YW5jZSwgdGV4dENvbnRlbnQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBzaG91bGRVcGRhdGU7XG4gIH1cblxuICBmdW5jdGlvbiBwb3BUb05leHRIb3N0UGFyZW50KGZpYmVyKSB7XG4gICAgdmFyIHBhcmVudCA9IGZpYmVyWydyZXR1cm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ZVxuICAgICAgICAgICAgdmFyIF9jdXJyZW50ID0gbmV4dEVmZmVjdC5hbHRlcm5hdGU7XG4gICAgICAgICAgICBjb21taXRXb3JrKF9jdXJyZW50LCBuZXh0RWZmZWN0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSBVcGRhdGU6XG4gICAgICAgICAge1xuICAgICAgICAgICAgdmFyIF9jdXJyZW50MiA9IG5leHRFZmZlY3QuYWx0ZXJuYXRlO1xuICAgICAgICAgICAgY29tbWl0V29yayhfY3VycmVudDIsIG5leHRFZmZlY3QpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlIERlbGV0aW9uOlxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGlzVW5tb3VudGluZyA9IHRydWU7XG4gICAgICAgICAgICBjb21taXREZWxldGlvbihuZXh0RWZmZWN0KTtcbiAgICAgICAgICAgIGlzVW5tb3VudGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgfVxuICAgICAgbmV4dEVmZmVjdCA9IG5leHRFZmZlY3QubmV4dEVmZmVjdDtcbiAgICB9XG5cbiAgICB7XG4gICAgICBSZWFjdERlYnVnQ3VycmVudEZpYmVyLnJlc2V0Q3VycmVudEZpYmVyKCk7XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gY29tbWl0QWxsTGlmZUN5Y2xlcygpIHtcbiAgICB3aGlsZSAobmV4dEVmZmVjdCAhPT0gbnVsbCkge1xuICAgICAgdmFyIGVmZmVjdFRhZyA9IG5leHRFZmZlY3QuZWZmZWN0VGFnO1xuXG4gICAgICBpZiAoZWZmZWN0VGFnICYgKFVwZGF0ZSB8IENhbGxiYWNrKSkge1xuICAgICAgICByZWNvcmRFZmZlY3QoKTtcbiAgICAgICAgdmFyIGN1cnJlbnQgPSBuZXh0RWZmZWN0LmFsdGVybmF0ZTtcbiAgICAg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xuICBmdW5jdGlvbiBmaW5kSG9zdEluc3RhbmNlKGZpYmVyKSB7XG4gICAgdmFyIGhvc3RGaWJlciA9IGZpbmRDdXJyZW50SG9zdEZpYmVyKGZpYmVyKTtcbiAgICBpZiAoaG9zdEZpYmVyID09PSBudWxsKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG4gICAgcmV0dXJuIGhvc3RGaWJlci5zdGF0ZU5vZGU7XG4gIH1cblxuICByZXR1cm4ge1xuICAgIGNyZWF0ZUNvbnRhaW5lcjogZnVuY3Rpb24gKGNvbnRhaW5lckluZm8sIGh5ZHJhdGUpIHtcbiAgICAgIHJldHVybiBjcmVhdGVGaWJlclJvb3QoY29udGFpbmVySW5mbywgaHlkcmF0ZSk7XG4gICAgfSxcbiAgICB1cGRhdGVDb250YWluZXI6IGZ1bmN0aW9uIChlbGVtZW50LCBjb250YWluZXIsIHBhcmVudENvbXBvbmVudCwgY2FsbGJhY2spIHtcbiAgICAgIC8vIFRPRE86IElmIHRoaXMgaXMgYSBuZXN0ZWQgY29udGFpbmVyLCB0aGlzIHdvbid0IGJlIHRoZSByb290LlxuICAgICAgdmFyIGN1cnJlbnQgPSBjb250YWluZXIuY3VycmVudDtcblxuICAgICAge1xuICAgICAgICBpZiAoUmVhY3RGaWJlckluc3RydW1lbnRhdGlvbl8xLmRlYnVnVG9vbCkge1xuICAgICAgICAgIGlmIChjdXJyZW50LmFsdGVybmF0ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgUmVhY3RGaWJlckluc3RydW1lbnRhdGlvbl8xLmRlYnVnVG9vbC5vbk1vdW50Q29udGFpbmVyKGNvbnRhaW5lcik7XG4gICAgICAgICAgfSBlbHNlIGlmIChlbGVtZW50ID09PSBudWxsKSB7XG4gICAgICAgICAgICBSZWFjdEZpYmVySW5zdHJ1bWVudGF0aW9uXzEuZGVidWdUb29sLm9uVW5tb3VudENvbnRhaW5lcihjb250YWluZXIpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBSZWFjdEZpYmVySW5zdHJ1bWVudGF0aW9uXzEuZGVidWdUb29sLm9uVXBkYXRlQ29udGFpbmVyKGNvbnRhaW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHZhciBjb250ZXh0ID0gZ2V0Q29udGV4dEZvclN1YnRyZWUocGFyZW50Q29tcG9uZW50KTtcbiAgICAgIGlmIChjb250YWluZXIuY29udGV4dCA9PT0gbnVsbCkge1xuICAgICAgICBjb250YWluZXIuY29udGV4dCA9IGNvbnRleHQ7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjb250YWluZXIucGVuZGluZ0NvbnRleHQgPSBjb250ZXh0O1xuICAgICAgfVxuXG4gICAgICBzY2hlZHVsZVRvcExldmVsVXBkYXRlKGN1cnJlbnQsIGVsZW1lbnQsIGNhbGxiYWNrKTtcbiAgICB9LFxuXG5cbiAgICBiYXRjaGVkVXBkYXRlczogYmF0Y2hlZFVwZGF0ZXMsXG5cbiAgICB1bmJhdGNoZWRVcGRhdGVzOiB1bmJhdGNoZWRVcGRhdGVzLFxuXG4gICAgZGVmZXJyZWRVcGRhdGVzOiBkZWZlcnJlZFVwZGF0ZXMsXG5cbiAgICBmbHVzaFN5bmM6IGZsdXNoU3luYyxcblxuICAgIGdldFB1YmxpY1Jvb3RJbnN0YW5jZTogZnVuY3Rpb24gKGNvbnRhaW5lcikge1xuICAgICAgdmFyIGNvbnRhaW5lckZpYmVyID0gY29udGFpbmVyLmN1cnJlbnQ7XG4gICAgICBpZiAoIWNvbnRhaW5lckZpYmVyLmNoaWxkKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgc3dpdGNoIChjb250YWluZXJGaWJlci5jaGlsZC50YWcpIHtcbiAgICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICAgIHJldHVybiBnZXRQdWJsaWNJbnN0YW5jZShjb250YWluZXJGaWJlci5jaGlsZC5zd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51bGw7XG5cbiAgICAgICAgaWYgKHByb3BlcnR5SW5mby5oYXNPdmVybG9hZGVkQm9vbGVhblZhbHVlKSB7XG4gICAgICAgICAgaWYgKG5vZGUuaGFzQXR0cmlidXRlKGF0dHJpYnV0ZU5hbWUpKSB7XG4gICAgICAgICAgICB2YXIgdmFsdWUgPSBub2RlLmdldEF0dHJpYnV0ZShhdHRyaWJ1dGVOYW1lKTtcbiAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gJycpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2hvdWxkSWdub3JlVmFsdWUocHJvcGVydHlJbmZvLCBleHBlY3RlZCkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSAnJyArIGV4cGVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiBleHBlY3RlZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAobm9kZS5oYXNBdHRyaWJ1dGUoYXR0cmlidXRlTmFtZSkpIHtcbiAgICAgICAgICBpZiAoc2hvdWxkSWdub3JlVmFsdWUocHJvcGVydHlJbmZvLCBleHBlY3RlZCkpIHtcbiAgICAgICAgICAgIC8vIFdlIGhhZCBhbiBhdHRyaWJ1dGUgYnV0IHNob3VsZG4ndCBoYXZlIGhhZCBvbmUsIHNvIHJlYWQgaXRcbiAgICAgICAgICAgIC8vIGZvciB0aGUgZXJyb3IgbWVzc2FnZS5cbiAgICAgICAgICAgIHJldHVybiBub2RlLmdldEF0dHJpYnV0ZShhdHRyaWJ1dGVOYW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHByb3BlcnR5SW5mby5oYXNCb29sZWFuVmFsdWUpIHtcbiAgICAgICAgICAgIC8vI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gJykkJylcbiAgICB9XG4gIH1cblxuICByZXR1cm4gZnVuY3Rpb24gKG9iaiwgb3B0cykge1xuICAgIHZhciBwYXRoID0gJydcbiAgICB2YXIgZGF0YSA9IG9iaiB8fCB7fVxuICAgIHZhciBvcHRpb25zID0gb3B0cyB8fCB7fVxuICAgIHZhciBlbmNvZGUgPSBvcHRpb25zLnByZXR0eSA/IGVuY29kZVVSSUNvbXBvbmVudFByZXR0eSA6IGVuY29kZVVSSUNvbXBvbmVudFxuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0b2tlbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciB0b2tlbiA9IHRva2Vuc1tpXVxuXG4gICAgICBpZiAodHlwZW9mIHRva2VuID09PSAnc3RyaW5nJykge1xuICAgICAgICBwYXRoICs9IHRva2VuXG5cbiAgICAgICAgY29udGludWVcbiAgICAgIH1cblxuICAgICAgdmFyIHZhbHVlID0gZGF0YVt0b2tlbi5uYW1lXVxuICAgICAgdmFyIHNlZ21lbnRcblxuICAgICAgaWYgKHZhbHVlID09IG51bGwpIHtcbiAgICAgICAgaWYgKHRva2VuLm9wdGlvbmFsKSB7XG4gICAgICAgICAgLy8gUHJlcGVuZCBwYXJ0aWFsIHNlZ21lbnQgcHJlZml4ZXMuXG4gICAgICAgICAgaWYgKHRva2VuLnBhcnRpYWwpIHtcbiAgICAgICAgICAgIHBhdGggKz0gdG9rZW4ucHJlZml4XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29udGludWVcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFeHBlY3RlZCBcIicgKyB0b2tlbi5uYW1lICsgJ1wiIHRvIGJlIGRlZmluZWQnKVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChpc2FycmF5KHZhbHVlKSkge1xuICAgICAgICBpZiAoIXRva2VuLnJlcGVhdCkge1xuICAgICAgICAgIHRocm93IG5ldyBUeXBlR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25Qcm9wZXJ0eS5jYWxsKG9iaiwgaSkpIGNvbnRpbnVlOyB0YXJnZXRbaV0gPSBvYmpbaV07IH0gcmV0dXJuIHRhcmdldDsgfVxuXG5mdW5jdGlvbiBfdG9Db25zdW1hYmxlQXJyYXkoYXJyKSB7IGlmIChBcnJheS5pc0FycmF5KGFycikpIHsgZm9yICh2YXIgaSA9IDAsIGFycjIgPSBBcnJheShhcnIubGVuZ3RoKTsgaSA8IGFyci5sZW5ndGg7IGkrKykgeyBhcnIyW2ldID0gYXJyW2ldOyB9IHJldHVybiBhcnIyOyB9IGVsc2UgeyByZXR1cm4gQXJyYXkuZnJvbShhcnIpOyB9IH0gLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUmVhY3QgR29vZ2xlIEFuYWx5dGljcyBNb2R1bGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEBwYWNrYWdlIHJlYWN0LWdhXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQGF1dGhvciAgQWRhbSBMb2Z0aW5nIDxhZGFtQG1vemlsbGFmb3VuZGF0aW9uLm9yZz5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgICAgICBBdHVsIFZhcm1hIDxhdHVsQG1vemlsbGFmb3VuZGF0aW9uLm9yZz5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi9cblxuLyoqXG4gKiBVdGlsaXRpZXNcbiAqL1xuXG5cbnZhciBfZGVidWcgPSBmYWxzZTtcbnZhciBfdGl0bGVDYXNlID0gdHJ1ZTtcbnZhciBfdGVzdE1vZGUgPSBmYWxzZTtcblxudmFyIGludGVybmFsR2EgPSBmdW5jdGlvbiBpbnRlcm5hbEdhKCkge1xuICB2YXIgX3dpbmRvdztcblxuICBpZiAoX3Rlc3RNb2RlKSByZXR1cm4gX3Rlc3RNb2RlQVBJMi5kZWZhdWx0LmdhLmFwcGx5KF90ZXN0TW9kZUFQSTIuZGVmY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1teQF0rQFteQF0rLy50ZXN0KHMpXG4gICk7XG59XG5cbi8qKiovIH0pLFxuLyogNSAqL1xuLyoqKi8gKGZ1bmN0aW9uKG1vZHVsZSwgZXhwb3J0cywgX193ZWJwYWNrX3JlcXVpcmVfXykge1xuXG5cInVzZSBzdHJpY3RcIjtcblxuXG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgdmFsdWU6IHRydWVcbn0pO1xuZXhwb3J0cy5kZWZhdWx0ID0gdG9UaXRsZUNhc2U7XG5cbnZhciBfdHJpbSA9IF9fd2VicGFja19yZXF1aXJlX18oMSk7XG5cbnZhciBfdHJpbTIgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF90cmltKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxudmFyIHNtYWxsV29yZHMgPSAvXihhfGFufGFuZHxhc3xhdHxidXR8Ynl8ZW58Zm9yfGlmfGlufG5vcnxvZnxvbnxvcnxwZXJ8dGhlfHRvfHZzP1xcLj98dmlhKSQvaTsgLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFRvIFRpdGxlIENhc2UgMi4xIC0gaHR0cDovL2luZGl2aWRlZC5jb20vY29kZS90by10aXRsZS1jYXNlL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb3B5cmlnaHQgMjAwOC0yMDEzIERhdmlkIEdvdWNoLiBMaWNlbnNlZCB1bmRlciB0aGUgTUlUIExpY2Vuc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGh0dHBzOi8vZ2l0aHViLmNvbS9nb3VjaC90by10aXRsZS1jYXNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuXG5mdW5jdGlvbiB0b1RpdGxlQ2FzZShzdHJpbmcpIHtcbiAgcmV0dXJuICgwLCBfdHJpbTIuZGVmYXVsdCkoc3RyaW5nKS5yZXBsYWNlKC9bQS1aYS16MC05XFx1MDBDMC1cXHUwMEZGXStbXlxccy1dKi9nLCBmdW5jdGlvbiAobWF0Y2gsIGluZGV4LCB0aXRsZSkge1xuICAgIGlmIChpbmRleCA+IDAgJiYgaW5kZXggKyBtYXRjaC5sZW5ndGggIT09IHRpdGxlLmxlbmd0aCAmJiBtYXRjaC5zZWFyY2goc21hbGxXb3JkcykgPiAtMSAmJiB0aXRsZS5jaGFyQXQoaW5kZXggLSAyKSAhPT0gJzonICYmICh0aXRsZS5jaGFyQXQoaW5kZXggKyBtYXRjaC5sZW5ndGgpICE9PSAnLScgfHwgdGl0bGUuY2hhckF0KGluZGV4IC0gMSkgPT09ICctJykgJiYgdGl0bGUuY2hhckF0KGluZGV4IC0gMSkuc2VhcmNoKC9bXlxccy1dLykgPCAwKSB7XG4gICAgICByZXR1cm4gbWF0Y2gudG9Mb3dlckNhc2UoKTtcbiAgICB9XG5cbiAgICBpZiAobWF0Y2guc3Vic3RyKDEpLnNlYXJjaCgvW0EtWl18XFwuLi8pID4gLTEpIHtcbiAgICAgIHJldHVybiBtYXRjaDtcbiAgICB9XG5cbiAgICByZXR1cm4gbWF0Y2guY2hhckF0KDApLnRvVXBwZXJDYXNlKCkgKyBtYXRjaC5zdWJzdHIoMSk7XG4gIH0pO1xufVxuXG4vKioqL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ICA8L2Rpdj5cbiAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT0nbmF2LWJhci0tcmlnaHQnPlxuICAgICAgICAgICAgPE5hdkxpbmsgY2xhc3NOYW1lPSduYXYtYmFyLWxpbmsgbGluay0tbmF2JyBhY3RpdmVDbGFzc05hbWU9J2xpbmstLW5hdi1hY3RpdmUnIHRvPScvJyBleGFjdD5QdWJsaXNoPC9OYXZMaW5rPlxuICAgICAgICAgICAgPE5hdkxpbmsgY2xhc3NOYW1lPSduYXYtYmFyLWxpbmsgbGluay0tbmF2JyAgYWN0aXZlQ2xhc3NOYW1lPSdsaW5rLS1uYXYtYWN0aXZlJyB0bz0nL2Fib3V0Jz5BYm91dDwvTmF2TGluaz5cbiAgICAgICAgICAgIHsgdGhpcy5wcm9wcy5jaGFubmVsTmFtZSA/IChcbiAgICAgICAgICAgICAgPE5hdkJhckNoYW5uZWxEcm9wZG93blxuICAgICAgICAgICAgICAgIGNoYW5uZWxOYW1lPXt0aGlzLnByb3BzLmNoYW5uZWxOYW1lfVxuICAgICAgICAgICAgICAgIGhhbmRsZVNlbGVjdGlvbj17dGhpcy5oYW5kbGVTZWxlY3Rpb259XG4gICAgICAgICAgICAgICAgZGVmYXVsdFNlbGVjdGlvbj17dGhpcy5wcm9wcy5jaGFubmVsTmFtZX1cbiAgICAgICAgICAgICAgICBWSUVXPXtWSUVXfVxuICAgICAgICAgICAgICAgIExPR09VVD17TE9HT1VUfVxuICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgPE5hdkxpbmsgaWQ9J25hdi1iYXItbG9naW4tbGluaycgY2xhc3NOYW1lPSduYXYtYmFyLWxpbmsgbGluay0tbmF2JyBhY3RpdmVDbGFzc05hbWU9J2xpbmstLW5hdi1hY3RpdmUnIHRvPScvbG9naW4nPkNoYW5uZWw8L05hdkxpbms+XG4gICAgICAgICAgICApfVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5cbiA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lbWVudC5xdWVyeVNlbGVjdG9yQWxsKHR5cGUgKyBcIltcIiArIF9IZWxtZXRDb25zdGFudHMuSEVMTUVUX0FUVFJJQlVURSArIFwiXVwiKTtcbiAgICB2YXIgb2xkVGFncyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKHRhZ05vZGVzKTtcbiAgICB2YXIgbmV3VGFncyA9IFtdO1xuICAgIHZhciBpbmRleFRvRGVsZXRlID0gdm9pZCAwO1xuXG4gICAgaWYgKHRhZ3MgJiYgdGFncy5sZW5ndGgpIHtcbiAgICAgICAgdGFncy5mb3JFYWNoKGZ1bmN0aW9uICh0YWcpIHtcbiAgICAgICAgICAgIHZhciBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCh0eXBlKTtcblxuICAgICAgICAgICAgZm9yICh2YXIgYXR0cmlidXRlIGluIHRhZykge1xuICAgICAgICAgICAgICAgIGlmICh0YWcuaGFzT3duUHJvcGVydHkoYXR0cmlidXRlKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cmlidXRlID09PSBfSGVsbWV0Q29uc3RhbnRzLlRBR19QUk9QRVJUSUVTLklOTkVSX0hUTUwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuaW5uZXJIVE1MID0gdGFnLmlubmVySFRNTDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhdHRyaWJ1dGUgPT09IF9IZWxtZXRDb25zdGFudHMuVEFHX1BST1BFUlRJRVMuQ1NTX1RFWFQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdFbGVtZW50LnN0eWxlU2hlZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LnN0eWxlU2hlZXQuY3NzVGV4dCA9IHRhZy5jc3NUZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKHRhZy5jc3NUZXh0KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSB0eXBlb2YgdGFnW2F0dHJpYnV0ZV0gPT09IFwidW5kZWZpbmVkXCIgPyBcIlwiIDogdGFnW2F0dHJpYnV0ZV07XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LnNldEF0dHJpYnV0ZShhdHRyaWJ1dGUsIHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbmV3RWxlbWVudC5zZXRBdHRyaWJ1dGUoX0hlbG1ldENvbnN0YW50cy5IRUxNRVRfQVRUUklCVVRFLCBcInRydWVcIik7XG5cbiAgICAgICAgICAgIC8vIFJlbW92ZSBhIGR1cGxpY2F0ZSB0YWcgZnJvbSBkb21UYWdzdG9SZW1vdmUsIHNvIGl0IGlzbid0IGNsZWFyZWQuXG4gICAgICAgICAgICBpZiAob2xkVGFncy5zb21lKGZ1bmN0aW9uIChleGlzdGluZ1RhZywgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICBpbmRleFRvRGVsZXRlID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ld0VsZW1lbnQuaXNFcXVhbE5vZGUoZXhpc3RpbmdUYWcpO1xuICAgICAgICAgICAgfSkpIHtcbiAgICAgICAgICAgICAgICBvbGRUYWdzLnNwbGljZShpbmRleFRvRGVsZXRlLCAxKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbmV3VGFncy5wdXNoKG5ld0VsZW1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICB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B7XG4gICAgICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSB0YWcuaW5uZXJIVE1MIHx8IHRhZy5jc3NUZXh0O1xuICAgICAgICAgICAgICAgIG1hcHBlZFRhZy5kYW5nZXJvdXNseVNldElubmVySFRNTCA9IHsgX19odG1sOiBjb250ZW50IH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG1hcHBlZFRhZ1ttYXBwZWRBdHRyaWJ1dGVdID0gdGFnW2F0dHJpYnV0ZV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBfcmVhY3QyLmRlZmF1bHQuY3JlYXRlRWxlbWVudCh0eXBlLCBtYXBwZWRUYWcpO1xuICAgIH0pO1xufTtcblxudmFyIGdldE1ldGhvZHNGb3JUYWcgPSBmdW5jdGlvbiBnZXRNZXRob2RzRm9yVGFnKHR5cGUsIHRhZ3MsIGVuY29kZSkge1xuICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuVEFHX05BTUVTLlRJVExFOlxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB0b0NvbXBvbmVudDogZnVuY3Rpb24gdG9Db21wb25lbnQoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZVRpdGxlQXNSZWFjdENvbXBvbmVudCh0eXBlLCB0YWdzLnRpdGxlLCB0YWdzLnRpdGxlQXR0cmlidXRlcywgZW5jb2RlKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHRvU3RyaW5nOiBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlVGl0bGVBc1N0cmluZyh0eXBlLCB0YWdzLnRpdGxlLCB0YWdzLnRpdGxlQXR0cmlidXRlcywgZW5jb2RlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuQVRUUklCVVRFX05BTUVTLkJPRFk6XG4gICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5BVFRSSUJVVEVfTkFNRVMuSFRNTDpcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgdG9Db21wb25lbnQ6IGZ1bmN0aW9uIHRvQ29tcG9uZW50KCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udmVydEVsZW1lbnRBdHRyaWJ1dGVzdG9SZWFjdFByb3BzKHRhZ3MpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgdG9TdHJpbmc6IGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVFbGVtZW50QXR0cmlidXRlc0FzU3RyaW5nKHRhZ3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHRvQ29tcG9uZW50OiBmdW5jdGlvbiB0b0NvbXBvbmVudCgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlVGFnc0FzUmVhY3RDb21wb25lbnQodHlwZSwgdGFncyk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gdG9TdHJpbmcoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZVRhZ3NBc1N0cmluZyh0eXBlLCB0YWdzLCBlbmNvZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgfVxufTtcblxudmFyIG1hcFN0YXRlT25TZXJ2ZXIgPSBmdW5jdGlvbiBtYXBTdGF0ZU9uU2VydmVyKF9yZWYpIHtcbiAgICB2YXI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B9XG4gICAgICAgICAgICAgICAgICBhbHQ9e25hbWV9IC8+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9naWYnOlxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxpbWdcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT0nYXNzZXQnXG4gICAgICAgICAgICAgICAgICBzcmM9e2AvJHtjbGFpbUlkfS8ke25hbWV9LiR7ZmlsZUV4dH1gfVxuICAgICAgICAgICAgICAgICAgYWx0PXtuYW1lfVxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICBjYXNlICd2aWRlby9tcDQnOlxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDx2aWRlbyBjbGFzc05hbWU9J2Fzc2V0IHZpZGVvJyBjb250cm9scyBwb3N0ZXI9e3RodW1ibmFpbH0+XG4gICAgICAgICAgICAgICAgICA8c291cmNlXG4gICAgICAgICAgICAgICAgICAgIHNyYz17YC8ke2NsYWltSWR9LyR7bmFtZX0uJHtmaWxlRXh0fWB9XG4gICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgPHA+WW91ciBicm93c2VyIGRvZXMgbm90IHN1cHBvcnQgdGhlIDxjb2RlPnZpZGVvPC9jb2RlPiBlbGVtZW50LjwvcD5cbiAgICAgICAgICAgICAgICA8L3ZpZGVvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8cD5VbnN1cHBvcnRlZCBmaWxlIHR5cGU8L3A+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9KSgpXG4gICAgICAgIH1cbiAgICAgIDwvZGl2PlxuICAgICk7XG4gIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFzc2V0RGlzcGxheTtcblxuX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taG9sZGVyJz5cbiAgICAgIDxMaW5rIHRvPXtzaG93VXJsTGlua30gPlxuICAgICAgICB7KCgpID0+IHtcbiAgICAgICAgICBzd2l0Y2ggKGNvbnRlbnRUeXBlKSB7XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9qcGVnJzpcbiAgICAgICAgICAgIGNhc2UgJ2ltYWdlL2pwZyc6XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9wbmcnOlxuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvZ2lmJzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8aW1nXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWU9eydhc3NldC1wcmV2aWV3J31cbiAgICAgICAgICAgICAgICAgIHNyYz17ZGlyZWN0U291cmNlTGlua31cbiAgICAgICAgICAgICAgICAgIGFsdD17bmFtZX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgY2FzZSAndmlkZW8vbXA0JzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8aW1nXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWU9eydhc3NldC1wcmV2aWV3IHZpZGVvJ31cbiAgICAgICAgICAgICAgICAgIHNyYz17dGh1bWJuYWlsIHx8IGRlZmF1bHRUaHVtYm5haWx9XG4gICAgICAgICAgICAgICAgICBhbHQ9e25hbWV9XG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPHA+dW5zdXBwb3J0ZWQgZmlsZSB0eXBlPC9wPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSkoKX1cbiAgICAgIDwvTGluaz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEFzc2V0U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EhST1c6XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoQlVGRkVSX09WRVJGTE9XKTtcbiAgICAgICAgICBjYXNlIE9OX09WRVJGTE9XX1NMSURFOlxuICAgICAgICAgICAgYXJyW3B1c2hJbmRleF0gPSBpdDtcbiAgICAgICAgICAgIHB1c2hJbmRleCA9IChwdXNoSW5kZXggKyAxKSAlIGxpbWl0O1xuICAgICAgICAgICAgcG9wSW5kZXggPSBwdXNoSW5kZXg7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIE9OX09WRVJGTE9XX0VYUEFORDpcbiAgICAgICAgICAgIGRvdWJsZWRMaW1pdCA9IDIgKiBsaW1pdDtcblxuICAgICAgICAgICAgYXJyID0gZmx1c2goKTtcblxuICAgICAgICAgICAgbGVuZ3RoID0gYXJyLmxlbmd0aDtcbiAgICAgICAgICAgIHB1c2hJbmRleCA9IGFyci5sZW5ndGg7XG4gICAgICAgICAgICBwb3BJbmRleCA9IDA7XG5cbiAgICAgICAgICAgIGFyci5sZW5ndGggPSBkb3VibGVkTGltaXQ7XG4gICAgICAgICAgICBsaW1pdCA9IGRvdWJsZWRMaW1pdDtcblxuICAgICAgICAgICAgcHVzaChpdCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIC8vIERST1BcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgdGFrZTogdGFrZSxcbiAgICBmbHVzaDogZmx1c2hcbiAgfTtcbn1cblxuZXhwb3J0IHZhciBidWZmZXJzID0ge1xuICBub25lOiBmdW5jdGlvbiBub25lKCkge1xuICAgIHJldHVybiB6ZXJvQnVmZmVyO1xuICB9LFxuICBmaXhlZDogZnVuY3Rpb24gZml4ZWQobGltaXQpIHtcbiAgICByZXR1cm4gcmluZ0J1ZmZlcihsaW1pdCwgT05fT1ZFUkZMT1dfVEhST1cpO1xuICB9LFxuICBkcm9wcGluZzogZnVuY3Rpb24gZHJ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ICAgIH0pO1xuICAgIGlmIChERVNDUklQVE9SUykgZFAoQy5wcm90b3R5cGUsICdzaXplJywge1xuICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB2YWxpZGF0ZSh0aGlzLCBOQU1FKVtTSVpFXTtcbiAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gQztcbiAgfSxcbiAgZGVmOiBmdW5jdGlvbiAodGhhdCwga2V5LCB2YWx1ZSkge1xuICAgIHZhciBlbnRyeSA9IGdldEVudHJ5KHRoYXQsIGtleSk7XG4gICAgdmFyIHByZXYsIGluZGV4O1xuICAgIC8vIGNoYW5nZSBleGlzdGluZyBlbnRyeVxuICAgIGlmIChlbnRyeSkge1xuICAgICAgZW50cnkudiA9IHZhbHVlO1xuICAgIC8vIGNyZWF0ZSBuZXcgZW50cnlcbiAgICB9IGVsc2Uge1xuICAgICAgdGhhdC5fbCA9IGVudHJ5ID0ge1xuICAgICAgICBpOiBpbmRleCA9IGZhc3RLZXkoa2V5LCB0cnVlKSwgLy8gPC0gaW5kZXhcbiAgICAgICAgazoga2V5LCAgICAgICAgICAgICAgICAgICAgICAgIC8vIDwtIGtleVxuICAgICAgICB2OiB2YWx1ZSwgICAgICAgICAgICAgICAgICAgICAgLy8gPC0gdmFsdWVcbiAgICAgICAgcDogcHJldiA9IHRoYXQuX2wsICAgICAgICAgICAgIC8vIDwtIHByZXZpb3VzIGVudHJ5XG4gICAgICAgIG46IHVuZGVmaW5lZCwgICAgICAgICAgICAgICAgICAvLyA8LSBuZXh0IGVudHJ5XG4gICAgICAgIHI6IGZhbHNlICAgICAgICAgICAgICAgICAgICAgICAvLyA8LSByZW1vdmVkXG4gICAgICB9O1xuICAgICAgaWYgKCF0aGF0Ll9mKSB0aGF0Ll9mID0gZW50cnk7XG4gICAgICBpZiAocHJldikgcHJldi5uID0gZW50cnk7XG4gICAgICB0aGF0W1NJWkVdKys7XG4gICAgICAvLyBhZGQgdG8gaW5kZXhcbi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gICAgIGlmIChvYmplY3RQcm90b3R5cGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5oZXJpdGVkQ29tcG9uZW50ID0gZ2V0UHJvdG90eXBlT2Yoc291cmNlQ29tcG9uZW50KTtcbiAgICAgICAgICAgICAgICBpZiAoaW5oZXJpdGVkQ29tcG9uZW50ICYmIGluaGVyaXRlZENvbXBvbmVudCAhPT0gb2JqZWN0UHJvdG90eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGhvaXN0Tm9uUmVhY3RTdGF0aWNzKHRhcmdldENvbXBvbmVudCwgaW5oZXJpdGVkQ29tcG9uZW50LCBibGFja2xpc3QpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFxuICAgICAgICAgICAgdmFyIGtleXMgPSBnZXRPd25Qcm9wZXJ0eU5hbWVzKHNvdXJjZUNvbXBvbmVudCk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGlmIChnZXRPd25Qcm9wZXJ0eVN5bWJvbHMpIHtcbiAgICAgICAgICAgICAgICBrZXlzID0ga2V5cy5jb25jYXQoZ2V0T3duUHJvcGVydHlTeW1ib2xzKHNvdXJjZUNvbXBvbmVudCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICB2YXIga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgICAgICBpZiAoIVJFQUNUX1NUQVRJQ1Nba2V5XSAmJiAhS05PV05fU1RBVElDU1trZXldICYmICghYmxhY2tsaXN0IHx8ICFibGFja2xpc3Rba2V5XSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlc2NyaXB0b3IgPSBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3Ioc291cmNlQ29tcG9uZW50LCBrZXkpO1xuICAgICAgICAgICAgICAgICAgICB0cnkgeyA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XNrKHRhc2spIHtcbiAgICB0YXNrcy5wdXNoKHRhc2spO1xuICAgIHRhc2suY29udCA9IGZ1bmN0aW9uIChyZXMsIGlzRXJyKSB7XG4gICAgICBpZiAoY29tcGxldGVkKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgcmVtb3ZlKHRhc2tzLCB0YXNrKTtcbiAgICAgIHRhc2suY29udCA9IG5vb3A7XG4gICAgICBpZiAoaXNFcnIpIHtcbiAgICAgICAgYWJvcnQocmVzKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmICh0YXNrID09PSBtYWluVGFzaykge1xuICAgICAgICAgIHJlc3VsdCA9IHJlcztcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXRhc2tzLmxlbmd0aCkge1xuICAgICAgICAgIGNvbXBsZXRlZCA9IHRydWU7XG4gICAgICAgICAgY2IocmVzdWx0KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG4gICAgLy8gdGFzay5jb250LmNhbmNlbCA9IHRhc2suY2FuY2VsXG4gIH1cblxuICBmdW5jdGlvbiBjYW5jZWxBbGwoKSB7XG4gICAgaWYgKGNvbXBsZXRlZCkge1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBjb21wbGV0ZWQgPSB0cnVlO1xuICAgIHRhc2tzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgIHQuY29udCA9IG5vb3A7XG4gICAgICB0LmNhbmNlbCgpO1xuICAgIH0pO1xuICAgIHRhc2tzID0gW107XG4gIH1cblxuICByZXR1cm4ge1xuICAgIGFkZFRhc2s6IGFkZFRhc2ssXG4gICAgY2FuY2VsQWxsOiBjYW5jZWxBbGwsXG4gICAgYWJvcnQ6IGFib3J0LFxuICAgIGdldFRhc2tzOiBmdW5jdGlvbiBnZXRUYXNrcygpIHtcbiAgICAgIHJldHVybiB0YXNrcztcbiAgICB9LFxuICAgIHRhc2tOYW1lczogZnVuY3Rpb24gdGFza05hbWVzKC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hcE5lc3RlZENoaWxkcmVuVG9Qcm9wcyA9IGZ1bmN0aW9uIG1hcE5lc3RlZENoaWxkcmVuVG9Qcm9wcyhjaGlsZCwgbmVzdGVkQ2hpbGRyZW4pIHtcbiAgICAgICAgICAgIGlmICghbmVzdGVkQ2hpbGRyZW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc3dpdGNoIChjaGlsZC50eXBlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5TQ1JJUFQ6XG4gICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5OT1NDUklQVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlubmVySFRNTDogbmVzdGVkQ2hpbGRyZW5cbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuU1RZTEU6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjc3NUZXh0OiBuZXN0ZWRDaGlsZHJlblxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCI8XCIgKyBjaGlsZC50eXBlICsgXCIgLz4gZWxlbWVudHMgYXJlIHNlbGYtY2xvc2luZyBhbmQgY2FuIG5vdCBjb250YWluIGNoaWxkcmVuLiBSZWZlciB0byBvdXIgQVBJIGZvciBtb3JlIGluZm9ybWF0aW9uLlwiKTtcbiAgICAgICAgfTtcblxuICAgICAgICBIZWxtZXRXcmFwcGVyLnByb3RvdHlwZS5mbGF0dGVuQXJyYXlUeXBlQ2hpbGRyZW4gPSBmdW5jdGlvbiBmbGF0dGVuQ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3JlZjIubmVzdGVkQ2hpbGRyZW47XG5cbiAgICAgICAgICAgIHN3aXRjaCAoY2hpbGQudHlwZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuVElUTEU6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBfZXh0ZW5kcyh7fSwgbmV3UHJvcHMsIChfZXh0ZW5kczMgPSB7fSwgX2V4dGVuZHMzW2NoaWxkLnR5cGVdID0gbmVzdGVkQ2hpbGRyZW4sIF9leHRlbmRzMy50aXRsZUF0dHJpYnV0ZXMgPSBfZXh0ZW5kcyh7fSwgbmV3Q2hpbGRQcm9wcyksIF9leHRlbmRzMykpO1xuXG4gICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5CT0RZOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX2V4dGVuZHMoe30sIG5ld1Byb3BzLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5QXR0cmlidXRlczogX2V4dGVuZHMoe30sIG5ld0NoaWxkUHJvcHMpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5IVE1MOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX2V4dGVuZHMoe30sIG5ld1Byb3BzLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBodG1sQXR0cmlidXRlczogX2V4dGVuZHMoe30sIG5ld0NoaWxkUHJvcHMpXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gX2V4dGVuZHMoe30sIG5ld1Byb3BzLCAoX2V4dGVuZHM0ID0ge30sIF9leHRlbmRzNFtjaGlsZC50eXBlXSA9IF9leHRlbmRzKHt9LCBuZXdDaGlsZFByb3BzKSwgX2V4dGVuZHM0KSk7XG4gICAgIC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cyhfY2hpbGQkcHJvcHMsIFtcImNoaWxkcmVuXCJdKTtcblxuICAgICAgICAgICAgICAgIHZhciBuZXdDaGlsZFByb3BzID0gKDAsIF9IZWxtZXRVdGlscy5jb252ZXJ0UmVhY3RQcm9wc3RvSHRtbEF0dHJpYnV0ZXMpKGNoaWxkUHJvcHMpO1xuXG4gICAgICAgICAgICAgICAgX3RoaXMyLndhcm5PbkludmFsaWRDaGlsZHJlbihjaGlsZCwgbmVzdGVkQ2hpbGRyZW4pO1xuXG4gICAgICAgICAgICAgICAgc3dpdGNoIChjaGlsZC50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgX0hlbG1ldENvbnN0YW50cy5UQUdfTkFNRVMuTElOSzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5NRVRBOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuVEFHX05BTUVTLk5PU0NSSVBUOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIF9IZWxtZXRDb25zdGFudHMuVEFHX05BTUVTLlNDUklQVDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBfSGVsbWV0Q29uc3RhbnRzLlRBR19OQU1FUy5TVFlMRTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5VHlwZUNoaWxkcmVuID0gX3RoaXMyLmZsYXR0ZW5BcnJheVR5cGVDaGlsZHJlbih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQ6IGNoaWxkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5VHlwZUNoaWxkcmVuOiBhcnJheVR5cGVDaGlsZHJlbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdDaGlsZFByb3BzOiBuZXdDaGlsZFByb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lc3RlZENoaWxkcmVuOiBuZXN0ZWRDaGlsZHJlblxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3UHJvcHMgPSBfdGhpczIubWFwT2JqZWN0VHlwZUNoaWxkcmVuKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZDogY2hpbGQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3UHJvcHM6IG5ld1Byb3BzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NoaWxkUHJvcHM6IG5ld0NoaWxkUHJvcHMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVzdGVkQ2hpbGRyZW46IG5lc3RlZENoaWxkcmVuXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBuZXdQcm9wcyA9IHRoaXMubWFwQXJyYXlUeXBlQ2hpbGRyZW5Ub1Byb3BzKGFycmF5VHlwZUNoaWxkcmVuLCBuZXdQcm9wcyk7XG4gICAgICAgICAgICByZXR1cm4gbmV3UHJvcHM7XG4gICAgICAgIH07XG5cbiAgICAgICAgSGVsbWV0V3JhcHBlci5wcm90b3R5cGUucmVuZGVyID0gZnVuY3Rpb24gcmVuZGVyKCkge1xuICAgICAgICAgICAgdmFyIF9wcm9wcyA9IHRoaXMucHJvcHMsXG4gICAgICAgICAgICAgICAgY2hpbGRyZW4gPSBfcHJvcHMuY2hpbGRyZW4sXG4gICAgICAgICAgICAgICAgcHJvcHMgPSBfb2JqZWN0V2l0aG91dFByb3BlcnRpZXMoX3Byb3BzLCBbXCJjaGlsZHJlblwiXSk7XG5cbiAgICAgICAgICAgIHZhciBuZXdQcm9wcyA9IF9leHRlbmRzKHt9LCBwcm9wcyk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gfVxuICAgIGlmICh4ID4gMWUtMjEpIHtcbiAgICAgIGUgPSBsb2coeCAqIHBvdygyLCA2OSwgMSkpIC0gNjk7XG4gICAgICB6ID0gZSA8IDAgPyB4ICogcG93KDIsIC1lLCAxKSA6IHggLyBwb3coMiwgZSwgMSk7XG4gICAgICB6ICo9IDB4MTAwMDAwMDAwMDAwMDA7XG4gICAgICBlID0gNTIgLSBlO1xuICAgICAgaWYgKGUgPiAwKSB7XG4gICAgICAgIG11bHRpcGx5KDAsIHopO1xuICAgICAgICBqID0gZjtcbiAgICAgICAgd2hpbGUgKGogPj0gNykge1xuICAgICAgICAgIG11bHRpcGx5KDFlNywgMCk7XG4gICAgICAgICAgaiAtPSA3O1xuICAgICAgICB9XG4gICAgICAgIG11bHRpcGx5KHBvdygxMCwgaiwgMSksIDApO1xuICAgICAgICBqID0gZSAtIDE7XG4gICAgICAgIHdoaWxlIChqID49IDIzKSB7XG4gICAgICAgICAgZGl2aWRlKDEgPDwgMjMpO1xuICAgICAgICAgIGogLT0gMjM7XG4gICAgICAgIH1cbiAgICAgICAgZGl2aWRlKDEgPDwgaik7XG4gICAgICAgIG11bHRpcGx5KDEsIDEpO1xuICAgICAgICBkaXZpZGUoMik7XG4gICAgICAgIG0gPSBudW1Ub1N0cmluZygpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbXVsdGlwbHkoMCwgeik7XG4gICAgICAgIG11bHRpcGx5KDEgPDwgLWUsIDApO1xuICAgICAgICBtID0gbnVtVG9TdHJpbmcoKSArIHJlcGVhdC5jYWxsKFpFUk8sIGYpO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAoZiA+IDApIHtcbiAgICAgIGsgPSBtLmxlbmd0aDtcbiAgICAgIG0gPSBzICsgKGsgPD0gZiA/ICcwLicgKyByZXBlYXQuY2FsbChaRVJPLCBmIC0gaykgKyBtIDogbS5zbGljZSgwLCBrIC0gZikgKyAnLicgKyBtLnNsaWNlKGsgLSBmKSk7XG4gICAgfSBlbH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2QpIHtcbiAgICAgIHZhciBvYnNlcnZhYmxlID0gYW5PYmplY3QobWV0aG9kLmNhbGwoeCkpO1xuICAgICAgcmV0dXJuIG9ic2VydmFibGUuY29uc3RydWN0b3IgPT09IEMgPyBvYnNlcnZhYmxlIDogbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIHJldHVybiBvYnNlcnZhYmxlLnN1YnNjcmliZShvYnNlcnZlcik7XG4gICAgICB9KTtcbiAgICB9XG4gICAgcmV0dXJuIG5ldyBDKGZ1bmN0aW9uIChvYnNlcnZlcikge1xuICAgICAgdmFyIGRvbmUgPSBmYWxzZTtcbiAgICAgIG1pY3JvdGFzayhmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICghZG9uZSkge1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBpZiAoZm9yT2YoeCwgZmFsc2UsIGZ1bmN0aW9uIChpdCkge1xuICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KGl0KTtcbiAgICAgICAgICAgICAgaWYgKGRvbmUpIHJldHVybiBSRVRVUk47XG4gICAgICAgICAgICB9KSA9PT0gUkVUVVJOKSByZXR1cm47XG4gICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHRocm93IGU7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihlKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9IG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsgZG9uZSA9IHRydWU7IH07XG4gICAgfSk7XG4gIH0sXG4gIG9mOiBmdW5jdGlvbiBvZigpIHtcbiAgICBmb3IgKHZhciBpID0gMCwgbCA9IGFyZ3VtZW50cy5sZW5ndGgsIGl0ZW1zID0gbmV3IEFycmF5KGwpOyBpIDwgbDspIGl0ZW1zW2ldID0gYXJndW1lbnRzW2krK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VnYXRlKGRlbGVnYXRlLCBjb250ZXh0KTtcbiAgICAgICAgICBpZiAoZGVsZWdhdGVSZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChkZWxlZ2F0ZVJlc3VsdCA9PT0gQ29udGludWVTZW50aW5lbCkgY29udGludWU7XG4gICAgICAgICAgICByZXR1cm4gZGVsZWdhdGVSZXN1bHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRleHQubWV0aG9kID09PSBcIm5leHRcIikge1xuICAgICAgICAgIC8vIFNldHRpbmcgY29udGV4dC5fc2VudCBmb3IgbGVnYWN5IHN1cHBvcnQgb2YgQmFiZWwnc1xuICAgICAgICAgIC8vIGZ1bmN0aW9uLnNlbnQgaW1wbGVtZW50YXRpb24uXG4gICAgICAgICAgY29udGV4dC5zZW50ID0gY29udGV4dC5fc2VudCA9IGNvbnRleHQuYXJnO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY29udGV4dC5tZXRob2QgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgIGlmIChzdGF0ZSA9PT0gR2VuU3RhdGVTdXNwZW5kZWRTdGFydCkge1xuICAgICAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUNvbXBsZXRlZDtcbiAgICAgICAgICAgIHRocm93IGNvbnRleHQuYXJnO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnRleHQuZGlzcGF0Y2hFeGNlcHRpb24oY29udGV4dC5hcmcpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY29udGV4dC5tZXRob2QgPT09IFwicmV0dXJuXCIpIHtcbiAgICAgICAgICBjb250ZXh0LmFicnVwdChcInJldHVyblwiLCBjb250ZXh0LmFyZyk7XG4gICAgICAgIH1cblxuICAgICAgICBzdGF0ZSA9IEdlblN0YXRlRXhlY3V0aW5nO1xuXG4gICAgICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChpbm5lckZuLCBzZWxmLCBjb250ZXh0KTtcbiAgICAg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XG4gICAgICAgICAgbWF5YmVJbnZva2VEZWxlZ2F0ZShkZWxlZ2F0ZSwgY29udGV4dCk7XG5cbiAgICAgICAgICBpZiAoY29udGV4dC5tZXRob2QgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgLy8gSWYgbWF5YmVJbnZva2VEZWxlZ2F0ZShjb250ZXh0KSBjaGFuZ2VkIGNvbnRleHQubWV0aG9kIGZyb21cbiAgICAgICAgICAgIC8vIFwicmV0dXJuXCIgdG8gXCJ0aHJvd1wiLCBsZXQgdGhhdCBvdmVycmlkZSB0aGUgVHlwZUVycm9yIGJlbG93LlxuICAgICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgIGNvbnRleHQuYXJnID0gbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICBcIlRoZSBpdGVyYXRvciBkb2VzIG5vdCBwcm92aWRlIGEgJ3Rocm93JyBtZXRob2RcIik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChtZXRob2QsIGRlbGVnYXRlLml0ZXJhdG9yLCBjb250ZXh0LmFyZyk7XG5cbiAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICBjb250ZXh0LmFyZyA9IHJlY29yZC5hcmc7XG4gICAgICBjb250ZXh0LmRlbGVnYXRlID0gbnVsbDtcbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhciBpbmZvID0gcmVjb3JkLmFyZztcblxuICAgIGlmICghIGluZm8pIHtcbiAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgY29udGV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2gocmVzZXRUcnlFbnRyeSk7XG5cbiAgICAgIGlmICghc2tpcFRlbXBSZXNldCkge1xuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHRoaXMpIHtcbiAgICAgICAgICAvLyBOb3Qgc3VyZSBhYm91dCB0aGUgb3B0aW1hbCBvcmRlciBvZiB0aGVzZSBjb25kaXRpb25zOlxuICAgICAgICAgIGlmIChuYW1lLmNoYXJBdCgwKSA9PT0gXCJ0XCIgJiZcbiAgICAgICAgICAgICAgaGFzT3duLmNhbGwodGhpcywgbmFtZSkgJiZcbiAgICAgICAgICAgICAgIWlzTmFOKCtuYW1lLnNsaWNlKDEpKSkge1xuICAgICAgICAgICAgdGhpc1tuYW1lXSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgc3RvcDogZnVuY3Rpb24oKSB7XG4gICAgICB0aGlzLmRvbmUgPSB0cnVlO1xuXG4gICAgICB2YXIgcm9vdEVudHJ5ID0gdGhpcy50cnlFbnRyaWVzWzBdO1xuICAgICAgdmFyIHJvb3RSZWNvcmQgPSByb290RW50cnkuY29tcGxldGlvbjtcbiAgICAgIGlmIChyb290UmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICB0aHJvdyByb290UmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHRoaXMucnZhbDtcbiAgICB9LFxuXG4gICAgZGlzcGF0Y2hFeGNlcHRpb246IGZ1bmN0aW9uKGV4Y2VwdGlvbikge1xuICAgICAgaWYgKHRoaXMuZG9uZSkge1xuICAgICAgICB0aHJvdyBleGNlcHRpb247XG4gICAgICB9XG5cbiAgICAgIHZhciBjb250ZXh0ID0gdGhpcztcbiAgICAgIGZ1bmN0aW9uIGhhbmRsZShsb2MsIGNhdWdodCkge1xuICAgICAgICByZWNvcmQudHlwZSA9IFwidGhyb3dcIjtcbiAgICAgICAgcmVjb3JkLmFyZyA9IGV4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yeSwgXCJjYXRjaExvY1wiKTtcbiAgICAgICAgICB2YXIgaGFzRmluYWxseSA9IGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIik7XG5cbiAgICAgICAgICBpZiAoaGFzQ2F0Y2ggJiYgaGFzRmluYWxseSkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0NhdGNoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLm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bmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS5maW5hbGx5TG9jID09PSBmaW5hbGx5TG9jKSB7XG4gICAgICAgICAgdGhpcy5jb21wbGV0ZShlbnRyeS5jb21wbGV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sdWdpbiAgICAgfFxuICogKy0tLS0tfC0tLS0tLSsgICAgLiAgICAgICAgICAgICAgIHYgICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiB8ICAgICB8ICAgICAgfCAgICAuICAgICstLS0tLS0tLS0tLS0tLSsgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0rXG4gKiB8ICAgICArLS0tLS0tLS0tLS0uLS0tPnxFdmVudFBsdWdpbkh1YnwgICAgICAgICAgICAgICAgICAgIHwgICAgRXZlbnQgICB8XG4gKiB8ICAgICAgICAgICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgICstLS0tLS0tLS0tLSsgIHwgUHJvcGFnYXRvcnN8XG4gKiB8IFJlYWN0RXZlbnQgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgIHxUYXBFdmVudCAgIHwgIHwtLS0tLS0tLS0tLS18XG4gKiB8ICBFbWl0dGVyICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHw8LS0tK3xQbHVnaW4gICAgIHwgIHxvdGhlciBwbHVnaW58XG4gKiB8ICAgICAgICAgICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgICstLS0tLS0tLS0tLSsgIHwgIHV0aWxpdGllcyB8XG4gKiB8ICAgICArLS0tLS0tLS0tLS0uLS0tPnwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0rXG4gKiB8ICAgICB8ICAgICAgfCAgICAuICAgICstLS0tLS0tLS0tLS0tLStcbiAqICstLS0tLXwtLS0tLS0rICAgIC4gICAgICAgICAgICAgICAgXiAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogICAgICAgfCAgICAgICAgICAgLiAgICAgICAgICAgICAgICB8ICAgICAgICB8RW50ZXIvTGVhdmV8XG4gKiAgICAgICArICAgICAgICAgICAuICAgICAgICAgICAgICAgICstLS0tLS0tK3xQbHVnaW4gICAgIHxcbiAqICstLS0tLS0tLS0tLS0tKyAgIC4gICA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sIG5ld0NoaWxkLCBleHBpcmF0aW9uVGltZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgY2FzZSBSRUFDVF9SRVRVUk5fVFlQRTpcbiAgICAgICAgICB7XG4gICAgICAgICAgICAvLyBSZXR1cm5zIGRvbid0IGhhdmUga2V5cy4gSWYgdGhlIHByZXZpb3VzIG5vZGUgaXMgaW1wbGljaXRseSBrZXllZFxuICAgICAgICAgICAgLy8gd2UgY2FuIGNvbnRpbnVlIHRvIHJlcGxhY2UgaXQgd2l0aG91dCBhYm9ydGluZyBldmVuIGlmIGl0IGlzIG5vdCBhXG4gICAgICAgICAgICAvLyB5aWVsZC5cbiAgICAgICAgICAgIGlmIChrZXkgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZVJldHVybihyZXR1cm5GaWJlciwgb2xkRmliZXIsIG5ld0NoaWxkLCBleHBpcmF0aW9uVGltZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgY2FzZSBSRUFDVF9QT1JUQUxfVFlQRTpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBpZiAobmV3Q2hpbGQua2V5ID09PSBrZXkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZVBvcnRhbChyZXR1cm5GaWJlciwgb2xkRmliZXIsIG5ld0NoaWxkLCBleHBpcmF0aW9uVGltZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChpc0FycmF5JDEobmV3Q2hpbGQpIHx8IGdldEl0ZXJhdG9yRm4obmV3Q2h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V0IGluc2VydGlvbnMgZnJvbSBlYWNoIGNoaWxkIGluXG4gICAgICAgICAgICAvLyB0aGUgcG9ydGFsIGRpcmVjdGx5LlxuICAgICAgICAgIH0gZWxzZSBpZiAobm9kZS5jaGlsZCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgbm9kZS5jaGlsZFsncmV0dXJuJ10gPSBub2RlO1xuICAgICAgICAgICAgbm9kZSA9IG5vZGUuY2hpbGQ7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKG5vZGUgPT09IHdvcmtJblByb2dyZXNzKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHdoaWxlIChub2RlLnNpYmxpbmcgPT09IG51bGwpIHtcbiAgICAgICAgICAgIGlmIChub2RlWydyZXR1cm4nXSA9PT0gbnVsbCB8fCBub2RlWydyZXR1cm4nXSA9PT0gd29ya0luUHJvZ3Jlc3MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbm9kZSA9IG5vZGVbJ3JldHVybiddO1xuICAgICAgICAgIH1cbiAgICAgICAgICBub2RlLnNpYmxpbmdbJ3JldHVybiddID0gbm9kZVsncmV0dXJuJ107XG4gICAgICAgICAgbm9kZSA9IG5vZGUuc2libGluZztcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIHVwZGF0ZUhvc3RDb250YWluZXIgPSBmdW5jdGlvbiAod29ya0luUHJvZ3Jlc3MpIHtcbiAgICAgICAgdmFyIHBvcnRhbE9yUm9vdCA9IHdvcmtJblByb2dyZXNzLnN0YXRlTm9kZTtcbiAgICAgICAgdmFyIGNoaWxkcmVuVW5jaGFuZ2VkID0gd29ya0luUHJvZ3Jlc3MuZmlyc3RFZmZlY3QgPT09IG51bGw7XG4gICAgICAgIGlmIChjaGlsZHJlblVuY2hhbmdlZCkge1xuICAgICAgICAgIC8vIE5vIGNoYW5nZXM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gICAgICAgIHZhciBpbnN0YW5jZSA9IGN1cnJlbnQuc3RhdGVOb2RlO1xuICAgICAgICAgIGlmICh0eXBlb2YgaW5zdGFuY2UuY29tcG9uZW50V2lsbFVubW91bnQgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIHNhZmVseUNhbGxDb21wb25lbnRXaWxsVW5tb3VudChjdXJyZW50LCBpbnN0YW5jZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgc2FmZWx5RGV0YWNoUmVmKGN1cnJlbnQpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgY2FzZSBDYWxsQ29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgY29tbWl0TmVzdGVkVW5tb3VudHMoY3VycmVudC5zdGF0ZU5vZGUpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgY2FzZSBIb3N0UG9ydGFsOlxuICAgICAgICB7XG4gICAgICAgICAgLy8gVE9ETzogdGhpcyBpcyByZWN1cnNpdmUuXG4gICAgICAgICAgLy8gV2UgYXJlIGFsc28gbm90IHVzaW5nIHRoaXMgcGFyZW50IGJlY2F1c2VcbiAgICAgICAgICAvLyB0aGUgcG9ydGFsIHdpbGwgZ2V0IHB1c2hlZCBpbW1lZGlhdGVseS5cbiAgICAgICAgICBpZiAoZW5hYmxlTXV0YXRpbmdSZWNvbmNpbGVyICYmIG11dGF0aW9uKSB7XG4gICAgICAgICAgICB1bm1vdW50SG9zdENvbXBvbmVudHMoY3VycmVudCk7XG4gICAgICAgICAgfSBlbHNlIGlmIChlbmFibGVQZXJzaXN0ZW50UmVjb25jaWxlciAmJiBwZXJzaXN0ZW5jZSkge1xuICAgICAgICAgICAgZW1wdHlQb3J0YWxDb250YWluZXIoY3VycmVudCk7XG4gICAgICAgICAgfVxuICAgICAg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hc3NDb21wb25lbnQ6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgY2FzZSBIb3N0Um9vdDpcbiAgICAgICAgICBjYXNlIEhvc3RQb3J0YWw6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHZhciBwb3J0YWxPclJvb3QgPSBmaW5pc2hlZFdvcmsuc3RhdGVOb2RlO1xuICAgICAgICAgICAgICB2YXIgY29udGFpbmVySW5mbyA9IHBvcnRhbE9yUm9vdC5jb250YWluZXJJbmZvLFxuICAgICAgICAgICAgICAgICAgX3BlbmRpbmdDaGlsZHJlbiA9IHBvcnRhbE9yUm9vdC5wZW5kaW5nQ2hpbGRyZW47XG5cbiAgICAgICAgICAgICAgcmVwbGFjZUNvbnRhaW5lckNoaWxkcmVuKGNvbnRhaW5lckluZm8sIF9wZW5kaW5nQ2hpbGRyZW4pO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgaW52YXJpYW50KGZhbHNlLCAnVGhpcyB1bml0IG9mIHdvcmsgdGFnIHNob3VsZCBub3QgaGF2ZSBzaWRlLWVmZmVjdHMuIFRoaXMgZXJyb3IgaXMgbGlrZWx5IGNhdXNlZCBieSBhIGJ1ZyBpbiBSZWFjdC4gUGxlYXNlIGZpbGUgYW4gaXNzdWUuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbW1pdENvbnR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lIGFuIGlzc3VlLicpIDogdm9pZCAwO1xuICAgICAgICAgIHN3aXRjaCAocGFyZW50LnRhZykge1xuICAgICAgICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICAgICAgICBjdXJyZW50UGFyZW50ID0gcGFyZW50LnN0YXRlTm9kZTtcbiAgICAgICAgICAgICAgY3VycmVudFBhcmVudElzQ29udGFpbmVyID0gZmFsc2U7XG4gICAgICAgICAgICAgIGJyZWFrIGZpbmRQYXJlbnQ7XG4gICAgICAgICAgICBjYXNlIEhvc3RSb290OlxuICAgICAgICAgICAgICBjdXJyZW50UGFyZW50ID0gcGFyZW50LnN0YXRlTm9kZS5jb250YWluZXJJbmZvO1xuICAgICAgICAgICAgICBjdXJyZW50UGFyZW50SXNDb250YWluZXIgPSB0cnVlO1xuICAgICAgICAgICAgICBicmVhayBmaW5kUGFyZW50O1xuICAgICAgICAgICAgY2FzZSBIb3N0UG9ydGFsOlxuICAgICAgICAgICAgICBjdXJyZW50UGFyZW50ID0gcGFyZW50LnN0YXRlTm9kZS5jb250YWluZXJJbmZvO1xuICAgICAgICAgICAgICBjdXJyZW50UGFyZW50SXNDb250YWluZXIgPSB0cnVlO1xuICAgICAgICAgICAgICBicmVhayBmaW5kUGFyZW50O1xuICAgICAgICAgIH1cbiAgICAgICAgICBwYXJlbnQgPSBwYXJlbnRbJ3JldHVybiddO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnRQYXJlbnRJc1ZhbGlkID0gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgaWYgKG5vZGUudGFnID09PSBIb3N0Q29tcG9uZW50IHx8IG5vZGUudGFnID09PSBIb3N0VGV4dCkge1xuICAgICAgICBjb21taXROZXN0ZWRVbm1vdW50cyhub2RlKTtcbiAgICAgICAgLy8gQWZ0ZXIgYWxsIHRoZSBjaGlsZHJlbiBoYXZlIHVubW91bnRlZCwgaXQgaXMgbm93IHNhZmUgdG8gcmVtb3ZlIHRoZVxuICAgICAgICAvL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ZSBob3N0IGNvbXBvbmVudHMgYmVsb3cuXG4gICAgICAgIGlmIChub2RlLmNoaWxkICE9PSBudWxsKSB7XG4gICAgICAgICAgbm9kZS5jaGlsZFsncmV0dXJuJ10gPSBub2RlO1xuICAgICAgICAgIG5vZGUgPSBub2RlLmNoaWxkO1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAobm9kZSA9PT0gY3VycmVudCkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICB3aGlsZSAobm9kZS5zaWJsaW5nID09PSBudWxsKSB7XG4gICAgICAgIGlmIChub2RlWydyZXR1cm4nXSA9PT0gbnVsbCB8fCBub2RlWydyZXR1cm4nXSA9PT0gY3VycmVudCkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBub2RlID0gbm9kZVsncmV0dXJuJ107XG4gICAgICAgIGlmIChub2RlLnRhZyA9PT0gSG9zdFBvcnRhbCkge1xuICAgICAgICAgIC8vIFdoZW4gd2UgZ28gb3V0IG9mIHRoZSBwb3J0YWwsIHdlIG5lZWQgdG8gcmVzdG9yZSB0aGUgcGFyZW50LlxuICAgICAgICAgIC8vIFNpbmNlIHdlIGRvbid0IGtlZXAgYSBzdGFjayBvZiB0aGVtLCB3ZSB3aWxsIHNlYXJjaCBmb3IgaXQuXG4gICAgICAgICAgY3VycmVudFBhcmVudElzVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgbm9kZS5zaWJsaW5nWydyZXR1cm4nXSA9IG5vZGVbJ3JldHVybiddO1xuICAgICAgbm9kZSA9IG5vZGUuc2libGluZztcbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBjb21taXREZWxldGlvbihjdXJyZW50KSB7XG4gICAgLy8gUmVjdXJzaXZlbHkgZGVsZXRlIGFsbCBob3N0IG5vZGVzIGZyb20gdGhlIHBhcmVudC5cbiAgICAvLyBEZXRhY2ggcmVmc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WNyZWF0ZWQuXG4gICAgaWYgKHJldHVybkZpYmVyLmxhc3RFZmZlY3QgIT09IG51bGwpIHtcbiAgICAgIHJldHVybkZpYmVyLmxhc3RFZmZlY3QubmV4dEVmZmVjdCA9IGNoaWxkVG9EZWxldGU7XG4gICAgICByZXR1cm5GaWJlci5sYXN0RWZmZWN0ID0gY2hpbGRUb0RlbGV0ZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuRmliZXIuZmlyc3RFZmZlY3QgPSByZXR1cm5GaWJlci5sYXN0RWZmZWN0ID0gY2hpbGRUb0RlbGV0ZTtcbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBpbnNlcnROb25IeWRyYXRlZEluc3RhbmNlKHJldHVybkZpYmVyLCBmaWJlcikge1xuICAgIGZpYmVyLmVmZmVjdFRhZyB8PSBQbGFjZW1lbnQ7XG4gICAge1xuICAgICAgc3dpdGNoIChyZXR1cm5GaWJlci50YWcpIHtcbiAgICAgICAgY2FzZSBIb3N0Um9vdDpcbiAgICAgICAgICB7XG4gICAgICAgICAgICB2YXIgcGFyZW50Q29udGFpbmVyID0gcmV0dXJuRmliZXIuc3RhdGVOb2RlLmNvbnRhaW5lckluZm87XG4gICAgICAgICAgICBzd2l0Y2ggKGZpYmVyLnRhZykge1xuICAgICAgICAgICAgICBjYXNlIEhvc3RDb21wb25lbnQ6XG4gICAgICAgICAgICAgICAgdmFyIHR5cGUgPSBmaWJlci50eXBlO1xuICAgICAgICAgICAgICAgIHZhciBwcm9wcyA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICAgICAgICBkaWROb3RGaW5kSHlkcmF0YWJsZUNvbnRhaW5lckluc3RhbmNlKHBhcmVudENvbnRhaW5lciwgdHlwZSwgcHJvcHMpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlIEhvc3RUZXh0OlxuICAgICAgICAgICAgICAgIHZhciB0ZXh0ID0gZmliZXIucGVuZGluZ1Byb3BzO1xuICAgICAgICAgICAgICAgIGRpZE5vdEZpbmRIeWRyYXRhYmxlQ29udGFpbmVyVGV4dEluc3RhbmNlKHBhcmVudENvbnRhaW5lciwgdGV4dCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAgICB7XG4gICAgICAgICAgICB2YXIgcGFyZW50VHlwZSA9IHJldHVybkZpYmVyLnR5cGU7XG4gICAgICAgICAgICB2YXIgcGFyZW50UHJvcHMgPSByZXR1cm5GaWJlci5tZW1vaXplZFByb3BzO1xuICAgICAgICAgICAgdmFyIHBhcmVudEluc3RhbmNlID0gcmV0dXJuRmliZXIuc3RhdGVOb2RlO1xuICAgICAgICAgICAgc3dpdGNoIChmaWJlci50YWcpIHtcbiAgICAgICAgICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICAgICAgICAgIHZhciBfdHlwZSA9IGZpYmVyLnR5cGU7XG4gICAgICAgICAgICAgICAgdmFyIF9wcm9wcyA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICAgICAgICBkaWROb3RGaW5kSHlkcmF0YWJsZUluc3RhbmNlKHBhcmVudFR5cGUsIHBhcmVudFByb3BzLCBwYXJlbnRJbnN0YW5jZSwgX3R5cGUsIF9wcm9wcyk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGNhc2UgSG9zdFRleHQ6XG4gICAgICAgICAgICAgICAgdmFyIF90ZXh0ID0gZmliZXIucGVuZGluZ1Byb3BzO1xuICAgICAgICAgICAgICAgIGRpZE5vdEZpbmRIeWRyYXRhYmxlVGV4dEluc3RhbmNlKHBhcmVudFR5cGUsIHBhcmVudFByb3BzLCBwYXJlbnRJbnN0YW5jZSwgX3RleHQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiB0cnlIeWRyYXRlKGZpYmVyLCBuZXh0SW5zdGFuY2UpIHtcbiAgICBzd2l0Y2ggKGZpYmVyLnRhZykge1xuICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIHR5cGUgPSBmaWJlci50eXBlO1xuICAgICAgICAgIHZhciBwcm9wcyA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICB2YXIgaW5zdGFuY2UgPSBjYW5IeWRyYXRlSW5zdGFuY2UobmV4dEluc3RhbmNlLCB0eXBlLCBwcm9wcyk7XG4gICAgICAgICAgaWYgKGluc3RhbmNlICE9PSBudWxsKSB7XG4gICAgICAgICAgICBmaWJlci5zdGF0ZU5vZGUgPSBpbnN0YW5jZTtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIGNhc2UgSG9zdFRleHQ6XG4gICAgICAgIHtcbiAgICAgICAgICB2YXIgdGV4dCA9IGZpYmVyLnBlbmRpbmdQcm9wcztcbiAgICAgICAgICB2YXIgdGV4dEluc3RhbmNlID0gY2FuSHlkcmF0ZVRleHRJbnN0YW5jZShuZXh0SW5zdGFuY2UsIHRleHQpO1xuICAgICAgICAgIGlmICh0ZXh0SW5zdGFuY2UgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGZpYmVyLnN0YXRlTm9kZSA9IHRleHRJbnN0YW5jZTtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIHJldH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gICAgICAgIHZhciByZXR1cm5GaWJlciA9IGh5ZHJhdGlvblBhcmVudEZpYmVyO1xuICAgICAgICBpZiAocmV0dXJuRmliZXIgIT09IG51bGwpIHtcbiAgICAgICAgICBzd2l0Y2ggKHJldHVybkZpYmVyLnRhZykge1xuICAgICAgICAgICAgY2FzZSBIb3N0Um9vdDpcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnRDb250YWluZXIgPSByZXR1cm5GaWJlci5zdGF0ZU5vZGUuY29udGFpbmVySW5mbztcbiAgICAgICAgICAgICAgICBkaWROb3RNYXRjaEh5ZHJhdGVkQ29udGFpbmVyVGV4dEluc3RhbmNlKHBhcmVudENvbnRhaW5lciwgdGV4dEluc3RhbmNlLCB0ZXh0Q29udGVudCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgSG9zdENvbXBvbmVudDpcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnRUeXBlID0gcmV0dXJuRmliZXIudHlwZTtcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50UHJvcHMgPSByZXR1cm5GaWJlci5tZW1vaXplZFByb3BzO1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnRJbnN0YW5jZSA9IHJldHVybkZpYmVyLnN0YXRlTm9kZTtcbiAgICAgICAgICAgICAgICBkaWROb3RNYXRjaEh5ZHJhdGVkVGV4dEluc3RhbmNlKHBhcmVudFR5cGUsIHBhcmVudFByb3BzLCBwYXJlbnRJbnN0YW5jZSwgdGV4dEluc3RhbmNlLCB0ZXh0Q29udGVudCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHNob3VsZFVwZGF0ZTtcbiAgfVxuXG4gIGZ1bmN0aW9uIHBvcFRvTm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AgICAgICAgbmV4dEVmZmVjdC5lZmZlY3RUYWcgJj0gflBsYWNlbWVudDtcblxuICAgICAgICAgICAgLy8gVXBkYXRlXG4gICAgICAgICAgICB2YXIgX2N1cnJlbnQgPSBuZXh0RWZmZWN0LmFsdGVybmF0ZTtcbiAgICAgICAgICAgIGNvbW1pdFdvcmsoX2N1cnJlbnQsIG5leHRFZmZlY3QpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlIFVwZGF0ZTpcbiAgICAgICAgICB7XG4gICAgICAgICAgICB2YXIgX2N1cnJlbnQyID0gbmV4dEVmZmVjdC5hbHRlcm5hdGU7XG4gICAgICAgICAgICBjb21taXRXb3JrKF9jdXJyZW50MiwgbmV4dEVmZmVjdCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIGNhc2UgRGVsZXRpb246XG4gICAgICAgICAge1xuICAgICAgICAgICAgaXNVbm1vdW50aW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIGNvbW1pdERlbGV0aW9uKG5leHRFZmZlY3QpO1xuICAgICAgICAgICAgaXNVbm1vdW50aW5nID0gZmFsc2U7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgICBuZXh0RWZmZWN0ID0gbmV4dEVmZmVjdC5uZXh0RWZmZWN0O1xuICAgIH1cblxuICAgIHtcbiAgICAgIFJlYWN0RGVidWdDdXJyZW50RmliZXIucmVzZXRDdXJyZW50RmliZXIoKTtcbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBjb21taXRBbGxMaWZlQ3ljbGVzKCkge1xuICAgIHdoaWxlIChuZXh0RWZmZWN0ICE9PSBudWxsKSB7XG4gICAgICB2YXIgZWZmZWN0VGFnID0gbmV4dEVmZmVjdC5lZmZlY3RUYWc7XG5cbiAgICAgIGlmIChlZmZlY3RUYWcgJiAoVXBkYXRlIHwgQ2FsbGJhY2spKSB7XG4gICAgICAgI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B3aGlsZSAobm9kZSAhPT0gbnVsbCkge1xuICAgICAgc3dpdGNoIChub2RlLnRhZykge1xuICAgICAgICBjYXNlIENsYXNzQ29tcG9uZW50OlxuICAgICAgICAgIHBvcENvbnRleHRQcm92aWRlcihub2RlKTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBIb3N0Q29tcG9uZW50OlxuICAgICAgICAgIHBvcEhvc3RDb250ZXh0KG5vZGUpO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIEhvc3RSb290OlxuICAgICAgICAgIHBvcEhvc3RDb250YWluZXIobm9kZSk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgSG9zdFBvcnRhbDpcbiAgICAgICAgICBwb3BIb3N0Q29udGFpbmVyKG5vZGUpO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgaWYgKG5vZGUgPT09IHRvIHx8IG5vZGUuYWx0ZXJuYXRlID09PSB0bykge1xuICAgICAgICBzdG9wRmFpbGVkV29ya1RpbWVyKG5vZGUpO1xuICAgICAgICBicmVhaztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHN0b3BXb3JrVGltZXIobm9kZSk7XG4gICAgICB9XG4gICAgICBub2RlID0gbm9kZVsncmV0dXJuJ107XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gY29tcHV0ZUFzeW5jRXhwaXJhdGlvbigpIHtcbiAgICAvLyBHaXZlbiB0aGUgY3VycmVudCBjbG9jayB0aW1lLCByZXR1cm5zIGFuIGV4cGlyYXRpb24gdGltZS4gV2UgdXNlIHJvdW5kaW5nXG4gICAgLy8gdG8gYmF0Y2ggbGlrZSB1cGRhdGVzIHRvZ2V0aGVyLlxuICAgIC8vIFNob3VsZCBjb21wbGV0ZSB3aXRoaW4gfjEwMDBtcy4gMTIwMG1zIG1heC5cbiAgICB2YXIgY3VycmVudFRpbWUgPSByZWNhbGN1bGF0ZUN1cnJlbnRUaW1lKCk7XG4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7XG4gICAgICAgICAgLy8gV2UndmUgY29tcGxldGVkIHRoZSByb290LiBDb21taXQgaXQuXG4gICAgICAgICAgcm9vdC5yZW1haW5pbmdFeHBpcmF0aW9uVGltZSA9IGNvbW1pdFJvb3QoZmluaXNoZWRXb3JrKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAvLyBGbHVzaCBhc3luYyB3b3JrLlxuICAgICAgdmFyIF9maW5pc2hlZFdvcmsgPSByb290LmZpbmlzaGVkV29yaztcbiAgICAgIGlmIChfZmluaXNoZWRXb3JrICE9PSBudWxsKSB7XG4gICAgICAgIC8vIFRoaXMgcm9vdCBpcyBhbHJlYWR5IGNvbXBsZXRlLiBXZSBjYW4gY29tbWl0IGl0LlxuICAgICAgICByb290LmZpbmlzaGVkV29yayA9IG51bGw7XG4gICAgICAgIHJvb3QucmVtYWluaW5nRXhwaXJhdGlvblRpbWUgPSBjb21taXRSb290KF9maW5pc2hlZFdvcmspO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcm9vdC5maW5pc2hlZFdvcmsgPSBudWxsO1xuICAgICAgICBfZmluaXNoZWRXb3JrID0gcmVuZGVyUm9vdChyb290LCBleHBpcmF0aW9uVGltZSk7XG4gICAgICAgIGlmIChfZmluaXNoZWRXb3JrICE9PSBudWxsKSB7XG4gICAgICAgICAgLy8gV2UndmUgY29tcGxldGVkIHRoZSByb290LiBDaGVjayB0aGUgZGVhZGxpbmUgb25lIG1vcmUgdGltZVxuICAgICAgICAgIC8vIGJlZm9yZSBjb21taXR0aW5nLlxuICAgICAgICAgIGlmICghc2hvdWxkWWllbGQoKSkge1xuICAgICAgICAgICAgLy8gU3RpbGwgdGltZSBsZWZ0LiBDb21taXQgdGhlIHJvb3QuXG4gICAgICAgICAgICByb290LnJlbWFpbmluZ0V4cGlyYXRpb25UaW1lID0gY29tbWl0Um9vdChfZmluaXNoZWRXb3JrKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgIC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db250YWluZXIocGFyZW50Q29tcG9uZW50LCBlbGVtZW50LCBjb250YWluZXJOb2RlLCBmYWxzZSwgY2FsbGJhY2spO1xuICB9LFxuICB1bm1vdW50Q29tcG9uZW50QXROb2RlOiBmdW5jdGlvbiAoY29udGFpbmVyKSB7XG4gICAgIWlzVmFsaWRDb250YWluZXIoY29udGFpbmVyKSA/IGludmFyaWFudChmYWxzZSwgJ3VubW91bnRDb21wb25lbnRBdE5vZGUoLi4uKTogVGFyZ2V0IGNvbnRhaW5lciBpcyBub3QgYSBET00gZWxlbWVudC4nKSA6IHZvaWQgMDtcblxuICAgIGlmIChjb250YWluZXIuX3JlYWN0Um9vdENvbnRhaW5lcikge1xuICAgICAge1xuICAgICAgICB2YXIgcm9vdEVsID0gZ2V0UmVhY3RSb290RWxlbWVudEluQ29udGFpbmVyKGNvbnRhaW5lcik7XG4gICAgICAgIHZhciByZW5kZXJlZEJ5RGlmZmVyZW50UmVhY3QgPSByb290RWwgJiYgIWdldEluc3RhbmNlRnJvbU5vZGUkMShyb290RWwpO1xuICAgICAgICB3YXJuaW5nKCFyZW5kZXJlZEJ5RGlmZmVyZW50UmVhY3QsIFwidW5tb3VudENvbXBvbmVudEF0Tm9kZSgpOiBUaGUgbm9kZSB5b3UncmUgYXR0ZW1wdGluZyB0byB1bm1vdW50IFwiICsgJ3dhcyByZW5kZXJlZCBieSBhbm90aGVyIGNvcHkgb2YgUmVhY3QuJyk7XG4gICAgICB9XG5cbiAgICAgIC8vIFVubW91bnQgc2hvdWxkIG5vdCBiZSBiYXRjaGVkLlxuICAgICAgRE9NUmVuZGVyZXIudW5iYXRjaGVkVXBkYXRlcyhmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJlbmRlclN1YnRyZWVJbnRvQ29udGFpbmVyKG51bGwsIG51bGwsIGNvbnRhaW5lciwgZmFsc2UsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICBjb250YWluZXIuX3JlYWN0Um9vdENvbnRhaW5lciA9IG51bGw7X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AgICdhbmQgd2lsbCB0aHJvdyBpbiB0aGUgc3RhbmRhbG9uZSBgcHJvcC10eXBlc2AgcGFja2FnZS4gJyArXG4gICAgICAgICAgICAgICdZb3UgbWF5IGJlIHNlZWluZyB0aGlzIHdhcm5pbmcgZHVlIHRvIGEgdGhpcmQtcGFydHkgUHJvcFR5cGVzICcgK1xuICAgICAgICAgICAgICAnbGlicmFyeS4gU2VlIGh0dHBzOi8vZmIubWUvcmVhY3Qtd2FybmluZy1kb250LWNhbGwtcHJvcHR5cGVzICcgKyAnZm9yIGRldGFpbHMuJyxcbiAgICAgICAgICAgICAgcHJvcEZ1bGxOYW1lLFxuICAgICAgICAgICAgICBjb21wb25lbnROYW1lXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgbWFudWFsUHJvcFR5cGVDYWxsQ2FjaGVbY2FjaGVLZXldID0gdHJ1ZTtcbiAgICAgICAgICAgIG1hbnVhbFByb3BUeXBlV2FybmluZ0NvdW50Kys7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJvcHNbcHJvcE5hbWVdID09IG51bGwpIHtcbiAgICAgICAgaWYgKGlzUmVxdWlyZWQpIHtcbiAgICAgICAgICBpZiAocHJvcHNbcHJvcE5hbWVdID09PSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb3BUeXBlRXJyb3IoJ1RoZSAnICsgbG9jYXRpb24gKyAnIGAnICsgcHJvcEZ1bGxOYW1lICsgJ2AgaXMgbWFya2VkIGFzIHJlcXVpcmVkICcgKyAoJ2luIGAnICsgY29tcG9uZW50TmFtZSArICdgLCBidXQgaXRzIHZhbHVlIGlzIGBudWxsYC4nKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBuZXcgUHJvcFR5cGVFcnJvcignVGhlICcgKyBsb2NhdGlvbiArICcgYCcgKyBwcm9wRnVsbE5hbWUgKyAnYCBpcyBtYXJrZWQgYXMgcmVxdWlyZWQgaW4gJyArIC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cmllcykge1xuICAgICAgICAgICAgd2hpbGUgKCEoc3RlcCA9IGl0ZXJhdG9yLm5leHQoKSkuZG9uZSkge1xuICAgICAgICAgICAgICBpZiAoIWlzTm9kZShzdGVwLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBJdGVyYXRvciB3aWxsIHByb3ZpZGUgZW50cnkgW2ssdl0gdHVwbGVzIHJhdGhlciB0aGFuIHZhbHVlcy5cbiAgICAgICAgICAgIHdoaWxlICghKHN0ZXAgPSBpdGVyYXRvci5uZXh0KCkpLmRvbmUpIHtcbiAgICAgICAgICAgICAgdmFyIGVudHJ5ID0gc3RlcC52YWx1ZTtcbiAgICAgICAgICAgICAgaWYgKGVudHJ5KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFpc05vZGUoZW50cnlbMV0pKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIGZ1bmN0aW9uIGlzU3ltYm9sKHByb3BUeXBlLCBwcm9wVmFsdWUpIHtcbiAgICAvLyBOYXRpdmUgU3ltYm9sLlxuICAgIGlmIChwcm9wVHlwZSA9PT0gJ3N5bWJvbCcpIHtcbiAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIDE5LjQuMy41IFN5bWJvbC5wcm90b3R5cGVbQEB0b1N0cmluZ1RhZ10gPT09ICdTeW1ib2wnXG4gICAgaWY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gICAgICAvLyBQcmVwZW5kIHBhcnRpYWwgc2VnbWVudCBwcmVmaXhlcy5cbiAgICAgICAgICBpZiAodG9rZW4ucGFydGlhbCkge1xuICAgICAgICAgICAgcGF0aCArPSB0b2tlbi5wcmVmaXhcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb250aW51ZVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0V4cGVjdGVkIFwiJyArIHRva2VuLm5hbWUgKyAnXCIgdG8gYmUgZGVmaW5lZCcpXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGlzYXJyYXkodmFsdWUpKSB7XG4gICAgICAgIGlmICghdG9rZW4ucmVwZWF0KSB7XG4gICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignRXhwZWN0ZWQgXCInICsgdG9rZW4ubmFtZSArICdcIiB0byBub3QgcmVwZWF0LCBidXQgcmVjZWl2ZWQgYCcgKyBKU09OLnN0cmluZ2lmeSh2YWx1ZSkgKyAnYCcpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodmFsdWUubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgaWYgKHRva2VuLm9wdGlvbmFsKSB7XG4gICAgICAgICAgICBjb250aW51ZVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFeHBlY3RlZCBcIicgKyB0b2tlbi5uYW1lICsgJ1wiIHRvIG5vdCBiZSBlbXB0eScpXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCB2YWx1ZS5sZW5ndGg7IGorKykge1xuICAgICAgICAgIHNlZ21lbnQgPSBlbmNvZGUodmFsdWVbal0pXG5cbiAgICAgICAgICBpZiAoIW1hdGNoZXNbaV0udGVzdChzZWdtZW50KSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignRX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ZExpbmsyID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfT3V0Ym91bmRMaW5rKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxuZnVuY3Rpb24gX29iamVjdFdpdGhvdXRQcm9wZXJ0aWVzKG9iaiwga2V5cykgeyB2YXIgdGFyZ2V0ID0ge307IGZvciAodmFyIGkgaW4gb2JqKSB7IGlmIChrZXlzLmluZGV4T2YoaSkgPj0gMCkgY29udGludWU7IGlmICghT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgaSkpIGNvbnRpbnVlOyB0YXJnZXRbaV0gPSBvYmpbaV07IH0gcmV0dXJuIHRhcmdldDsgfVxuXG5mdW5jdGlvbiBfdG9Db25zdW1hYmxlQXJyYXkoYXJyKSB7IGlmIChBcnJheS5pc0FycmF5KGFycikpIHsgZm9yICh2YXIgaSA9IDAsIGFycjIgPSBBcnJheShhcnIubGVuZ3RoKTsgaSA8IGFyci5sZW5ndGg7IGkrKykgeyBhcnIyW2ldID0gYXJyW2ldOyB9IHJldHVybiBhcnIyOyB9IGVsc2UgeyByZXR1cm4gQXJyYXkuZnJvbShhcnIpOyB9IH0gLyoqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUmVhY3QgR29vZ2xlIEFuYWx5dGljcyBNb2R1bGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEBwYWNrYWdlIHJlYWN0LWdhXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQGF1dGhvciAgQWRhbSBMb2Z0aW5nIDxhZGFtQG1vemlsbGFmb3VuZGF0aW9uLm9yZz5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgICAgICBBdHVsIFZhcm1hIDxhdHVsQG1vemlsbGFmb3VuZGF0aW9uLm9yZz5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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oqXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFRvIFRpdGxlIENhc2UgMi4xIC0gaHR0cDovL2luZGl2aWRlZC5jb20vY29kZS90by10aXRsZS1jYXNlL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBDb3B5cmlnaHQgMjAwOC0yMDEzIERhdmlkIEdvdWNoLiBMaWNlbnNlZCB1bmRlciB0aGUgTUlUIExpY2Vuc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGh0dHBzOi8vZ2l0aHViLmNvbS9nb3VjaC90by10aXRsZS1jYXNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuXG5mdW5jdGlvbiB0b1RpdGxlQ2FzZShzdHJpbmcpIHtcbiAgcmV0dXJuICgwLCBfdHJpbTIuZGVmYXVsdCkoc3RyaW5nKS5yZXBsYWNlKC9bQS1aYS16MC05XFx1MDBDMC1cXHUwMEZGXStbXlxccy1dKi9nLCBmdW5jdGlvbiAobWF0Y2gsIGluZGV4LCB0aXRsZSkge1xuICAgIGlmIChpbmRleCA+IDAgJiYgaW5kZXggKyBtYXRjaC5sZW5ndGggIT09IHRpdGxlLmxlbmd0aCAmJiBtYXRjaC5zZWFyY2goc21hbGxXb3JkcykgPiAtMSAmJiB0aXRsZS5jaGFyQXQoaW5kZXggLSAyKSAhPT0gJzonICYmICh0aXRsZS5jaGFyQXQoaW5kZXggKyBtYXRjaC5sZW5ndGgpICE9PSAnL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ciBhdHRyaWJ1dGUgaW4gdGFnKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRhZy5oYXNPd25Qcm9wZXJ0eShhdHRyaWJ1dGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyaWJ1dGUgPT09IF9IZWxtZXRDb25zdGFudHMuVEFHX1BST1BFUlRJRVMuSU5ORVJfSFRNTCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV3RWxlbWVudC5pbm5lckhUTUwgPSB0YWcuaW5uZXJIVE1MO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGF0dHJpYnV0ZSA9PT0gX0hlbG1ldENvbnN0YW50cy5UQUdfUFJPUEVSVElFUy5DU1NfVEVYVCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld0VsZW1lbnQuc3R5bGVTaGVldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc3R5bGVTaGVldC5jc3NUZXh0ID0gdGFnLmNzc1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUodGFnLmNzc1RleHQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHR5cGVvZiB0YWdbYXR0cmlidXRlXSA9PT0gXCJ1bmRlZmluZWRcIiA/IFwiXCIgOiB0YWdbYXR0cmlidXRlXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc2V0QXR0cmlidXRlKGF0dHJpYnV0ZSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICA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KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZUVsZW1lbnRBdHRyaWJ1dGVzQXNTdHJpbmcodGFncyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgdG9Db21wb25lbnQ6IGZ1bmN0aW9uIHRvQ29tcG9uZW50KCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVUYWdzQXNSZWFjdENvbXBvbmVudCh0eXBlLCB0YWdzKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHRvU3RyaW5nOiBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlVGFnc0FzU3RyaW5nKHR5cGUsIHRhZ3MsIGVuY29kZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICB9XG59O1xuXG52YXIgbWFwU3RhdGVPblNlcnZlciA9IGZ1bmN0aW9uIG1hcFN0YXRlT25TZXJ2ZXIoX3JlZikge1xuICAgIHZhciBiYXNlVGFnID0gX3JlZi5iYXNlVGFnLFxuICAgICAgICBib2R5QXR0cmlidXRlcyA9IF9yZWYuYm9keUF0dHJpYnV0ZXMsXG4gICAgICAgIGVuY29kZSA9IF9yZWYuZW5jb2RlLFxuICAgICAgICBodG1sQXR0cmlidXRlcyA9IF9yZWYuaHRtbEF0dHJpYnV0ZXMsXG4gICAgICAgIGxpbmtUYWdzID0gX3JlZi5saW5rVGFncyxcbiAgICAgICAgbWV0YVRhZ3MgPSBfcmVmLm1ldGFUYWdzLFxuICAgICAgICBub3NjcmlwdFRhZ3MgPSBfcmVmLm5vc2NyaXB0VGFncyxcbiAgICAgICAgc2NyaXB0VGFncyA9IF9yZWYuc2NyaXB0VGFncyxcbiAgICAgICAgc3R5bGVUYWd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gICAgIDxkaXY+XG4gICAgICAgICAgPHA+VW5mb3J0dW5hdGVseSwgd2UgY291bGRuJ3QgZG93bmxvYWQgeW91ciBhc3NldCBmcm9tIExCUlkuICBZb3UgY2FuIGhlbHAgdXMgb3V0IGJ5IHNoYXJpbmcgdGhlIGJlbG93IGVycm9yIG1lc3NhZ2UgaW4gdGhlIDxhIGNsYXNzTmFtZT0nbGluay0tcHJpbWFyeScgaHJlZj0naHR0cHM6Ly9kaXNjb3JkLmdnL1lqWWJ3aFMnIHRhcmdldD0nX2JsYW5rJz5MQlJZIGRpc2NvcmQ8L2E+LjwvcD5cbiAgICAgICAgICA8aT48cCBpZD0nZXJyb3ItbWVzc2FnZSc+e2Vycm9yfTwvcD48L2k+XG4gICAgICAgIDwvZGl2PlxuICAgICAgICB9XG4gICAgICAgIHsoc3RhdHVzID09PSBBVkFJTEFCTEUpICYmXG4gICAgICAgICgoKSA9PiB7XG4gICAgICAgICAgc3dpdGNoIChjb250ZW50VHlwZSkge1xuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvanBlZyc6XG4gICAgICAgICAgICBjYXNlICdpbWFnZS9qcGcnOlxuICAgICAgICAgICAgY2FzZSAnaW1hZ2UvcG5nJzpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8aW1nXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWU9J2Fzc2V0J1xuICAgICAgICAgICAgICAgICAgc3JjPXtgLyR7Y2xhaW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9YH1cbiAgICAgICAgICAgICAgICAgIGFsdD17bmFtZX0gLz5cbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGNhc2UgJ2ltYWdlL2dpZic6XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGltZ1xuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPSdhc3NldCdcbiAgICAgICAgICAgICAgICAgIHNyYz17YC8ke2NsYWltSWR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250cm9scyBwb3N0ZXI9XCIke3RodW1ibmFpbH1cIiBzcmM9XCIke2hvc3R9LyR7Y2xhaW1JZH0vJHtuYW1lfS4ke2ZpbGVFeHR9XCIvPjwvdmlkZW8+YH0gLz5cbiAgICAgICAgICAgICAgICAgICkgOiAoXG4gICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSd0ZXh0JyBpZD0nZW1iZWQtdGV4dCcgY2xhc3NOYW1lPSdpbnB1dC1kaXNhYmxlZCBpbnB1dC10ZXh0LS1mdWxsLXdpZHRoJyByZWFkT25seVxuICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9e3RoaXMuc2VsZWN0fSBzcGVsbENoZWNrPSdmYWxzZSdcbiAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT17YDxpbWcgc3JjPVwiJHtob3N0fS8ke2NsYWltSWR9LyR7bmFtZX0uJHtmaWxlRXh0fVwiLz5gfVxuICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT0nY29sdW1uIGNvbHVtbi0tMScgLz5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT0nY29sdW1uIGNvbHVtbi0tMic+XG4gICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzTmFtZT0nYnV0dG9uLS1wcmltYXJ5IGJ1dHRvbi0td2lkZScgZGF0YS1lbGVtZW50dG9jb3B5PSdlbWJlZC10ZXh0J1xuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXt0aGlzLmNvcHlUb0NsaXBib2FyZH0+Y29weVxuICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuXG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XR1cm4gKFxuICAgICAgICAgICAgICAgIDxpbWdcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT17J2Fzc2V0LXByZXZpZXcnfVxuICAgICAgICAgICAgICAgICAgc3JjPXtkaXJlY3RTb3VyY2VMaW5rfVxuICAgICAgICAgICAgICAgICAgYWx0PXtuYW1lfVxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICBjYXNlICd2aWRlby9tcDQnOlxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxpbWdcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT17J2Fzc2V0LXByZXZpZXcgdmlkZW8nfVxuICAgICAgICAgICAgICAgICAgc3JjPXt0aHVtYm5haWwgfHwgZGVmYXVsdFRodW1ibmFpbH1cbiAgICAgICAgICAgICAgICAgIGFsdD17bmFtZX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8cD51bnN1cHBvcnRlZCBmaWxlIHR5cGU8L3A+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9KSgpfVxuICAgICAgPC9MaW5rPlxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQXNzZXRQcmV2aWV3O1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vY2xpZW50L2NvbXBvbmVudHMvQXNzZXRQcmV2aWV3L3ZpZXcuanN4IiwiaW1wb3J0IHsgY29ubmVjdCB9IGZyb20gJ3JlYWN0LXJlZHV4JztcbmltcG9ydCBWaWV3IGZyb20gJy4vdmlldyc7XG5cbmNvbnN0IG1hcFN0YXRlVG9Qcm9wcyA9ICh7IHNpdGU6IHsgaG9zdCwgdGl0bGUgfSB9KSA9PiB7XG4gIHJldHVybiB7XG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