diff --git a/appasar/canary/app_bootstrap/Constants.js b/appasar/canary/app_bootstrap/Constants.js
new file mode 100644
index 0000000..880fa94
--- /dev/null
+++ b/appasar/canary/app_bootstrap/Constants.js
@@ -0,0 +1,28 @@
+'use strict';
+
+// bootstrap constants
+// after startup, these constants will be merged into core module constants
+// since they are used in both locations (see app/Constants.js)
+
+const { releaseChannel } = require('./buildInfo');
+const { getSettings } = require('./appSettings');
+
+const settings = getSettings();
+
+function capitalizeFirstLetter(s) {
+ return s.charAt(0).toUpperCase() + s.slice(1);
+}
+
+const APP_NAME = 'Discord' + (releaseChannel === 'stable' ? '' : capitalizeFirstLetter(releaseChannel));
+const APP_ID_BASE = 'com.squirrel';
+const APP_ID = `${APP_ID_BASE}.${APP_NAME}.${APP_NAME}`;
+
+const API_ENDPOINT = settings.get('API_ENDPOINT') || 'https://discordapp.com/api';
+const UPDATE_ENDPOINT = settings.get('UPDATE_ENDPOINT') || API_ENDPOINT;
+
+module.exports = {
+ APP_NAME,
+ APP_ID,
+ API_ENDPOINT,
+ UPDATE_ENDPOINT
+};
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/GPUSettings.js b/appasar/canary/app_bootstrap/GPUSettings.js
new file mode 100644
index 0000000..f208526
--- /dev/null
+++ b/appasar/canary/app_bootstrap/GPUSettings.js
@@ -0,0 +1,17 @@
+"use strict";
+
+// this file is here for two reasons:
+// 1. web requires ./GPUSettings file from electron app (bad!), and requires are
+// relative to process.main (bootstrap's index.js)
+// 2. GPUSettings has been refactored into GPUSettings, and because we want to
+// be able to update GPUSettings OTA, we will have the core module provide
+// us with the GPUSettings
+// so tl;dr this is core module's GPUSettings, providing compat for web
+
+exports.replace = function (GPUSettings) {
+ // replacing module.exports directly would have no effect, since requires are cached
+ // so we mutate the existing object
+ for (const name of Object.keys(GPUSettings)) {
+ exports[name] = GPUSettings[name];
+ }
+};
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/appSettings.js b/appasar/canary/app_bootstrap/appSettings.js
new file mode 100644
index 0000000..2d880a8
--- /dev/null
+++ b/appasar/canary/app_bootstrap/appSettings.js
@@ -0,0 +1,29 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.init = init;
+exports.getSettings = getSettings;
+
+var _Settings = require('../common/Settings');
+
+var _Settings2 = _interopRequireDefault(_Settings);
+
+var _paths = require('../common/paths');
+
+var paths = _interopRequireWildcard(_paths);
+
+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; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+let settings;
+
+function init() {
+ settings = new _Settings2.default(paths.getUserData());
+}
+
+function getSettings() {
+ return settings;
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/appUpdater.js b/appasar/canary/app_bootstrap/appUpdater.js
new file mode 100644
index 0000000..ca7af7f
--- /dev/null
+++ b/appasar/canary/app_bootstrap/appUpdater.js
@@ -0,0 +1,40 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.update = update;
+exports.focusSplash = focusSplash;
+
+var _moduleUpdater = require('../common/moduleUpdater');
+
+var moduleUpdater = _interopRequireWildcard(_moduleUpdater);
+
+var _splashScreen = require('./splashScreen');
+
+var splashScreen = _interopRequireWildcard(_splashScreen);
+
+var _appSettings = require('./appSettings');
+
+var _Constants = require('./Constants');
+
+var _buildInfo = require('./buildInfo');
+
+var _buildInfo2 = _interopRequireDefault(_buildInfo);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+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; } }
+
+function update(startMinimized, doneCallback, showCallback) {
+ const settings = (0, _appSettings.getSettings)();
+ moduleUpdater.init(_Constants.UPDATE_ENDPOINT, settings, _buildInfo2.default);
+
+ splashScreen.initSplash(startMinimized);
+ splashScreen.events.once(splashScreen.APP_SHOULD_LAUNCH, doneCallback);
+ splashScreen.events.once(splashScreen.APP_SHOULD_SHOW, showCallback);
+}
+
+function focusSplash() {
+ splashScreen.focusWindow();
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/autoStart/darwin.js b/appasar/canary/app_bootstrap/autoStart/darwin.js
new file mode 100644
index 0000000..954818c
--- /dev/null
+++ b/appasar/canary/app_bootstrap/autoStart/darwin.js
@@ -0,0 +1,24 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.install = install;
+exports.update = update;
+exports.isInstalled = isInstalled;
+exports.uninstall = uninstall;
+function install(callback) {
+ return callback();
+}
+
+function update(callback) {
+ return callback();
+}
+
+function isInstalled(callback) {
+ return callback(false);
+}
+
+function uninstall(callback) {
+ return callback();
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/autoStart/index.js b/appasar/canary/app_bootstrap/autoStart/index.js
new file mode 100644
index 0000000..012f895
--- /dev/null
+++ b/appasar/canary/app_bootstrap/autoStart/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./' + process.platform);
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/autoStart/linux.js b/appasar/canary/app_bootstrap/autoStart/linux.js
new file mode 100644
index 0000000..4097e7f
--- /dev/null
+++ b/appasar/canary/app_bootstrap/autoStart/linux.js
@@ -0,0 +1,87 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.install = install;
+exports.update = update;
+exports.isInstalled = isInstalled;
+exports.uninstall = uninstall;
+
+var _fs = require('fs');
+
+var _fs2 = _interopRequireDefault(_fs);
+
+var _path = require('path');
+
+var _path2 = _interopRequireDefault(_path);
+
+var _electron = require('electron');
+
+var _buildInfo = require('../buildInfo');
+
+var _buildInfo2 = _interopRequireDefault(_buildInfo);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// TODO: We should use Constant's APP_NAME, but only once
+// we set up backwards compat with this.
+const appName = _path2.default.basename(process.execPath, '.exe');
+const exePath = _electron.app.getPath('exe');
+const exeDir = _path2.default.dirname(exePath);
+const iconPath = _path2.default.join(exeDir, 'discord.png');
+const autostartDir = _path2.default.join(_electron.app.getPath('appData'), 'autostart');
+const autostartFileName = _path2.default.join(autostartDir, _electron.app.getName() + '-' + _buildInfo2.default.releaseChannel + '.desktop');
+const desktopFile = `[Desktop Entry]
+Type=Application
+Exec=${exePath}
+Hidden=false
+NoDisplay=false
+Name=${appName}
+Icon=${iconPath}
+Comment=Text and voice chat for gamers.
+X-GNOME-Autostart-enabled=true
+`;
+
+function ensureDir() {
+ try {
+ _fs2.default.mkdirSync(autostartDir);
+ return true;
+ } catch (e) {
+ // catch for when it already exists.
+ }
+ return false;
+}
+
+function install(callback) {
+ // TODO: This could fail. We should read its return value
+ ensureDir();
+ try {
+ return _fs2.default.writeFile(autostartFileName, desktopFile, callback);
+ } catch (e) {
+ // I guess we don't autostart then
+ return callback();
+ }
+}
+
+function update(callback) {
+ // TODO: We might need to implement this later on
+ return callback();
+}
+
+function isInstalled(callback) {
+ try {
+ _fs2.default.stat(autostartFileName, (err, stats) => {
+ if (err) {
+ return callback(false);
+ }
+ return callback(stats.isFile());
+ });
+ } catch (e) {
+ return callback(false);
+ }
+}
+
+function uninstall(callback) {
+ return _fs2.default.unlink(autostartFileName, callback);
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/autoStart/win32.js b/appasar/canary/app_bootstrap/autoStart/win32.js
new file mode 100644
index 0000000..3350c17
--- /dev/null
+++ b/appasar/canary/app_bootstrap/autoStart/win32.js
@@ -0,0 +1,67 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.install = install;
+exports.update = update;
+exports.isInstalled = isInstalled;
+exports.uninstall = uninstall;
+
+var _path = require('path');
+
+var _path2 = _interopRequireDefault(_path);
+
+var _windowsUtils = require('../windowsUtils');
+
+var windowsUtils = _interopRequireWildcard(_windowsUtils);
+
+var _appSettings = require('../appSettings');
+
+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; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const settings = (0, _appSettings.getSettings)();
+
+// TODO: We should use Constant's APP_NAME, but only once
+// we set up backwards compat with this.
+const appName = _path2.default.basename(process.execPath, '.exe');
+
+function install(callback) {
+ const startMinimized = settings.get('START_MINIMIZED', false);
+ let { execPath } = process;
+ if (startMinimized) {
+ execPath = `${execPath} --start-minimized`;
+ }
+ const queue = [['HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName, '/d', execPath]];
+
+ windowsUtils.addToRegistry(queue, callback);
+}
+
+function update(callback) {
+ isInstalled(installed => {
+ if (installed) {
+ install(callback);
+ } else {
+ callback();
+ }
+ });
+}
+
+function isInstalled(callback) {
+ const queryValue = ['HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName];
+ queryValue.unshift('query');
+ windowsUtils.spawnReg(queryValue, (error, stdout) => {
+ const doesOldKeyExist = stdout.indexOf(appName) >= 0;
+ callback(doesOldKeyExist);
+ });
+}
+
+function uninstall(callback) {
+ const queryValue = ['HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName, '/f'];
+ queryValue.unshift('delete');
+ windowsUtils.spawnReg(queryValue, (error, stdout) => {
+ callback();
+ });
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/bootstrap.js b/appasar/canary/app_bootstrap/bootstrap.js
new file mode 100644
index 0000000..044f1fa
--- /dev/null
+++ b/appasar/canary/app_bootstrap/bootstrap.js
@@ -0,0 +1,140 @@
+'use strict';
+
+// bootstrap, or what runs before the rest of desktop does
+// responsible for handling updates and updating modules before continuing startup
+
+if (process.platform === 'linux') {
+ // Some people are reporting audio problems on Linux that are fixed by setting
+ // an environment variable PULSE_LATENCY_MSEC=30 -- the "real" fix is to see
+ // what conditions require this and set this then (also to set it directly in
+ // our webrtc setup code rather than here) but this should fix the bug for now.
+ if (process.env.PULSE_LATENCY_MSEC === undefined) {
+ process.env.PULSE_LATENCY_MSEC = 30;
+ }
+}
+
+const { app, Menu } = require('electron');
+
+const buildInfo = require('./buildInfo');
+app.setVersion(buildInfo.version);
+
+// expose releaseChannel to a global, since it's used by splash screen
+global.releaseChannel = buildInfo.releaseChannel;
+
+const errorHandler = require('./errorHandler');
+errorHandler.init();
+
+const paths = require('../common/paths');
+paths.init(buildInfo);
+
+global.modulePath = paths.getModulePath();
+
+const appSettings = require('./appSettings');
+appSettings.init();
+
+const Constants = require('./Constants');
+const GPUSettings = require('./GPUSettings');
+
+const settings = appSettings.getSettings();
+// TODO: this is a copy of gpuSettings.getEnableHardwareAcceleration
+if (!settings.get('enableHardwareAcceleration', true)) {
+ app.disableHardwareAcceleration();
+}
+
+// [adill] disables color correction based on monitor's color profile
+app.commandLine.appendSwitch('force-color-profile', 'srgb');
+
+// [adill] work around chrome 66 disabling autoplay by default
+app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');
+
+function hasArgvFlag(flag) {
+ return (process.argv || []).slice(1).includes(flag);
+}
+
+console.log(`${Constants.APP_NAME} ${app.getVersion()}`);
+
+let preventStartup = false;
+if (process.platform === 'win32') {
+ // this tells Windows (in particular Windows 10) which icon to associate your app with, important for correctly
+ // pinning app to task bar.
+ app.setAppUserModelId(Constants.APP_ID);
+
+ const { handleStartupEvent } = require('./squirrelUpdate');
+ // TODO: Isn't using argv[1] fragile?
+ const squirrelCommand = process.argv[1];
+ // TODO: Should `Discord` be a constant in this case? It's a protocol.
+ // TODO: Is protocol case sensitive?
+ if (handleStartupEvent('Discord', app, squirrelCommand)) {
+ preventStartup = true;
+ }
+}
+
+const singleInstance = require('./singleInstance');
+const appUpdater = require('./appUpdater');
+const moduleUpdater = require('../common/moduleUpdater');
+const splashScreen = require('./splashScreen');
+const autoStart = require('./autoStart');
+const requireNative = require('./requireNative');
+let coreModule;
+
+function startUpdate() {
+ const startMinimized = hasArgvFlag('--start-minimized');
+
+ appUpdater.update(startMinimized, () => {
+ try {
+ coreModule = requireNative('discord_desktop_core');
+ coreModule.startup({
+ paths,
+ splashScreen,
+ moduleUpdater,
+ autoStart,
+ buildInfo,
+ appSettings,
+ Constants,
+ GPUSettings
+ });
+ } catch (err) {
+ return errorHandler.fatal(err);
+ }
+ }, () => {
+ coreModule.setMainWindowVisible(!startMinimized);
+ });
+}
+
+function startApp() {
+ paths.cleanOldVersions(buildInfo);
+ const startupMenu = require('./startupMenu');
+ Menu.setApplicationMenu(startupMenu);
+
+ const multiInstance = hasArgvFlag('--multi-instance');
+
+ if (multiInstance) {
+ startUpdate();
+ } else {
+ singleInstance.create(startUpdate, args => {
+ // TODO: isn't relying on index 0 awfully fragile?
+ if (args != null && args.length > 0 && args[0] === '--squirrel-uninstall') {
+ app.quit();
+ return;
+ }
+
+ if (coreModule) {
+ coreModule.handleSingleInstance(args);
+ } else {
+ appUpdater.focusSplash();
+ }
+ });
+ }
+}
+
+if (preventStartup) {
+ console.log('Startup prevented.');
+ // TODO: shouldn't we exit out?
+} else {
+ console.log('Starting updater.');
+ if (app.isReady()) {
+ startApp();
+ } else {
+ app.once('ready', startApp);
+ }
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/buildInfo.js b/appasar/canary/app_bootstrap/buildInfo.js
new file mode 100644
index 0000000..1e83b40
--- /dev/null
+++ b/appasar/canary/app_bootstrap/buildInfo.js
@@ -0,0 +1,16 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _path = require('path');
+
+var _path2 = _interopRequireDefault(_path);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const buildInfo = require(_path2.default.join(process.resourcesPath, 'build_info.json'));
+
+exports.default = buildInfo;
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/data/quotes_copy.json b/appasar/canary/app_bootstrap/data/quotes_copy.json
new file mode 100644
index 0000000..fc33384
--- /dev/null
+++ b/appasar/canary/app_bootstrap/data/quotes_copy.json
@@ -0,0 +1,14 @@
+[
+ "Upsorbing the Contents",
+ "Additive Parsing the Load",
+ "Commence Monosaturated Goodening",
+ "Kick Off the Multi-Core Widening",
+ "Bastening the Game Turkey",
+ "Abstracting the Rummage Disc",
+ "Undecerealenizing the Process",
+ "Postrefragmenting the Widget Layer",
+ "Satisfying the Constraints",
+ "Abnoramalzing Some of the Matrices",
+ "Optimizing the People",
+ "Proclaigerizing the Network"
+]
diff --git a/appasar/canary/app_bootstrap/errorHandler.js b/appasar/canary/app_bootstrap/errorHandler.js
new file mode 100644
index 0000000..d2b2d7e
--- /dev/null
+++ b/appasar/canary/app_bootstrap/errorHandler.js
@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.init = init;
+exports.fatal = fatal;
+
+var _electron = require('electron');
+
+function isErrorSafeToSuppress(error) {
+ return (/attempting to call a function in a renderer window/i.test(error.message)
+ );
+}
+
+function init() {
+ process.on('uncaughtException', error => {
+ const stack = error.stack ? error.stack : String(error);
+ const message = `Uncaught exception:\n ${stack}`;
+ console.warn(message);
+
+ if (!isErrorSafeToSuppress(error)) {
+ _electron.dialog.showErrorBox('A JavaScript error occurred in the main process', message);
+ }
+ });
+}
+
+// show a similar error message to the error handler, except exit out the app
+// after the error message has been closed
+function fatal(err) {
+ _electron.dialog.showMessageBox({
+ type: 'error',
+ message: 'A fatal Javascript error occured',
+ detail: err && err.stack ? err.stack : String(err)
+ }, () => {
+ _electron.app.quit();
+ });
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/hostUpdater.js b/appasar/canary/app_bootstrap/hostUpdater.js
new file mode 100644
index 0000000..5dd9f8e
--- /dev/null
+++ b/appasar/canary/app_bootstrap/hostUpdater.js
@@ -0,0 +1,189 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _events = require('events');
+
+var _squirrelUpdate = require('./squirrelUpdate');
+
+var squirrelUpdate = _interopRequireWildcard(_squirrelUpdate);
+
+var _electron = require('electron');
+
+var _request = require('./request');
+
+var _request2 = _interopRequireDefault(_request);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+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; } }
+
+function versionParse(verString) {
+ return verString.split('.').map(i => parseInt(i));
+}
+
+function versionNewer(verA, verB) {
+ let i = 0;
+ while (true) {
+ const a = verA[i];
+ const b = verB[i];
+ i++;
+ if (a === undefined) {
+ return false;
+ } else {
+ if (b === undefined || a > b) {
+ return true;
+ }
+ if (a < b) {
+ return false;
+ }
+ }
+ }
+}
+
+class AutoUpdaterWin32 extends _events.EventEmitter {
+ constructor() {
+ super();
+
+ this.updateUrl = null;
+ this.updateVersion = null;
+ }
+
+ setFeedURL(updateUrl) {
+ this.updateUrl = updateUrl;
+ }
+
+ quitAndInstall() {
+ if (squirrelUpdate.updateExistsSync()) {
+ squirrelUpdate.restart(_electron.app, this.updateVersion || _electron.app.getVersion());
+ } else {
+ require('auto-updater').quitAndInstall();
+ }
+ }
+
+ downloadAndInstallUpdate(callback) {
+ squirrelUpdate.spawnUpdateInstall(this.updateUrl, progress => {
+ this.emit('update-progress', progress);
+ }).catch(err => callback(err)).then(() => callback());
+ }
+
+ checkForUpdates() {
+ if (this.updateUrl == null) {
+ throw new Error('Update URL is not set');
+ }
+
+ this.emit('checking-for-update');
+
+ if (!squirrelUpdate.updateExistsSync()) {
+ this.emit('update-not-available');
+ return;
+ }
+
+ squirrelUpdate.spawnUpdate(['--check', this.updateUrl], (error, stdout) => {
+ if (error != null) {
+ this.emit('error', error);
+ return;
+ }
+
+ try {
+ // Last line of the output is JSON details about the releases
+ const json = stdout.trim().split('\n').pop();
+ const releasesFound = JSON.parse(json).releasesToApply;
+ if (releasesFound == null || releasesFound.length == 0) {
+ this.emit('update-not-available');
+ return;
+ }
+
+ const update = releasesFound.pop();
+ this.emit('update-available');
+ this.downloadAndInstallUpdate(error => {
+ if (error != null) {
+ this.emit('error', error);
+ return;
+ }
+
+ this.updateVersion = update.version;
+
+ this.emit('update-downloaded', {}, update.release, update.version, new Date(), this.updateUrl, this.quitAndInstall.bind(this));
+ });
+ } catch (error) {
+ error.stdout = stdout;
+ this.emit('error', error);
+ }
+ });
+ }
+}
+
+// todo
+class AutoUpdaterLinux extends _events.EventEmitter {
+ constructor() {
+ super();
+ this.updateUrl = null;
+ }
+
+ setFeedURL(url) {
+ this.updateUrl = url;
+ }
+
+ checkForUpdates() {
+ const currVersion = versionParse(_electron.app.getVersion());
+ this.emit('checking-for-update');
+
+ _request2.default.get({ url: this.updateUrl, encoding: null }, (error, response, body) => {
+ if (error) {
+ console.error('[Updates] Error fetching ' + this.updateUrl + ': ' + error);
+ this.emit('error', error);
+ return;
+ }
+
+ if (response.statusCode === 204) {
+ // you are up to date
+ this.emit('update-not-available');
+ } else if (response.statusCode === 200) {
+ let latestVerStr = '';
+ let latestVersion = [];
+ try {
+ const latestMetadata = JSON.parse(body);
+ latestVerStr = latestMetadata.name;
+ latestVersion = versionParse(latestVerStr);
+ } catch (e) {}
+
+ if (versionNewer(latestVersion, currVersion)) {
+ console.log('[Updates] You are out of date!');
+ // you need to update
+ this.emit('update-manually', latestVerStr);
+ } else {
+ console.log('[Updates] You are living in the future!');
+ this.emit('update-not-available');
+ }
+ } else {
+ // something is wrong
+ console.error(`[Updates] Error: fetch returned: ${response.statusCode}`);
+ this.emit('update-not-available');
+ }
+ });
+ }
+}
+
+let autoUpdater;
+
+// TODO
+// events: checking-for-update, update-available, update-not-available, update-manually, update-downloaded, error
+// also, checkForUpdates, setFeedURL, quitAndInstall
+// also, see electron.autoUpdater, and its API
+switch (process.platform) {
+ case 'darwin':
+ autoUpdater = require('electron').autoUpdater;
+ break;
+ case 'win32':
+ autoUpdater = new AutoUpdaterWin32();
+ break;
+ case 'linux':
+ autoUpdater = new AutoUpdaterLinux();
+ break;
+}
+
+exports.default = autoUpdater;
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/images/img_lucky_dice.png b/appasar/canary/app_bootstrap/images/img_lucky_dice.png
new file mode 100644
index 0000000..909b729
Binary files /dev/null and b/appasar/canary/app_bootstrap/images/img_lucky_dice.png differ
diff --git a/appasar/canary/app_bootstrap/index.js b/appasar/canary/app_bootstrap/index.js
new file mode 100644
index 0000000..8f37857
--- /dev/null
+++ b/appasar/canary/app_bootstrap/index.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const buildInfo = require('./buildInfo');
+const paths = require('../common/paths');
+paths.init(buildInfo);
+const moduleUpdater = require('../common/moduleUpdater');
+moduleUpdater.initPathsOnly(buildInfo);
+const requireNative = require('./requireNative');
+
+function getAppMode() {
+ if (process.argv && process.argv.includes('--overlay-host')) {
+ return 'overlay-host';
+ }
+
+ return 'app';
+}
+
+const mode = getAppMode();
+if (mode === 'app') {
+ require('./bootstrap');
+} else if (mode === 'overlay-host') {
+ requireNative('discord_overlay2/standalone_host.js');
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/installDevTools.js b/appasar/canary/app_bootstrap/installDevTools.js
new file mode 100644
index 0000000..ca17e45
--- /dev/null
+++ b/appasar/canary/app_bootstrap/installDevTools.js
@@ -0,0 +1,18 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+// used in devtools to hook in additional dev tools
+// require('electron').remote.require('./installDevTools')()
+
+function installDevTools() {
+ console.log(`Installing Devtron`);
+ const devtron = require('devtron');
+ devtron.uninstall();
+ devtron.install();
+ console.log(`Installed Devtron`);
+}
+
+exports.default = installDevTools;
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/ipcMain.js b/appasar/canary/app_bootstrap/ipcMain.js
new file mode 100644
index 0000000..8b9cc21
--- /dev/null
+++ b/appasar/canary/app_bootstrap/ipcMain.js
@@ -0,0 +1,13 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _electron = require('electron');
+
+exports.default = {
+ on: (event, callback) => _electron.ipcMain.on(`DISCORD_${event}`, callback),
+ removeListener: (event, callback) => _electron.ipcMain.removeListener(`DISCORD_${event}`, callback)
+};
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/request.js b/appasar/canary/app_bootstrap/request.js
new file mode 100644
index 0000000..58e1730
--- /dev/null
+++ b/appasar/canary/app_bootstrap/request.js
@@ -0,0 +1,116 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+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 _electron = require('electron');
+
+var _querystring = require('querystring');
+
+var _querystring2 = _interopRequireDefault(_querystring);
+
+var _request = require('request');
+
+var _request2 = _interopRequireDefault(_request);
+
+var _events = require('events');
+
+var _events2 = _interopRequireDefault(_events);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _log(_msg) {
+ // console.log('[Request] ' + _msg);
+}
+
+function requestWithMethod(method, origOpts, origCallback) {
+ if (typeof origOpts == 'string') {
+ origOpts = { url: origOpts };
+ }
+
+ const opts = _extends({}, origOpts, { method });
+
+ let callback;
+ if (origCallback || opts.callback) {
+ const origOptsCallback = opts.callback;
+ delete opts.callback;
+ callback = (...args) => {
+ if (origCallback) {
+ origCallback.apply(this, args);
+ }
+ if (origOptsCallback) {
+ origOptsCallback.apply(this, args);
+ }
+ };
+ }
+
+ const strictOpts = _extends({}, opts, { strictSSL: true });
+ const laxOpts = _extends({}, opts, { strictSSL: false });
+
+ const rv = new _events2.default();
+
+ if (callback) {
+ _log('have callback, so wrapping');
+ rv.on('response', response => {
+ const chunks = [];
+ response.on('data', chunk => chunks.push(chunk));
+ response.on('end', () => {
+ callback(null, response, Buffer.concat(chunks));
+ });
+ });
+ rv.on('error', error => callback(error));
+ }
+
+ const requestTypes = [{
+ factory: function () {
+ return (0, _request2.default)(strictOpts);
+ },
+ method: 'node_request_strict'
+ }, {
+ factory: function () {
+ const qs = _querystring2.default.stringify(strictOpts.qs);
+ const nr = _electron.net.request(_extends({}, strictOpts, { url: `${strictOpts.url}?${qs}` }));
+ nr.end();
+ return nr;
+ },
+ method: 'electron_net_request_strict'
+ }, {
+ factory: function () {
+ return (0, _request2.default)(laxOpts);
+ },
+ method: 'node_request_lax'
+ }];
+
+ function attempt(index) {
+ const { factory, method } = requestTypes[index];
+ _log(`Attempt #${index + 1}: ${method}`);
+ factory().on('response', response => {
+ _log(`${method} success! emitting response ${response}`);
+ rv.emit('response', response);
+ }).on('error', error => {
+ if (index + 1 < requestTypes.length) {
+ _log(`${method} failure, trying next option`);
+ attempt(index + 1);
+ } else {
+ _log(`${method} failure, out of options`);
+ rv.emit('error', error);
+ }
+ });
+ }
+
+ attempt(0);
+
+ return rv;
+}
+
+// only supports get for now, since retrying is non-idempotent and
+// we'd want to grovel the errors to make sure it's safe to retry
+for (const method of ['get']) {
+ requestWithMethod[method] = requestWithMethod.bind(null, method);
+}
+
+exports.default = requestWithMethod;
+module.exports = exports['default'];
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/requireNative.js b/appasar/canary/app_bootstrap/requireNative.js
new file mode 100644
index 0000000..c18c0c0
--- /dev/null
+++ b/appasar/canary/app_bootstrap/requireNative.js
@@ -0,0 +1,5 @@
+"use strict";
+
+// require(), with paths specialized for requiring only native modules.
+module.paths = [];
+module.exports = require;
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/singleInstance.js b/appasar/canary/app_bootstrap/singleInstance.js
new file mode 100644
index 0000000..86bd416
--- /dev/null
+++ b/appasar/canary/app_bootstrap/singleInstance.js
@@ -0,0 +1,129 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.create = create;
+exports.pipeCommandLineArgs = pipeCommandLineArgs;
+
+var _electron = require('electron');
+
+var _net = require('net');
+
+var _net2 = _interopRequireDefault(_net);
+
+var _path = require('path');
+
+var _path2 = _interopRequireDefault(_path);
+
+var _fs = require('fs');
+
+var _fs2 = _interopRequireDefault(_fs);
+
+var _os = require('os');
+
+var _os2 = _interopRequireDefault(_os);
+
+var _buildInfo = require('./buildInfo');
+
+var _buildInfo2 = _interopRequireDefault(_buildInfo);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function deleteSocketFile(socketPath) {
+ if (process.platform === 'win32') {
+ return;
+ }
+
+ if (_fs2.default.existsSync(socketPath)) {
+ try {
+ _fs2.default.unlinkSync(socketPath);
+ } catch (error) {
+ // Ignore ENOENT errors in case the file was deleted between the exists
+ // check and the call to unlink sync. This occurred occasionally on CI
+ // which is why this check is here.
+ if (error.code !== 'ENOENT') {
+ throw error;
+ }
+ }
+ }
+}
+
+/**
+ * Creates server to listen for additional atom application launches.
+ *
+ * You can run the command multiple times, but after the first launch
+ * the other launches will just pass their information to this server and then
+ * close immediately.
+ */
+function listenForArgumentsFromNewProcess(socketPath, callback) {
+ deleteSocketFile(socketPath);
+
+ const server = _net2.default.createServer(connection => {
+ connection.on('data', data => {
+ const args = JSON.parse(data);
+ callback(args);
+ });
+ });
+ server.listen(socketPath);
+ server.on('error', error => console.error('Application server failed', error));
+ return server;
+}
+
+function tryStart(socketPath, callback, otherAppFound) {
+ // FIXME: Sometimes when socketPath doesn't exist, net.connect would strangely
+ // take a few seconds to trigger 'error' event, it could be a bug of node
+ // or atom-shell, before it's fixed we check the existence of socketPath to
+ // speedup startup.
+ if (process.platform !== 'win32' && !_fs2.default.existsSync(socketPath)) {
+ callback();
+ return;
+ }
+
+ const client = _net2.default.connect({ path: socketPath }, () => {
+ client.write(JSON.stringify(process.argv.slice(1)), () => {
+ client.end();
+ otherAppFound();
+ });
+ });
+ client.on('error', callback);
+}
+
+function makeSocketPath() {
+ let name = _electron.app.getName();
+ if (_buildInfo2.default.releaseChannel !== 'stable') {
+ name = _electron.app.getName() + _buildInfo2.default.releaseChannel;
+ }
+
+ if (process.platform === 'win32') {
+ return '\\\\.\\pipe\\' + name + '-sock';
+ } else {
+ return _path2.default.join(_os2.default.tmpdir(), name + '.sock');
+ }
+}
+
+function create(startCallback, newProcessCallback) {
+ const socketPath = makeSocketPath();
+
+ tryStart(socketPath, () => {
+ const server = listenForArgumentsFromNewProcess(socketPath, newProcessCallback);
+
+ _electron.app.on('will-quit', () => {
+ server.close();
+ deleteSocketFile(socketPath);
+ });
+
+ _electron.app.on('will-exit', () => {
+ server.close();
+ deleteSocketFile(socketPath);
+ });
+
+ startCallback();
+ }, () => {
+ _electron.app.exit(0);
+ });
+}
+
+function pipeCommandLineArgs(noOtherAppFoundCallback, otherAppFound) {
+ tryStart(makeSocketPath(), noOtherAppFoundCallback, otherAppFound);
+}
\ No newline at end of file
diff --git a/appasar/canary/app_bootstrap/splash/a934ab008c7f6a2274ec441f6be0696a.woff b/appasar/canary/app_bootstrap/splash/a934ab008c7f6a2274ec441f6be0696a.woff
new file mode 100644
index 0000000..98aa239
Binary files /dev/null and b/appasar/canary/app_bootstrap/splash/a934ab008c7f6a2274ec441f6be0696a.woff differ
diff --git a/appasar/canary/app_bootstrap/splash/abddffb32a4a35627c3857a06c751424.png b/appasar/canary/app_bootstrap/splash/abddffb32a4a35627c3857a06c751424.png
new file mode 100644
index 0000000..909b729
Binary files /dev/null and b/appasar/canary/app_bootstrap/splash/abddffb32a4a35627c3857a06c751424.png differ
diff --git a/appasar/canary/app_bootstrap/splash/d153359b5d87601d2b9c708b7ae2db02.woff b/appasar/canary/app_bootstrap/splash/d153359b5d87601d2b9c708b7ae2db02.woff
new file mode 100644
index 0000000..2a2f65a
Binary files /dev/null and b/appasar/canary/app_bootstrap/splash/d153359b5d87601d2b9c708b7ae2db02.woff differ
diff --git a/appasar/canary/app_bootstrap/splash/index.html b/appasar/canary/app_bootstrap/splash/index.html
new file mode 100644
index 0000000..5dec1de
--- /dev/null
+++ b/appasar/canary/app_bootstrap/splash/index.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Discord Updater
+
+
+
+
+
+
diff --git a/appasar/canary/app_bootstrap/splash/index.js b/appasar/canary/app_bootstrap/splash/index.js
new file mode 100644
index 0000000..737b244
--- /dev/null
+++ b/appasar/canary/app_bootstrap/splash/index.js
@@ -0,0 +1,25742 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 85);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+/**
+ * Use invariant() to assert state which your program assumes to be true.
+ *
+ * Provide sprintf-style format (only %s is supported) and arguments
+ * to provide information about what broke and what you were
+ * expecting.
+ *
+ * The invariant message will be stripped in production, but the invariant
+ * will remain to ensure logic does not differ in production.
+ */
+
+var validateFormat = function validateFormat(format) {};
+
+if (process.env.NODE_ENV !== 'production') {
+ validateFormat = function validateFormat(format) {
+ if (format === undefined) {
+ throw new Error('invariant requires an error message argument');
+ }
+ };
+}
+
+function invariant(condition, format, a, b, c, d, e, f) {
+ validateFormat(format);
+
+ if (!condition) {
+ var error;
+ if (format === undefined) {
+ error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
+ } else {
+ var args = [a, b, c, d, e, f];
+ var argIndex = 0;
+ error = new Error(format.replace(/%s/g, function () {
+ return args[argIndex++];
+ }));
+ error.name = 'Invariant Violation';
+ }
+
+ error.framesToPop = 1; // we don't care about invariant's own frame
+ throw error;
+ }
+}
+
+module.exports = invariant;
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2014-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var emptyFunction = __webpack_require__(7);
+
+/**
+ * Similar to invariant but only logs a warning if the condition is not met.
+ * This can be used to log issues in development environments in critical
+ * paths. Removing the logging code for production environments will keep the
+ * same logic and follow the same code paths.
+ */
+
+var warning = emptyFunction;
+
+if (process.env.NODE_ENV !== 'production') {
+ var printWarning = function printWarning(format) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ var argIndex = 0;
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
+ return args[argIndex++];
+ });
+ if (typeof console !== 'undefined') {
+ console.error(message);
+ }
+ try {
+ // --- Welcome to debugging React ---
+ // This error was thrown as a convenience so that you can use this stack
+ // to find the callsite that caused this warning to fire.
+ throw new Error(message);
+ } catch (x) {}
+ };
+
+ warning = function warning(condition, format) {
+ if (format === undefined) {
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
+ }
+
+ if (format.indexOf('Failed Composite propType: ') === 0) {
+ return; // Ignore CompositeComponent proptype check.
+ }
+
+ if (!condition) {
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
+ args[_key2 - 2] = arguments[_key2];
+ }
+
+ printWarning.apply(undefined, [format].concat(args));
+ }
+ };
+}
+
+module.exports = warning;
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+
+/**
+ * WARNING: DO NOT manually require this module.
+ * This is a replacement for `invariant(...)` used by the error code system
+ * and will _only_ be required by the corresponding babel pass.
+ * It always throws.
+ */
+
+function reactProdInvariant(code) {
+ var argCount = arguments.length - 1;
+
+ var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
+
+ for (var argIdx = 0; argIdx < argCount; argIdx++) {
+ message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
+ }
+
+ message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
+
+ var error = new Error(message);
+ error.name = 'Invariant Violation';
+ error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
+
+ throw error;
+}
+
+module.exports = reactProdInvariant;
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/*
+object-assign
+(c) Sindre Sorhus
+@license MIT
+*/
+
+
+/* eslint-disable no-unused-vars */
+var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+var propIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+function toObject(val) {
+ if (val === null || val === undefined) {
+ throw new TypeError('Object.assign cannot be called with null or undefined');
+ }
+
+ return Object(val);
+}
+
+function shouldUseNative() {
+ try {
+ if (!Object.assign) {
+ return false;
+ }
+
+ // Detect buggy property enumeration order in older V8 versions.
+
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
+ test1[5] = 'de';
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
+ return false;
+ }
+
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test2 = {};
+ for (var i = 0; i < 10; i++) {
+ test2['_' + String.fromCharCode(i)] = i;
+ }
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+ return test2[n];
+ });
+ if (order2.join('') !== '0123456789') {
+ return false;
+ }
+
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test3 = {};
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+ test3[letter] = letter;
+ });
+ if (Object.keys(Object.assign({}, test3)).join('') !==
+ 'abcdefghijklmnopqrst') {
+ return false;
+ }
+
+ return true;
+ } catch (err) {
+ // We don't expect any of the above to throw, but better to be safe.
+ return false;
+ }
+}
+
+module.exports = shouldUseNative() ? Object.assign : function (target, source) {
+ var from;
+ var to = toObject(target);
+ var symbols;
+
+ for (var s = 1; s < arguments.length; s++) {
+ from = Object(arguments[s]);
+
+ for (var key in from) {
+ if (hasOwnProperty.call(from, key)) {
+ to[key] = from[key];
+ }
+ }
+
+ if (getOwnPropertySymbols) {
+ symbols = getOwnPropertySymbols(from);
+ for (var i = 0; i < symbols.length; i++) {
+ if (propIsEnumerable.call(from, symbols[i])) {
+ to[symbols[i]] = from[symbols[i]];
+ }
+ }
+ }
+ }
+
+ return to;
+};
+
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var _prodInvariant = __webpack_require__(2);
+
+var DOMProperty = __webpack_require__(12);
+var ReactDOMComponentFlags = __webpack_require__(59);
+
+var invariant = __webpack_require__(0);
+
+var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
+var Flags = ReactDOMComponentFlags;
+
+var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
+
+/**
+ * Check if a given node should be cached.
+ */
+function shouldPrecacheNode(node, nodeID) {
+ return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
+}
+
+/**
+ * Drill down (through composites and empty components) until we get a host or
+ * host text component.
+ *
+ * This is pretty polymorphic but unavoidable with the current structure we have
+ * for `_renderedChildren`.
+ */
+function getRenderedHostOrTextFromComponent(component) {
+ var rendered;
+ while (rendered = component._renderedComponent) {
+ component = rendered;
+ }
+ return component;
+}
+
+/**
+ * Populate `_hostNode` on the rendered host/text component with the given
+ * DOM node. The passed `inst` can be a composite.
+ */
+function precacheNode(inst, node) {
+ var hostInst = getRenderedHostOrTextFromComponent(inst);
+ hostInst._hostNode = node;
+ node[internalInstanceKey] = hostInst;
+}
+
+function uncacheNode(inst) {
+ var node = inst._hostNode;
+ if (node) {
+ delete node[internalInstanceKey];
+ inst._hostNode = null;
+ }
+}
+
+/**
+ * Populate `_hostNode` on each child of `inst`, assuming that the children
+ * match up with the DOM (element) children of `node`.
+ *
+ * We cache entire levels at once to avoid an n^2 problem where we access the
+ * children of a node sequentially and have to walk from the start to our target
+ * node every time.
+ *
+ * Since we update `_renderedChildren` and the actual DOM at (slightly)
+ * different times, we could race here and see a newer `_renderedChildren` than
+ * the DOM nodes we see. To avoid this, ReactMultiChild calls
+ * `prepareToManageChildren` before we change `_renderedChildren`, at which
+ * time the container's child nodes are always cached (until it unmounts).
+ */
+function precacheChildNodes(inst, node) {
+ if (inst._flags & Flags.hasCachedChildNodes) {
+ return;
+ }
+ var children = inst._renderedChildren;
+ var childNode = node.firstChild;
+ outer: for (var name in children) {
+ if (!children.hasOwnProperty(name)) {
+ continue;
+ }
+ var childInst = children[name];
+ var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
+ if (childID === 0) {
+ // We're currently unmounting this child in ReactMultiChild; skip it.
+ continue;
+ }
+ // We assume the child nodes are in the same order as the child instances.
+ for (; childNode !== null; childNode = childNode.nextSibling) {
+ if (shouldPrecacheNode(childNode, childID)) {
+ precacheNode(childInst, childNode);
+ continue outer;
+ }
+ }
+ // We reached the end of the DOM children without finding an ID match.
+ true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
+ }
+ inst._flags |= Flags.hasCachedChildNodes;
+}
+
+/**
+ * Given a DOM node, return the closest ReactDOMComponent or
+ * ReactDOMTextComponent instance ancestor.
+ */
+function getClosestInstanceFromNode(node) {
+ if (node[internalInstanceKey]) {
+ return node[internalInstanceKey];
+ }
+
+ // Walk up the tree until we find an ancestor whose instance we have cached.
+ var parents = [];
+ while (!node[internalInstanceKey]) {
+ parents.push(node);
+ if (node.parentNode) {
+ node = node.parentNode;
+ } else {
+ // Top of the tree. This node must not be part of a React tree (or is
+ // unmounted, potentially).
+ return null;
+ }
+ }
+
+ var closest;
+ var inst;
+ for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
+ closest = inst;
+ if (parents.length) {
+ precacheChildNodes(inst, node);
+ }
+ }
+
+ return closest;
+}
+
+/**
+ * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
+ * instance, or null if the node was not rendered by this React.
+ */
+function getInstanceFromNode(node) {
+ var inst = getClosestInstanceFromNode(node);
+ if (inst != null && inst._hostNode === node) {
+ return inst;
+ } else {
+ return null;
+ }
+}
+
+/**
+ * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
+ * DOM node.
+ */
+function getNodeFromInstance(inst) {
+ // Without this first invariant, passing a non-DOM-component triggers the next
+ // invariant for a missing parent, which is super confusing.
+ !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
+
+ if (inst._hostNode) {
+ return inst._hostNode;
+ }
+
+ // Walk up the tree until we find an ancestor whose DOM node we have cached.
+ var parents = [];
+ while (!inst._hostNode) {
+ parents.push(inst);
+ !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
+ inst = inst._hostParent;
+ }
+
+ // Now parents contains each ancestor that does *not* have a cached native
+ // node, and `inst` is the deepest ancestor that does.
+ for (; parents.length; inst = parents.pop()) {
+ precacheChildNodes(inst, inst._hostNode);
+ }
+
+ return inst._hostNode;
+}
+
+var ReactDOMComponentTree = {
+ getClosestInstanceFromNode: getClosestInstanceFromNode,
+ getInstanceFromNode: getInstanceFromNode,
+ getNodeFromInstance: getNodeFromInstance,
+ precacheChildNodes: precacheChildNodes,
+ precacheNode: precacheNode,
+ uncacheNode: uncacheNode
+};
+
+module.exports = ReactDOMComponentTree;
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
+
+/**
+ * Simple, lightweight module assisting with the detection and context of
+ * Worker. Helps avoid circular dependencies and allows code to reason about
+ * whether or not they are in a Worker, even if they never include the main
+ * `ReactWorker` dependency.
+ */
+var ExecutionEnvironment = {
+
+ canUseDOM: canUseDOM,
+
+ canUseWorkers: typeof Worker !== 'undefined',
+
+ canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
+
+ canUseViewport: canUseDOM && !!window.screen,
+
+ isInWorker: !canUseDOM // For now, this is true - might change in the future.
+
+};
+
+module.exports = ExecutionEnvironment;
+
+/***/ }),
+/* 6 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2016-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+
+
+var _prodInvariant = __webpack_require__(16);
+
+var ReactCurrentOwner = __webpack_require__(9);
+
+var invariant = __webpack_require__(0);
+var warning = __webpack_require__(1);
+
+function isNative(fn) {
+ // Based on isNative() from Lodash
+ var funcToString = Function.prototype.toString;
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ var reIsNative = RegExp('^' + funcToString
+ // Take an example native function source for comparison
+ .call(hasOwnProperty
+ // Strip regex characters so we can use it for regex
+ ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'
+ // Remove hasOwnProperty from the template to make it generic
+ ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
+ try {
+ var source = funcToString.call(fn);
+ return reIsNative.test(source);
+ } catch (err) {
+ return false;
+ }
+}
+
+var canUseCollections =
+// Array.from
+typeof Array.from === 'function' &&
+// Map
+typeof Map === 'function' && isNative(Map) &&
+// Map.prototype.keys
+Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
+// Set
+typeof Set === 'function' && isNative(Set) &&
+// Set.prototype.keys
+Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
+
+var setItem;
+var getItem;
+var removeItem;
+var getItemIDs;
+var addRoot;
+var removeRoot;
+var getRootIDs;
+
+if (canUseCollections) {
+ var itemMap = new Map();
+ var rootIDSet = new Set();
+
+ setItem = function (id, item) {
+ itemMap.set(id, item);
+ };
+ getItem = function (id) {
+ return itemMap.get(id);
+ };
+ removeItem = function (id) {
+ itemMap['delete'](id);
+ };
+ getItemIDs = function () {
+ return Array.from(itemMap.keys());
+ };
+
+ addRoot = function (id) {
+ rootIDSet.add(id);
+ };
+ removeRoot = function (id) {
+ rootIDSet['delete'](id);
+ };
+ getRootIDs = function () {
+ return Array.from(rootIDSet.keys());
+ };
+} else {
+ var itemByKey = {};
+ var rootByKey = {};
+
+ // Use non-numeric keys to prevent V8 performance issues:
+ // https://github.com/facebook/react/pull/7232
+ var getKeyFromID = function (id) {
+ return '.' + id;
+ };
+ var getIDFromKey = function (key) {
+ return parseInt(key.substr(1), 10);
+ };
+
+ setItem = function (id, item) {
+ var key = getKeyFromID(id);
+ itemByKey[key] = item;
+ };
+ getItem = function (id) {
+ var key = getKeyFromID(id);
+ return itemByKey[key];
+ };
+ removeItem = function (id) {
+ var key = getKeyFromID(id);
+ delete itemByKey[key];
+ };
+ getItemIDs = function () {
+ return Object.keys(itemByKey).map(getIDFromKey);
+ };
+
+ addRoot = function (id) {
+ var key = getKeyFromID(id);
+ rootByKey[key] = true;
+ };
+ removeRoot = function (id) {
+ var key = getKeyFromID(id);
+ delete rootByKey[key];
+ };
+ getRootIDs = function () {
+ return Object.keys(rootByKey).map(getIDFromKey);
+ };
+}
+
+var unmountedIDs = [];
+
+function purgeDeep(id) {
+ var item = getItem(id);
+ if (item) {
+ var childIDs = item.childIDs;
+
+ removeItem(id);
+ childIDs.forEach(purgeDeep);
+ }
+}
+
+function describeComponentFrame(name, source, ownerName) {
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
+}
+
+function getDisplayName(element) {
+ if (element == null) {
+ return '#empty';
+ } else if (typeof element === 'string' || typeof element === 'number') {
+ return '#text';
+ } else if (typeof element.type === 'string') {
+ return element.type;
+ } else {
+ return element.type.displayName || element.type.name || 'Unknown';
+ }
+}
+
+function describeID(id) {
+ var name = ReactComponentTreeHook.getDisplayName(id);
+ var element = ReactComponentTreeHook.getElement(id);
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
+ var ownerName;
+ if (ownerID) {
+ ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
+ }
+ process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
+ return describeComponentFrame(name, element && element._source, ownerName);
+}
+
+var ReactComponentTreeHook = {
+ onSetChildren: function (id, nextChildIDs) {
+ var item = getItem(id);
+ !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
+ item.childIDs = nextChildIDs;
+
+ for (var i = 0; i < nextChildIDs.length; i++) {
+ var nextChildID = nextChildIDs[i];
+ var nextChild = getItem(nextChildID);
+ !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
+ !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
+ !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
+ if (nextChild.parentID == null) {
+ nextChild.parentID = id;
+ // TODO: This shouldn't be necessary but mounting a new root during in
+ // componentWillMount currently causes not-yet-mounted components to
+ // be purged from our tree data so their parent id is missing.
+ }
+ !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
+ }
+ },
+ onBeforeMountComponent: function (id, element, parentID) {
+ var item = {
+ element: element,
+ parentID: parentID,
+ text: null,
+ childIDs: [],
+ isMounted: false,
+ updateCount: 0
+ };
+ setItem(id, item);
+ },
+ onBeforeUpdateComponent: function (id, element) {
+ var item = getItem(id);
+ if (!item || !item.isMounted) {
+ // We may end up here as a result of setState() in componentWillUnmount().
+ // In this case, ignore the element.
+ return;
+ }
+ item.element = element;
+ },
+ onMountComponent: function (id) {
+ var item = getItem(id);
+ !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
+ item.isMounted = true;
+ var isRoot = item.parentID === 0;
+ if (isRoot) {
+ addRoot(id);
+ }
+ },
+ onUpdateComponent: function (id) {
+ var item = getItem(id);
+ if (!item || !item.isMounted) {
+ // We may end up here as a result of setState() in componentWillUnmount().
+ // In this case, ignore the element.
+ return;
+ }
+ item.updateCount++;
+ },
+ onUnmountComponent: function (id) {
+ var item = getItem(id);
+ if (item) {
+ // We need to check if it exists.
+ // `item` might not exist if it is inside an error boundary, and a sibling
+ // error boundary child threw while mounting. Then this instance never
+ // got a chance to mount, but it still gets an unmounting event during
+ // the error boundary cleanup.
+ item.isMounted = false;
+ var isRoot = item.parentID === 0;
+ if (isRoot) {
+ removeRoot(id);
+ }
+ }
+ unmountedIDs.push(id);
+ },
+ purgeUnmountedComponents: function () {
+ if (ReactComponentTreeHook._preventPurging) {
+ // Should only be used for testing.
+ return;
+ }
+
+ for (var i = 0; i < unmountedIDs.length; i++) {
+ var id = unmountedIDs[i];
+ purgeDeep(id);
+ }
+ unmountedIDs.length = 0;
+ },
+ isMounted: function (id) {
+ var item = getItem(id);
+ return item ? item.isMounted : false;
+ },
+ getCurrentStackAddendum: function (topElement) {
+ var info = '';
+ if (topElement) {
+ var name = getDisplayName(topElement);
+ var owner = topElement._owner;
+ info += describeComponentFrame(name, topElement._source, owner && owner.getName());
+ }
+
+ var currentOwner = ReactCurrentOwner.current;
+ var id = currentOwner && currentOwner._debugID;
+
+ info += ReactComponentTreeHook.getStackAddendumByID(id);
+ return info;
+ },
+ getStackAddendumByID: function (id) {
+ var info = '';
+ while (id) {
+ info += describeID(id);
+ id = ReactComponentTreeHook.getParentID(id);
+ }
+ return info;
+ },
+ getChildIDs: function (id) {
+ var item = getItem(id);
+ return item ? item.childIDs : [];
+ },
+ getDisplayName: function (id) {
+ var element = ReactComponentTreeHook.getElement(id);
+ if (!element) {
+ return null;
+ }
+ return getDisplayName(element);
+ },
+ getElement: function (id) {
+ var item = getItem(id);
+ return item ? item.element : null;
+ },
+ getOwnerID: function (id) {
+ var element = ReactComponentTreeHook.getElement(id);
+ if (!element || !element._owner) {
+ return null;
+ }
+ return element._owner._debugID;
+ },
+ getParentID: function (id) {
+ var item = getItem(id);
+ return item ? item.parentID : null;
+ },
+ getSource: function (id) {
+ var item = getItem(id);
+ var element = item ? item.element : null;
+ var source = element != null ? element._source : null;
+ return source;
+ },
+ getText: function (id) {
+ var element = ReactComponentTreeHook.getElement(id);
+ if (typeof element === 'string') {
+ return element;
+ } else if (typeof element === 'number') {
+ return '' + element;
+ } else {
+ return null;
+ }
+ },
+ getUpdateCount: function (id) {
+ var item = getItem(id);
+ return item ? item.updateCount : 0;
+ },
+
+
+ getRootIDs: getRootIDs,
+ getRegisteredIDs: getItemIDs,
+
+ pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
+ if (typeof console.reactStack !== 'function') {
+ return;
+ }
+
+ var stack = [];
+ var currentOwner = ReactCurrentOwner.current;
+ var id = currentOwner && currentOwner._debugID;
+
+ try {
+ if (isCreatingElement) {
+ stack.push({
+ name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
+ fileName: currentSource ? currentSource.fileName : null,
+ lineNumber: currentSource ? currentSource.lineNumber : null
+ });
+ }
+
+ while (id) {
+ var element = ReactComponentTreeHook.getElement(id);
+ var parentID = ReactComponentTreeHook.getParentID(id);
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
+ var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
+ var source = element && element._source;
+ stack.push({
+ name: ownerName,
+ fileName: source ? source.fileName : null,
+ lineNumber: source ? source.lineNumber : null
+ });
+ id = parentID;
+ }
+ } catch (err) {
+ // Internal state is messed up.
+ // Stop building the stack (it's just a nice to have).
+ }
+
+ console.reactStack(stack);
+ },
+ popNonStandardWarningStack: function () {
+ if (typeof console.reactStackEnd !== 'function') {
+ return;
+ }
+ console.reactStackEnd();
+ }
+};
+
+module.exports = ReactComponentTreeHook;
+
+/***/ }),
+/* 7 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+function makeEmptyFunction(arg) {
+ return function () {
+ return arg;
+ };
+}
+
+/**
+ * This function accepts and discards inputs; it has no side effects. This is
+ * primarily useful idiomatically for overridable function endpoints which
+ * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
+ */
+var emptyFunction = function emptyFunction() {};
+
+emptyFunction.thatReturns = makeEmptyFunction;
+emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
+emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
+emptyFunction.thatReturnsNull = makeEmptyFunction(null);
+emptyFunction.thatReturnsThis = function () {
+ return this;
+};
+emptyFunction.thatReturnsArgument = function (arg) {
+ return arg;
+};
+
+module.exports = emptyFunction;
+
+/***/ }),
+/* 8 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2016-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+
+
+// Trust the developer to only use ReactInstrumentation with a __DEV__ check
+
+var debugTool = null;
+
+if (process.env.NODE_ENV !== 'production') {
+ var ReactDebugTool = __webpack_require__(118);
+ debugTool = ReactDebugTool;
+}
+
+module.exports = { debugTool: debugTool };
+
+/***/ }),
+/* 9 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+
+
+/**
+ * Keeps track of the current owner.
+ *
+ * The current owner is the component who should own any components that are
+ * currently being constructed.
+ */
+var ReactCurrentOwner = {
+ /**
+ * @internal
+ * @type {ReactComponent}
+ */
+ current: null
+};
+
+module.exports = ReactCurrentOwner;
+
+/***/ }),
+/* 10 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var _prodInvariant = __webpack_require__(2),
+ _assign = __webpack_require__(3);
+
+var CallbackQueue = __webpack_require__(63);
+var PooledClass = __webpack_require__(14);
+var ReactFeatureFlags = __webpack_require__(64);
+var ReactReconciler = __webpack_require__(17);
+var Transaction = __webpack_require__(27);
+
+var invariant = __webpack_require__(0);
+
+var dirtyComponents = [];
+var updateBatchNumber = 0;
+var asapCallbackQueue = CallbackQueue.getPooled();
+var asapEnqueued = false;
+
+var batchingStrategy = null;
+
+function ensureInjected() {
+ !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
+}
+
+var NESTED_UPDATES = {
+ initialize: function () {
+ this.dirtyComponentsLength = dirtyComponents.length;
+ },
+ close: function () {
+ if (this.dirtyComponentsLength !== dirtyComponents.length) {
+ // Additional updates were enqueued by componentDidUpdate handlers or
+ // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
+ // these new updates so that if A's componentDidUpdate calls setState on
+ // B, B will update before the callback A's updater provided when calling
+ // setState.
+ dirtyComponents.splice(0, this.dirtyComponentsLength);
+ flushBatchedUpdates();
+ } else {
+ dirtyComponents.length = 0;
+ }
+ }
+};
+
+var UPDATE_QUEUEING = {
+ initialize: function () {
+ this.callbackQueue.reset();
+ },
+ close: function () {
+ this.callbackQueue.notifyAll();
+ }
+};
+
+var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
+
+function ReactUpdatesFlushTransaction() {
+ this.reinitializeTransaction();
+ this.dirtyComponentsLength = null;
+ this.callbackQueue = CallbackQueue.getPooled();
+ this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
+ /* useCreateElement */true);
+}
+
+_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
+ getTransactionWrappers: function () {
+ return TRANSACTION_WRAPPERS;
+ },
+
+ destructor: function () {
+ this.dirtyComponentsLength = null;
+ CallbackQueue.release(this.callbackQueue);
+ this.callbackQueue = null;
+ ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
+ this.reconcileTransaction = null;
+ },
+
+ perform: function (method, scope, a) {
+ // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
+ // with this transaction's wrappers around it.
+ return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
+ }
+});
+
+PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
+
+function batchedUpdates(callback, a, b, c, d, e) {
+ ensureInjected();
+ return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
+}
+
+/**
+ * Array comparator for ReactComponents by mount ordering.
+ *
+ * @param {ReactComponent} c1 first component you're comparing
+ * @param {ReactComponent} c2 second component you're comparing
+ * @return {number} Return value usable by Array.prototype.sort().
+ */
+function mountOrderComparator(c1, c2) {
+ return c1._mountOrder - c2._mountOrder;
+}
+
+function runBatchedUpdates(transaction) {
+ var len = transaction.dirtyComponentsLength;
+ !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
+
+ // Since reconciling a component higher in the owner hierarchy usually (not
+ // always -- see shouldComponentUpdate()) will reconcile children, reconcile
+ // them before their children by sorting the array.
+ dirtyComponents.sort(mountOrderComparator);
+
+ // Any updates enqueued while reconciling must be performed after this entire
+ // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
+ // C, B could update twice in a single batch if C's render enqueues an update
+ // to B (since B would have already updated, we should skip it, and the only
+ // way we can know to do so is by checking the batch counter).
+ updateBatchNumber++;
+
+ for (var i = 0; i < len; i++) {
+ // If a component is unmounted before pending changes apply, it will still
+ // be here, but we assume that it has cleared its _pendingCallbacks and
+ // that performUpdateIfNecessary is a noop.
+ var component = dirtyComponents[i];
+
+ // If performUpdateIfNecessary happens to enqueue any new updates, we
+ // shouldn't execute the callbacks until the next render happens, so
+ // stash the callbacks first
+ var callbacks = component._pendingCallbacks;
+ component._pendingCallbacks = null;
+
+ var markerName;
+ if (ReactFeatureFlags.logTopLevelRenders) {
+ var namedComponent = component;
+ // Duck type TopLevelWrapper. This is probably always true.
+ if (component._currentElement.type.isReactTopLevelWrapper) {
+ namedComponent = component._renderedComponent;
+ }
+ markerName = 'React update: ' + namedComponent.getName();
+ console.time(markerName);
+ }
+
+ ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
+
+ if (markerName) {
+ console.timeEnd(markerName);
+ }
+
+ if (callbacks) {
+ for (var j = 0; j < callbacks.length; j++) {
+ transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
+ }
+ }
+ }
+}
+
+var flushBatchedUpdates = function () {
+ // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
+ // array and perform any updates enqueued by mount-ready handlers (i.e.,
+ // componentDidUpdate) but we need to check here too in order to catch
+ // updates enqueued by setState callbacks and asap calls.
+ while (dirtyComponents.length || asapEnqueued) {
+ if (dirtyComponents.length) {
+ var transaction = ReactUpdatesFlushTransaction.getPooled();
+ transaction.perform(runBatchedUpdates, null, transaction);
+ ReactUpdatesFlushTransaction.release(transaction);
+ }
+
+ if (asapEnqueued) {
+ asapEnqueued = false;
+ var queue = asapCallbackQueue;
+ asapCallbackQueue = CallbackQueue.getPooled();
+ queue.notifyAll();
+ CallbackQueue.release(queue);
+ }
+ }
+};
+
+/**
+ * Mark a component as needing a rerender, adding an optional callback to a
+ * list of functions which will be executed once the rerender occurs.
+ */
+function enqueueUpdate(component) {
+ ensureInjected();
+
+ // Various parts of our code (such as ReactCompositeComponent's
+ // _renderValidatedComponent) assume that calls to render aren't nested;
+ // verify that that's the case. (This is called by each top-level update
+ // function, like setState, forceUpdate, etc.; creation and
+ // destruction of top-level components is guarded in ReactMount.)
+
+ if (!batchingStrategy.isBatchingUpdates) {
+ batchingStrategy.batchedUpdates(enqueueUpdate, component);
+ return;
+ }
+
+ dirtyComponents.push(component);
+ if (component._updateBatchNumber == null) {
+ component._updateBatchNumber = updateBatchNumber + 1;
+ }
+}
+
+/**
+ * Enqueue a callback to be run at the end of the current batching cycle. Throws
+ * if no updates are currently being performed.
+ */
+function asap(callback, context) {
+ invariant(batchingStrategy.isBatchingUpdates, "ReactUpdates.asap: Can't enqueue an asap callback in a context where" + 'updates are not being batched.');
+ asapCallbackQueue.enqueue(callback, context);
+ asapEnqueued = true;
+}
+
+var ReactUpdatesInjection = {
+ injectReconcileTransaction: function (ReconcileTransaction) {
+ !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
+ ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
+ },
+
+ injectBatchingStrategy: function (_batchingStrategy) {
+ !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
+ !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
+ !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
+ batchingStrategy = _batchingStrategy;
+ }
+};
+
+var ReactUpdates = {
+ /**
+ * React references `ReactReconcileTransaction` using this property in order
+ * to allow dependency injection.
+ *
+ * @internal
+ */
+ ReactReconcileTransaction: null,
+
+ batchedUpdates: batchedUpdates,
+ enqueueUpdate: enqueueUpdate,
+ flushBatchedUpdates: flushBatchedUpdates,
+ injection: ReactUpdatesInjection,
+ asap: asap
+};
+
+module.exports = ReactUpdates;
+
+/***/ }),
+/* 11 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var _assign = __webpack_require__(3);
+
+var PooledClass = __webpack_require__(14);
+
+var emptyFunction = __webpack_require__(7);
+var warning = __webpack_require__(1);
+
+var didWarnForAddedNewProperty = false;
+var isProxySupported = typeof Proxy === 'function';
+
+var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
+
+/**
+ * @interface Event
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/
+ */
+var EventInterface = {
+ type: null,
+ target: null,
+ // currentTarget is set when dispatching; no use in copying it here
+ currentTarget: emptyFunction.thatReturnsNull,
+ eventPhase: null,
+ bubbles: null,
+ cancelable: null,
+ timeStamp: function (event) {
+ return event.timeStamp || Date.now();
+ },
+ defaultPrevented: null,
+ isTrusted: null
+};
+
+/**
+ * Synthetic events are dispatched by event plugins, typically in response to a
+ * top-level event delegation handler.
+ *
+ * These systems should generally use pooling to reduce the frequency of garbage
+ * collection. The system should check `isPersistent` to determine whether the
+ * event should be released into the pool after being dispatched. Users that
+ * need a persisted event should invoke `persist`.
+ *
+ * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
+ * normalizing browser quirks. Subclasses do not necessarily have to implement a
+ * DOM interface; custom application-specific events can also subclass this.
+ *
+ * @param {object} dispatchConfig Configuration used to dispatch this event.
+ * @param {*} targetInst Marker identifying the event target.
+ * @param {object} nativeEvent Native browser event.
+ * @param {DOMEventTarget} nativeEventTarget Target node.
+ */
+function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
+ if (process.env.NODE_ENV !== 'production') {
+ // these have a getter/setter for warnings
+ delete this.nativeEvent;
+ delete this.preventDefault;
+ delete this.stopPropagation;
+ }
+
+ this.dispatchConfig = dispatchConfig;
+ this._targetInst = targetInst;
+ this.nativeEvent = nativeEvent;
+
+ var Interface = this.constructor.Interface;
+ for (var propName in Interface) {
+ if (!Interface.hasOwnProperty(propName)) {
+ continue;
+ }
+ if (process.env.NODE_ENV !== 'production') {
+ delete this[propName]; // this has a getter/setter for warnings
+ }
+ var normalize = Interface[propName];
+ if (normalize) {
+ this[propName] = normalize(nativeEvent);
+ } else {
+ if (propName === 'target') {
+ this.target = nativeEventTarget;
+ } else {
+ this[propName] = nativeEvent[propName];
+ }
+ }
+ }
+
+ var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
+ if (defaultPrevented) {
+ this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
+ } else {
+ this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
+ }
+ this.isPropagationStopped = emptyFunction.thatReturnsFalse;
+ return this;
+}
+
+_assign(SyntheticEvent.prototype, {
+ preventDefault: function () {
+ this.defaultPrevented = true;
+ var event = this.nativeEvent;
+ if (!event) {
+ return;
+ }
+
+ if (event.preventDefault) {
+ event.preventDefault();
+ // eslint-disable-next-line valid-typeof
+ } else if (typeof event.returnValue !== 'unknown') {
+ event.returnValue = false;
+ }
+ this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
+ },
+
+ stopPropagation: function () {
+ var event = this.nativeEvent;
+ if (!event) {
+ return;
+ }
+
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ // eslint-disable-next-line valid-typeof
+ } else if (typeof event.cancelBubble !== 'unknown') {
+ // The ChangeEventPlugin registers a "propertychange" event for
+ // IE. This event does not support bubbling or cancelling, and
+ // any references to cancelBubble throw "Member not found". A
+ // typeof check of "unknown" circumvents this issue (and is also
+ // IE specific).
+ event.cancelBubble = true;
+ }
+
+ this.isPropagationStopped = emptyFunction.thatReturnsTrue;
+ },
+
+ /**
+ * We release all dispatched `SyntheticEvent`s after each event loop, adding
+ * them back into the pool. This allows a way to hold onto a reference that
+ * won't be added back into the pool.
+ */
+ persist: function () {
+ this.isPersistent = emptyFunction.thatReturnsTrue;
+ },
+
+ /**
+ * Checks if this event should be released back into the pool.
+ *
+ * @return {boolean} True if this should not be released, false otherwise.
+ */
+ isPersistent: emptyFunction.thatReturnsFalse,
+
+ /**
+ * `PooledClass` looks for `destructor` on each instance it releases.
+ */
+ destructor: function () {
+ var Interface = this.constructor.Interface;
+ for (var propName in Interface) {
+ if (process.env.NODE_ENV !== 'production') {
+ Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
+ } else {
+ this[propName] = null;
+ }
+ }
+ for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
+ this[shouldBeReleasedProperties[i]] = null;
+ }
+ if (process.env.NODE_ENV !== 'production') {
+ Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
+ Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
+ Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
+ }
+ }
+});
+
+SyntheticEvent.Interface = EventInterface;
+
+/**
+ * Helper to reduce boilerplate when creating subclasses.
+ *
+ * @param {function} Class
+ * @param {?object} Interface
+ */
+SyntheticEvent.augmentClass = function (Class, Interface) {
+ var Super = this;
+
+ var E = function () {};
+ E.prototype = Super.prototype;
+ var prototype = new E();
+
+ _assign(prototype, Class.prototype);
+ Class.prototype = prototype;
+ Class.prototype.constructor = Class;
+
+ Class.Interface = _assign({}, Super.Interface, Interface);
+ Class.augmentClass = Super.augmentClass;
+
+ PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
+};
+
+/** Proxying after everything set on SyntheticEvent
+ * to resolve Proxy issue on some WebKit browsers
+ * in which some Event properties are set to undefined (GH#10010)
+ */
+if (process.env.NODE_ENV !== 'production') {
+ if (isProxySupported) {
+ /*eslint-disable no-func-assign */
+ SyntheticEvent = new Proxy(SyntheticEvent, {
+ construct: function (target, args) {
+ return this.apply(target, Object.create(target.prototype), args);
+ },
+ apply: function (constructor, that, args) {
+ return new Proxy(constructor.apply(that, args), {
+ set: function (target, prop, value) {
+ if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
+ process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
+ didWarnForAddedNewProperty = true;
+ }
+ target[prop] = value;
+ return true;
+ }
+ });
+ }
+ });
+ /*eslint-enable no-func-assign */
+ }
+}
+
+PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
+
+module.exports = SyntheticEvent;
+
+/**
+ * Helper to nullify syntheticEvent instance properties when destructing
+ *
+ * @param {object} SyntheticEvent
+ * @param {String} propName
+ * @return {object} defineProperty object
+ */
+function getPooledWarningPropertyDefinition(propName, getVal) {
+ var isFunction = typeof getVal === 'function';
+ return {
+ configurable: true,
+ set: set,
+ get: get
+ };
+
+ function set(val) {
+ var action = isFunction ? 'setting the method' : 'setting the property';
+ warn(action, 'This is effectively a no-op');
+ return val;
+ }
+
+ function get() {
+ var action = isFunction ? 'accessing the method' : 'accessing the property';
+ var result = isFunction ? 'This is a no-op function' : 'This is set to null';
+ warn(action, result);
+ return getVal;
+ }
+
+ function warn(action, result) {
+ var warningCondition = false;
+ process.env.NODE_ENV !== 'production' ? warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
+ }
+}
+
+/***/ }),
+/* 12 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var _prodInvariant = __webpack_require__(2);
+
+var invariant = __webpack_require__(0);
+
+function checkMask(value, bitmask) {
+ return (value & bitmask) === bitmask;
+}
+
+var DOMPropertyInjection = {
+ /**
+ * Mapping from normalized, camelcased property names to a configuration that
+ * specifies how the associated DOM property should be accessed or rendered.
+ */
+ MUST_USE_PROPERTY: 0x1,
+ HAS_BOOLEAN_VALUE: 0x4,
+ HAS_NUMERIC_VALUE: 0x8,
+ HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
+ HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
+
+ /**
+ * Inject some specialized knowledge about the DOM. This takes a config object
+ * with the following properties:
+ *
+ * isCustomAttribute: function that given an attribute name will return true
+ * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
+ * attributes where it's impossible to enumerate all of the possible
+ * attribute names,
+ *
+ * Properties: object mapping DOM property name to one of the
+ * DOMPropertyInjection constants or null. If your attribute isn't in here,
+ * it won't get written to the DOM.
+ *
+ * DOMAttributeNames: object mapping React attribute name to the DOM
+ * attribute name. Attribute names not specified use the **lowercase**
+ * normalized name.
+ *
+ * DOMAttributeNamespaces: object mapping React attribute name to the DOM
+ * attribute namespace URL. (Attribute names not specified use no namespace.)
+ *
+ * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
+ * Property names not specified use the normalized name.
+ *
+ * DOMMutationMethods: Properties that require special mutation methods. If
+ * `value` is undefined, the mutation method should unset the property.
+ *
+ * @param {object} domPropertyConfig the config as described above.
+ */
+ injectDOMPropertyConfig: function (domPropertyConfig) {
+ var Injection = DOMPropertyInjection;
+ var Properties = domPropertyConfig.Properties || {};
+ var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
+ var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
+ var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
+ var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
+
+ if (domPropertyConfig.isCustomAttribute) {
+ DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
+ }
+
+ for (var propName in Properties) {
+ !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
+
+ var lowerCased = propName.toLowerCase();
+ var propConfig = Properties[propName];
+
+ var propertyInfo = {
+ attributeName: lowerCased,
+ attributeNamespace: null,
+ propertyName: propName,
+ mutationMethod: null,
+
+ mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
+ hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
+ hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
+ hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
+ hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
+ };
+ !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
+
+ if (process.env.NODE_ENV !== 'production') {
+ DOMProperty.getPossibleStandardName[lowerCased] = propName;
+ }
+
+ if (DOMAttributeNames.hasOwnProperty(propName)) {
+ var attributeName = DOMAttributeNames[propName];
+ propertyInfo.attributeName = attributeName;
+ if (process.env.NODE_ENV !== 'production') {
+ DOMProperty.getPossibleStandardName[attributeName] = propName;
+ }
+ }
+
+ if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
+ propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
+ }
+
+ if (DOMPropertyNames.hasOwnProperty(propName)) {
+ propertyInfo.propertyName = DOMPropertyNames[propName];
+ }
+
+ if (DOMMutationMethods.hasOwnProperty(propName)) {
+ propertyInfo.mutationMethod = DOMMutationMethods[propName];
+ }
+
+ DOMProperty.properties[propName] = propertyInfo;
+ }
+ }
+};
+
+/* eslint-disable max-len */
+var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
+/* eslint-enable max-len */
+
+/**
+ * DOMProperty exports lookup objects that can be used like functions:
+ *
+ * > DOMProperty.isValid['id']
+ * true
+ * > DOMProperty.isValid['foobar']
+ * undefined
+ *
+ * Although this may be confusing, it performs better in general.
+ *
+ * @see http://jsperf.com/key-exists
+ * @see http://jsperf.com/key-missing
+ */
+var DOMProperty = {
+ ID_ATTRIBUTE_NAME: 'data-reactid',
+ ROOT_ATTRIBUTE_NAME: 'data-reactroot',
+
+ ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
+ ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
+
+ /**
+ * Map from property "standard name" to an object with info about how to set
+ * the property in the DOM. Each object contains:
+ *
+ * attributeName:
+ * Used when rendering markup or with `*Attribute()`.
+ * attributeNamespace
+ * propertyName:
+ * Used on DOM node instances. (This includes properties that mutate due to
+ * external factors.)
+ * mutationMethod:
+ * If non-null, used instead of the property or `setAttribute()` after
+ * initial render.
+ * mustUseProperty:
+ * Whether the property must be accessed and mutated as an object property.
+ * hasBooleanValue:
+ * Whether the property should be removed when set to a falsey value.
+ * hasNumericValue:
+ * Whether the property must be numeric or parse as a numeric and should be
+ * removed when set to a falsey value.
+ * hasPositiveNumericValue:
+ * Whether the property must be positive numeric or parse as a positive
+ * numeric and should be removed when set to a falsey value.
+ * hasOverloadedBooleanValue:
+ * Whether the property can be used as a flag as well as with a value.
+ * Removed when strictly equal to false; present without a value when
+ * strictly equal to true; present with a value otherwise.
+ */
+ properties: {},
+
+ /**
+ * Mapping from lowercase property names to the properly cased version, used
+ * to warn in the case of missing properties. Available only in __DEV__.
+ *
+ * autofocus is predefined, because adding it to the property whitelist
+ * causes unintended side effects.
+ *
+ * @type {Object}
+ */
+ getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null,
+
+ /**
+ * All of the isCustomAttribute() functions that have been injected.
+ */
+ _isCustomAttributeFunctions: [],
+
+ /**
+ * Checks whether a property name is a custom attribute.
+ * @method
+ */
+ isCustomAttribute: function (attributeName) {
+ for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
+ var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
+ if (isCustomAttributeFn(attributeName)) {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ injection: DOMPropertyInjection
+};
+
+module.exports = DOMProperty;
+
+/***/ }),
+/* 13 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2014-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var _assign = __webpack_require__(3);
+
+var ReactCurrentOwner = __webpack_require__(9);
+
+var warning = __webpack_require__(1);
+var canDefineProperty = __webpack_require__(24);
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var REACT_ELEMENT_TYPE = __webpack_require__(54);
+
+var RESERVED_PROPS = {
+ key: true,
+ ref: true,
+ __self: true,
+ __source: true
+};
+
+var specialPropKeyWarningShown, specialPropRefWarningShown;
+
+function hasValidRef(config) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (hasOwnProperty.call(config, 'ref')) {
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
+ if (getter && getter.isReactWarning) {
+ return false;
+ }
+ }
+ }
+ return config.ref !== undefined;
+}
+
+function hasValidKey(config) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (hasOwnProperty.call(config, 'key')) {
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
+ if (getter && getter.isReactWarning) {
+ return false;
+ }
+ }
+ }
+ return config.key !== undefined;
+}
+
+function defineKeyPropWarningGetter(props, displayName) {
+ var warnAboutAccessingKey = function () {
+ if (!specialPropKeyWarningShown) {
+ specialPropKeyWarningShown = true;
+ process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
+ }
+ };
+ warnAboutAccessingKey.isReactWarning = true;
+ Object.defineProperty(props, 'key', {
+ get: warnAboutAccessingKey,
+ configurable: true
+ });
+}
+
+function defineRefPropWarningGetter(props, displayName) {
+ var warnAboutAccessingRef = function () {
+ if (!specialPropRefWarningShown) {
+ specialPropRefWarningShown = true;
+ process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
+ }
+ };
+ warnAboutAccessingRef.isReactWarning = true;
+ Object.defineProperty(props, 'ref', {
+ get: warnAboutAccessingRef,
+ configurable: true
+ });
+}
+
+/**
+ * Factory method to create a new React element. This no longer adheres to
+ * the class pattern, so do not use new to call it. Also, no instanceof check
+ * will work. Instead test $$typeof field against Symbol.for('react.element') to check
+ * if something is a React Element.
+ *
+ * @param {*} type
+ * @param {*} key
+ * @param {string|object} ref
+ * @param {*} self A *temporary* helper to detect places where `this` is
+ * different from the `owner` when React.createElement is called, so that we
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
+ * functions, and as long as `this` and owner are the same, there will be no
+ * change in behavior.
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
+ * indicating filename, line number, and/or other information.
+ * @param {*} owner
+ * @param {*} props
+ * @internal
+ */
+var ReactElement = function (type, key, ref, self, source, owner, props) {
+ var element = {
+ // This tag allow us to uniquely identify this as a React Element
+ $$typeof: REACT_ELEMENT_TYPE,
+
+ // Built-in properties that belong on the element
+ type: type,
+ key: key,
+ ref: ref,
+ props: props,
+
+ // Record the component responsible for creating this element.
+ _owner: owner
+ };
+
+ if (process.env.NODE_ENV !== 'production') {
+ // The validation flag is currently mutative. We put it on
+ // an external backing store so that we can freeze the whole object.
+ // This can be replaced with a WeakMap once they are implemented in
+ // commonly used development environments.
+ element._store = {};
+
+ // To make comparing ReactElements easier for testing purposes, we make
+ // the validation flag non-enumerable (where possible, which should
+ // include every environment we run tests in), so the test framework
+ // ignores it.
+ if (canDefineProperty) {
+ Object.defineProperty(element._store, 'validated', {
+ configurable: false,
+ enumerable: false,
+ writable: true,
+ value: false
+ });
+ // self and source are DEV only properties.
+ Object.defineProperty(element, '_self', {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: self
+ });
+ // Two elements created in two different places should be considered
+ // equal for testing purposes and therefore we hide it from enumeration.
+ Object.defineProperty(element, '_source', {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: source
+ });
+ } else {
+ element._store.validated = false;
+ element._self = self;
+ element._source = source;
+ }
+ if (Object.freeze) {
+ Object.freeze(element.props);
+ Object.freeze(element);
+ }
+ }
+
+ return element;
+};
+
+/**
+ * Create and return a new ReactElement of the given type.
+ * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
+ */
+ReactElement.createElement = function (type, config, children) {
+ var propName;
+
+ // Reserved names are extracted
+ var props = {};
+
+ var key = null;
+ var ref = null;
+ var self = null;
+ var source = null;
+
+ if (config != null) {
+ if (hasValidRef(config)) {
+ ref = config.ref;
+ }
+ if (hasValidKey(config)) {
+ key = '' + config.key;
+ }
+
+ self = config.__self === undefined ? null : config.__self;
+ source = config.__source === undefined ? null : config.__source;
+ // Remaining properties are added to a new props object
+ for (propName in config) {
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
+ props[propName] = config[propName];
+ }
+ }
+ }
+
+ // Children can be more than one argument, and those are transferred onto
+ // the newly allocated props object.
+ var childrenLength = arguments.length - 2;
+ if (childrenLength === 1) {
+ props.children = children;
+ } else if (childrenLength > 1) {
+ var childArray = Array(childrenLength);
+ for (var i = 0; i < childrenLength; i++) {
+ childArray[i] = arguments[i + 2];
+ }
+ if (process.env.NODE_ENV !== 'production') {
+ if (Object.freeze) {
+ Object.freeze(childArray);
+ }
+ }
+ props.children = childArray;
+ }
+
+ // Resolve default props
+ if (type && type.defaultProps) {
+ var defaultProps = type.defaultProps;
+ for (propName in defaultProps) {
+ if (props[propName] === undefined) {
+ props[propName] = defaultProps[propName];
+ }
+ }
+ }
+ if (process.env.NODE_ENV !== 'production') {
+ if (key || ref) {
+ if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
+ if (key) {
+ defineKeyPropWarningGetter(props, displayName);
+ }
+ if (ref) {
+ defineRefPropWarningGetter(props, displayName);
+ }
+ }
+ }
+ }
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
+};
+
+/**
+ * Return a function that produces ReactElements of a given type.
+ * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
+ */
+ReactElement.createFactory = function (type) {
+ var factory = ReactElement.createElement.bind(null, type);
+ // Expose the type on the factory and the prototype so that it can be
+ // easily accessed on elements. E.g. `.type === Foo`.
+ // This should not be named `constructor` since this may not be the function
+ // that created the element, and it may not even be a constructor.
+ // Legacy hook TODO: Warn if this is accessed
+ factory.type = type;
+ return factory;
+};
+
+ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
+
+ return newElement;
+};
+
+/**
+ * Clone and return a new ReactElement using element as the starting point.
+ * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
+ */
+ReactElement.cloneElement = function (element, config, children) {
+ var propName;
+
+ // Original props are copied
+ var props = _assign({}, element.props);
+
+ // Reserved names are extracted
+ var key = element.key;
+ var ref = element.ref;
+ // Self is preserved since the owner is preserved.
+ var self = element._self;
+ // Source is preserved since cloneElement is unlikely to be targeted by a
+ // transpiler, and the original source is probably a better indicator of the
+ // true owner.
+ var source = element._source;
+
+ // Owner will be preserved, unless ref is overridden
+ var owner = element._owner;
+
+ if (config != null) {
+ if (hasValidRef(config)) {
+ // Silently steal the ref from the parent.
+ ref = config.ref;
+ owner = ReactCurrentOwner.current;
+ }
+ if (hasValidKey(config)) {
+ key = '' + config.key;
+ }
+
+ // Remaining properties override existing props
+ var defaultProps;
+ if (element.type && element.type.defaultProps) {
+ defaultProps = element.type.defaultProps;
+ }
+ for (propName in config) {
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
+ if (config[propName] === undefined && defaultProps !== undefined) {
+ // Resolve default props
+ props[propName] = defaultProps[propName];
+ } else {
+ props[propName] = config[propName];
+ }
+ }
+ }
+ }
+
+ // Children can be more than one argument, and those are transferred onto
+ // the newly allocated props object.
+ var childrenLength = arguments.length - 2;
+ if (childrenLength === 1) {
+ props.children = children;
+ } else if (childrenLength > 1) {
+ var childArray = Array(childrenLength);
+ for (var i = 0; i < childrenLength; i++) {
+ childArray[i] = arguments[i + 2];
+ }
+ props.children = childArray;
+ }
+
+ return ReactElement(element.type, key, ref, self, source, owner, props);
+};
+
+/**
+ * Verifies the object is a ReactElement.
+ * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
+ * @param {?object} object
+ * @return {boolean} True if `object` is a valid component.
+ * @final
+ */
+ReactElement.isValidElement = function (object) {
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
+};
+
+module.exports = ReactElement;
+
+/***/ }),
+/* 14 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+
+
+var _prodInvariant = __webpack_require__(2);
+
+var invariant = __webpack_require__(0);
+
+/**
+ * Static poolers. Several custom versions for each potential number of
+ * arguments. A completely generic pooler is easy to implement, but would
+ * require accessing the `arguments` object. In each of these, `this` refers to
+ * the Class itself, not an instance. If any others are needed, simply add them
+ * here, or in their own files.
+ */
+var oneArgumentPooler = function (copyFieldsFrom) {
+ var Klass = this;
+ if (Klass.instancePool.length) {
+ var instance = Klass.instancePool.pop();
+ Klass.call(instance, copyFieldsFrom);
+ return instance;
+ } else {
+ return new Klass(copyFieldsFrom);
+ }
+};
+
+var twoArgumentPooler = function (a1, a2) {
+ var Klass = this;
+ if (Klass.instancePool.length) {
+ var instance = Klass.instancePool.pop();
+ Klass.call(instance, a1, a2);
+ return instance;
+ } else {
+ return new Klass(a1, a2);
+ }
+};
+
+var threeArgumentPooler = function (a1, a2, a3) {
+ var Klass = this;
+ if (Klass.instancePool.length) {
+ var instance = Klass.instancePool.pop();
+ Klass.call(instance, a1, a2, a3);
+ return instance;
+ } else {
+ return new Klass(a1, a2, a3);
+ }
+};
+
+var fourArgumentPooler = function (a1, a2, a3, a4) {
+ var Klass = this;
+ if (Klass.instancePool.length) {
+ var instance = Klass.instancePool.pop();
+ Klass.call(instance, a1, a2, a3, a4);
+ return instance;
+ } else {
+ return new Klass(a1, a2, a3, a4);
+ }
+};
+
+var standardReleaser = function (instance) {
+ var Klass = this;
+ !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
+ instance.destructor();
+ if (Klass.instancePool.length < Klass.poolSize) {
+ Klass.instancePool.push(instance);
+ }
+};
+
+var DEFAULT_POOL_SIZE = 10;
+var DEFAULT_POOLER = oneArgumentPooler;
+
+/**
+ * Augments `CopyConstructor` to be a poolable class, augmenting only the class
+ * itself (statically) not adding any prototypical fields. Any CopyConstructor
+ * you give this may have a `poolSize` property, and will look for a
+ * prototypical `destructor` on instances.
+ *
+ * @param {Function} CopyConstructor Constructor that can be used to reset.
+ * @param {Function} pooler Customizable pooler.
+ */
+var addPoolingTo = function (CopyConstructor, pooler) {
+ // Casting as any so that flow ignores the actual implementation and trusts
+ // it to match the type we declared
+ var NewKlass = CopyConstructor;
+ NewKlass.instancePool = [];
+ NewKlass.getPooled = pooler || DEFAULT_POOLER;
+ if (!NewKlass.poolSize) {
+ NewKlass.poolSize = DEFAULT_POOL_SIZE;
+ }
+ NewKlass.release = standardReleaser;
+ return NewKlass;
+};
+
+var PooledClass = {
+ addPoolingTo: addPoolingTo,
+ oneArgumentPooler: oneArgumentPooler,
+ twoArgumentPooler: twoArgumentPooler,
+ threeArgumentPooler: threeArgumentPooler,
+ fourArgumentPooler: fourArgumentPooler
+};
+
+module.exports = PooledClass;
+
+/***/ }),
+/* 15 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var _assign = __webpack_require__(3);
+
+var ReactBaseClasses = __webpack_require__(52);
+var ReactChildren = __webpack_require__(94);
+var ReactDOMFactories = __webpack_require__(98);
+var ReactElement = __webpack_require__(13);
+var ReactPropTypes = __webpack_require__(102);
+var ReactVersion = __webpack_require__(104);
+
+var createReactClass = __webpack_require__(105);
+var onlyChild = __webpack_require__(107);
+
+var createElement = ReactElement.createElement;
+var createFactory = ReactElement.createFactory;
+var cloneElement = ReactElement.cloneElement;
+
+if (process.env.NODE_ENV !== 'production') {
+ var lowPriorityWarning = __webpack_require__(32);
+ var canDefineProperty = __webpack_require__(24);
+ var ReactElementValidator = __webpack_require__(56);
+ var didWarnPropTypesDeprecated = false;
+ createElement = ReactElementValidator.createElement;
+ createFactory = ReactElementValidator.createFactory;
+ cloneElement = ReactElementValidator.cloneElement;
+}
+
+var __spread = _assign;
+var createMixin = function (mixin) {
+ return mixin;
+};
+
+if (process.env.NODE_ENV !== 'production') {
+ var warnedForSpread = false;
+ var warnedForCreateMixin = false;
+ __spread = function () {
+ lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
+ warnedForSpread = true;
+ return _assign.apply(null, arguments);
+ };
+
+ createMixin = function (mixin) {
+ lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
+ warnedForCreateMixin = true;
+ return mixin;
+ };
+}
+
+var React = {
+ // Modern
+
+ Children: {
+ map: ReactChildren.map,
+ forEach: ReactChildren.forEach,
+ count: ReactChildren.count,
+ toArray: ReactChildren.toArray,
+ only: onlyChild
+ },
+
+ Component: ReactBaseClasses.Component,
+ PureComponent: ReactBaseClasses.PureComponent,
+
+ createElement: createElement,
+ cloneElement: cloneElement,
+ isValidElement: ReactElement.isValidElement,
+
+ // Classic
+
+ PropTypes: ReactPropTypes,
+ createClass: createReactClass,
+ createFactory: createFactory,
+ createMixin: createMixin,
+
+ // This looks DOM specific but these are actually isomorphic helpers
+ // since they are just generating DOM strings.
+ DOM: ReactDOMFactories,
+
+ version: ReactVersion,
+
+ // Deprecated hook for JSX spread, don't use this for anything.
+ __spread: __spread
+};
+
+if (process.env.NODE_ENV !== 'production') {
+ var warnedForCreateClass = false;
+ if (canDefineProperty) {
+ Object.defineProperty(React, 'PropTypes', {
+ get: function () {
+ lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
+ didWarnPropTypesDeprecated = true;
+ return ReactPropTypes;
+ }
+ });
+
+ Object.defineProperty(React, 'createClass', {
+ get: function () {
+ lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
+ warnedForCreateClass = true;
+ return createReactClass;
+ }
+ });
+ }
+
+ // React.DOM factories are deprecated. Wrap these methods so that
+ // invocations of the React.DOM namespace and alert users to switch
+ // to the `react-dom-factories` package.
+ React.DOM = {};
+ var warnedForFactories = false;
+ Object.keys(ReactDOMFactories).forEach(function (factory) {
+ React.DOM[factory] = function () {
+ if (!warnedForFactories) {
+ lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
+ warnedForFactories = true;
+ }
+ return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
+ };
+ });
+}
+
+module.exports = React;
+
+/***/ }),
+/* 16 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+
+/**
+ * WARNING: DO NOT manually require this module.
+ * This is a replacement for `invariant(...)` used by the error code system
+ * and will _only_ be required by the corresponding babel pass.
+ * It always throws.
+ */
+
+function reactProdInvariant(code) {
+ var argCount = arguments.length - 1;
+
+ var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
+
+ for (var argIdx = 0; argIdx < argCount; argIdx++) {
+ message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
+ }
+
+ message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
+
+ var error = new Error(message);
+ error.name = 'Invariant Violation';
+ error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
+
+ throw error;
+}
+
+module.exports = reactProdInvariant;
+
+/***/ }),
+/* 17 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var ReactRef = __webpack_require__(116);
+var ReactInstrumentation = __webpack_require__(8);
+
+var warning = __webpack_require__(1);
+
+/**
+ * Helper to call ReactRef.attachRefs with this composite component, split out
+ * to avoid allocations in the transaction mount-ready queue.
+ */
+function attachRefs() {
+ ReactRef.attachRefs(this, this._currentElement);
+}
+
+var ReactReconciler = {
+ /**
+ * Initializes the component, renders markup, and registers event listeners.
+ *
+ * @param {ReactComponent} internalInstance
+ * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
+ * @param {?object} the containing host component instance
+ * @param {?object} info about the host container
+ * @return {?string} Rendered markup to be inserted into the DOM.
+ * @final
+ * @internal
+ */
+ mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots
+ {
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
+ }
+ }
+ var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
+ if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
+ transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
+ }
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
+ }
+ }
+ return markup;
+ },
+
+ /**
+ * Returns a value that can be passed to
+ * ReactComponentEnvironment.replaceNodeWithMarkup.
+ */
+ getHostNode: function (internalInstance) {
+ return internalInstance.getHostNode();
+ },
+
+ /**
+ * Releases any resources allocated by `mountComponent`.
+ *
+ * @final
+ * @internal
+ */
+ unmountComponent: function (internalInstance, safely) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
+ }
+ }
+ ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
+ internalInstance.unmountComponent(safely);
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
+ }
+ }
+ },
+
+ /**
+ * Update a component using a new element.
+ *
+ * @param {ReactComponent} internalInstance
+ * @param {ReactElement} nextElement
+ * @param {ReactReconcileTransaction} transaction
+ * @param {object} context
+ * @internal
+ */
+ receiveComponent: function (internalInstance, nextElement, transaction, context) {
+ var prevElement = internalInstance._currentElement;
+
+ if (nextElement === prevElement && context === internalInstance._context) {
+ // Since elements are immutable after the owner is rendered,
+ // we can do a cheap identity compare here to determine if this is a
+ // superfluous reconcile. It's possible for state to be mutable but such
+ // change should trigger an update of the owner which would recreate
+ // the element. We explicitly check for the existence of an owner since
+ // it's possible for an element created outside a composite to be
+ // deeply mutated and reused.
+
+ // TODO: Bailing out early is just a perf optimization right?
+ // TODO: Removing the return statement should affect correctness?
+ return;
+ }
+
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
+ }
+ }
+
+ var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
+
+ if (refsChanged) {
+ ReactRef.detachRefs(internalInstance, prevElement);
+ }
+
+ internalInstance.receiveComponent(nextElement, transaction, context);
+
+ if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
+ transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
+ }
+
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
+ }
+ }
+ },
+
+ /**
+ * Flush any dirty changes in a component.
+ *
+ * @param {ReactComponent} internalInstance
+ * @param {ReactReconcileTransaction} transaction
+ * @internal
+ */
+ performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
+ if (internalInstance._updateBatchNumber !== updateBatchNumber) {
+ // The component's enqueued batch number should always be the current
+ // batch or the following one.
+ process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
+ return;
+ }
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
+ }
+ }
+ internalInstance.performUpdateIfNecessary(transaction);
+ if (process.env.NODE_ENV !== 'production') {
+ if (internalInstance._debugID !== 0) {
+ ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
+ }
+ }
+ }
+};
+
+module.exports = ReactReconciler;
+
+/***/ }),
+/* 18 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/**
+ * Copyright (c) 2015-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
+
+
+
+var DOMNamespaces = __webpack_require__(41);
+var setInnerHTML = __webpack_require__(29);
+
+var createMicrosoftUnsafeLocalFunction = __webpack_require__(42);
+var setTextContent = __webpack_require__(68);
+
+var ELEMENT_NODE_TYPE = 1;
+var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
+
+/**
+ * In IE (8-11) and Edge, appending nodes with no children is dramatically
+ * faster than appending a full subtree, so we essentially queue up the
+ * .appendChild calls here and apply them so each node is added to its parent
+ * before any children are added.
+ *
+ * In other browsers, doing so is slower or neutral compared to the other order
+ * (in Firefox, twice as slow) so we only do this inversion in IE.
+ *
+ * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
+ */
+var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
+
+function insertTreeChildren(tree) {
+ if (!enableLazy) {
+ return;
+ }
+ var node = tree.node;
+ var children = tree.children;
+ if (children.length) {
+ for (var i = 0; i < children.length; i++) {
+ insertTreeBefore(node, children[i], null);
+ }
+ } else if (tree.html != null) {
+ setInnerHTML(node, tree.html);
+ } else if (tree.text != null) {
+ setTextContent(node, tree.text);
+ }
+}
+
+var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
+ // DocumentFragments aren't actually part of the DOM after insertion so
+ // appending children won't update the DOM. We need to ensure the fragment
+ // is properly populated first, breaking out of our lazy approach for just
+ // this level. Also, some